/* Window Seat: you sit at a window, and the sky outside is the real hour.
   Panels are always dark glass, so text stays readable whichever sky is behind them. */
:root {
  --night: #140f24;
  --night-2: #1d1534;
  --glass: rgba(22, 15, 38, 0.8);
  --line: rgba(255, 214, 170, 0.22);
  --cream: #fbefe0;
  --muted: #cdbfdc;
  --sun: #ff9a5a;
  --sun-ink: #2a1208;
  --rose: #ff7a9a;
  --leaf: #9be39a;
  --sky: #86c4ff;
  --display: "Pixelify Sans", "Silkscreen", ui-monospace, monospace;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--cream); font: 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
body::before { /* a faint starfield under everything below the window */
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: 0.5;
  background-image: radial-gradient(1px 1px at 12% 20%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 63% 8%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 82% 44%, #fff7 50%, transparent 51%), radial-gradient(1px 1px at 31% 71%, #fff5 50%, transparent 51%), radial-gradient(1px 1px at 90% 90%, #fff6 50%, transparent 51%);
  background-size: 340px 340px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 0.4em; letter-spacing: 0.01em; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.7rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--sun); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cream); color: var(--night); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 72px 16px 8px; }
.eyebrow { font: 700 0.8rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sun); margin-bottom: 0.6em; }
.sub { color: var(--muted); max-width: 46em; }
.fine { color: var(--muted); font-size: 0.88rem; margin: 0.8em 0 0; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 6px; backdrop-filter: blur(6px); }

/* Pixel buttons: a hard edge and a step of shadow, pressed down on click. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; font: 700 1rem var(--display); letter-spacing: 0.02em; color: var(--cream); background: var(--night-2); border: 3px solid var(--cream); border-radius: 2px; padding: 10px 18px; text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 #000a; transition: transform 0.08s var(--ease), box-shadow 0.08s var(--ease), background 0.15s; }
.btn:hover { background: #2b2048; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000a; }
.btn.primary { background: var(--sun); color: var(--sun-ink); border-color: #ffe2c2; }
.btn.primary:hover { background: #ffad73; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; font-size: 0.9rem; box-shadow: 0 3px 0 #000a; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.chip { font: 700 0.78rem var(--mono); color: var(--cream); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--cream); color: var(--night); }
.chip.static { cursor: default; }
.link { background: none; border: 0; color: var(--sun); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; text-underline-offset: 3px; }

/* HUD */
.hud { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: linear-gradient(#140f24f2, #140f24b0); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 8px; font: 700 1.05rem var(--display); letter-spacing: 0.18em; color: var(--cream); text-decoration: none; }
.brand-cat { width: 20px; height: 18px; background: var(--sun); clip-path: polygon(0 0, 30% 0, 30% 20%, 70% 20%, 70% 0, 100% 0, 100% 100%, 0 100%); }
.xp { display: flex; align-items: center; gap: 8px; margin-left: 8px; font: 0.78rem var(--mono); color: var(--muted); min-width: 0; }
.lvl, .xpn { color: var(--cream); white-space: nowrap; }
.bar { display: block; width: 110px; height: 12px; border: 2px solid var(--cream); padding: 1px; }
.bar i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, var(--sun) 0 6px, transparent 6px 8px); clip-path: inset(0 100% 0 0); transition: clip-path 0.5s var(--ease); }
.hud-nav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.hud-nav a { color: var(--cream); text-decoration: none; font-size: 0.92rem; }
.hud-nav a:hover { color: var(--sun); }
body.calm .xp, body.calm #questsNav { display: none; }

