/* ============================================================
   W2G GUEST HOME — "The Team Board" (fable5 guest home redesign)
   ------------------------------------------------------------
   Loaded only by Prototype.html (after style-mobile.css).
   Every selector is scoped under `body.app-shell-guest #home`,
   so the authenticated app shell (body.app-shell-v2), the guest
   discovery views (#competitions/#teams/#members), Organizer,
   Admin, and Mission Center are structurally unreachable from
   this file.

   Why a dedicated file: the previous guest-home styles live in
   the 1.35 MB style-polish-v3.css override layer keyed to the
   old .guest-landing-handoff class names (now unused, therefore
   inert). Keeping the new surface in its own small file makes
   the redesign reviewable and instantly rollback-able (remove
   one <link> + this file).

   Colors, radii, and shadows come from the shared --w2g-* tokens
   defined in style-polish-v3.css for light and dark; no token is
   redefined here.
   ============================================================ */

/* ── Root layout ── */
body.app-shell-guest #home .ghb {
  --gh-motion-fast: 150ms;
  --gh-motion-interaction: 180ms;
  --gh-motion-enter: 480ms;
  --gh-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  gap: clamp(60px, 9vh, 96px);
  max-width: 1180px;
  margin-inline: auto;
  padding: clamp(26px, 5.5vh, 58px) 0 90px;
}

/* ── Shared editorial atoms ── */
body.app-shell-guest #home .ghb-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--w2g-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
body.app-shell-guest #home .ghb-kicker::before {
  content: '';
  flex: 0 0 auto;
  width: 26px;
  height: 2px;
  background: var(--w2g-orange);
}

body.app-shell-guest #home .ghb-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--w2g-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--w2g-line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  cursor: pointer;
  box-shadow: none;
  transition: color var(--gh-motion-interaction) var(--gh-motion-ease), text-decoration-color var(--gh-motion-interaction) var(--gh-motion-ease);
}
body.app-shell-guest #home .ghb-link:hover {
  color: var(--w2g-orange-strong, var(--w2g-orange));
  text-decoration-color: currentColor;
}
body.app-shell-guest #home .ghb-link-muted { color: var(--w2g-muted); }
body.app-shell-guest #home .ghb-link-muted:hover { color: var(--w2g-orange-strong, var(--w2g-orange)); }
body.app-shell-guest #home .ghb-link:focus-visible,
body.app-shell-guest #home .ghb-primary:focus-visible,
body.app-shell-guest #home .ghb-join:focus-visible,
body.app-shell-guest #home .ghb-comp-row:focus-visible {
  outline: 2px solid var(--w2g-orange);
  outline-offset: 3px;
}
body.app-shell-guest #home .ghb-link > span[aria-hidden="true"],
body.app-shell-guest #home .ghb-primary > span[aria-hidden="true"],
body.app-shell-guest #home .ghb-join > span[aria-hidden="true"] {
  display: inline-block;
  transition: transform var(--gh-motion-interaction) var(--gh-motion-ease);
}
body.app-shell-guest #home .ghb-link:hover > span[aria-hidden="true"],
body.app-shell-guest #home .ghb-link:focus-visible > span[aria-hidden="true"],
body.app-shell-guest #home .ghb-primary:hover > span[aria-hidden="true"],
body.app-shell-guest #home .ghb-primary:focus-visible > span[aria-hidden="true"],
body.app-shell-guest #home .ghb-join:hover > span[aria-hidden="true"],
body.app-shell-guest #home .ghb-join:focus-visible > span[aria-hidden="true"] {
  transform: translateX(3px);
}

body.app-shell-guest #home .ghb-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}
body.app-shell-guest #home .ghb-primary {
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  transition: background-color var(--gh-motion-interaction) var(--gh-motion-ease), color var(--gh-motion-interaction) var(--gh-motion-ease), transform var(--gh-motion-fast) var(--gh-motion-ease);
}
body.app-shell-guest #home .ghb-primary:active { transform: scale(0.98); }

body.app-shell-guest #home .ghb-row-num {
  padding-top: 3px;
  color: var(--w2g-faint);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

body.app-shell-guest #home .ghb-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 36px 0;
  border-bottom: 1px solid var(--w2g-line);
}
body.app-shell-guest #home .ghb-empty p {
  margin: 0;
  color: var(--w2g-muted);
  font-size: 14.5px;
}

