:root {
    --linen: #F7F3E9;
    --linen-deep: #EFE9D8;
    --ink: #17251C;
    --ink-soft: #55645A;
    --bubble-me: #D6F5C6;
    --bubble-me-edge: #BFE8A9;
    --bubble-tomo: #FFFFFF;
    --bubble-edge: #E6DFCB;
    --sun: #F0A500;
    --sun-deep: #C98A00;
    --display: "Bricolage Grotesque", "Avenir Next", "Trebuchet MS", sans-serif;
    --body: "Atkinson Hyperlegible", "Verdana", sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--body); color: var(--ink); background: var(--linen);
    line-height: 1.6; font-size: 1.0625rem;
    background-image: radial-gradient(var(--linen-deep) 1px, transparent 1px);
    background-size: 22px 22px;
  }
  a { color: inherit; }
  :focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
  /* padding-INLINE only: a `padding` shorthand here would zero the vertical
     padding of every section (they all carry .wrap too), and a class beats
     the `section` element selector. That collision silently flattened the
     whole page rhythm once. */
  .wrap { max-width: 1060px; margin: 0 auto; padding-inline: 24px; }

  /* ---------- nav ---------- */
  nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 0; }
  .logo { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; }
  .logo img { border-radius: 50%; margin-right: 9px; }
  .logo b { color: var(--sun-deep); }
  .nav-cta { font-weight: 700; font-size: .92rem; text-decoration: none; background: var(--ink); color: var(--linen); padding: 9px 18px; border-radius: 999px; }
  .nav-cta:hover { background: #223529; }
  .nav-links { display: flex; gap: 26px; font-size: .95rem; }
  .nav-links a { text-decoration: none; color: var(--ink-soft); font-weight: 700; }
  .nav-links a:hover { color: var(--ink); }
  @media (max-width: 900px) { .nav-links { display: none; } }

  /* floating CTA — appears on phones once the hero scrolls away */
  .float-cta {
    position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50;
    transform: translateX(-50%) translateY(90px); opacity: 0; pointer-events: none;
    background: var(--ink); color: var(--linen); font-weight: 700; font-size: .98rem;
    text-decoration: none; padding: 13px 26px; border-radius: 999px;
    box-shadow: 0 12px 32px rgba(23,37,28,.3); transition: transform .3s ease, opacity .3s ease;
  }
  .float-cta.show { transform: translateX(-50%); opacity: 1; pointer-events: auto; }
  @media (min-width: 901px) { .float-cta { display: none; } }

  /* ---------- hero ---------- */
  .hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding-block: 72px 84px; }
  h1 { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; font-size: clamp(2.5rem, 5.4vw, 4rem); line-height: 1.02; text-wrap: balance; }
  h1 .sun-word { color: var(--sun-deep); }
  .sub { margin-top: 20px; color: var(--ink-soft); max-width: 30em; font-size: 1.15rem; }
  .sub b { color: var(--ink); }

  .send-cta {
    margin-top: 34px; display: inline-flex; align-items: center; gap: 14px;
    background: #fff; border: 1.5px solid var(--bubble-edge); border-radius: 999px;
    padding: 10px 10px 10px 22px; text-decoration: none;
    box-shadow: 0 10px 30px rgba(23,37,28,.08); transition: transform .12s ease, box-shadow .12s ease;
  }
  .send-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(23,37,28,.12); }
  .send-cta .ghost-text { color: var(--ink-soft); font-size: 1.02rem; }
  .send-cta .send-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--sun); flex: none; display: grid; place-items: center; color: var(--ink); }
  .send-btn svg { width: 20px; height: 20px; margin-left: 2px; }
  .cta-note { margin-top: 12px; font-size: .88rem; color: var(--ink-soft); }

  /* ---------- chat primitives ---------- */
  .chat-card { background: #fff; border: 1.5px solid var(--bubble-edge); border-radius: 22px; box-shadow: 0 24px 60px rgba(23,37,28,.10); overflow: hidden; }
  .chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--ink); color: var(--linen); }
  .chat-head .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: var(--ink); flex: none; }
  .chat-head .name { font-weight: 700; line-height: 1.2; }
  .chat-head .status { font-size: .78rem; opacity: .75; }
  .chat-body {
    padding: 20px 16px 22px; display: flex; flex-direction: column; gap: 10px;
    background: linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.6)), radial-gradient(var(--linen-deep) 1px, transparent 1px);
    background-size: auto, 18px 18px;
  }
  .msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: .98rem; line-height: 1.45; position: relative; width: fit-content; white-space: pre-line; }
  .msg .t { display: block; font-size: .68rem; color: var(--ink-soft); margin-top: 4px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .me { background: var(--bubble-me); border: 1px solid var(--bubble-me-edge); align-self: flex-end; border-bottom-right-radius: 5px; }
  .tomo { background: var(--bubble-tomo); border: 1px solid var(--bubble-edge); align-self: flex-start; border-bottom-left-radius: 5px; }
  .day-split { align-self: center; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); background: var(--linen); border: 1px solid var(--bubble-edge); padding: 3px 12px; border-radius: 999px; }
  .kbd { font-family: var(--mono); font-size: .85em; background: rgba(23,37,28,.07); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }

  /* WhatsApp-style entrance: bubbles grow softly from their tail corner
     while sliding up — one gentle decelerating curve, no bounce. */
  .msg.me { transform-origin: bottom right; }
  .msg.tomo, .day-split { transform-origin: bottom left; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes msgIn {
      0%   { opacity: 0; transform: translateY(16px) scale(.92); }
      60%  { opacity: 1; }
      100% { opacity: 1; transform: none; }
    }
    .play .msg, .play .day-split { opacity: 0; animation: msgIn .42s cubic-bezier(.23,.72,.26,1) forwards; }
    .play [data-beat="1"] { animation-delay: .6s; }
    .play [data-beat="2"] { animation-delay: 2.2s; }
    .play [data-beat="3"] { animation-delay: 4.0s; }
    .play [data-beat="4"] { animation-delay: 5.3s; }
    .play [data-beat="5"] { animation-delay: 7.0s; }
    .reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
    .reveal.in { opacity: 1; transform: none; }
    .msg.live, .day-split.live { animation: msgIn .42s cubic-bezier(.23,.72,.26,1) both; }
  }

  /* ---------- fact strip ---------- */
  .facts { border-block: 1.5px solid var(--bubble-edge); background: rgba(255,255,255,.55); }
  .facts .wrap { display: flex; gap: 12px 40px; flex-wrap: wrap; justify-content: space-between; padding-block: 18px; }
  .fact { font-size: .95rem; color: var(--ink-soft); }
  .fact b { color: var(--ink); font-weight: 700; }

  section { padding-block: 84px; }
  .eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sun-deep); }
  h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.025em; font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-top: 8px; text-wrap: balance; }
  .lede { color: var(--ink-soft); margin-top: 10px; max-width: 40em; }

  /* ---------- how it works ---------- */
  .hiw { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .hiw-step { background: #fff; border: 1.5px solid var(--bubble-edge); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
  .hiw-step .n { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; color: var(--sun); }
  .hiw-step h3 { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
  .hiw-step p { color: var(--ink-soft); font-size: .95rem; }
  .hiw-step .msg { font-size: .9rem; max-width: 100%; margin-top: auto; }
  .hiw-note { margin-top: 18px; color: var(--ink-soft); font-size: .95rem; }
  .hiw-note b { color: var(--ink); }

  /* ---------- use cases ---------- */
  .uses { margin-top: 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .use { background: #fff; border: 1.5px solid var(--bubble-edge); border-radius: 18px; padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
  .use h3 { font-family: var(--display); font-weight: 800; font-size: 1.08rem; letter-spacing: -0.01em; }
  .use .who { color: var(--ink-soft); font-size: .92rem; margin-bottom: 6px; }
  .use .msg { font-size: .9rem; max-width: 95%; }

  /* ---------- you've tried everything ---------- */
  .tried { background: var(--ink); color: var(--linen); border-radius: 24px; padding: 56px 48px; margin-top: 40px; }
  .tried h2 { color: var(--linen); }
  .tried .eyebrow { color: var(--sun); }
  .graveyard { margin-top: 30px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px; }
  .grave { display: flex; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid rgba(247,243,233,.14); }
  .grave b { font-family: var(--display); font-weight: 800; white-space: nowrap; }
  .grave span { opacity: .72; font-size: .96rem; }
  .tried .turn { margin-top: 32px; font-size: 1.12rem; max-width: 36em; }
  .tried .turn b { color: var(--sun); }
  @media (max-width: 640px) { .tried { padding: 40px 26px; } }

  /* ---------- scrollytelling: one day with tomo ---------- */
  .story-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; margin-top: 24px; align-items: start; }
  .steps { display: flex; flex-direction: column; }
  .step { min-height: 68vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .4s ease; padding-right: 8px; }
  .step.active { opacity: 1; }
  .step .clock { font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--sun-deep); background: #FFF6E0; border: 1px solid #F3DFAE; border-radius: 999px; padding: 3px 12px; width: fit-content; }
  .step h3 { font-family: var(--display); font-weight: 800; font-size: clamp(1.35rem, 2.6vw, 1.8rem); letter-spacing: -0.02em; margin-top: 14px; text-wrap: balance; }
  .step p { color: var(--ink-soft); margin-top: 10px; max-width: 30em; }
  .step p b { color: var(--ink); }
  .story-phone { position: sticky; top: 60px; }
  #story-chat .chat-body {
    height: min(540px, calc(100vh - 220px));
    overflow-y: auto; scrollbar-width: none; /* scrolls programmatically, no visible bar */
  }
  #story-chat .chat-body::-webkit-scrollbar { display: none; }

  /* ---------- playground ---------- */
  .playground { display: grid; grid-template-columns: .9fr 1.1fr; gap: 30px; margin-top: 40px; align-items: start; }
  .chip-groups { display: flex; flex-direction: column; gap: 20px; }
  .chip-group h4 { font-family: var(--display); font-weight: 800; font-size: .95rem; letter-spacing: .02em; margin-bottom: 10px; color: var(--ink); }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    font-family: var(--body); font-size: .88rem; cursor: pointer; border: 1.5px solid var(--bubble-edge);
    background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 14px;
    transition: border-color .12s ease, background .12s ease, transform .12s ease;
  }
  .chip:hover { border-color: var(--sun); background: #FFF9EC; transform: translateY(-1px); }
  .chip:active { transform: translateY(0); }
  #demo .chat-body { height: 430px; overflow-y: auto; scroll-behavior: smooth; }
  .demo-input { display: flex; gap: 10px; padding: 12px; border-top: 1.5px solid var(--bubble-edge); background: #fff; }
  .demo-input input {
    flex: 1; border: 1.5px solid var(--bubble-edge); border-radius: 999px; padding: 10px 18px;
    /* 16px minimum: anything smaller makes iOS Safari zoom the page on focus */
    font-family: var(--body); font-size: 1rem; color: var(--ink); background: var(--linen);
  }
  .demo-input input::placeholder { color: var(--ink-soft); opacity: .8; }
  .demo-input button { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--sun); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
  .demo-input button:hover { background: #FFB70E; }
  .demo-input button svg { width: 18px; height: 18px; margin-left: 2px; }
  .typing { display: inline-flex; gap: 4px; padding: 13px 16px; }
  .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); animation: blink 1s infinite; }
  .typing i:nth-child(2) { animation-delay: .18s; } .typing i:nth-child(3) { animation-delay: .36s; }
  @keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
  .demo-note { margin-top: 12px; font-size: .85rem; color: var(--ink-soft); }

  /* ---------- vocabulary ---------- */
  .vocab { margin-top: 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .vocab-card { background: #fff; border: 1.5px solid var(--bubble-edge); border-radius: 18px; padding: 22px 24px; }
  .vocab-card h3 { font-family: var(--display); font-weight: 800; font-size: 1.05rem; margin-bottom: 14px; }
  .vocab-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; font-size: .92rem; align-items: baseline; }
  .vocab-card dt { font-family: var(--mono); font-size: .82rem; background: rgba(23,37,28,.06); border-radius: 6px; padding: 2px 8px; white-space: nowrap; justify-self: start; }
  .vocab-card dd { color: var(--ink-soft); }
  .vocab-card dd b { color: var(--ink); }

  /* ---------- promises ---------- */
  .promises { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .promise { background: #fff; border: 1.5px solid var(--bubble-edge); border-radius: 18px; padding: 24px; }
  .promise .big { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--sun-deep); }
  .promise h3 { font-family: var(--display); font-weight: 800; font-size: 1.08rem; margin: 6px 0 8px; }
  .promise p { color: var(--ink-soft); font-size: .95rem; }

  /* ---------- pricing ---------- */
  .plans { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
  .plan { border-radius: 20px; padding: 30px 28px; display: flex; flex-direction: column; gap: 8px; }
  .plan.free { background: #fff; border: 1.5px solid var(--bubble-edge); }
  .plan.pro { background: var(--ink); color: var(--linen); position: relative; overflow: hidden; }
  .plan.pro::after { content: "☀️"; position: absolute; right: -18px; top: -24px; font-size: 7rem; opacity: .14; }
  .plan .tier { font-family: var(--display); font-weight: 800; font-size: 1.25rem; }
  .plan .price { font-family: var(--display); font-weight: 800; font-size: 2.1rem; letter-spacing: -0.02em; margin: 4px 0 6px; }
  .plan .price small { font-size: 1rem; font-weight: 500; opacity: .65; }
  .plan .price .was { font-size: 1.15rem; font-weight: 700; opacity: .45; text-decoration-thickness: 2px; margin-right: 2px; }
  .plan ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
  .plan li { padding-left: 26px; position: relative; font-size: .97rem; }
  .plan li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; color: var(--sun-deep); }
  .plan.pro li::before { color: var(--sun); }
  .plan .fine { margin-top: auto; padding-top: 16px; font-size: .85rem; opacity: .65; }

  .finale { text-align: center; padding-block: 96px 110px; }
  .finale h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
  .finale .send-cta { margin-top: 36px; }

  footer { background: var(--ink); color: var(--linen); }
  footer .wrap { padding: 34px 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .9rem; }
  footer a { color: var(--linen); }
  footer .quiet { opacity: .65; }

  @media (max-width: 900px) {
    .story-grid { grid-template-columns: 1fr; gap: 0; }
    .story-phone { order: -1; top: 10px; z-index: 5; }
    #story-chat .chat-body { height: min(320px, 44vh); }
    .step { min-height: 62vh; }
    .hero, .playground { grid-template-columns: 1fr; gap: 40px; }
    .hero { padding-block: 48px 64px; }
    .vocab, .plans { grid-template-columns: 1fr; }
    .promises, .hiw, .uses, .graveyard { grid-template-columns: 1fr; }
    /* Touch targets: chips are 35px on desktop; lift to ~44px for fingers */
    .chip { padding: 11px 16px; font-size: .9rem; }
    .demo-input button { width: 44px; height: 44px; }
    section { padding-block: 64px; }
    #demo .chat-body { height: 360px; }
    .chip-groups { order: 2; }
  }

/* Keyboard/screen-reader shortcut past the nav — visible only when focused */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--linen); font-weight: 700; font-size: .92rem;
  padding: 10px 18px; border-radius: 0 0 12px 12px; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }
