/* Deralba — site stylesheet.
   Palette and type come from the app's design system ("Eşik Işığı" v8, DESIGN.md).
   Rules carried over: no pure black/white, no shadows, no pill buttons,
   no gradient CTAs, ember appears once per view.
   Every animated element has a complete static state: without JavaScript, or with
   reduced motion, the page shows the finished frame. */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Sans";
  src: url("fonts/geist-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #181714;
  --threshold: #1c1b18;
  --mineral: #202821;
  --curtain: #12120f;
  --bone: #f2ede2;
  --paper: #f7f2e9;
  --paper-deep: #e7e0d3;
  --ink: #24231f;
  --ink-muted: #5e5a53;
  --stone: #aaa69c;
  --stone-warm: #67645d;
  --ember: #d05d31;
  --ember-deep: #c14d25;
  --copper: #8c3f16;
  --brick: #b85f54;
  --moss: #5e9a6b;
  --spark: #e9c33f;
  --lv1: #6e9e72;
  --lv2: #a3a257;
  --lv3: #e9c33f;
  --lv4: #e39a3a;
  --lv5: #ce7a2a;

  --hairline: rgba(242, 237, 226, 0.12);
  --hairline-strong: rgba(242, 237, 226, 0.26);
  --hairline-light: rgba(36, 35, 31, 0.14);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(80px, 12vw, 152px);
  --measure: 38rem;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--bone);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--bone);
  color: var(--ink);
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type roles ---------- */

.label {
  margin: 0 0 20px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 7.2vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.headline {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  margin: 28px 0 0;
  max-width: 34rem;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.55;
  color: var(--stone);
  text-wrap: pretty;
}

.lede strong {
  font-weight: 400;
  color: var(--bone);
}

.tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- Scroll reveal (JS only) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 480ms var(--ease-out) var(--d, 0ms),
    transform 480ms var(--ease-out) var(--d, 0ms);
}

.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--hairline);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

.brand svg {
  width: 20px;
  height: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9375rem;
  font-weight: 400;
}

.nav a {
  color: var(--stone);
  text-decoration: none;
  padding-block: 12px;
}

.nav a:hover {
  color: var(--bone);
}

.soon-tag {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  padding: 7px 10px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .nav .nav-link {
    display: none;
  }
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn-primary {
  background: var(--bone);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--paper-deep);
}

.btn-secondary {
  border: 1px solid var(--hairline-strong);
  color: var(--bone);
}

.btn-secondary:hover {
  border-color: rgba(242, 237, 226, 0.5);
}

/* ---------- Store badges ----------
   Official artwork, unmodified and never animated. The Google Play PNG carries its
   own clear space (41 of 250 px), so it is pulled in to line up with Apple's. */

.stores {
  margin-top: 36px;
}

.stores .tag {
  display: block;
  margin-bottom: 14px;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}

.badge-apple {
  width: auto;
  height: 44px;
}

.badge-google {
  width: auto;
  height: 65.5px;
  margin: -10.75px;
}

/* ---------- Phone frame ---------- */

.phone {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 300 / 630;
  padding: 9px;
  border-radius: 46px;
  background: var(--curtain);
  border: 1px solid var(--hairline-strong);
}

.phone::before {
  content: "";
  position: absolute;
  z-index: 5;
  top: 21px;
  left: 50%;
  width: 28%;
  height: 22px;
  border-radius: 12px;
  background: var(--curtain);
  transform: translateX(-50%);
}

.screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 37px;
  background: var(--night);
  container-type: inline-size;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 8vw, 104px) var(--section);
}

/* Directional light from the upper right — the app's threshold light, kept faint. */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -30% auto auto;
  width: 80vw;
  height: 80vw;
  max-width: 980px;
  max-height: 980px;
  background: radial-gradient(closest-side, rgba(208, 93, 49, 0.12), rgba(208, 93, 49, 0));
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-caption {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--stone);
}

.replay {
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--bone);
  font: 500 0.8125rem/1 var(--sans);
  cursor: pointer;
}

.js .replay {
  display: inline-block;
}

.replay:hover {
  border-color: rgba(242, 237, 226, 0.5);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- The gate, on a phone (hero) ----------
   Timeline, in seconds: rise 0.4–3.4 · maze 3.7–7.6 · choose 8.4 →.
   The final frame (duration choice) is the static state. */

.gate-phone .stage {
  position: absolute;
  inset: 0;
}

.dawn {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(
    ellipse 120% 70% at 50% -18%,
    rgba(140, 63, 22, 0.95),
    rgba(193, 77, 37, 0.32) 42%,
    rgba(122, 46, 22, 0.1) 64%,
    rgba(24, 23, 20, 0) 80%
  );
}

.stage-rise,
.stage-maze {
  opacity: 0;
}

.trail {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 44cqw;
  height: 12%;
  transform: translateX(-50%);
  clip-path: polygon(48.6% 0, 51.4% 0, 100% 100%, 0 100%);
  background: linear-gradient(
    to bottom,
    rgba(242, 237, 226, 0.7),
    rgba(242, 237, 226, 0.22) 46%,
    rgba(242, 237, 226, 0.02)
  );
}

.orb {
  position: absolute;
  left: 50%;
  bottom: 12%;
  width: 5cqw;
  height: 5cqw;
  margin: 0 0 -2.5cqw -2.5cqw;
  border-radius: 50%;
  background: var(--bone);
}

.orb::after {
  content: "";
  position: absolute;
  inset: -45%;
  border: 1px solid rgba(242, 237, 226, 0.55);
  border-radius: 50%;
}

.words {
  position: absolute;
  left: 0;
  right: 0;
  top: 58%;
  margin: 0;
  font-family: var(--serif);
  font-size: 11cqw;
  line-height: 1;
  text-align: center;
  color: var(--bone);
}

.words span {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
}

.stage-maze {
  display: grid;
  place-items: center;
  padding: 16cqw 8cqw 10cqw;
}

.phone-maze {
  width: 100%;
  height: auto;
  overflow: visible;
}

.stage-choose {
  display: flex;
  flex-direction: column;
  padding: 26cqw 9cqw 10cqw;
}

.balance {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 2cqw;
  margin: 0;
  padding: 2.2cqw 3.6cqw;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 5cqw;
  line-height: 1;
}

.bolt {
  width: 1em;
  height: 1em;
  fill: var(--spark);
  flex: none;
}

.choose-title {
  margin: 12cqw 0 0;
  font-family: var(--serif);
  font-size: 10.5cqw;
  line-height: 1.02;
  text-align: left;
}

.choose-note {
  margin: 3.5cqw 0 0;
  font-size: 4.2cqw;
  line-height: 1.4;
  color: var(--stone);
}

.choices {
  display: grid;
  gap: 2.6cqw;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.choices li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 15cqw;
  padding: 0 5cqw;
  border-radius: 8px;
  background: var(--mineral);
  font-size: 5.2cqw;
  font-weight: 400;
}

.choices li span {
  font-family: var(--mono);
  font-size: 4.2cqw;
  color: var(--stone);
}

.choices .pick {
  background: var(--ember);
  color: var(--night);
}

.choices .pick span {
  color: var(--night);
}

.turn-back {
  margin: 5cqw 0 0;
  font-size: 4.6cqw;
  text-align: center;
  color: var(--stone);
}

/* Playback */

.gate-phone.play .dawn {
  animation: dawn 3.8s ease 0.4s both;
}

.gate-phone.play .stage-rise {
  animation: stage-rise 3.6s linear both;
}

.gate-phone.play .trail {
  animation: trail-grow 3s cubic-bezier(0.35, 0.05, 0.75, 1) 0.4s both;
}

.gate-phone.play .orb {
  animation:
    orb-rise 3s cubic-bezier(0.35, 0.05, 0.75, 1) 0.4s both,
    orb-melt 0.32s ease-in 3.4s both;
}

.gate-phone.play .orb::after {
  animation: breathe 1.5s ease-in-out 0.4s 2;
}

.gate-phone.play .words span {
  animation: word 0.62s ease both;
}

.gate-phone.play .words span:nth-child(1) { animation-delay: 0.55s; }
.gate-phone.play .words span:nth-child(2) { animation-delay: 1.1s; }
.gate-phone.play .words span:nth-child(3) { animation-delay: 1.75s; }
.gate-phone.play .words span:nth-child(4) { animation-delay: 2.2s; }
.gate-phone.play .words span:nth-child(5) { animation-delay: 2.65s; }

.gate-phone.play .stage-maze {
  animation: stage-maze 4.7s linear 3.7s both;
}

.gate-phone.play .stage-maze .maze-thread {
  animation: trace 3.3s cubic-bezier(0.45, 0.05, 0.3, 1) 4.1s both;
}

.gate-phone.play .stage-maze .maze-exit {
  animation: arrive 0.4s ease 7.3s both;
}

.gate-phone.play .stage-choose {
  animation: rise-in 0.48s var(--ease-out) 8.45s both;
}

.gate-phone.play .choices li {
  animation: rise-in 0.42s var(--ease-out) both;
}

.gate-phone.play .choices li:nth-child(1) { animation-delay: 8.65s; }
.gate-phone.play .choices li:nth-child(2) { animation-delay: 8.72s; }
.gate-phone.play .choices li:nth-child(3) { animation-delay: 8.79s; }

.gate-phone.play .choices .pick {
  animation:
    rise-in 0.42s var(--ease-out) 8.72s both,
    pick 0.28s ease 9.9s both;
}

.gate-phone.play .choices .pick span {
  animation: pick-meta 0.28s ease 9.9s both;
}

@keyframes dawn {
  0% { opacity: 0; }
  20% { opacity: 0.15; }
  76% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes stage-rise {
  0%, 94% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes trail-grow {
  from { height: 12%; }
  to { height: 88%; }
}

@keyframes orb-rise {
  from { bottom: 12%; }
  to { bottom: 88%; }
}

@keyframes orb-melt {
  to { opacity: 0; transform: scale(0.3); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0.25; }
}

@keyframes word {
  0% { opacity: 0; transform: translateY(6px); }
  22%, 70% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-4px); }
}

@keyframes stage-maze {
  0% { opacity: 0; }
  7%, 91% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes pick {
  from { background: var(--mineral); color: var(--bone); }
  to { background: var(--ember); color: var(--night); }
}

@keyframes pick-meta {
  from { color: var(--stone); }
  to { color: var(--night); }
}

/* ---------- Maze drawing (shared) ---------- */

.maze-walls {
  fill: none;
  stroke: var(--stone);
  stroke-opacity: 0.55;
  stroke-width: 2;
  stroke-linecap: square;
}

.maze-thread {
  fill: none;
  stroke: var(--ember);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.maze-start,
.maze-exit {
  fill: var(--bone);
}

@keyframes trace {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--hairline);
}

.section-head {
  max-width: 48rem;
  margin-bottom: clamp(48px, 7vw, 88px);
}

.section-head .lede {
  max-width: var(--measure);
}

/* How it works: rows beside a live budget */

.how {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: clamp(40px, 7vw, 112px);
}

.how-visual {
  position: sticky;
  top: 40px;
}

@media (max-width: 900px) {
  .how {
    grid-template-columns: minmax(0, 1fr);
  }

  .how-visual {
    position: relative;
    top: auto;
    order: -1;
    justify-self: center;
    width: min(100%, 300px);
  }
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 16px 24px;
  padding-block: clamp(28px, 4vw, 40px);
  border-bottom: 1px solid var(--hairline);
}

.row-mark {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 0.4rem;
}

.row-num {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--stone);
}

.row-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--bone);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-icon.is-bolt {
  fill: var(--spark);
  stroke: none;
}

.row-icon.row-bars {
  height: 16px;
  stroke: none;
}

.row-bars rect {
  fill: rgba(170, 166, 156, 0.22);
}

.row h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
  line-height: 1.1;
}

.row p {
  margin: 0;
  max-width: var(--measure);
  color: var(--stone);
}

@media (max-width: 560px) {
  .row {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 12px 16px;
  }
}

/* ---------- Budget phone (Home) ---------- */

.budget-phone .screen {
  display: flex;
  flex-direction: column;
  /* Percentages, not cqw: a container cannot size its own padding in its own units. */
  padding: 17% 7% 0;
}

.b-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.b-lock {
  display: inline-flex;
  align-items: center;
  gap: 2.4cqw;
}

.lock {
  width: 6.4cqw;
  height: auto;
  overflow: visible;
}

.lock-shackle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 14px 12.5px;
}

.lock-body {
  fill: currentColor;
}

.b-lock {
  color: var(--moss);
}

.b-dot {
  width: 2.3cqw;
  height: 2.3cqw;
  border-radius: 50%;
  background: var(--moss);
}

.b-settings,
.b-label,
.arm-label {
  margin: 0;
  font-size: 3.2cqw;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

.gauge {
  position: relative;
  width: 86%;
  margin: 7cqw auto 0;
}

.gauge-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.gauge-track,
.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.gauge-track {
  stroke: rgba(170, 166, 156, 0.18);
}

.gauge-fill {
  stroke: var(--spark);
  stroke-dasharray: 1;
  stroke-dashoffset: 0.2235;
}

.gauge-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1cqw;
  text-align: center;
}

.g-num {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8cqw;
  margin: 0;
  font-family: var(--mono);
  font-size: 11cqw;
  line-height: 1;
  letter-spacing: -0.02em;
}

.g-num .bolt {
  width: 0.56em;
  height: 0.56em;
  transform-origin: 50% 50%;
}

.bolt.charge {
  animation: charge 0.46s var(--ease-out);
}

@keyframes charge {
  0%, 100% { transform: scale(1); fill: var(--spark); }
  40% { transform: scale(1.34); fill: #f4e6b8; }
}

.g-sub {
  margin: 1.6cqw 0 0;
  font-size: 3.4cqw;
  color: var(--stone);
}

.arms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4cqw;
  margin-top: 8cqw;
  padding-block: 4cqw;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.arm-val {
  margin: 1.4cqw 0 0;
  font-family: var(--mono);
  font-size: 5.6cqw;
  line-height: 1.1;
}

.arm-val.gain {
  color: var(--moss);
}

.arm-val.cost {
  color: var(--brick);
}

.b-label {
  margin-top: 6cqw;
}

.tasks {
  margin: 1.6cqw 0 0;
  padding: 0;
  list-style: none;
}

.task {
  display: grid;
  grid-template-columns: 6cqw minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2.8cqw;
  min-height: 12.5cqw;
  border-bottom: 1px solid var(--hairline);
  font-size: 4.3cqw;
  font-weight: 400;
}

.t-check {
  width: 5.6cqw;
  height: 5.6cqw;
  fill: none;
  stroke: var(--stone);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.t-tick {
  opacity: 0;
  stroke: var(--bone);
}

.t-text {
  position: relative;
  justify-self: start;
  white-space: nowrap;
  transition: color 220ms ease;
}

.t-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  height: 1px;
  background: var(--bone);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease;
}

.task.done .t-text {
  color: var(--stone);
}

.task.done .t-text::after {
  transform: scaleX(1);
}

.task.done .t-tick {
  opacity: 1;
  transition: opacity 180ms ease;
}

.task.done .t-ring {
  stroke: var(--bone);
}

.bars {
  width: 6.6cqw;
  height: 4.2cqw;
  overflow: visible;
}

.bars rect {
  fill: rgba(170, 166, 156, 0.22);
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.lv1 { --lv: var(--lv1); }
.lv2 { --lv: var(--lv2); }
.lv3 { --lv: var(--lv3); }
.lv4 { --lv: var(--lv4); }
.lv5 { --lv: var(--lv5); }

.lv1 rect:nth-child(-n + 1),
.lv2 rect:nth-child(-n + 2),
.lv3 rect:nth-child(-n + 3),
.lv4 rect:nth-child(-n + 4),
.lv5 rect:nth-child(-n + 5) {
  fill: var(--lv);
}

.t-earn {
  min-width: 11cqw;
  font-family: var(--mono);
  font-size: 3.6cqw;
  text-align: right;
  color: var(--lv);
}

.fly {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  opacity: 0;
  font-family: var(--mono);
  font-size: 4cqw;
  color: var(--lv4);
  pointer-events: none;
  white-space: nowrap;
}

.shell {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: auto -2cqw 3.4cqw;
  padding: 2.8cqw 1cqw 2.2cqw;
  border: 1px solid rgba(242, 237, 226, 0.09);
  border-radius: 16px;
  background: rgba(28, 27, 24, 0.9);
}

.door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2cqw;
  font-size: 2.9cqw;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
}

.door svg {
  width: 5.4cqw;
  height: 5.4cqw;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.door .pupil {
  fill: currentColor;
  stroke: none;
}

.door.is-here {
  color: var(--bone);
}

.door.is-here span {
  padding-bottom: 0.5cqw;
  border-bottom: 1px solid var(--bone);
}

/* Budget playback: JS sets the starting frame, then adds .in */

.js .budget-phone.pre .arm,
.js .budget-phone.pre .task,
.js .budget-phone.pre .b-label {
  opacity: 0;
  transform: translateY(8px);
}

.budget-phone .arm,
.budget-phone .task,
.budget-phone .b-label {
  transition:
    opacity 420ms var(--ease-out) var(--d, 0ms),
    transform 420ms var(--ease-out) var(--d, 0ms);
}

.js .budget-phone.pre .bars rect {
  transform: scaleY(0);
}

.budget-phone .bars rect {
  transition: transform 360ms var(--ease-out) var(--bd, 0ms);
}

/* ---------- The maze section ---------- */

.gate-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gate-step {
  padding-top: 28px;
  border-top: 1px solid var(--hairline-strong);
}

.step-visual {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 112px;
  margin-bottom: 28px;
}

.gate-step h3 {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 1.1875rem;
  font-weight: 500;
}

.gate-step p {
  margin: 0;
  color: var(--stone);
}

/* 1 · rise */
.mini-rise {
  position: relative;
  width: 72px;
  height: 112px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--threshold);
  container-type: inline-size;
}

.mini-rise .trail {
  width: 64cqw;
  height: 84%;
}

.mini-rise .orb {
  bottom: 84%;
  width: 11cqw;
  height: 11cqw;
  margin: 0 0 -5.5cqw -5.5cqw;
}

[data-anim].in .mini-rise .trail {
  animation: trail-mini 2.6s cubic-bezier(0.35, 0.05, 0.75, 1) both;
}

[data-anim].in .mini-rise .orb {
  animation: orb-mini 2.6s cubic-bezier(0.35, 0.05, 0.75, 1) both;
}

@keyframes trail-mini {
  from { height: 10%; }
  to { height: 84%; }
}

@keyframes orb-mini {
  from { bottom: 10%; }
  to { bottom: 84%; }
}

/* 2 · maze */
.mini-maze {
  width: 104px;
  height: 104px;
  overflow: visible;
}

.mini-maze .maze-walls {
  stroke-width: 1.5;
}

.mini-maze .maze-thread {
  stroke-width: 2.2;
}

.js [data-anim]:not(.in) .mini-maze .maze-thread {
  stroke-dashoffset: 1;
}

[data-anim].in .mini-maze .maze-thread {
  animation: trace 2.2s cubic-bezier(0.45, 0.05, 0.3, 1) 0.2s both;
}

/* 3 · choose */
.mini-choices {
  display: grid;
  gap: 6px;
  width: 128px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-choices li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--mineral);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.mini-choices li span {
  color: var(--stone);
}

.mini-choices .pick {
  background: var(--bone);
  color: var(--ink);
}

.mini-choices .pick span {
  color: var(--ink-muted);
}

.js [data-anim]:not(.in) .mini-choices .pick {
  background: var(--mineral);
  color: var(--bone);
}

[data-anim].in .mini-choices .pick {
  animation: mini-pick 0.3s ease 0.7s both;
}

@keyframes mini-pick {
  from { background: var(--mineral); color: var(--bone); }
  to { background: var(--bone); color: var(--ink); }
}

.gate-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px clamp(32px, 4vw, 56px);
  margin-top: clamp(56px, 7vw, 88px);
}