/* ── Hero ── */
body.app-shell-guest #home .ghb-title {
  display: flex;
  flex-direction: column;
  margin: 20px 0 0;
  color: var(--w2g-ink);
  font-size: clamp(42px, 6.2vw, 82px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.032em;
}
html[lang="th"] body.app-shell-guest #home .ghb-title {
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.16;
  letter-spacing: 0;
}
body.app-shell-guest #home .ghb-title .ghb-accent { color: var(--w2g-orange); }

body.app-shell-guest #home .ghb-hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  gap: 28px 56px;
  align-items: end;
  margin-top: clamp(26px, 4vh, 40px);
}
body.app-shell-guest #home .ghb-lead {
  margin: 0;
  color: var(--w2g-body);
  font-size: 16.5px;
  line-height: 1.68;
}
body.app-shell-guest #home .ghb-hero-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-self: end;
  align-items: flex-start;
}
body.app-shell-guest #home .ghb-hero-note {
  margin: 0;
  color: var(--w2g-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ── Section heads (board + competitions) ── */
body.app-shell-guest #home .ghb-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--w2g-ink);
}
body.app-shell-guest #home .ghb-section-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--w2g-ink);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.015em;
}
html[lang="th"] body.app-shell-guest #home .ghb-section-head h2 { letter-spacing: 0; }

body.app-shell-guest #home .ghb-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--w2g-success);
}

body.app-shell-guest #home .ghb-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  color: var(--w2g-muted);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.app-shell-guest #home .ghb-counts i {
  color: var(--w2g-faint);
  font-style: normal;
}

/* ── The board (recruiting teams ledger) ── */
body.app-shell-guest #home .ghb-rows,
body.app-shell-guest #home .ghb-comp-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.app-shell-guest #home .ghb-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1.1fr) minmax(0, 1.15fr) minmax(0, 0.85fr) auto;
  gap: 14px 22px;
  padding: 22px 6px;
  border-bottom: 1px solid var(--w2g-line);
  transition: background-color var(--gh-motion-interaction) var(--gh-motion-ease), border-color var(--gh-motion-interaction) var(--gh-motion-ease);
}
body.app-shell-guest #home .ghb-row:hover,
body.app-shell-guest #home .ghb-row:focus-within {
  background: color-mix(in srgb, var(--w2g-surface-2, var(--w2g-surface)) 62%, transparent);
  border-color: var(--w2g-line-strong);
}

body.app-shell-guest #home .ghb-cell-label {
  display: block;
  margin-bottom: 7px;
  color: var(--w2g-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
body.app-shell-guest #home .ghb-row-roles strong {
  display: block;
  color: var(--w2g-ink);
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.014em;
}
html[lang="th"] body.app-shell-guest #home .ghb-row-roles strong { letter-spacing: 0; }

body.app-shell-guest #home .ghb-row-team strong {
  display: block;
  color: var(--w2g-ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}
body.app-shell-guest #home .ghb-row-team p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--w2g-body);
  font-size: 13px;
  line-height: 1.55;
}
body.app-shell-guest #home .ghb-row-team small {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-top: 7px;
  color: var(--w2g-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
body.app-shell-guest #home .ghb-row-team small i {
  color: var(--w2g-faint);
  font-style: normal;
}

body.app-shell-guest #home .ghb-row-comp strong {
  display: block;
  color: var(--w2g-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}
body.app-shell-guest #home .ghb-row-comp small {
  display: block;
  margin-top: 5px;
  color: var(--w2g-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

body.app-shell-guest #home .ghb-row-action { align-self: center; }
body.app-shell-guest #home .ghb-join {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 16px;
  border: 1px solid var(--w2g-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--w2g-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: border-color var(--gh-motion-fast) var(--gh-motion-ease), background-color var(--gh-motion-fast) var(--gh-motion-ease), color var(--gh-motion-fast) var(--gh-motion-ease), transform var(--gh-motion-fast) var(--gh-motion-ease);
}
body.app-shell-guest #home .ghb-join:hover {
  border-color: var(--w2g-orange);
  background: var(--w2g-orange-soft);
  color: var(--w2g-orange-ink, var(--w2g-orange-strong));
}
body.app-shell-guest #home .ghb-join:active { transform: scale(0.98); }

body.app-shell-guest #home .ghb-board-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 16px;
}

