/* Landing page only. Tokens and shared chrome are in site.css. */

.fine { font-size: 13px; line-height: 1.5; color: var(--muted); }
.center { text-align: center; }

/* ---------- Story: pinned 3D phone, steps scroll past ---------- */
.story { position: relative; background: linear-gradient(to bottom, var(--sky-top), var(--sky) 55vh, var(--sky) 85%, var(--deep)); }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100lvh;
  overflow: hidden; pointer-events: none;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-glow {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(40vmax 40vmax at var(--glow-x, 50%) var(--glow-y, 70%), rgba(240, 199, 94, 0.12), transparent 70%);
}

/* The sky behind the phone: a faint starfield and Orion, which lights up star by
   star as the story goes on (landing.js sets .is-lit). */
.sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; overflow: visible; }
.sky .field circle { fill: var(--cream); }
.sky .orion line {
  stroke: var(--cream); stroke-width: 1.4; stroke-linecap: round; vector-effect: non-scaling-stroke;
  opacity: 0; transition: opacity 0.8s ease;
}
.sky .orion line.is-lit { opacity: 0.35; }
.sky .orion circle {
  fill: #5560b4; opacity: 0.9;
  transform-box: fill-box; transform-origin: center;
  transition: fill 0.6s ease, opacity 0.6s ease, transform 0.6s cubic-bezier(.2, .9, .3, 1.4);
}
.sky .orion circle.is-lit { fill: var(--gold); opacity: 1; transform: scale(1.6); filter: drop-shadow(0 0 4px rgba(240, 199, 94, 0.9)); }

.steps { position: relative; margin-top: -100vh; margin-top: -100lvh; }

.step {
  --vis: 1;
  min-height: 115vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 max(16px, 7vw);
  opacity: var(--vis);
  transform: translateY(calc((1 - var(--vis)) * 24px));
  will-change: opacity, transform;
}
.step > * { max-width: 430px; }
.step h2 {
  text-wrap: balance;
  font-size: clamp(34px, 4.2vw, 54px); line-height: 1.04; letter-spacing: -0.01em; font-weight: 900;
  margin: 14px 0 18px; color: var(--cream);
  text-shadow: 0 3px 0 var(--shadow);
}
.step .pill { align-self: flex-start; }
.step p { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.step p.fine { font-size: 14px; font-weight: 800; color: var(--gold); }
.step-shot { display: none; }

.step-hero {
  position: relative;
  min-height: 100vh; justify-content: flex-start; align-items: center; text-align: center;
  padding-top: calc(var(--nav-h) + 9vh);
}
.step-hero > * { max-width: 780px; }
.step-hero h1 {
  text-wrap: balance;
  font-size: clamp(42px, min(6.4vw, 9vh), 88px); line-height: 1; letter-spacing: -0.02em; font-weight: 900;
  margin: 0 0 18px; color: var(--cream); text-shadow: 0 4px 0 var(--shadow);
}

/* The "LONE STAR" sticker logo, as on the app's home screen: cream letters with a graphite
   outline and a hard shadow, a gold star sticker on the L and a small pink one after the R. */
.logo { position: relative; display: inline-block; margin: 0 auto 18px; padding: 0 0.5em; }
.logo-word {
  display: block; font-size: clamp(54px, min(9vw, 13vh), 128px); line-height: 1; font-weight: 900;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--cream);
  -webkit-text-stroke: 0.09em var(--ink); paint-order: stroke fill;
  text-shadow: 0 0.07em 0 var(--shadow);
}
.logo-star { position: absolute; stroke: var(--ink); stroke-linejoin: round; filter: drop-shadow(0 3px 0 var(--shadow)); }
.logo-star-gold { width: 0.62em; height: 0.62em; left: 0.06em; top: -0.18em; fill: var(--gold); stroke-width: 2.2; transform: rotate(-14deg); font-size: clamp(54px, min(9vw, 13vh), 128px); }
.logo-star-pink { width: 0.3em; height: 0.3em; right: 0.12em; bottom: 0.02em; fill: var(--pink); stroke-width: 2.6; transform: rotate(12deg); font-size: clamp(54px, min(9vw, 13vh), 128px); }
.step-hero .lede { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.4; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.hero-note { font-size: 14px; font-weight: 600; color: var(--muted); }
.step-outro .hero-cta { justify-content: flex-start; margin-top: 18px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; width: 26px; height: 42px; margin-left: -13px;
  border: 2.5px solid rgba(255, 248, 224, 0.5); border-radius: 14px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--text); animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* Phones and small tablets: phone in the upper half, text at the bottom over a fade. */
@media (max-width: 820px) {
  .stage::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
    background: linear-gradient(to bottom, rgba(32, 39, 90, 0), rgba(32, 39, 90, 0.92) 38%, var(--sky));
    opacity: var(--fade, 1); transition: opacity 0.4s;
  }
  .step { justify-content: flex-end; padding: 0 16px 7vh; min-height: 120vh; }
  .step > * { max-width: 560px; }
  .step h2 { font-size: 30px; margin-bottom: 10px; }
  .step p { font-size: 16px; }
  .step-hero { min-height: 100vh; justify-content: flex-start; padding-top: calc(var(--nav-h) + 4vh); }
  .step-outro .hero-cta { justify-content: flex-start; }
}

/* Without WebGL: show each step's screenshot inline instead of the 3D phone. */
.no-webgl .stage { display: none; }
.no-webgl .steps { margin-top: 0; }
.no-webgl .step { min-height: auto; padding-top: 12vh; padding-bottom: 12vh; opacity: 1; transform: none; }
.no-webgl .step-shot {
  display: block; width: min(280px, 70vw); margin-top: 28px;
  border-radius: 34px; border: 7px solid var(--ink); box-shadow: var(--hard);
}
.no-webgl .scroll-cue { display: none; }

/* ---------- Section heads ---------- */
.section-head { max-width: 760px; margin: 0 auto; padding: 0 16px 44px; text-align: center; }
.section-head h2 { text-wrap: balance; font-size: clamp(36px, 5.6vw, 66px); line-height: 1.04; letter-spacing: -0.02em; font-weight: 900; margin: 0; text-shadow: 0 4px 0 var(--shadow); }
.section-sub { color: var(--muted); font-size: 19px; margin: 16px auto 0; max-width: 560px; }

/* ---------- Try one: a playable puzzle ---------- */
.try {
  max-width: 1080px; margin: 0 auto; padding: 120px 16px 110px;
  display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: 64px; align-items: center;
}
.try h2 { font-size: clamp(36px, 5.6vw, 66px); line-height: 1.04; letter-spacing: -0.02em; font-weight: 900; margin: 0 0 18px; text-shadow: 0 4px 0 var(--shadow); }
.try-copy p { color: var(--muted); font-size: 19px; max-width: 460px; margin: 0 0 14px; }
.try-copy .try-how { font-size: 15px; }

.board-wrap { --cell: min(66px, calc((100vw - 64px) / 6)); }
/* The app's 2.0 board: pastel regions, graphite grid, thick region borders, gold star stickers. */
.board {
  display: grid; grid-template-columns: repeat(6, var(--cell));
  width: max-content; margin: 0 auto;
  border: 4px solid var(--ink); border-radius: 18px; overflow: hidden;
  background: var(--ink);
  box-shadow: 0 6px 0 var(--shadow), 0 0 0 6px var(--cream), 0 10px 0 6px var(--shadow);
  transition: box-shadow 0.6s;
}
.cell {
  width: var(--cell); height: var(--cell); padding: 0; margin: 0;
  border: 0; border-right: 1px solid rgba(27, 27, 34, 0.28); border-bottom: 1px solid rgba(27, 27, 34, 0.28);
  background: var(--region); color: var(--gold); cursor: pointer;
  display: grid; place-items: center; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.cell:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; border-radius: 4px; z-index: 1; }