.note {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: var(--threshold);
  border-radius: 12px;
}

.note-icon {
  flex: none;
  width: 28px;
  padding-top: 2px;
  color: var(--bone);
}

.note-icon svg {
  width: 28px;
  height: auto;
  overflow: visible;
}

.note-icon .loop {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-icon .loop-dot {
  fill: currentColor;
}

.note h3 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 500;
}

.note p {
  margin: 0;
  color: var(--stone);
}

.note .tag {
  display: block;
  margin-top: 14px;
}

.js .note-lock[data-anim]:not(.in) .lock-shackle {
  transform: rotate(32deg);
}

.note-lock[data-anim].in .lock-shackle {
  animation: shackle-close 0.46s cubic-bezier(0.4, 0, 0.2, 1) 0.35s both;
}

@keyframes shackle-close {
  from { transform: rotate(32deg); }
  to { transform: rotate(0deg); }
}

@media (max-width: 860px) {
  .gate-steps,
  .gate-notes {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Outgrow */

.outgrow {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.outgrow .section-head {
  margin-bottom: 0;
}

.curve {
  width: 100%;
  height: auto;
  overflow: visible;
}

.curve-base {
  stroke: var(--hairline-strong);
  stroke-width: 1;
}

.curve-line {
  fill: none;
  stroke: var(--spark);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.curve-dot {
  fill: var(--spark);
}

.curve-value {
  font-family: var(--mono);
  font-size: 21px;
  fill: var(--bone);
}

.curve-axis {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--stone);
}

.js [data-anim]:not(.in) .curve-line {
  stroke-dashoffset: 1;
}

.js [data-anim]:not(.in) .curve-dot,
.js [data-anim]:not(.in) .curve-value {
  opacity: 0;
}

[data-anim].in .curve-line {
  animation: trace 1.6s cubic-bezier(0.3, 0, 0.2, 1) 0.1s both;
}

[data-anim].in .curve-dot,
[data-anim].in .curve-value {
  animation: arrive 0.4s ease both;
}

[data-anim].in .curve-dot:nth-of-type(1),
[data-anim].in .curve-value:nth-of-type(1) { animation-delay: 0.15s; }
[data-anim].in .curve-dot:nth-of-type(2),
[data-anim].in .curve-value:nth-of-type(2) { animation-delay: 0.55s; }
[data-anim].in .curve-dot:nth-of-type(3),
[data-anim].in .curve-value:nth-of-type(3) { animation-delay: 1.5s; }

@media (max-width: 900px) {
  .outgrow {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Quiet by design */

.quiet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(24px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.quiet li {
  padding-top: 24px;
  border-top: 1px solid var(--hairline-strong);
}

.quiet h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.1;
}

.quiet p {
  margin: 0;
  font-size: 1rem;
  color: var(--stone);
}

@media (max-width: 960px) {
  .quiet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px clamp(24px, 3vw, 40px);
  }
}

@media (max-width: 560px) {
  .quiet {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Light surface (story, legal pages) ---------- */

.paper {
  background: var(--bone);
  color: var(--ink);
  color-scheme: light;
}

.paper .label {
  color: var(--stone-warm);
}

.paper :focus-visible {
  outline-color: var(--ink);
}

.story {
  padding-block: var(--section);
}

.story-body {
  max-width: 40rem;
  margin-inline: auto;
}

.story-body .headline {
  margin-bottom: clamp(40px, 6vw, 64px);
}

.story-body p {
  margin: 0 0 1.35em;
  font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  font-weight: 350;
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}

.story-body .pull {
  margin-block: 1.6em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.875rem, 3.4vw, 2.625rem);
  line-height: 1.15;
}

.story-sign {
  margin-top: clamp(48px, 7vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--hairline-light);
}

.story-body .story-sign p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.4vw, 3.25rem);
  line-height: 1;
}

.thread-mark {
  display: block;
  width: 56px;
  height: 3px;
  margin-bottom: 20px;
  background: var(--ember-deep);
  border-radius: 2px;
  transform-origin: left center;
}

.js .story-sign:not(.in) .thread-mark {
  transform: scaleX(0);
}

.story-sign.in .thread-mark {
  transition: transform 700ms var(--ease-out) 200ms;
}

/* ---------- Pricing ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 920px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 40px);
  background: var(--threshold);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.plan-featured {
  background: var(--mineral);
  border-color: var(--hairline-strong);
}

.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 30px;
}

.plan-name {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}

.plan-badge {
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--ember);
  color: var(--night);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 28px 0 0;
}

.plan-amount {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(3rem, 5.4vw, 4rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--bone);
}

.plan-period {
  font-size: 1.0625rem;
  color: var(--stone);
}

.plan-note {
  margin: 14px 0 0;
  color: var(--stone);
  font-size: 1rem;
}

.plan-trial {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 1rem;
  font-weight: 400;
  color: var(--bone);
}

.plan-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: auto;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--stone);
}

.plan-trial + .plan-cta {
  margin-top: 24px;
}

.plan-includes {
  max-width: 920px;
  margin-top: clamp(48px, 6vw, 72px);
}

.plan-includes h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
  font-weight: 400;
  line-height: 1.1;
}

.plan-includes ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-includes li {
  position: relative;
  padding: 16px 0 16px 28px;
  border-bottom: 1px solid var(--hairline);
  color: var(--stone);
}

.plan-includes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.35em;
  width: 11px;
  height: 6px;
  border-left: 1.5px solid var(--bone);
  border-bottom: 1.5px solid var(--bone);
  transform: rotate(-45deg);
}

.plan-fine {
  max-width: 44rem;
  margin: 32px 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--stone);
}

@media (max-width: 760px) {
  .plans,
  .plan-includes ul {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(40px, 6vw, 96px);
}

.faq .section-head {
  margin-bottom: 0;
}

.faq-list {
  border-top: 1px solid var(--hairline);
}

.faq-list details {
  border-bottom: 1px solid var(--hairline);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding-block: 18px;
  cursor: pointer;
  list-style: none;
  font-size: 1.1875rem;
  font-weight: 400;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  flex: none;
  font-family: var(--mono);
  font-size: 1.25rem;
  color: var(--stone);
  transition: transform 180ms ease;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list details p {
  margin: 0 0 24px;
  max-width: var(--measure);
  color: var(--stone);
}

@media (max-width: 860px) {
  .faq {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Closing + footer ---------- */

.closing {
  padding-block: var(--section);
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.closing .headline {
  max-width: 44rem;
  margin-inline: auto;
}

.closing .stores {
  margin-top: 44px;
}

.closing .store-badges {
  justify-content: center;
}

.closing .contact {
  margin: 40px 0 0;
  color: var(--stone);
}

.site-footer {
  background: var(--threshold);
  border-top: 1px solid var(--hairline);
  padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px));
  font-size: 0.9375rem;
  color: var(--stone);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.footer-grid .brand {
  color: var(--bone);
}

.footer-sign {
  margin: 12px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-block;
  padding-block: 12px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--bone);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
}

.footer-meta p {
  margin: 0;
}

/* ---------- Legal pages ---------- */

.legal {
  padding-block: clamp(56px, 8vw, 104px) var(--section);
}

.legal-body {
  max-width: 44rem;
  margin-inline: auto;
}

.legal-body .headline {
  margin-bottom: 16px;
}

.legal-meta {
  margin: 0 0 48px;
  color: var(--ink-muted);
  font-size: 1rem;
}

.legal-summary {
  margin: 0 0 56px;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--hairline-light);
  border-radius: 12px;
}

.legal-body .legal-summary h2 {
  margin-top: 0;
}

.legal-summary ul {
  margin-bottom: 0;
}

.legal-body h2 {
  margin: 56px 0 16px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.legal-body h3 {
  margin: 32px 0 8px;
  font-size: 1.125rem;
  font-weight: 500;
}

.legal-body p,
.legal-body li {
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.7;
  color: var(--ink);
}

.legal-body p {
  margin: 0 0 1em;
}

.legal-body ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.legal-body li {
  margin-bottom: 0.5em;
}

.legal-body a {
  text-underline-offset: 3px;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5em;
}

.legal-body table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.legal-body th,
.legal-body td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--hairline-light);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.legal-body th {
  font-weight: 500;
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-content: center;
  min-height: 70vh;
  padding-block: 80px;
  text-align: center;
}

.lost .actions {
  justify-content: center;
}

/* ---------- Motion preferences ----------
   Reduced motion: the gate phone rests on the finished maze, everything else on its
   final frame. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .gate-phone .stage-rise,
  .gate-phone .dawn,
  .gate-phone .stage-choose {
    display: none;
  }

  .gate-phone .stage-maze {
    opacity: 1;
  }

  .js [data-anim] .mini-maze .maze-thread,
  .js [data-anim] .curve-line {
    stroke-dashoffset: 0;
  }

  .js [data-anim] .curve-dot,
  .js [data-anim] .curve-value {
    opacity: 1;
  }

  .js .note-lock .lock-shackle,
  .js .story-sign .thread-mark {
    transform: none;
  }

  .replay {
    display: none !important;
  }
}
