/* ──────────────────────────────────────────────────────────────────────────────
   MMT Wins Feed — styles.css
   Brand: deep black, MMT orange accent #F5A623, off-white text #F4F3EF
   Fonts: DM Sans (headings/brand), Inter (body) — loaded from Google Fonts
   ────────────────────────────────────────────────────────────────────────────── */

/* ─── Design tokens ───────────────────────────────────────────────────────── */
:root {
  --color-bg:           #0B0B0B;
  --color-surface:      #131313;
  --color-surface-2:    #1A1A1A;
  --color-border:       #2A2A27;
  --color-border-hover: #F5A623;
  --color-teal:         #F5A623;
  --color-teal-hover:   #FFB949;
  --color-teal-glow:    rgba(245, 166, 35, 0.18);
  --color-live-red:     #E53935;
  --color-live-red-glow:rgba(229, 57, 53, 0.28);
  --color-text:         #F4F3EF;
  --color-text-muted:   #8E8D88;
  --color-text-faint:   #4A4A47;
  --color-skeleton-a:   #1E1E1E;
  --color-skeleton-b:   #2A2A27;

  --font-brand: 'DM Sans', 'Inter', system-ui, sans-serif;
  --font-body:  'Inter', system-ui, sans-serif;

  --radius-card: 16px;
  --radius-img:  10px;
  --radius-avatar: 50%;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.6), 0 4px 20px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 4px 24px rgba(245, 166, 35, 0.18);
  --transition-card: 180ms cubic-bezier(0.22, 1, 0.36, 1);

  --max-content: 1280px;
  --col-gap: 20px;
  --page-pad: clamp(16px, 4vw, 40px);
}

/* ─── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--color-bg);
  /* Subtle orange radial glow at the top */
  background-image:
    radial-gradient(ellipse 900px 320px at 50% 0px, rgba(245, 166, 35, 0.10) 0%, transparent 80%);
  background-attachment: fixed;
}

img { display: block; max-width: 100%; }
a { color: var(--color-teal); text-decoration: none; }
a:hover { color: var(--color-teal-hover); }

/* ─── Market ticker tape (exact replica of makemoney.com.au) ──────────── */
.intro__ticker {
  position: relative;
  top: 0; left: 0; right: 0;
  z-index: 99;
  height: 34px;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.intro__ticker-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  gap: 48px;
  white-space: nowrap;
  animation: tickerScroll 55s linear infinite;
  padding-left: 48px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  will-change: transform;
}

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.intro__ticker .tk {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  text-transform: uppercase;
}

.intro__ticker .tk strong {
  color: #fff;
  font-weight: 700;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.intro__ticker .tk em {
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.intro__ticker .tk em.up   { color: #22c55e; }
.intro__ticker .tk em.down { color: #ef4444; }

.intro__ticker .tk-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #F5A623;
  display: inline-block;
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.7);
  flex-shrink: 0;
}
.intro__ticker .tk-dot.up   { background: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.7); }
.intro__ticker .tk-dot.down { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.7); }

@media (max-width: 640px) {
  .intro__ticker { height: 30px; }
  .intro__ticker .tk { font-size: 10px; }
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--page-pad);
  height: 56px;
  background: rgba(11, 11, 11, 0.85);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-brand);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
}

.site-header__logo svg,
.site-header__logo img {
  flex-shrink: 0;
}

.site-header__logo img.site-header__mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.site-header__logo span {
  opacity: 0.55;
  font-weight: 400;
  letter-spacing: 0.1em;
}

/* ─── Live indicator ──────────────────────────────────────────────────────── */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  transition: color 300ms;
}

/* Centered hero variant — pill style */
.live-indicator--hero {
  margin: 0 auto 18px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(19, 19, 19, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.live-indicator.is-live {
  color: var(--color-live-red);
}

.live-indicator--hero.is-live {
  border-color: rgba(229, 57, 53, 0.45);
  background: rgba(229, 57, 53, 0.08);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-faint);
  transition: background 300ms, box-shadow 300ms;
  flex-shrink: 0;
}

.live-indicator.is-live .live-dot {
  background: var(--color-live-red);
  box-shadow: 0 0 0 0 var(--color-live-red-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: clamp(40px, 7vw, 72px) var(--page-pad) clamp(32px, 5vw, 56px);
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__title {
  font-family: var(--font-brand);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 16px;
}

.hero__title em {
  font-style: normal;
  color: var(--color-teal);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(13px, 1.6vw, 17px);
  color: var(--color-text-muted);
  max-width: none;
  margin: 0 auto;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .hero__subtitle {
    white-space: normal;
    font-size: 13px;
    max-width: 440px;
  }
}

/* ─── Wins grid (JS-managed row-first masonry) ───────────────────────────── */
.wins-section {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--page-pad) 80px;
}

.wins-grid {
  display: flex;
  gap: var(--col-gap);
  align-items: flex-start;
}

.wins-grid__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--col-gap);
}

/* ─── Win card ────────────────────────────────────────────────────────────── */
.win-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition:
    border-color var(--transition-card),
    box-shadow var(--transition-card),
    transform var(--transition-card);
  /* Entrance animation state */
  --card-opacity: 1;
  --card-translate-y: 0px;
  opacity: var(--card-opacity);
  transform: translateY(var(--card-translate-y));
}

.win-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* New card entrance */
.win-card.entering {
  --card-opacity: 0;
  --card-translate-y: -18px;
  animation: card-enter 250ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes card-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .win-card.entering { animation: none; opacity: 1; transform: none; }
  .win-card:hover { transform: none; }
  .live-indicator.is-live .live-dot { animation: none; }
}

/* ─── Card header (avatar + name + time) ─────────────────────────────────── */
.win-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.win-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-avatar);
  object-fit: cover;
  background: var(--color-surface-2);
  flex-shrink: 0;
  border: 1.5px solid var(--color-border);
}

.win-card__meta {
  flex: 1;
  min-width: 0;
}

.win-card__name {
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.win-card__time {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.win-card__edited-badge {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--color-text-faint);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

/* ─── Card images ─────────────────────────────────────────────────────────── */
.win-card__images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.win-card__img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-img);
  object-fit: contain;
  background: var(--color-surface-2);
  display: block;
}

.win-card__video {
  width: 100%;
  border-radius: var(--radius-img);
  background: #000;
  display: block;
}

/* ─── Card content ────────────────────────────────────────────────────────── */
.win-card__content {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.win-card__content:empty { display: none; }

/* ─── Skeleton shimmer ────────────────────────────────────────────────────── */
.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px;
  overflow: hidden;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-skeleton-a) 25%,
    var(--color-skeleton-b) 50%,
    var(--color-skeleton-a) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line { height: 10px; border-radius: 4px; }
.skeleton-line--short { width: 50%; }
.skeleton-line--medium { width: 70%; }

.skeleton-img {
  height: 160px;
  border-radius: var(--radius-img);
  margin-bottom: 10px;
}

.skeleton-text { height: 10px; margin-bottom: 6px; }
.skeleton-text:last-child { width: 60%; margin-bottom: 0; }

/* ─── Load-more trigger ───────────────────────────────────────────────────── */
#load-trigger {
  height: 1px;
  width: 100%;
  margin-top: -600px; /* fires 600px before the real bottom */
  pointer-events: none;
}

/* ─── Loading state ───────────────────────────────────────────────────────── */
#load-status {
  text-align: center;
  padding: 24px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  width: 100%;
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-state__title {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.empty-state__body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text-muted);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px var(--page-pad);
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.site-footer a {
  color: var(--color-teal);
}

.site-footer a:hover {
  color: var(--color-teal-hover);
}