/* ── Competition index ── */
body.app-shell-guest #home .ghb-comp-item { margin: 0; padding: 0; }
body.app-shell-guest #home .ghb-comp-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 26px;
  gap: 6px 22px;
  align-items: center;
  width: 100%;
  padding: 18px 6px;
  border: 0;
  border-bottom: 1px solid var(--w2g-line);
  border-radius: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: background-color var(--gh-motion-interaction) var(--gh-motion-ease), border-color var(--gh-motion-interaction) var(--gh-motion-ease);
}
body.app-shell-guest #home .ghb-comp-row:hover,
body.app-shell-guest #home .ghb-comp-row:focus-visible {
  background: color-mix(in srgb, var(--w2g-surface-2, var(--w2g-surface)) 62%, transparent);
  border-color: var(--w2g-line-strong);
}
body.app-shell-guest #home .ghb-comp-main { min-width: 0; }
body.app-shell-guest #home .ghb-comp-main strong {
  display: block;
  color: var(--w2g-ink);
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.012em;
}
html[lang="th"] body.app-shell-guest #home .ghb-comp-main strong { letter-spacing: 0; }
body.app-shell-guest #home .ghb-comp-main small {
  display: block;
  margin-top: 4px;
  color: var(--w2g-muted);
  font-size: 12.5px;
}
body.app-shell-guest #home .ghb-comp-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--w2g-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body.app-shell-guest #home .ghb-comp-deadline {
  color: var(--w2g-body);
  font-weight: 650;
}
body.app-shell-guest #home .ghb-row-arrow {
  color: var(--w2g-faint);
  font-size: 16px;
  transition: transform var(--gh-motion-interaction) var(--gh-motion-ease), color var(--gh-motion-interaction) var(--gh-motion-ease);
}
body.app-shell-guest #home .ghb-comp-row:hover .ghb-row-arrow,
body.app-shell-guest #home .ghb-comp-row:focus-visible .ghb-row-arrow {
  transform: translateX(4px);
  color: var(--w2g-orange);
}

/* ── The loop (how it works) ── */
body.app-shell-guest #home .ghb-loop {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 32px clamp(40px, 6vw, 88px);
  align-items: start;
}
body.app-shell-guest #home .ghb-loop-intro h2 {
  margin: 14px 0 12px;
  color: var(--w2g-ink);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
}
html[lang="th"] body.app-shell-guest #home .ghb-loop-intro h2 {
  line-height: 1.28;
  letter-spacing: 0;
}
body.app-shell-guest #home .ghb-loop-copy {
  margin: 0;
  max-width: 46ch;
  color: var(--w2g-body);
  font-size: 14.5px;
  line-height: 1.7;
}
body.app-shell-guest #home .ghb-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
body.app-shell-guest #home .ghb-step {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--w2g-line);
}
body.app-shell-guest #home .ghb-step:last-child { border-bottom: 1px solid var(--w2g-line); }
body.app-shell-guest #home .ghb-step-num {
  color: var(--w2g-faint);
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
body.app-shell-guest #home .ghb-step strong {
  display: block;
  color: var(--w2g-ink);
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.4;
}
body.app-shell-guest #home .ghb-step p {
  margin: 6px 0 0;
  color: var(--w2g-body);
  font-size: 13.5px;
  line-height: 1.65;
}

/* ── Close ── */
body.app-shell-guest #home .ghb-close {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto;
  gap: 24px 40px;
  align-items: center;
  padding-top: 38px;
  border-top: 2px solid var(--w2g-ink);
}
body.app-shell-guest #home .ghb-close h2 {
  margin: 0;
  max-width: 24ch;
  color: var(--w2g-ink);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
}
html[lang="th"] body.app-shell-guest #home .ghb-close h2 {
  line-height: 1.28;
  letter-spacing: 0;
}

/* Anchor targets clear the mobile sticky topbar when scrolled to. */
body.app-shell-guest #home .ghb-board,
body.app-shell-guest #home .ghb-loop { scroll-margin-top: 84px; }

/* ── Motion (opt-in only when the user allows it) ── */
@media (prefers-reduced-motion: no-preference) {
  body.app-shell-guest #home .ghb.gh-motion-ready .ghb-hero > .ghb-kicker {
    animation: ghbMotionEnter 440ms var(--gh-motion-ease) both;
  }
  body.app-shell-guest #home .ghb.gh-motion-ready .ghb-title .ghb-line {
    animation: ghbMotionEnter var(--gh-motion-enter) var(--gh-motion-ease) both;
  }
  body.app-shell-guest #home .ghb.gh-motion-ready .ghb-title .ghb-line:nth-child(1) { animation-delay: 60ms; }
  body.app-shell-guest #home .ghb.gh-motion-ready .ghb-title .ghb-line:nth-child(2) { animation-delay: 130ms; }
  body.app-shell-guest #home .ghb.gh-motion-ready .ghb-title .ghb-line:nth-child(3) { animation-delay: 200ms; }
  body.app-shell-guest #home .ghb.gh-motion-ready .ghb-lead {
    animation: ghbMotionEnter var(--gh-motion-enter) var(--gh-motion-ease) 270ms both;
  }
  body.app-shell-guest #home .ghb.gh-motion-ready .ghb-hero-cta {
    animation: ghbMotionEnter var(--gh-motion-enter) var(--gh-motion-ease) 340ms both;
  }
  body.app-shell-guest #home .ghb-row.ghb-motion-reveal {
    animation: ghbMotionEnter 460ms var(--gh-motion-ease) both;
    animation-delay: calc(var(--ghb-reveal-index, 0) * 80ms);
  }
  body.app-shell-guest #home .ghb-live-dot {
    animation: ghbMotionLive 2.8s ease-in-out infinite;
  }
  /* Section-level scroll reveal: competition cards, how-it-works, and the closing CTA
     are off-screen on load, so they get a slightly larger travel distance than the
     above-the-fold hero/row treatment. Each element reveals once, then stays put. */
  body.app-shell-guest #home .ghb-comp-card.ghb-motion-reveal {
    animation: ghbSectionReveal 520ms var(--gh-motion-ease) both;
    animation-delay: calc(var(--ghb-reveal-index, 0) * 70ms);
  }
  body.app-shell-guest #home .ghb-loop-intro.ghb-motion-reveal,
  body.app-shell-guest #home .ghb-steps.ghb-motion-reveal,
  body.app-shell-guest #home .ghb-close.ghb-motion-reveal {
    animation: ghbSectionReveal 520ms var(--gh-motion-ease) both;
  }
}
@keyframes ghbMotionEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ghbSectionReveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ghbMotionLive {
  0%, 100% { opacity: 0.72; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  body.app-shell-guest #home .ghb *,
  body.app-shell-guest #home .ghb *::before,
  body.app-shell-guest #home .ghb *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* ── Tablet / small desktop ── */
@media (max-width: 1050px) {
  body.app-shell-guest #home .ghb { gap: 52px; padding-top: 18px; }

  body.app-shell-guest #home .ghb-hero-foot {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  body.app-shell-guest #home .ghb-hero-cta { justify-self: start; }

  body.app-shell-guest #home .ghb-row {
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-areas:
      'num roles'
      'num team'
      'num comp'
      'num action';
    gap: 12px 14px;
    padding: 20px 2px;
  }
  body.app-shell-guest #home .ghb-row-num { grid-area: num; }
  body.app-shell-guest #home .ghb-row-roles { grid-area: roles; }
  body.app-shell-guest #home .ghb-row-team { grid-area: team; }
  body.app-shell-guest #home .ghb-row-comp { grid-area: comp; }
  body.app-shell-guest #home .ghb-row-action { grid-area: action; align-self: start; margin-top: 2px; }

  body.app-shell-guest #home .ghb-comp-row {
    grid-template-columns: 34px minmax(0, 1fr) 26px;
    grid-template-areas:
      'num main arrow'
      'num side arrow';
    gap: 6px 14px;
    padding: 16px 2px;
  }
  body.app-shell-guest #home .ghb-comp-row .ghb-row-num { grid-area: num; }
  body.app-shell-guest #home .ghb-comp-main { grid-area: main; }
  body.app-shell-guest #home .ghb-comp-side {
    grid-area: side;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    white-space: normal;
  }
  body.app-shell-guest #home .ghb-row-arrow { grid-area: arrow; }

  body.app-shell-guest #home .ghb-loop { grid-template-columns: minmax(0, 1fr); }
  body.app-shell-guest #home .ghb-close { grid-template-columns: minmax(0, 1fr); align-items: start; }
}

/* ── Phones ── */
@media (max-width: 640px) {
  body.app-shell-guest #home .ghb { gap: 46px; padding-bottom: 64px; }
  body.app-shell-guest #home .ghb-lead { font-size: 15px; }
  body.app-shell-guest #home .ghb-title { font-size: clamp(36px, 10.5vw, 46px); }
  html[lang="th"] body.app-shell-guest #home .ghb-title { font-size: clamp(32px, 9.6vw, 42px); }
  body.app-shell-guest #home .ghb-primary { width: 100%; justify-content: center; }
  body.app-shell-guest #home .ghb-actions { width: 100%; }
  body.app-shell-guest #home .ghb-hero-cta { width: 100%; }
  body.app-shell-guest #home .ghb-row-roles strong { font-size: 17px; }
  body.app-shell-guest #home .ghb-section-head { flex-direction: column; align-items: flex-start; }
}
