/* Homepage (core/templates/core/index.html): hero board, scroll story, "your
   turn" band. Loaded after puzzle.css and site.css via extra_head. The hero
   board follows the site's light/dark tokens exactly like /play/; the story
   band is dark in both themes, so it uses its own fixed colours (only the
   --tape yellow is shared). */

/* --- hero ------------------------------------------------------------------ */
.home-hero{padding:56px 0 72px;}
.home-hero-inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,480px);gap:56px;align-items:center;}
.home-hero .kicker{margin-bottom:16px;}
.home-hero h1{font-size:clamp(34px,5.2vw,56px);line-height:1.04;letter-spacing:-0.03em;text-wrap:balance;}
.home-lede{font-size:clamp(16px,1.6vw,19px);line-height:1.6;color:var(--muted);max-width:34em;margin:20px 0 0;}
.home-ctas{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:28px;}
.home-ctas .btn-primary{display:inline-block;}

.hero-board{padding:24px;}
.hero-board h2{text-align:left;font-size:20px;margin-bottom:6px;}
.hero-board > p{text-align:left;}
.hero-status{font-size:13px;color:var(--muted);margin:0 0 14px;font-variant-numeric:tabular-nums;}
.hero-board .puzzle-grid{grid-template-columns:repeat(var(--cols),minmax(0,1fr));}
.hero-board .cell:focus-visible{outline-offset:-3px;}
.hero-board .word-list{list-style:none;margin:18px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px;}
.hero-board .word-list li{font-size:14px;padding:5px 12px;border:1px solid var(--line);border-radius:999px;}
.hero-hint{margin-top:16px;font-size:14px;line-height:1.55;color:var(--muted);}
.hero-hint p{margin:0 0 8px;}
.hero-done{margin-top:16px;padding:12px 14px;border-radius:10px;background:var(--accent-light);font-size:15px;font-weight:600;line-height:1.5;}
.hero-done[hidden]{display:none;}
.hero-done a{color:var(--accent);white-space:nowrap;}

/* --- scroll story: always dark -------------------------------------------- */
.story{background:#141413;color:#F2F0E9;border-top:1px solid #2E2C29;}
.story .wrap{padding-top:96px;padding-bottom:96px;}
.story h2,.story h3{font-family:'Space Grotesk',sans-serif;}
.story :focus-visible{outline-color:var(--tape);}
.story-kicker{margin:0;font-size:13px;font-weight:500;letter-spacing:0.08em;text-transform:uppercase;color:#A9A597;}
.story-inner{max-width:1000px;margin:0 auto;}
.story-steps{display:flex;flex-direction:column;gap:32px;}
.story-intro{display:flex;flex-direction:column;gap:14px;padding-bottom:0;margin-bottom:8px;}
.story-intro h2{font-size:clamp(30px,3.6vw,44px);line-height:1.08;letter-spacing:-0.02em;}
.story-intro p:last-child{font-size:17px;line-height:1.6;color:#C9C5B9;max-width:30em;margin:0;}
.step{background:#1E1D1B;border:1px solid #2E2C29;border-radius:16px;padding:18px;}
.step-body{display:flex;flex-direction:column;gap:14px;min-width:0;}
.step-title{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline;}
.step-num{font-size:14px;color:#A9A597;font-variant-numeric:tabular-nums;}
.step-name{margin:0;font-size:28px;font-weight:700;letter-spacing:-0.02em;}
.step-angle{font-size:15px;font-weight:600;color:var(--tape);}
.step-copy{margin:0;font-size:17px;line-height:1.6;color:#D8D4C8;max-width:30em;}
.step-grid{display:block;width:100%;max-width:420px;}

/* story grids */
.sg{position:relative;width:100%;aspect-ratio:1;container-type:inline-size;user-select:none;-webkit-user-select:none;}
.sg svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;}
.sg-cells{position:absolute;inset:0;display:grid;border-top:1px solid #34322E;border-left:1px solid #34322E;}
/* Letters match /play/'s cells: buttons there use the UA system font, 600, uppercase. */
.sg-cell{display:flex;align-items:center;justify-content:center;position:relative;border-right:1px solid #34322E;border-bottom:1px solid #34322E;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;font-weight:600;line-height:1;text-transform:uppercase;font-size:20px;font-size:5.4cqw;color:#8E8B82;transition:color .2s;}
.sg-cell.on{color:#181A17;}
.sg-path{fill:none;stroke:var(--tape);stroke-width:7.6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;}
.sg-ghost{fill:none;stroke:#8E8B82;stroke-width:.9;stroke-dasharray:1.6 2;stroke-linecap:round;}
.sg-wall{stroke:var(--tape);stroke-width:1.6;stroke-linecap:round;opacity:0;}
.sg-wall.show{animation:sg-flash .9s ease-out forwards;}
.sg-mark{opacity:0;transition:opacity .3s;}
.sg-mark.show{opacity:1;}
@keyframes sg-flash{0%{opacity:1;stroke-width:3;}100%{opacity:.55;stroke-width:1.4;}}

/* Desktop: grid in one column, text centred against it; even cards flip.
   DOM order stays title, grid, copy. */
@media (min-width:900px){
  .story .wrap{padding-top:88px;padding-bottom:88px;}
  .step{padding:32px;}
  .step-body{display:grid;grid-template-columns:minmax(0,420px) minmax(0,1fr);grid-template-areas:"grid title" "grid copy";column-gap:48px;row-gap:12px;align-content:center;align-items:center;}
  .step:nth-of-type(even) .step-body{grid-template-columns:minmax(0,1fr) minmax(0,420px);grid-template-areas:"title grid" "copy grid";}
  .step-title{grid-area:title;align-self:end;}
  .step-grid{grid-area:grid;}
  .step-copy{grid-area:copy;align-self:start;font-size:18px;}
  .step-name{font-size:32px;}
}
@media (max-width:899px){
  .story .wrap{padding-top:64px;padding-bottom:64px;}
  .story-steps{gap:20px;}
}

/* --- "your turn" band ------------------------------------------------------- */
.try{background:var(--accent-light);border-top:1px solid var(--line);}
.try-inner{padding-top:72px;padding-bottom:72px;}
.try .kicker{margin-bottom:12px;}
.try h2{font-size:clamp(28px,3.6vw,40px);line-height:1.1;letter-spacing:-0.02em;max-width:18em;text-wrap:balance;}
.try-body{font-size:17px;line-height:1.6;color:var(--muted);max-width:34em;margin:16px 0 0;}

@media (max-width:860px){
  .home-hero{padding:36px 0 48px;}
  .home-hero-inner{grid-template-columns:minmax(0,1fr);gap:32px;}
  .hero-board{max-width:520px;width:100%;}
}
@media (max-width:480px){
  .hero-board{padding:16px;}
  .step{padding:14px;}
}

@media (prefers-reduced-motion:reduce){
  .sg-cell,.sg-mark{transition:none;}
  .sg-wall.show{animation:none;opacity:.7;}
}