.cell.r { border-right: 3px solid var(--ink); }
.cell.b { border-bottom: 3px solid var(--ink); }
.cell svg { width: 60%; height: 60%; overflow: visible; }
.cell .x { width: 34%; height: 34%; fill: none; stroke: rgba(27, 27, 34, 0.45); stroke-width: 3; stroke-linecap: round; }
.cell .star { fill: currentColor; filter: drop-shadow(0 2px 0 rgba(27, 27, 34, 0.35)); transform-box: fill-box; transform-origin: center; transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.4); }
.cell.is-star .star { animation: pop 0.25s cubic-bezier(.2, .9, .3, 1.4); }
.cell.is-bad { color: var(--pink); }
.cell.is-bad::after { content: ""; position: absolute; inset: 0; background: rgba(232, 99, 122, 0.35); }
@keyframes pop { from { transform: scale(0.4); } to { transform: scale(1); } }

.board.is-solved { box-shadow: 0 6px 0 var(--shadow), 0 0 0 6px var(--gold), 0 10px 0 6px var(--shadow), 0 0 60px 10px rgba(240, 199, 94, 0.45); }
.board.is-solved .cell { cursor: default; }
.board.is-solved .cell.is-star .star { animation: glow 0.9s ease both; animation-delay: calc(var(--i) * 90ms); }
@keyframes glow { 0% { transform: scale(1); } 40% { transform: scale(1.35); filter: drop-shadow(0 0 8px rgba(240, 199, 94, 0.9)); } 100% { transform: scale(1); } }

.board-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: calc(var(--cell) * 6 + 20px); margin: 30px auto 0; }
.board-status { margin: 0; font-weight: 800; }
.board.is-solved + .board-bar .board-status { color: var(--gold); }
.board-reset {
  font: inherit; font-size: 14px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
  background: var(--cream); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--shadow);
  padding: 7px 16px; cursor: pointer; white-space: nowrap; transition: transform 0.15s, box-shadow 0.15s;
}
.board-reset:hover { background: var(--gold); }
.board-reset:active { transform: translateY(3px); box-shadow: 0 0 0 var(--shadow); }

@media (max-width: 820px) {
  .try { grid-template-columns: 1fr; gap: 36px; padding: 88px 16px 80px; }
}

/* ---------- Gallery carousel ---------- */
.gallery { padding: 110px 0 96px; overflow: hidden; }
.track {
  position: relative;
  display: flex; gap: 24px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 8px max(16px, calc(50vw - 390px)) 28px;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.slide {
  flex: 0 0 min(780px, calc(100vw - 32px));
  scroll-snap-align: center;
  margin: 0; padding: 44px 52px;
  background: var(--cream); color: var(--ink); border: var(--outline); border-radius: 32px; box-shadow: 0 6px 0 var(--shadow);
  display: grid; grid-template-columns: 250px 1fr; gap: 48px; align-items: center;
  opacity: 0.4; transform: scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.slide.is-active { opacity: 1; transform: none; }

.device { position: relative; background: var(--ink); border-radius: 36px; padding: 7px; box-shadow: 0 6px 0 var(--shadow); }
.device img { display: block; width: 100%; border-radius: 29px; }

.pin {
  position: absolute; left: var(--x); top: var(--y);
  width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0;
  border: 2.5px solid var(--ink); border-radius: 50%;
  background: var(--cream); color: var(--ink);
  font: 900 12px/21px var(--sans); text-align: center; cursor: pointer;
  box-shadow: 0 3px 0 var(--shadow);
  transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.4), background 0.2s;
}
.pin::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 2.5px solid var(--gold); opacity: 0; animation: ping 2.4s ease-out infinite;
}
.slide:not(.is-active) .pin::after { animation: none; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.8; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
.pin.is-hot { transform: scale(1.25); background: var(--gold); }

figcaption h3 { font-size: 30px; letter-spacing: -0.01em; font-weight: 900; margin: 0 0 18px; }
figcaption ol { list-style: none; margin: 0; padding: 0; }
figcaption li {
  position: relative; padding: 12px 0 12px 42px; border-top: 2px dashed rgba(27, 27, 34, 0.16);
  font-size: 17px; line-height: 1.4; cursor: default; color: var(--ink-soft); font-weight: 700; transition: color 0.2s;
}
figcaption li::before {
  content: attr(data-n); position: absolute; left: 0; top: 10px;
  width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--ink); box-sizing: border-box;
  background: var(--cream); color: var(--ink); font: 900 11px/21px var(--sans); text-align: center;
  transition: background 0.2s;
}
figcaption li.is-hot { color: var(--ink); }
figcaption li.is-hot::before { background: var(--gold); }