/* The window */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding: 96px 16px 56px; overflow: hidden; }
.scene { position: absolute; inset: 0; z-index: 0; background: var(--night-2); }
.scene .layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: opacity 1.4s ease; }
#sceneB { opacity: 0; }
#sceneMotion { z-index: 1; pointer-events: none; }
.vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(to top, #140f24 0%, #140f24b0 18%, transparent 55%), radial-gradient(ellipse at 50% 40%, transparent 55%, #140f2466 100%); }
.hero-copy { position: relative; z-index: 3; max-width: 560px; padding: 26px 28px 22px; margin-left: max(0px, calc((100vw - 1040px) / 2)); animation: rise 0.7s var(--ease) both; }
.hero-copy h1 { margin-bottom: 0.35em; }
.lede { font-size: 1.1rem; color: var(--cream); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.scrub { position: absolute; z-index: 3; right: 16px; top: 76px; display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; width: min(260px, calc(100vw - 32px)); font: 0.8rem var(--mono); color: var(--muted); }
.scrub output { color: var(--cream); font-size: 1.1rem; }
input[type="range"] { width: 100%; accent-color: var(--sun); }
.cat { position: absolute; z-index: 3; right: 7%; bottom: 0; background: none; border: 0; cursor: pointer; padding: 0; line-height: 0; }
.cat svg { display: block; transition: transform 0.2s var(--ease); }
.cat:hover svg { transform: translateY(-2px); }
.cat .eyes { animation: blink 5s infinite; transform-origin: center; }
.cat.purr svg { animation: bob 0.5s ease 3; }
@keyframes blink { 0%, 94%, 100% { opacity: 1; } 96% { opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* A strip of sky between sections */
.band { position: relative; margin: 72px 0 0; height: clamp(160px, 26vw, 300px); overflow: hidden; border-block: 1px solid var(--line); }
.band canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.band[data-scene="rooftop-sunset"] canvas { object-position: 50% 92%; }
.band[data-scene="lantern-shop"] canvas { object-position: 50% 62%; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#140f24 0%, transparent 22%, transparent 78%, #140f24 100%); pointer-events: none; }

/* Quests */
.quests { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.quest { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; background: var(--glass); border: 1px solid var(--line); border-radius: 6px; transition: border-color 0.2s, transform 0.2s var(--ease); }
.quest .tick { width: 26px; height: 26px; border: 3px solid var(--cream); display: grid; place-items: center; font: 700 1rem var(--display); color: transparent; }
.quest.done { border-color: var(--leaf); }
.quest.done .tick { background: var(--leaf); border-color: var(--leaf); color: var(--night); }
.quest h3 { font-size: 1.05rem; margin: 0 0 2px; }
.quest p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.quest .pts { font: 700 0.78rem var(--mono); color: var(--sun); white-space: nowrap; }
.quest a, .quest button.link { font-size: 0.92rem; }
body.calm .quests, body.calm #quests .sub, body.calm #quests { display: none; }

/* Game */
.game { padding: 20px; max-width: 700px; margin-top: 18px; }
.game-top { display: flex; justify-content: space-between; align-items: center; font: 0.8rem var(--mono); color: var(--muted); margin-bottom: 10px; }
.code { font: 0.95rem/1.55 var(--mono); background: #0b0716; border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; margin: 0 0 14px; overflow-x: auto; color: #ffe9d2; }
.ask { font-weight: 700; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opts .btn { font-family: var(--mono); min-width: 84px; }
.opts .btn.right { background: var(--leaf); color: var(--night); border-color: #d5ffd2; }
.opts .btn.wrong { background: #3a1a2a; border-color: var(--rose); }
.tutor { margin: 14px 0 0; min-height: 3.2em; color: var(--cream); border-left: 4px solid var(--sun); padding-left: 12px; }
.tutor:empty { border-left-color: transparent; }
.game-end { margin-top: 14px; }
.game-end[hidden] { display: none; }

/* Cards and pricing */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 20px; }
.card { padding: 20px 22px 8px; }
.card p { color: var(--muted); font-size: 0.98rem; }
.pricing { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); margin-top: 20px; align-items: start; }
.plan { padding: 26px; border-color: #ffd9b5; box-shadow: 6px 6px 0 #000a; }
.plan-top { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.amount b { font: 700 clamp(2.4rem, 6vw, 3.4rem) var(--display); color: var(--sun); display: block; line-height: 1; }
.amount span { font: 0.8rem var(--mono); color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; }
.ticks li { padding-left: 26px; position: relative; margin: 7px 0; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 12px; height: 8px; border-left: 3px solid var(--leaf); border-bottom: 3px solid var(--leaf); transform: rotate(-45deg); }
.side { padding: 20px 22px; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 700; }
details p { color: var(--muted); margin: 8px 0 0; font-size: 0.95rem; }

.foot { margin-top: 80px; border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
.foot-in { padding-top: 0; display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot p { margin: 0; }

/* Sign in */
dialog { border: 0; padding: 0; background: transparent; color: var(--cream); max-width: 440px; width: calc(100vw - 24px); }
dialog::backdrop { background: #08051099; backdrop-filter: blur(3px); }
.sheet { padding: 24px; position: relative; background: #1a1230; }
.sheet .x { position: absolute; right: 10px; top: 10px; background: none; border: 0; color: var(--cream); font: 1.1rem var(--mono); cursor: pointer; padding: 6px 10px; }
.oauth { display: grid; gap: 10px; margin: 14px 0 6px; }
.oauth .g, .oauth .d { width: 22px; height: 22px; display: grid; place-items: center; font: 700 0.8rem var(--mono); border-radius: 3px; }
.oauth .g { background: #fff; color: #3a3a3a; }
.oauth .d { background: #5865f2; color: #fff; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 0.78rem var(--mono); margin: 16px 0 10px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.row { display: flex; gap: 8px; }
.row[hidden] { display: none; }
input[type="tel"], input[type="text"], input[type="email"] { flex: 1; min-width: 0; font: 1rem var(--mono); color: var(--cream); background: #0b0716; border: 2px solid var(--line); border-radius: 3px; padding: 9px 11px; }
input:focus { border-color: var(--sky); outline: none; }
.msg { min-height: 1.4em; margin: 12px 0 0; font-size: 0.92rem; color: var(--leaf); }
.msg.err { color: var(--rose); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; background: var(--cream); color: var(--night); padding: 10px 16px; border: 3px solid var(--night); box-shadow: 0 4px 0 #000a; font: 700 0.92rem var(--display); z-index: 60; pointer-events: none; transition: 0.3s var(--ease); max-width: calc(100vw - 24px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Account + legal pages */
.page { max-width: 760px; margin: 0 auto; padding: 100px 16px 40px; }
.panel { padding: 22px 24px; margin: 16px 0; }
.licence { font: 700 clamp(1rem, 3.6vw, 1.5rem) var(--mono); letter-spacing: 0.06em; word-break: break-all; background: #0b0716; border: 2px dashed var(--sun); padding: 14px; margin: 10px 0; user-select: all; }
.legal h2 { font-size: 1.3rem; margin-top: 1.6em; }
.legal p, .legal li { color: var(--muted); }
.legal .draft { border: 1px dashed var(--sun); padding: 8px 12px; background: #2a1d10; color: var(--cream); border-radius: 4px; }

@media (max-width: 760px) {
  .pricing { grid-template-columns: 1fr; }
  .hud-nav a { display: none; }
  .xp .bar, .xp .lvl { display: none; }
  .brand { letter-spacing: 0.08em; font-size: 0.95rem; }
  .chip, .btn.small { white-space: nowrap; }
  .hud { gap: 8px; padding: 8px 10px; }
  .scrub { padding: 8px 12px; }
  .scrub { top: 66px; }
  .hero { padding-bottom: 40px; align-items: flex-end; }
  .hero-copy { padding: 20px; margin-top: 190px; }
}

/* Hold still, and the system's own reduce-motion setting */
html.still *, html.still *::before, html.still *::after, body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  * , *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* The app, as it looks */
.shot { margin: 28px 0 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #07110c; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 12px 16px; font-size: 0.95rem; color: var(--muted); background: var(--night); border-top: 1px solid var(--line); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--night); border-bottom: 1px solid var(--line); }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 214, 170, 0.28); }
.shot-bar span { margin-left: 8px; font: 0.8rem var(--mono); color: var(--muted); }
.shot-pair { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 24px; }
.shot.small { margin: 0; }
.shot-note h3 { font-family: var(--display); font-size: 1.25rem; margin: 0 0 8px; }
.shot-note ol { margin: 0 0 12px; padding-left: 1.2em; line-height: 1.7; }
@media (max-width: 760px) { .shot-pair { grid-template-columns: 1fr; } }

/* Pixel strips are punctuation, not the main event */
.band { height: clamp(110px, 15vw, 190px); margin-top: 56px; }

/* price section: what you buy, what you don't, what happens next */
.plan h4 { font-family: var(--display); font-size: 1rem; margin: 18px 0 6px; color: var(--cream); }
.plan .steps { margin: 0 0 18px; padding-left: 22px; }
.plan .steps li { margin: 6px 0; }
.plan .fine a, .side a { color: var(--sun); }

.ticks.nope li::before { width: 10px; height: 0; border-left: 0; border-bottom: 3px solid var(--sun); transform: none; top: 0.75em; }
