/* Walnut landing (#231): one fixed 3D stage, scroll-driven chapters over it, then normal flow. */

body.landing { transition: background-color 400ms, color 400ms; }

/* ---------- the stage ---------- */
.stage { position: fixed; inset: 0; z-index: 0; transition: opacity 120ms linear; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; outline: none; }
/* #246: the turn zone follows the object on screen. On it a touch turns the object; anywhere else the page scrolls. */
.stage .grab { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 50%; display: none; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.stage .grab.on { display: block; }
.stage .grab.isle { touch-action: pan-y; }            /* the island turns sideways only; vertical swipes still scroll */
.stage .grab.dragging, html.turning, html.turning body { cursor: grabbing; }
html.turning body { -webkit-user-select: none; user-select: none; }
.stage .turn-hint { position: absolute; left: 0; top: 0; font-size: 15px; line-height: 20px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 400ms; }
.stage .turn-hint.on { opacity: .55; }
.stage .fallback { position: absolute; left: 50%; top: 50%; width: min(70vw, 420px); height: auto; transform: translate(-10%, -50%); border-radius: 28px; }
@media (max-width: 760px) { .stage .fallback { width: auto; height: min(42vh, 360px); top: auto; bottom: 40px; transform: translateX(-50%); } }
.stage .halo { position: absolute; width: 60vmin; height: 60vmin; left: 70%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, var(--halo), transparent); pointer-events: none; opacity: var(--halo-o, 1); }
@media (max-width: 760px) { .stage .halo { left: 50%; top: 50%; width: 90vmin; height: 90vmin; } }

/* ---------- nav over the stage ---------- */
.landing .wn-nav { position: absolute; left: 0; right: 0; top: 0; }

/* ---------- chapters ---------- */
.chapters { position: relative; z-index: 1; pointer-events: none; }
.ch { position: relative; height: 165vh; }
.ch-hero { height: 140vh; }
.ch-copy { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; }
.ch-copy .wn-sec { display: flex; }
.ch-text { max-width: 520px; display: flex; flex-direction: column; gap: 18px; will-change: opacity, transform; }
.ch-text a, .ch-text button { pointer-events: auto; }
.ch h1 { margin: 0; font-size: clamp(44px, 7vw, 84px); line-height: .98; letter-spacing: -2px; font-weight: 600; }
.ch h2 { margin: 0; font-size: clamp(34px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -1.2px; font-weight: 600; text-wrap: balance; }
.ch p { margin: 0; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; opacity: var(--dim); max-width: 440px; text-wrap: pretty; }

.appstore { height: 56px; padding: 0 22px; border-radius: 14px; background: var(--tx); color: var(--bg); display: inline-flex; align-items: center; gap: 10px; font-size: 17px; text-decoration: none; align-self: flex-start; transition: background-color 400ms, color 400ms; }
.appstore[aria-disabled="true"] { cursor: default; }
.fine { font-size: 15px; opacity: .55; }

.undo-pill { align-self: flex-start; height: 40px; padding: 0 16px; border-radius: 20px; background: var(--tx); color: var(--bg); display: inline-flex; align-items: center; font-size: 15px; transition: background-color 400ms, color 400ms; }

.skins { display: flex; gap: 10px; flex-wrap: wrap; }
.skin { height: 44px; padding: 0 16px 0 8px; border-radius: 22px; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; background: transparent; color: inherit; font: inherit; font-size: 15px; border: 0; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 200ms, background-color 400ms; }
.skin i { width: 28px; height: 28px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35); }
.skin small { font-size: 13px; opacity: .5; }
.skin[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--tx); background: var(--el); }
.skin[data-skin="graphite"] i { background: #26272A; }
.skin[data-skin="chalk"] i { background: #F6F3EC; }
.skin[data-skin="basalt"] i { background: #4A4A4E; }
.skin[data-skin="sandstone"] i { background: #D9C2A0; }

/* Mobile (#246): the words at the top, the object below them in its own space (landing.js sizes it to the space left). */
@media (max-width: 760px) {
  .ch-copy { align-items: flex-start; }
  .ch-copy .wn-sec { padding-top: max(48px, env(safe-area-inset-top)); }
  .ch-hero .ch-copy .wn-sec { padding-top: 96px; }
  .ch-text { gap: 14px; }
}
@media (max-width: 760px) and (max-height: 720px) {
  .ch h1 { font-size: 40px; }
  .ch h2 { font-size: 30px; letter-spacing: -.8px; }
  .ch p { font-size: 16px; }
  .ch-text { gap: 12px; }
  .ch-copy .wn-sec { padding-top: max(36px, env(safe-area-inset-top)); }
  .ch-hero .ch-copy .wn-sec { padding-top: 84px; }
}

/* ---------- closing: normal flow, the stage fades behind ---------- */
.closing { position: relative; z-index: 1; padding-top: 12vh; }
.closing .wn-sec > * + * { margin-top: 0; }
.close-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 860px) { .close-grid { grid-template-columns: 1fr; gap: 40px; } }
.price h2 { margin: 0 0 14px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -1px; line-height: 1.04; font-weight: 600; }
.price p { margin: 0 0 22px; font-size: 18px; line-height: 1.5; opacity: var(--dim); max-width: 460px; }
.price .plans { display: flex; flex-direction: column; gap: 10px; margin: 0 0 26px; font-size: 17px; }
.price .plans div { display: flex; gap: 12px; align-items: baseline; }
.price .plans b { font-weight: 600; min-width: 44px; }
.price .plans span { opacity: var(--dim); }
.price .plans .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; align-self: center; background: var(--tx); }
.price .plans .dot.am { background: var(--am); }
.qs h3 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.qs .faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.qs .faq details:last-child { border-bottom: 1px solid var(--line); }
.qs .faq summary { cursor: pointer; list-style: none; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.qs .faq summary::-webkit-details-marker { display: none; }
.qs .faq summary::after { content: "+"; opacity: .5; font-size: 22px; line-height: 1; flex: none; }
.qs .faq details[open] summary::after { content: "\2212"; }
.qs .faq p { margin: 10px 0 0; font-size: 16px; line-height: 1.55; opacity: var(--dim); }

/* Reduced motion: the stage is a still picture, words are always on. */
@media (prefers-reduced-motion: reduce) {
  .ch-text { opacity: 1 !important; transform: none !important; }
  body.landing, .appstore, .undo-pill, .skin { transition: none; }
}

.noscript-note { position: relative; z-index: 2; text-align: center; opacity: .6; font-size: 14px; padding: 8px; }