.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 8px; }
.arrow {
  width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink); cursor: pointer;
  background: var(--cream); color: var(--ink); box-shadow: 0 3px 0 var(--shadow);
  display: grid; place-items: center; transition: background 0.2s;
}
.arrow:hover { background: var(--gold); }
.arrow:disabled { opacity: 0.35; cursor: default; }
.arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dots { display: flex; gap: 8px; }
.dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; cursor: pointer;
  background: rgba(255, 248, 224, 0.3); transition: width 0.3s, background 0.3s;
}
.dots button[aria-selected="true"] { width: 26px; background: var(--gold); }

@media (max-width: 820px) {
  .gallery { padding: 80px 0 72px; }
  .slide { grid-template-columns: 1fr; gap: 26px; padding: 26px 20px 20px; border-radius: 28px; }
  .slide .device { width: min(230px, 66vw); margin: 0 auto; }
  figcaption h3 { font-size: 24px; margin-bottom: 10px; }
  figcaption li { font-size: 15px; padding: 10px 0 10px 36px; }
  figcaption li::before { top: 8px; }
  .pin { width: 22px; height: 22px; margin: -11px 0 0 -11px; font-size: 10px; line-height: 17px; }
}

/* ---------- The little things ---------- */
.details { padding: 40px 16px 110px; }
.bento { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 48px; }
.bento { gap: 20px; }
.tile { background: var(--cream); color: var(--ink); border: var(--outline); border-radius: 22px; box-shadow: var(--hard); padding: 24px 24px 26px; }
.tile .glyph {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: var(--hue); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--shadow); margin-bottom: 16px;
}
.tile .glyph svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tile h3 { font-size: 21px; letter-spacing: -0.01em; font-weight: 900; margin: 0 0 8px; }
.tile p { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.5; font-weight: 600; }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .bento { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */
.pricing { padding: 100px 16px 90px; }
.plans { max-width: 820px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; align-items: start; }
.plan { background: var(--cream); color: var(--ink); border: var(--outline); border-radius: 26px; box-shadow: 0 6px 0 var(--shadow); padding: 30px 28px; }
.plan h3 { font-size: 17px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 12px; color: var(--ink-soft); }
.plan .price { color: var(--ink); font-size: 50px; line-height: 1; letter-spacing: -0.03em; font-weight: 900; margin: 0 0 22px; }
.plan .price small { font-size: 18px; letter-spacing: 0; font-weight: 800; color: var(--ink-soft); }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { position: relative; padding: 9px 0 9px 28px; border-top: 2px dashed rgba(27, 27, 34, 0.14); color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.4; }
.plan li::before {
  content: ""; position: absolute; left: 1px; top: 12px; width: 16px; height: 16px;
  background: var(--ink-soft);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.plan-pro { background: var(--gold); box-shadow: 0 6px 0 var(--shadow), 0 0 60px -10px rgba(240, 199, 94, 0.55); }
.plan-pro h3 { color: var(--ink); }
.plan-pro li::before { background: var(--ink); }
.plan-pro li { border-top-color: rgba(27, 27, 34, 0.22); }
.pricing .fine { margin: 28px 0 0; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; max-width: 520px; } }

/* ---------- Support ---------- */
.support { padding: 90px 16px 100px; }
.support .section-head { padding-bottom: 28px; }
.faq { max-width: 720px; margin: 0 auto; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative;
  font-size: 19px; font-weight: 800;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.25s;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { margin: 0 0 20px; color: var(--muted); max-width: 640px; }
.faq a { color: var(--gold); text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .track { scroll-behavior: auto; }
  .pin::after, .scroll-cue span { animation: none; }
  .step { transform: none; }
  .sky .orion line, .sky .orion circle { transition: none; }
  .cell.is-star .star, .board.is-solved .cell.is-star .star { animation: none; }
}
