:root {
    --ink: #1a1636;
    --ink-soft: rgba(26, 22, 54, .72);
    --ink-faint: rgba(26, 22, 54, .5);
    --paper: #f2efea;
    --glass: rgba(255, 255, 255, .3);
    --glass-strong: rgba(255, 255, 255, .58);
    --glass-line: rgba(255, 255, 255, .62);
    --leaf: #2f7d4f;
    --coral: #f0745a;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --pad: clamp(20px, 3.2vw, 48px);
  }
  * { box-sizing: border-box; margin: 0; }
  html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Geist", system-ui, sans-serif;
    padding: 12px;
  }
  a { color: inherit; text-decoration: none; }
  button, input, textarea { font: inherit; color: inherit; border: 0; background: none; }
  button { cursor: pointer; }
  :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
  input:focus-visible, textarea:focus-visible { outline: none; }

  /* ---------- Frame ---------- */
  .hero {
    position: relative;
    height: calc(100svh - 24px);
    min-height: 680px;
    border-radius: 28px;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 1fr;
    background: #aab3e0;
    --on: var(--ink); --on-soft: var(--ink-soft);
    --bg-img: url("assets/hero.webp"); --bg-pos: 78% 50%;
    --wash: 255, 240, 228; --fade: 253, 234, 220; --fade-solid: #fbe3cf;
  }
  .hero[data-bg="blush"] { --bg-img: url("assets/hero-blush.webp"); --bg-pos: 80% 50%; --wash: 255, 226, 226; --fade: 253, 222, 214; --fade-solid: #fbd6cc; }
  .hero[data-bg="moss"] {
    --bg-img: url("assets/hero-moss.webp"); --bg-pos: 84% 62%;
    --on: #f8f3e4; --on-soft: rgba(248, 243, 228, .82);
    --wash: 24, 28, 12; --fade: 44, 46, 24; --fade-solid: #2c2e18;
  }
  .hero[data-bg="clouds"] { --bg-img: url("assets/hero-clouds.webp"); --bg-pos: 80% 62%; --wash: 255, 255, 255; --fade: 255, 255, 255; --fade-solid: #fff; }
  .hero[data-bg="pond"] { --bg-img: url("assets/hero-pond.webp"); --bg-pos: 80% 60%; --wash: 236, 236, 222; --fade: 206, 206, 190; --fade-solid: #cecebe; }
  .hero[data-bg="dusk"] {
    --bg-img: url("assets/hero-dusk.webp"); --bg-pos: 80% 50%;
    --on: #f6f0ff; --on-soft: rgba(246, 240, 255, .82);
    --wash: 20, 14, 52; --fade: 26, 20, 62; --fade-solid: #1a143e;
    --glass: rgba(255, 255, 255, .46);
  }
  .hero[data-bg="meadow"] {
    --bg-img: url("assets/hero-meadow-new.webp"); --bg-pos: 82% 70%;
    --on: #fffdf4; --on-soft: rgba(255, 253, 244, .9);
    --wash: 18, 40, 16; --fade: 34, 58, 28; --fade-solid: #223a1c;
  }
  .hero[data-bg="meadow"]::before {
    background:
      linear-gradient(0deg, rgba(var(--wash), .6), transparent 52%),
      linear-gradient(180deg, rgba(20, 60, 120, .22), transparent 24%);
  }
  .hero__bg {
    position: absolute; inset: -3%;
    z-index: -3;
    background: var(--bg-img) var(--bg-pos) / cover no-repeat;
    transform: translate3d(calc(var(--mx, 0) * -14px), calc(var(--my, 0) * -10px), 0) scale(1.02);
    transition: transform 1.2s var(--ease);
    animation: bgIn 2.4s var(--ease) both;
  }
  /* ordered-dither render of the artwork, drawn by script on top of the plain image */
  .hero__bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: 0; transition: opacity .6s; }
  .hero__bg canvas.is-ready { opacity: 1; }
  @keyframes bgIn { from { scale: 1.12; filter: blur(14px) saturate(.8); } to { scale: 1; filter: none; } }
  .hero::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background:
      radial-gradient(90% 70% at 0% 100%, rgba(var(--wash), .55), transparent 62%),
      linear-gradient(180deg, rgba(255,255,255,.14), transparent 26%);
  }
  .hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    opacity: .16; mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  .glass {
    background: var(--glass);
    border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 24px 60px -24px rgba(40, 30, 90, .35);
  }

  /* ---------- Nav ---------- */
  .nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: clamp(16px, 2vw, 26px) var(--pad);
    animation: rise .9s var(--ease) .15s both;
  }
  .nav__links { grid-column: 2; display: flex; gap: 2px; padding: 5px; border-radius: 999px; }
  .nav__links a {
    padding: 9px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
    transition: background .3s, color .3s;
  }
  .nav__links a:hover, .nav__links a[aria-current] { background: rgba(255,255,255,.7); color: var(--ink); }

  /* ---------- Stage ---------- */
  .stage { position: relative; display: grid; min-height: 0; --dir: 1; }
  /* every menu item is a "view" stacked in the same cell; only one is shown at a time */
  .view {
    grid-area: 1 / 1;
    display: none;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 32px;
    padding: 0 var(--pad) clamp(22px, 3vw, 44px);
    min-height: 0;
  }
  .view.is-on { display: grid; }
  /* swipe: the old view leaves as one piece, the new one arrives block by block */
  .view.is-out { animation: swipeOut .32s cubic-bezier(.55, 0, .85, .3) both; pointer-events: none; }
  .hero .view.is-in .s { animation: swipeIn .75s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
  @keyframes swipeOut { to { opacity: 0; transform: translateX(calc(var(--dir) * -14vw)); filter: blur(6px); } }
  @keyframes swipeIn { from { opacity: 0; transform: translateX(calc(var(--dir) * 18vw)); filter: blur(8px); } }
  /* once the first-load reveal has played, stop it replaying when the product view comes back */
  .hero.is-loaded .composer, .hero.is-loaded h1 .line > span, .hero.is-loaded .sub, .hero.is-loaded .ticker { animation: none; }

  /* ---------- Info views (How it works / Use cases / Pricing) ---------- */
  .info { display: flex; flex-direction: column; gap: clamp(16px, 2.6vh, 30px); min-width: 0; max-width: 800px; }
  .display {
    color: var(--on); font-weight: 500; line-height: .92; letter-spacing: -.05em; margin-left: -.03em;
    font-size: clamp(42px, min(6.4vw, 12.5vh), 112px);
  }
  .display em { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; letter-spacing: -.03em; font-size: 1.08em; padding-right: .05em; }
  /* How it works: headline up top, a full-width numbered strip along the bottom */
  .view--how { grid-template-columns: 1fr; grid-template-rows: 1fr auto; align-items: start; padding-top: clamp(4px, 3vh, 40px); }
  .view--how .info { max-width: none; }
  .strip { list-style: none; padding: 8px; border-radius: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .strip li { background: var(--glass-strong); border-radius: 20px; padding: 16px 22px 18px 18px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
  .strip__n { font: italic 400 clamp(72px, 7.5vw, 124px)/.8 "Instrument Serif", serif; letter-spacing: -.04em; min-width: .55em; text-align: center; padding-bottom: .08em; }
  .strip small { display: block; font: 500 11px/1 "Geist Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
  .strip strong { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 5px; }
  .strip p { font-size: 14px; line-height: 1.42; color: var(--ink-soft); }

  /* Use cases: two full-bleed rows of requests drifting in opposite directions */
  .view--cases { grid-template-columns: 1fr; padding-inline: 0; gap: clamp(18px, 3vh, 34px); }
  .view--cases .info { padding-inline: var(--pad); }
  .marquees { display: grid; gap: 10px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
  .marquee { overflow: hidden; }
  .marquee__track { display: flex; gap: 10px; width: max-content; animation: drift 70s linear infinite; }
  .marquee:nth-child(2) .marquee__track { animation-direction: reverse; animation-duration: 84s; }
  .marquees:hover .marquee__track, .marquees:focus-within .marquee__track { animation-play-state: paused; }
  @keyframes drift { to { transform: translateX(-50%); } }
  .req {
    flex: none; display: flex; align-items: center; gap: 14px; padding: 12px 22px 12px 12px; border-radius: 999px; text-align: left;
    background: rgba(255, 255, 255, .66); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    transition: background .3s, transform .4s var(--ease);
  }
  .req:hover { background: #fff; transform: translateY(-2px); }
  .req small { font: 500 10.5px/1 "Geist Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--ink); padding: 8px 11px; border-radius: 999px; }
  .req span { font: italic 400 21px/1.1 "Instrument Serif", serif; white-space: nowrap; }

  /* Pricing */
  .view--pricing { grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); }
  .view--pricing .info { gap: clamp(10px, 1.8vh, 20px); }
  .mega { color: var(--on); font-weight: 500; font-size: clamp(150px, min(27vw, 50vh), 460px); line-height: .78; letter-spacing: -.075em; margin-left: -.05em; }
  .mega + .display { font-size: clamp(34px, min(4.4vw, 8vh), 72px); }
  .view--how .cta p { color: var(--ink); font-weight: 500; }
  .cta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
  .cta p { font-size: 15px; line-height: 1.4; color: var(--on-soft); max-width: 34ch; }
  .btn {
    display: inline-flex; align-items: center; gap: 14px; height: 52px; padding: 0 6px 0 22px; border-radius: 999px;
    background: var(--ink); color: #fff; font-size: 15.5px; font-weight: 500; box-shadow: 0 18px 40px -16px rgba(26,22,54,.7);
  }
  .btn span { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; transition: transform .5s var(--ease); }
  .btn:hover span { transform: translateX(3px); }
  .lead { display: flex; flex-direction: column; gap: clamp(16px, 2.6vh, 30px); min-width: 0; }

  /* ---------- Composer / intake ---------- */
  .composer {
    width: min(100%, 520px);
    border-radius: 24px; padding: 8px;
    animation: rise 1s var(--ease) .42s both;
  }
  .composer__field {
    background: var(--glass-strong);
    border-radius: 17px;
    padding: 16px 18px 14px;
    display: flex; flex-direction: column; gap: 12px;
    transition: box-shadow .3s;
  }
  .composer:focus-within .composer__field { box-shadow: 0 0 0 1.5px rgba(26,22,54,.5); }
  .composer__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .composer__label, .dots { font: 500 11px/1 "Geist Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
  .dots { display: flex; gap: 5px; }
  .dots i { width: 14px; height: 3px; border-radius: 3px; background: rgba(26,22,54,.16); transition: background .4s; }
  .dots i.is-on { background: var(--ink); }

  .pane { display: none; min-height: 66px; }
  .pane.is-on { display: block; animation: paneIn .5s var(--ease) both; }
  @keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  /* step 0: free text */
  .ask { position: relative; margin: 0 -6px; }
  .ask textarea, .ghost {
    display: block; width: 100%; resize: none; padding: 2px 6px;
    font-size: clamp(17px, 1.45vw, 21px); line-height: 1.3; letter-spacing: -.015em; font-weight: 500;
  }
  .ask textarea { min-height: calc(2.6em + 4px); max-height: min(34vh, 11em); overflow-y: auto; }
  textarea { scrollbar-width: thin; scrollbar-color: rgba(26,22,54,.3) transparent; }
  .ask textarea::placeholder { color: var(--ink-faint); }
  .ghost { position: absolute; inset: 0; pointer-events: none; }
  .ghost[hidden] { display: none; }
  .caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; background: var(--ink); vertical-align: -.16em; animation: blink 1s steps(2) infinite; }
  @keyframes blink { 50% { opacity: 0; } }

  /* steps 1-3: short rows */
  .row {
    display: grid; grid-template-columns: 96px 1fr; align-items: start; gap: 10px;
    padding: 5px 0; border-bottom: 1px solid rgba(26,22,54,.12);
  }
  .row:last-child { border-bottom: 0; padding-bottom: 0; }
  .row > span { font-size: 13px; font-weight: 500; color: var(--ink-soft); line-height: 22px; padding: 6px 0; }
  .row input, .row textarea {
    display: block; width: 100%; min-width: 0; font-size: 16px; line-height: 22px; font-weight: 500; letter-spacing: -.01em;
    padding: 6px 6px; border-radius: 8px; resize: none;
  }
  .row textarea { max-height: 7.2em; overflow-y: auto; }
  .row input::placeholder, .row textarea::placeholder { color: var(--ink-faint); font-weight: 400; }
  /* keep browser autofill from repainting the field */
  input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink); caret-color: var(--ink);
    transition: background-color 99999s ease-out 99999s;
    font-family: "Geist", system-ui, sans-serif;
  }
  .row.is-missing > span { color: #c2412c; }
  .row.is-missing { border-bottom-color: #c2412c; }
  .seg { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 9px; border-bottom: 1px solid rgba(26,22,54,.12); }
  .seg label { cursor: pointer; }
  .seg input { position: absolute; opacity: 0; pointer-events: none; }
  .seg span {
    display: block; font-size: 13.5px; font-weight: 500; padding: 8px 13px; border-radius: 999px;
    border: 1px solid rgba(26,22,54,.16); color: var(--ink-soft); transition: all .25s;
  }
  .seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
  .seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

  /* step 4: review, step 5: done */
  .review { font-size: 16.5px; line-height: 1.42; letter-spacing: -.012em; color: var(--ink-soft); }
  .review b { color: var(--ink); font-weight: 600; }
  .review q { display: block; margin-top: 6px; font-family: "Instrument Serif", serif; font-style: italic; font-size: 20px; line-height: 1.2; color: var(--ink); quotes: "“" "”"; }
  .done { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
  .done svg { width: 34px; height: 34px; margin-top: 2px; }

  .composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 6px 2px 10px; min-height: 48px; }
  .bar__left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; font-size: 12.5px; color: var(--ink-soft); }
  .chip {
    font-size: 12.5px; font-weight: 500; padding: 7px 12px; border-radius: 999px; color: var(--ink-soft);
    border: 1px solid rgba(26,22,54,.14); transition: all .3s;
  }
  .chip:hover { color: var(--ink); border-color: rgba(26,22,54,.4); }
  .chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
  .send {
    flex: none; height: 38px; min-width: 38px; padding: 0 11px; border-radius: 999px; background: var(--ink); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 14px; font-weight: 500; white-space: nowrap;
    transition: transform .4s var(--ease), padding .3s;
  }
  .send:hover { transform: translateX(2px); }
  .send.has-label { padding: 0 14px 0 18px; }
  .send[hidden] { display: none; }

  /* ---------- Headline ---------- */
  h1 {
    color: var(--on);
    font-weight: 500;
    font-size: clamp(50px, min(8.7vw, 16.5vh), 156px);
    line-height: .9;
    letter-spacing: -.055em;
    margin-left: -.04em;
  }
  h1 .line { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
  h1 .line > span { display: block; animation: lineUp 1.2s var(--ease) both; }
  h1 .line:nth-child(1) > span { animation-delay: .5s; }
  h1 .line:nth-child(2) > span { animation-delay: .62s; }
  h1 em {
    font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400;
    letter-spacing: -.035em; font-size: 1.08em; padding-right: .06em;
  }
  @keyframes lineUp { from { transform: translateY(110%) rotate(3deg); } to { transform: none; } }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

  .sub { font-size: 16px; line-height: 1.45; color: var(--on-soft); max-width: 46ch; animation: rise 1s var(--ease) .85s both; }
  .sub b { color: var(--on); font-weight: 600; }

  /* ---------- Example-call ticker ---------- */
  .ticker {
    display: flex; align-items: center; gap: 12px;
    width: 340px; padding: 9px 16px 9px 9px; border-radius: 999px;
    animation: rise 1.1s var(--ease) 1s both;
  }
  .ticker__wave { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; gap: 2.5px; }
  .ticker__wave i { width: 2.5px; height: 16px; border-radius: 2px; background: var(--ink); transform: scaleY(.2); transition: transform .3s, background .3s; }
  .ticker.is-live .ticker__wave i { animation: wave 1s ease-in-out infinite; }
  .ticker__wave i:nth-child(2) { animation-delay: -.8s !important; } .ticker__wave i:nth-child(3) { animation-delay: -.3s !important; }
  .ticker__wave i:nth-child(4) { animation-delay: -.6s !important; }
  @keyframes wave { 0%,100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
  .ticker__txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
  .ticker__txt small { font: 500 10px/1 "Geist Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
  .ticker__txt span { font-size: 13.5px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ticker.is-done .ticker__txt span { color: var(--leaf); font-weight: 600; }
  .ticker.is-done .ticker__wave i { background: var(--leaf); }
  .ticker time { font: 400 11.5px "Geist Mono", monospace; color: var(--ink-soft); }

  /* ---------- Responsive ---------- */
  @media (max-width: 1080px) {
    .ticker { width: 300px; }
  }
  @media (max-width: 820px) {
    .hero { height: auto; min-height: calc(100svh - 24px); }
    .hero__bg { background-position: 72% 0; background-size: auto 62%; background-color: var(--fade-solid); }
    .hero::before { background: linear-gradient(180deg, transparent 30%, rgba(var(--fade), .92) 62%); }
    .view { grid-template-columns: 1fr; padding-top: 30vh; }
    .nav { grid-template-columns: 1fr; justify-items: center; padding-inline: 8px; }
    .nav__links { grid-column: 1; }
    .nav__links a { padding: 8px 11px; font-size: 13px; white-space: nowrap; }
    .view--how { grid-template-rows: auto; gap: 20px; }
    .strip { grid-template-columns: 1fr; }
    .strip__n { font-size: 64px; }
    .view--cases { padding-inline: 0; }
    .req span { font-size: 18px; }
    .view--pricing { grid-template-columns: 1fr; }
    .mega { font-size: 44vw; }
    .ticker { width: 100%; }
    .row { grid-template-columns: 84px 1fr; }
  }
  @media (prefers-reduced-motion: reduce) {
    .marquee { overflow-x: auto; }
    .req[aria-hidden] { display: none; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }
