/* =========================================================================
   SuperDocs — marketing site
   Base system: design.md (calm luxury: pill actions, floating panels, soft
   diffused shadows, 1140 container, 8-pt spacing) with the purple brand
   replaced by the Docchi mascot palette (Docchi-Mascot-Kit/README.md).
   ========================================================================= */

/* ---------- 0. Fonts ---------- */
/* Self-hosted so a page view sends nothing to a third party: privacy.html says this site has no third-party requests.
   Thai and Latin subsets only. Add latin-ext from Google Fonts if the copy starts using characters outside these ranges. */
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/assets/fonts/anuphan-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/assets/fonts/anuphan-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bellefair"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/bellefair-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 1. Tokens ---------- */
:root {
  /* Brand — from Docchi */
  --folder: #F7D774;          /* front of the folder: brand yellow */
  --folder-deep: #EDBE4F;     /* back of the folder / feet */
  --folder-tint: #FDF3D3;     /* chips on yellow */
  --folder-ink: #7A5A12;      /* text on folder tint (5.7:1) */
  --matcha: #2F6F5E;          /* accent → primary action (was #684B9B) */
  --matcha-strong: #245849;   /* hover / pressed (was #503383) */
  --matcha-deep: #1F4A3F;     /* footer (was #381B6B) */
  --matcha-darkest: #163830;
  --matcha-tint: #E4EFEA;     /* tint pill / chips (was #F5EFFF) */
  --sage: #9CC5B3;            /* office-element secondary */
  --cheek: #F4A6A0;

  /* Ink & text — mascot ink instead of navy */
  --ink: #2A2A2A;             /* headings (13.5:1 on cream) */
  --text: #5C574E;            /* body (6.8:1) */
  --muted: #6B665C;           /* meta (5.4:1) */
  --placeholder: #8A8578;     /* decorative only (3.5:1) */
  --on-dark: #FFFFFF;
  --on-dark-soft: #D7E6DF;

  /* Surfaces */
  --cream: #FAF8F3;           /* page */
  --cream-deep: #F3EEE2;      /* soft sections (was #F2F2FA) */
  --paper: #FFFFFF;           /* cards / floating panels */
  --line: #E7E1D3;
  --divider: #EEE9DE;

  /* Type */
  --font-sans: "Anuphan", "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bellefair", Georgia, "Times New Roman", serif;

  /* Radius (design.md §5) */
  --r-sm: 5px; --r-md: 8px; --r-lg: 16px; --r-xl: 24px; --r-pill: 30px; --r-full: 9999px;

  /* Elevation (design.md §6, warmed to match the cream page) */
  --shadow-xs: 0 1px 2px 0 rgba(64, 52, 24, .06);
  --shadow-card: 0 0 32px 0 rgba(64, 52, 24, .08);
  --shadow-md: 0 12px 20px 0 rgba(64, 52, 24, .10);
  --shadow-lg: 0 16px 32px 0 rgba(64, 52, 24, .09);
  --shadow-float: 0 16px 40px 0 rgba(64, 52, 24, .13);
  --shadow-header: 0 1px 0 0 rgba(0, 0, 0, .02), 0 .5px 0 0 rgba(0, 0, 0, .09);

  /* Spacing (8-pt) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s8: 48px; --s10: 64px; --s12: 96px;

  /* Layout */
  --container: 1140px;
  --gutter: 16px;
  --header-h: 72px;

  /* Motion */
  --dur-fast: 150ms;
  --ease: ease-in-out;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}
@media (min-width: 768px) { :root { --gutter: 24px; } }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.35; font-weight: 700; text-wrap: balance; }
.nw { white-space: nowrap; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--matcha); text-decoration: none; }
a:hover { color: var(--matcha-strong); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(47, 111, 94, .4); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--folder); color: var(--ink); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 18px; height: 18px; }
.icon--xs { width: 14px; height: 14px; stroke-width: 2.4; }
.icon--ok { display: inline-block; vertical-align: -2px; color: var(--matcha); }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 8px 16px; background: var(--ink); color: #fff; border-radius: var(--r-pill); }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- 3. Type helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 15px; line-height: 1.2;
  letter-spacing: .16em; text-transform: uppercase; color: var(--matcha);
  margin-bottom: var(--s3);
}
.eyebrow::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: var(--folder-deep); }
.eyebrow--on-dark { color: var(--folder); }
.section-title { font-size: clamp(28px, 1.9vw + 18px, 42px); line-height: 1.3; letter-spacing: -.005em; }
.section-title--on-dark { color: var(--on-dark); }
.section-sub { margin-top: var(--s4); font-size: clamp(16px, .3vw + 15px, 18px); color: var(--text); }
.section-head { max-width: 680px; margin: 0 auto var(--s8); text-align: center; }
.section-head .section-sub { margin-inline: auto; }
.section-head--left { margin-inline: 0; text-align: left; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: var(--r-pill); font: 600 12px/1.6 var(--font-sans); white-space: nowrap; background: var(--matcha-tint); color: var(--matcha-strong); }
.chip--soon { background: var(--folder-tint); color: var(--folder-ink); }
.chip--save { background: var(--folder); color: var(--ink); }
.chip--out { background: var(--folder-tint); color: var(--folder-ink); }
.chip--in { background: var(--matcha-tint); color: var(--matcha-strong); }

.bubble {
  position: relative; display: inline-block;
  padding: 10px 16px; border-radius: 18px;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1.45;
  box-shadow: 3px 3px 0 var(--ink);
}
.bubble::after {
  content: ""; position: absolute; left: 34px; bottom: -9px; width: 14px; height: 14px;
  background: var(--paper); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}
.bubble--lg { font-size: clamp(16px, .6vw + 13px, 19px); padding: 14px 20px; }

/* ---------- 4. Buttons (design.md §10.1, matcha instead of purple) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 28px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font: 600 16px/1.2 var(--font-sans); text-align: center; white-space: nowrap;
  box-shadow: var(--shadow-xs); cursor: pointer; user-select: none;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease-out);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: var(--shadow-xs); }
.btn img { width: 22px; height: 22px; border-radius: 6px; }
.btn--primary { background: var(--matcha); border-color: var(--matcha); color: #fff; }
.btn--primary:hover { background: var(--matcha-strong); border-color: var(--matcha-strong); color: #fff; }
.btn--tint { background: var(--matcha-tint); color: var(--matcha-strong); box-shadow: none; }
.btn--tint:hover { background: #D5E7DE; color: var(--matcha-strong); }
.btn--light { background: var(--paper); border-color: var(--line); color: var(--matcha); }
.btn--light:hover { border-color: var(--matcha); color: var(--matcha-strong); }
.btn--lg { min-height: 56px; padding: 12px 30px; font-size: 17px; }
.btn--sm { min-height: 40px; padding: 6px 18px; font-size: 15px; }
.btn--block { width: 100%; }
.btn.is-soon { cursor: not-allowed; opacity: .75; transform: none; box-shadow: none; }

/* ---------- 5. Folder card — the brand shape ---------- */
.folder {
  position: relative;
  background: var(--paper);
  border-radius: 0 var(--r-lg) var(--r-lg) var(--r-lg);
  filter: drop-shadow(0 10px 22px rgba(64, 52, 24, .08)) drop-shadow(0 1px 1px rgba(64, 52, 24, .05));
}
.folder__tab {
  position: absolute; left: 0; bottom: 100%;
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px 0 16px;
  background: inherit; border-radius: 12px 0 0 0;
  font: 600 13px/1 var(--font-sans); color: var(--matcha); white-space: nowrap;
}
.folder__tab::after {
  content: ""; position: absolute; top: 0; left: 100%; width: 26px; height: 100%;
  background: inherit; border-top-right-radius: 12px;
  transform: skewX(28deg); transform-origin: bottom left;
}
.folder--yellow { background: var(--folder); }
.folder--yellow .folder__tab { color: var(--ink); }

/* ---------- 6. Notice bar ---------- */
.notice { background: linear-gradient(63deg, var(--matcha-darkest) -10%, var(--matcha) 70%, #3F8771 110%); color: #fff; font-size: 14px; line-height: 1.5; }
.notice__inner { display: flex; align-items: center; justify-content: center; gap: var(--s3); min-height: 40px; padding-block: 6px; }
.notice__text { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.notice__badge { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: var(--r-pill); background: var(--folder); color: var(--ink); font-weight: 700; font-size: 12px; line-height: 20px; }
.notice__link { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--folder); font-weight: 600; white-space: nowrap; }
.notice__link:hover { color: #fff; }
.notice__close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-full); background: transparent; color: #fff; cursor: pointer; opacity: .8; }
.notice__close:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.notice.is-hidden, .no-notice .notice { display: none; }

/* ---------- 7. Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(250, 248, 243, .82); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); transition: box-shadow .2s var(--ease), background-color .2s var(--ease); }
.header.is-scrolled { background: rgba(250, 248, 243, .94); box-shadow: var(--shadow-header), 0 8px 24px rgba(64, 52, 24, .05); }
.header__inner { display: flex; align-items: center; gap: var(--s5); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__mark { width: 52px; transition: transform .35s var(--ease-back); }
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.06); }
.brand__word { width: 118px; }
.nav { display: none; margin-left: auto; align-items: center; gap: var(--s5); }
.nav__list { display: flex; gap: var(--s1); }
.nav__link { position: relative; display: block; padding: 8px 12px; color: var(--ink); font-weight: 500; font-size: 15px; border-radius: var(--r-pill); transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.nav__link:hover { color: var(--matcha); background: rgba(47, 111, 94, .07); }
.nav__link[aria-current="true"] { color: var(--matcha); }
.nav__link[aria-current="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--folder-deep); }
.nav__cta { min-height: 44px; padding-inline: 22px; font-size: 15px; }
.header__cta { margin-left: auto; }
.menu-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--paper); color: var(--ink); cursor: pointer; }
.mobile-nav { border-top: 1px solid var(--divider); background: var(--cream); box-shadow: var(--shadow-md); }
.mobile-nav:not([hidden]) { animation: drop .28s var(--ease-out); }
.mobile-nav__list { display: grid; gap: 2px; padding-block: var(--s3) var(--s5); }
.mobile-nav__list a:not(.btn) { display: block; padding: 12px 4px; color: var(--ink); font-weight: 500; font-size: 17px; border-bottom: 1px solid var(--divider); }
.mobile-nav__list li:last-child { margin-top: var(--s4); }
@media (max-width: 400px) { .header__cta { display: none; } .menu-btn { margin-left: auto; } }
@media (min-width: 992px) {
  .nav { display: flex; }
  .header__cta, .menu-btn, .mobile-nav { display: none !important; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- 8. Hero ---------- */
.hero { position: relative; padding: var(--s8) 0 120px; overflow: hidden; isolation: isolate; }
.hero::before { /* notebook-dot paper, faded toward the edges */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: radial-gradient(rgba(42, 42, 42, .09) 1.1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 70% 45%, #000 20%, transparent 75%);
}
.hero::after { /* warm lamp glow behind the phone */
  content: ""; position: absolute; z-index: -1; right: -10%; top: -20%; width: 900px; height: 900px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(247, 215, 116, .42), rgba(247, 215, 116, .12) 55%, transparent);
  pointer-events: none;
}
.hero__grid { display: grid; gap: var(--s8); align-items: center; }
.hero__title { margin: 0; font-size: clamp(36px, 3.6vw + 16px, 60px); line-height: 1.22; letter-spacing: -.01em; }
.marker {
  padding-inline: 2px;
  background: linear-gradient(transparent 60%, var(--folder) 60%, var(--folder) 90%, transparent 90%) no-repeat 0 0 / 100% 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero__lead { margin-top: var(--s5); max-width: 560px; font-size: clamp(17px, .4vw + 15px, 19px); line-height: 1.75; }
.hero__highlight {
  display: flex; align-items: center; gap: var(--s3);
  width: fit-content; max-width: 100%; margin-top: var(--s5); padding: 10px 20px 10px 10px;
  border: 1px solid var(--folder); border-radius: 18px; background: var(--folder-tint); line-height: 1.45;
}
.hero__highlight b { display: block; color: var(--ink); font-size: 17px; }
.hero__highlight small { display: block; color: var(--text); font-size: 14.5px; }
.hero__highlight-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--folder); color: var(--ink); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.hero__proof { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s5); font-size: 15px; color: var(--muted); }
.hero__proof li { display: inline-flex; align-items: center; gap: 6px; }
.hero__proof .icon { color: var(--matcha); }

.hero__stage { --demo-nudge: 0px; position: relative; display: grid; place-items: center; padding: 36px 0 24px; min-height: 560px; }
.demo { position: relative; margin-left: var(--demo-nudge); }

/* Lamp rig: anchored to the phone, not the viewport, so the wires always land in
   the free space beside it. Under 992px the lamp hides and only the MCP pill stays. */
.hero__rig { position: absolute; inset: 0; pointer-events: none; }
.hero__lamp { display: none; width: 150px; }
.hero__glow { display: none; }

/* MCP: compact pill by default, a hanging mobile from the bulb on wide screens */
.mcp {
  position: absolute; left: 50%; top: -16px; translate: -50% 0;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 16px 4px 8px;
  border: 2px solid var(--ink); border-radius: var(--r-pill); background: var(--paper);
  box-shadow: 3px 4px 0 rgba(42, 42, 42, .1);
  color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 28px; white-space: nowrap;
  pointer-events: auto;
}
.mcp:hover { color: var(--ink); background: var(--folder-tint); }
.mcp::after { /* wire down to the phone; its far end tucks behind the phone */
  content: ""; position: absolute; left: 50%; top: 100%; width: 3px; height: 26px; margin-left: -1.5px;
  background: radial-gradient(circle closest-side, var(--ink) 90%, transparent) 0 0 / 3px 6.6px repeat-y; /* a dotted border renders differently in Safari */
  pointer-events: none;
}
.mcp__hub { order: 1; margin-left: 2px; }
.mcp__logo { display: grid; place-items: center; width: 24px; height: 28px; }
.mcp__logo img { width: 22px; height: 22px; }
.mcp__wires, .mcp__pulse { display: none; }

/* Phone — ink outline echoes Docchi's 3.2px line */
.phone { position: relative; width: 290px; padding: 9px; border: 3px solid var(--ink); border-radius: 44px; background: var(--paper); box-shadow: var(--shadow-float), 8px 10px 0 rgba(42, 42, 42, .07); }
.phone::before { content: ""; position: absolute; top: 15px; left: 50%; width: 76px; height: 20px; border-radius: 12px; background: var(--ink); transform: translateX(-50%); z-index: 3; }
.phone__screen { display: flex; flex-direction: column; height: 560px; border-radius: 34px; overflow: hidden; background: #F4F1E8; }
.chat__head { display: flex; align-items: center; gap: 10px; padding: 42px 14px 10px; background: var(--paper); border-bottom: 1px solid var(--divider); }
.chat__avatar { width: 34px; height: 34px; border-radius: var(--r-full); background: var(--folder-tint); padding: 1px; }
.chat__who { display: grid; line-height: 1.3; }
.chat__who strong { color: var(--ink); font-size: 14px; }
.chat__who span { font-size: 11px; color: var(--muted); }
.chat__who span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #3BB273; vertical-align: 0; }
.chat__body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; overflow: hidden; }
.chat__input { display: flex; align-items: center; gap: 8px; padding: 10px 12px 16px; background: var(--paper); border-top: 1px solid var(--divider); color: var(--matcha); }
.chat__field { flex: 1; min-height: 32px; padding: 5px 14px; border-radius: var(--r-pill); background: #F2EFE7; color: var(--placeholder); font-size: 13px; line-height: 22px; white-space: nowrap; overflow: hidden; }
.chat__field.is-typing { color: var(--ink); }
.chat__field.is-typing::after { content: ""; display: inline-block; width: 1.5px; height: 14px; margin-left: 1px; background: var(--matcha); vertical-align: -2px; animation: caret 1s steps(1) infinite; }

.msg { max-width: 86%; padding: 8px 12px; border-radius: 16px; font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.msg small { color: var(--muted); font-size: 11px; }
.msg--me { align-self: flex-end; background: #CDE5D9; border-bottom-right-radius: 4px; }
.msg--bot { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 4px; box-shadow: 0 1px 0 rgba(0, 0, 0, .04); }
.msg--card { padding: 0; background: none; box-shadow: none; max-width: 92%; width: 92%; }
.msg--me:has(.photo) { padding: 4px; background: var(--paper); border-radius: 16px; }
.msg--typing { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.demo:not(.is-live) .msg--typing { display: none; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--matcha); opacity: .35; animation: dot 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }

.photo { display: grid; place-items: center; width: 150px; height: 160px; border-radius: 12px; background: linear-gradient(135deg, #E7DCC2, #D4C29C); overflow: hidden; }
.receipt {
  display: grid; gap: 1px; width: 112px; padding: 10px 9px 14px;
  background: #fff; color: #3a3a3a; font-size: 8px; line-height: 1.45; transform: rotate(-4deg);
  box-shadow: 0 6px 10px rgba(64, 52, 24, .18);
  -webkit-mask: radial-gradient(circle 3px at 4px 100%, #0000 97%, #000) 0 0 / 8px 100% repeat-x;
  mask: radial-gradient(circle 3px at 4px 100%, #0000 97%, #000) 0 0 / 8px 100% repeat-x;
}
.receipt b { font-size: 9px; text-align: center; }
.receipt__sub { font-size: 6.5px; color: #888; text-align: center; }
.receipt__row { display: flex; justify-content: space-between; }
.receipt__total { margin-top: 2px; padding-top: 2px; border-top: 1px dashed #bbb; font-weight: 700; }

.flex { overflow: hidden; border-radius: 14px; background: var(--paper); border: 1px solid var(--divider); box-shadow: 0 2px 6px rgba(64, 52, 24, .06); }
.flex__head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--cream); }
.flex__head img { width: 30px; height: 30px; }
.flex__head div { display: grid; line-height: 1.35; }
.flex__head b { font-size: 12.5px; color: var(--ink); }
.flex__head small { font-size: 10px; color: var(--muted); }
.flex__body { display: grid; gap: 3px; padding: 8px 10px; font-size: 11.5px; }
.flex__row { display: flex; justify-content: space-between; gap: 8px; }
.flex__sum { margin-top: 3px; padding-top: 6px; border-top: 1px solid var(--divider); font-weight: 700; }
.flex__sum b { font-size: 14px; color: var(--ink); }
.flex__meta { font-size: 9.5px; color: var(--muted); }
.flex__btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 8px 8px; }
.flex__btns span { display: grid; place-items: center; min-height: 26px; border-radius: 8px; background: #F1EEE6; font-size: 10px; font-weight: 600; color: var(--ink); }
.flex__btns .is-primary { background: var(--matcha); color: #fff; }

/* Annotation chips beside the phone */
.demo__tags { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 7px 14px; border-radius: var(--r-pill); background: var(--paper); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tag .icon { color: var(--matcha); }
.tag img { width: 16px; height: 16px; }

/* Storage that isn't built yet: a floating tag once there's room beside the phone (tags
   clip below 1240px), otherwise a line under the hero's proof points. Never shown as done. */
.tag--soon { display: none; }
.hero__soon img { width: 18px; height: 18px; }
@media (min-width: 1240px) {
  .tag--soon { display: inline-flex; }
  .hero__proof .hero__soon { display: none; }
}

/* Docchi beside the phone */
.hero__docchi { position: absolute; left: max(-8px, calc(50% - 300px)); bottom: 0; width: 170px; z-index: 4; }
.hero__docchi-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 24px; }
.hero__say { position: absolute; left: 30px; bottom: calc(100% - 6px); white-space: nowrap; font-size: 14px; }
.docchi { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 12px 10px rgba(64, 52, 24, .14)); }
.d-arm { transform-box: view-box; transform-origin: 168px 112px; }
.d-blink { transform-box: fill-box; transform-origin: center; }
.d-look { transition: transform .3s var(--ease-out); }
.d-paper { transition: transform .35s var(--ease-back); }
.hero__docchi-btn:hover .d-paper, .hero__docchi-btn:focus-visible .d-paper { transform: translateY(-9px); }
.hero__plant { display: none; position: absolute; right: -10px; bottom: 0; width: 120px; pointer-events: none; }

@media (min-width: 768px) {
  .demo__tags { display: grid; gap: 10px; position: absolute; left: calc(100% - 26px); top: 34%; z-index: 5; }
  .hero__docchi { width: 200px; left: calc(50% - 330px); }
  .hero__plant { display: block; }
}
@media (min-width: 992px) {
  .hero { padding-top: var(--s10); }
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: var(--s6); }
  .hero__stage { --demo-nudge: 64px; --bulb-offset: -66px; min-height: 640px; padding-top: 8px; }
  .hero__docchi { left: -12px; }

  /* Bulb is 56px into the 150px lamp image and --bulb-offset from the phone's right edge.
     -88px puts the top of the cord at the top of the hero. */
  .hero__rig {
    inset: auto; top: -88px; left: calc(50% + var(--demo-nudge) / 2 + 145px + var(--bulb-offset) - 56px);
    width: 150px; height: 150px; transform-origin: 56px 26px;
  }
  .hero__lamp { display: block; }
  /* Cord runs on past the top of the hero, so it still meets the edge if the copy pushes the stage down */
  .hero__rig::before { content: ""; position: absolute; left: 55.2px; top: -24px; width: 1.6px; height: 52px; background: var(--ink); }

  /* Pill clear of the shade, in the gap above the phone, wired across to the bulb */
  .mcp { left: auto; right: 136px; top: 52px; translate: none; }
  .mcp::after { left: calc(100% - 2px); top: 31px; width: 37px; height: 3px; margin: -1.5px 0 0; background-size: 6.6px 3px; background-repeat: repeat-x; }
}
@media (min-width: 1200px) { .hero__stage { --demo-nudge: 40px; } }
@media (min-width: 1270px) {
  /* Room beside the phone: the bulb moves out as far as the right tile allows */
  .hero__stage { --bulb-offset: min(96px, calc(50vw - 554px)); }

  .hero__glow {
    display: block; position: absolute; left: 56px; top: 85px; width: 76px; height: 76px; translate: -50% -50%;
    border-radius: 50%; background: radial-gradient(closest-side, rgba(247, 215, 116, .95), rgba(247, 215, 116, 0)); opacity: 0;
  }
  .hero__lamp { position: relative; }

  /* Same pixel grid as .mcp__wires' viewBox: y=0 is the centre of the bulb */
  .mcp {
    display: block; left: -30px; right: auto; top: 85px; width: 172px; height: 176px; padding: 0;
    border: 0; border-radius: 0; background: none; box-shadow: none; line-height: 24px;
  }
  .mcp:hover { background: none; }
  .mcp::after { content: none; }
  .mcp__wires { display: block; position: absolute; inset: 0; }
  .mcp__wires path { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: .1 6.5; }
  .mcp__hub {
    position: absolute; left: 50%; top: 44px; translate: -50% 0; margin: 0; padding: 3px 14px;
    border: 2px solid var(--ink); border-radius: var(--r-pill); background: var(--folder);
    box-shadow: 3px 4px 0 rgba(42, 42, 42, .1); transition: background var(--dur-fast) var(--ease);
  }
  .mcp:hover .mcp__hub { background: var(--folder-deep); }
  .mcp__logo {
    position: absolute; width: 52px; height: 52px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper);
    box-shadow: var(--shadow-md), 3px 4px 0 rgba(42, 42, 42, .08); transition: scale .25s var(--ease-back);
  }
  .mcp:hover .mcp__logo { scale: 1.07; }
  .mcp__logo img { width: 28px; height: 28px; }
  .mcp__logo:nth-of-type(2) { left: 0; top: 102px; }
  .mcp__logo:nth-of-type(3) { left: 60px; top: 120px; }
  .mcp__logo:nth-of-type(4) { left: 120px; top: 102px; }
}

/* ---------- 9. Floating channels bar (design.md quick-link bar) ---------- */
.channels {
  position: relative; z-index: 6; margin-top: -72px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.channels__item { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); line-height: 1.4; }
.channels__item b { display: block; color: var(--ink); font-size: 15px; }
.channels__item small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.channels__item:nth-child(odd) { border-right: 1px solid var(--divider); }
.channels__item:nth-child(-n+2) { border-bottom: 1px solid var(--divider); }
.channels__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--folder-tint); color: var(--ink); }
@media (min-width: 992px) {
  .channels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .channels__item { padding: 20px 22px; }
  .channels__item:nth-child(-n+2) { border-bottom: 0; }
  .channels__item:not(:last-child) { border-right: 1px solid var(--divider); }
}

/* ---------- 10. Marquee ---------- */
.docs-strip { padding: var(--s10) 0 var(--s2); }
.docs-strip__title { margin-bottom: var(--s4); text-align: center; font-size: 15px; font-weight: 600; color: var(--muted); }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 6px var(--gutter); }
.marquee__track li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 15px; white-space: nowrap; }
.marquee__track li::before { content: ""; width: 10px; height: 12px; border-radius: 2px; background: var(--folder); border: 1.5px solid var(--ink); }
html.js .marquee.is-ready .marquee__track { flex-wrap: nowrap; justify-content: flex-start; width: max-content; padding-inline: 0; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---------- 11. Sections ---------- */
.section { padding-block: var(--s10); }
.section--soft { background: var(--cream-deep); }
@media (min-width: 992px) { .section { padding-block: var(--s12); } }

/* Before / after */
.compare { display: grid; gap: var(--s10) var(--s5); }
.compare__card { position: relative; padding: var(--s6) var(--s5) var(--s5); border-radius: var(--r-lg); }
.compare__card h3 { font-size: 24px; margin-bottom: var(--s4); padding-right: 96px; }
.compare__card--old { background: transparent; border: 2px dashed #DCD4C2; }
.compare__card--old h3 { color: var(--muted); }
.compare__docchi { position: absolute; top: -46px; right: 12px; width: 108px; }
.compare__list { display: grid; gap: var(--s3); }
.compare__list li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.6; }
.compare__list .icon { margin-top: 4px; }
.compare__card--old li { color: var(--muted); }
.compare__card--old .icon { color: #B5543F; }
.compare__card--new li { color: var(--ink); }
.compare__card--new .icon { color: var(--matcha-strong); }
.compare__card--old li span { background: linear-gradient(#B5543F, #B5543F) no-repeat 0 58% / 100% 1.5px; }
html.js .compare__card--old li span { background-size: 0% 1.5px; transition: background-size .6s var(--ease-out); }
html.js .compare__card--old.is-in li span { background-size: 100% 1.5px; }
html.js .compare__card--old.is-in li:nth-child(1) span { transition-delay: .5s; }
html.js .compare__card--old.is-in li:nth-child(2) span { transition-delay: .7s; }
html.js .compare__card--old.is-in li:nth-child(3) span { transition-delay: .9s; }
html.js .compare__card--old.is-in li:nth-child(4) span { transition-delay: 1.1s; }
@media (min-width: 768px) {
  .compare { grid-template-columns: 1fr 1fr; }
  .compare__card { padding: var(--s8) var(--s6) var(--s6); }
}

/* Steps */
.steps { position: relative; }
.steps__path { display: none; }
.steps__list { display: grid; gap: var(--s8); counter-reset: step; }
.step { position: relative; text-align: center; max-width: 360px; margin-inline: auto; }
.step__docchi { width: 150px; margin: 0 auto var(--s2); transition: transform .4s var(--ease-back); }
.step:hover .step__docchi { transform: translateY(-6px) rotate(-4deg); }
.step__num { display: block; font-family: var(--font-display); font-size: 44px; line-height: 1; color: var(--folder-deep); -webkit-text-stroke: 1px var(--ink); }
.step h3 { margin-top: var(--s2); font-size: 22px; }
.step p { margin-top: var(--s2); font-size: 16px; }
@media (min-width: 992px) {
  .steps__list { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
  .steps__path { display: block; position: absolute; left: 0; right: 0; top: 30px; width: 100%; height: 120px; pointer-events: none; }
  html.js .steps__path { clip-path: inset(0 100% 0 0); transition: clip-path 1.8s var(--ease-out) .3s; }
  html.js .steps.is-in .steps__path { clip-path: inset(0 0 0 0); }
}

/* Features — design.md offers grid: 1 large + 1 small, then rows of 3 */
.features { display: grid; gap: var(--s8) var(--s5); }
.feature { display: flex; flex-direction: column; padding: var(--s5) var(--s5) var(--s4); }
.feature h3 { font-size: 20px; }
.feature p { margin-top: var(--s2); font-size: 15.5px; }
.feature__docchi { align-self: flex-end; width: 104px; margin: auto -6px -8px 0; padding-top: var(--s3); transition: transform .4s var(--ease-back); }
.feature:hover .feature__docchi { transform: translateY(-6px) rotate(-6deg); }
.feature--soon .folder__tab { color: var(--folder-ink); }
.feature--soon h3, .feature--soon p { opacity: .85; }
.feature--wide { gap: var(--s5); }
.feature--wide h3 { font-size: clamp(22px, .8vw + 17px, 28px); }
.feature--wide .feature__text { display: flex; flex-direction: column; }
.feature--wide .feature__docchi { width: 120px; }
@media (min-width: 768px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature--wide { grid-column: 1 / -1; flex-direction: row; align-items: stretch; padding: var(--s6); }
  .feature--wide .feature__text { flex: .85 1 0; }
  .feature--wide .scan { flex: 1.5 1 0; }
}
@media (min-width: 1200px) {
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature--wide { grid-column: span 2; }
}

/* AI scan visual */
.scan { display: grid; gap: var(--s3); align-content: center; padding: var(--s4); border-radius: 12px; background: var(--cream); }
.scan__paper { position: relative; display: grid; gap: 2px; padding: 14px 14px 16px; overflow: hidden; border-radius: var(--r-md); background: var(--paper); border: 1.5px solid var(--line); font-size: 12.5px; color: var(--ink); }
.scan__paper b { font-size: 13.5px; }
.scan__paper > span:nth-child(2) { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.scan__row { display: flex; justify-content: space-between; gap: 8px; }
.scan__row > span:last-child { white-space: nowrap; }
.scan__total { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); font-weight: 700; }
.scan__beam { position: absolute; left: 0; right: 0; top: -40px; height: 40px; background: linear-gradient(180deg, rgba(247, 215, 116, 0), rgba(247, 215, 116, .55)); border-bottom: 2px solid var(--folder-deep); pointer-events: none; opacity: 0; }
.scan__fields { display: grid; gap: 6px; }
.scan__fields li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--paper); font-size: 13.5px; color: var(--muted); }
.scan__fields li .icon { color: var(--matcha); }
.scan__fields b { margin-left: auto; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 560px) { .scan { grid-template-columns: 1fr 1fr; align-items: center; } }
html.js .scan.is-playing .scan__beam { animation: beam 4.8s var(--ease) infinite; }
html.js .scan.is-playing .scan__fields li { animation: field-on 4.8s var(--ease) infinite; }
html.js .scan.is-playing .scan__fields li:nth-child(2) { animation-delay: .45s; }
html.js .scan.is-playing .scan__fields li:nth-child(3) { animation-delay: .9s; }
html.js .scan.is-playing .scan__fields li:nth-child(4) { animation-delay: 1.35s; }

/* Typewriter */
.typer { display: grid; gap: 8px; margin-top: var(--s4); padding: var(--s3); border-radius: 12px; background: var(--cream); }
.typer__input { display: flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.typer__caret { width: 2px; height: 18px; margin-left: 2px; background: var(--matcha); animation: caret 1s steps(1) infinite; }
.typer__out { display: flex; align-items: center; gap: 8px; padding-left: 8px; font-weight: 700; color: var(--ink); transition: opacity .25s var(--ease), transform .25s var(--ease-out); }
.typer__out.is-hidden { opacity: 0; transform: translateY(4px); }

/* Stamp doc */
.stamp-doc { position: relative; display: grid; gap: 6px; margin-top: var(--s4); padding: 14px 16px; border-radius: var(--r-md); background: var(--paper); border: 1.5px solid var(--line); }
.stamp-doc__title { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.stamp-doc__line { height: 6px; border-radius: 3px; background: var(--divider); }
.stamp-doc__line--short { width: 62%; }
.stamp-doc__baht { font-size: 12.5px; color: var(--muted); }
.stamp-doc__stamp { position: absolute; right: 14px; bottom: 10px; padding: 2px 10px; border: 2.5px solid var(--matcha); border-radius: 8px; color: var(--matcha); font-weight: 700; font-size: 14px; transform: rotate(-12deg); opacity: .9; }
html.js .reveal:not(.is-in) .stamp-doc__stamp { opacity: 0; transform: rotate(-12deg) scale(1.8); }
html.js .reveal.is-in .stamp-doc__stamp { transition: opacity .2s ease .6s, transform .45s var(--ease-back) .6s; }

/* Drive breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: var(--s4); padding: 10px; border-radius: 12px; background: var(--cream); font-size: 13px; color: var(--ink); }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); }
.crumbs li + li::before { content: "›"; margin: 0 2px 0 -2px; color: var(--placeholder); }
.crumbs li:last-child { background: var(--folder); border-color: var(--folder-deep); font-weight: 600; }
html.js .reveal:not(.is-in) .crumbs li { opacity: 0; transform: translateX(-6px); }
html.js .reveal.is-in .crumbs li { transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
html.js .reveal.is-in .crumbs li:nth-child(2) { transition-delay: .5s; }
html.js .reveal.is-in .crumbs li:nth-child(3) { transition-delay: .7s; }
html.js .reveal.is-in .crumbs li:nth-child(4) { transition-delay: .9s; }
html.js .reveal.is-in .crumbs li:nth-child(1) { transition-delay: .3s; }

/* ---------- 12. Summary band (design.md dark brand band) ---------- */
.band { position: relative; padding-block: var(--s10); color: var(--on-dark-soft); background: var(--matcha) url("/assets/img/bg-matcha.webp") center / cover no-repeat; }
.band__grid { display: grid; gap: var(--s8); align-items: center; }
.band__copy > p { margin-top: var(--s4); font-size: 17px; max-width: 520px; }
.band__list { display: grid; gap: var(--s3); margin-top: var(--s5); }
.band__list li { display: flex; gap: 10px; align-items: flex-start; color: #fff; }
.band__list .icon { margin-top: 4px; color: var(--folder); }
.report { padding: var(--s5); border-radius: var(--r-lg); background: var(--paper); color: var(--text); box-shadow: 0 24px 48px rgba(10, 30, 25, .28); max-width: 520px; width: 100%; justify-self: center; }
.report__head { display: flex; align-items: center; gap: var(--s3); }
.report__head div { display: grid; line-height: 1.4; }
.report__head b { color: var(--ink); font-size: 18px; }
.report__head small { color: var(--muted); font-size: 13px; }
.report__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: var(--s5) 0; }
.report__stats > div { padding: 12px; border-radius: 12px; background: var(--cream); }
.report__stats dt { font-size: 13px; color: var(--muted); }
.report__stats dd { margin: 2px 0 0; font-size: clamp(18px, 1vw + 12px, 24px); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.report__stats .is-net { background: var(--matcha-tint); }
.report__stats .is-net dd { color: var(--matcha-strong); }
.report__label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: var(--s2); }
.bars { display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 9.5em) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bars li > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bars__track { height: 10px; border-radius: 5px; background: var(--cream-deep); overflow: hidden; }
.bars__fill { display: block; height: 100%; border-radius: 5px; background: var(--folder-deep); transform-origin: left center; }
.bars li:first-child .bars__fill { background: var(--matcha); }
.bars__fill[data-bar="100"] { width: 100%; }
.bars__fill[data-bar="79"] { width: 79%; }
.bars__fill[data-bar="66"] { width: 66%; }
.bars__fill[data-bar="54"] { width: 54%; }
.bars__fill[data-bar="40"] { width: 40%; }
html.js .report:not(.is-in) .bars__fill { transform: scaleX(0); }
html.js .report.is-in .bars__fill { transition: transform 1.1s var(--ease-out) .35s; }
html.js .report.is-in .bars li:nth-child(2) .bars__fill { transition-delay: .45s; }
html.js .report.is-in .bars li:nth-child(3) .bars__fill { transition-delay: .55s; }
html.js .report.is-in .bars li:nth-child(4) .bars__fill { transition-delay: .65s; }
html.js .report.is-in .bars li:nth-child(5) .bars__fill { transition-delay: .75s; }
.report__file { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s5); padding: 8px 14px; border-radius: var(--r-pill); background: var(--matcha-tint); color: var(--matcha-strong); font-size: 13.5px; font-weight: 600; }
@media (min-width: 992px) {
  .band { padding-block: var(--s12); }
  .band__grid { grid-template-columns: 1fr 1fr; gap: var(--s10); }
}

/* ---------- 13. Meet Docchi ---------- */
.meet { display: grid; gap: var(--s8); align-items: center; }
.meet__stage { position: relative; display: grid; justify-items: center; padding-top: 88px; isolation: isolate; }
.meet__stage::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 110px; width: min(340px, 82vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--folder-tint), rgba(253, 243, 211, 0)); transform: translateX(-50%); }
.meet__stage::after { content: ""; position: absolute; z-index: -1; left: 50%; bottom: 52px; width: 180px; height: 18px; border-radius: 50%; background: rgba(64, 52, 24, .1); transform: translateX(-50%); }
.meet__say { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(420px, 94%); text-align: center; text-wrap: balance; }
.meet__say::after { left: calc(50% - 7px); }
.meet__img { width: min(280px, 70vw); }
.meet__when { margin-top: var(--s3); font-size: 14px; color: var(--muted); }
.meet__when span { margin-right: 4px; }
.meet__when b { color: var(--matcha-strong); }
.moods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: var(--s6); }
.mood { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 10px 6px 8px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), transform .25s var(--ease-back); }
.mood img { width: 44px; height: 44px; transition: transform .3s var(--ease-back); }
.mood:hover { border-color: var(--sage); }
.mood:hover img { transform: translateY(-3px) rotate(-6deg); }
.mood[aria-selected="true"] { border-color: var(--matcha); background: var(--matcha-tint); font-weight: 600; }
.mood:active { transform: scale(.96); }
@media (min-width: 560px) {
  .mood { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 8px 12px; text-align: left; }
  .mood img { width: 40px; height: 40px; }
}
@media (min-width: 992px) {
  .meet { grid-template-columns: 1fr 1.15fr; gap: var(--s10); }
}

/* ---------- 14. Security ---------- */
.secure { display: grid; gap: var(--s6); }
.secure__docchi { width: 150px; margin-bottom: var(--s3); }
.secure__grid { display: grid; gap: var(--s4); }
.secure__item { padding: var(--s5); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-card); }
.secure__item h3 { margin-top: var(--s3); font-size: 18px; }
.secure__item p { margin-top: var(--s1); font-size: 15px; }
.secure__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--matcha-tint); color: var(--matcha); }
@media (min-width: 768px) { .secure__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 992px) {
  .secure { grid-template-columns: .9fr 1.4fr; gap: var(--s10); align-items: center; }
  .secure__docchi { width: 190px; }
}
.works-with { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s4) var(--s6); margin-top: var(--s10); padding-top: var(--s6); border-top: 1px solid var(--line); }
.works-with > p { font-size: 14px; font-weight: 600; color: var(--muted); }
.works-with ul { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s4) var(--s6); }
.works-with li { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 15px; filter: grayscale(1); opacity: .7; transition: filter .25s var(--ease), opacity .25s var(--ease); }
.works-with li:hover { filter: none; opacity: 1; }
.works-with img { width: auto; height: 26px; }
.works-with img.is-wordmark { height: 28px; }

/* ---------- 15. Pricing ---------- */
.billing { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-bottom: var(--s10); font-weight: 600; color: var(--muted); }
.billing__label { cursor: pointer; transition: color var(--dur-fast) var(--ease); }
.billing__label.is-active { color: var(--ink); }
/* design.md §10.12 toggle, matcha on */
.switch { position: relative; width: 52px; height: 30px; flex: none; padding: 0; border: 0; border-radius: var(--r-pill); background: #D9D2C3; cursor: pointer; transition: background-color .2s var(--ease); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs), 0 2px 4px rgba(0, 0, 0, .12); transition: transform .3s var(--ease-back); }
.switch[aria-checked="true"] { background: var(--matcha); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.plans { display: grid; gap: var(--s10) var(--s5); align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: var(--s6) var(--s5) var(--s5); }
.plan__name { font-size: 22px; }
.plan__for { margin-top: 2px; font-size: 14.5px; color: var(--muted); }
.plan__price { display: flex; align-items: baseline; gap: 2px; margin-top: var(--s4); color: var(--ink); font-weight: 700; line-height: 1.1; }
.plan__cur { font-size: 22px; }
.plan__num { font-size: 46px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: inline-block; }
.plan__per { margin-left: 4px; font-size: 15px; font-weight: 500; color: var(--muted); }
.plan__note { min-height: 1.7em; margin: var(--s1) 0 var(--s5); font-size: 14px; color: var(--muted); }
.plan__list { display: grid; gap: 10px; margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--divider); font-size: 15px; color: var(--ink); }
.plan__list li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.55; }
.plan__list li .icon { margin-top: 2px; }
.plan__list .chip { margin-left: 4px; vertical-align: 1px; }
.plan__list .icon { color: var(--matcha); }
.plan--pro .plan__for, .plan--pro .plan__per, .plan--pro .plan__note { color: #5A4B1E; }
.plan--pro .plan__list { border-top-color: rgba(42, 42, 42, .14); }
.plan--pro .plan__list .icon { color: var(--matcha-strong); }
.plan--pro .chip--soon { background: rgba(255, 255, 255, .7); }
.plan__docchi { position: absolute; top: -78px; right: 6px; width: 104px; transform: rotate(8deg); transition: transform .4s var(--ease-back); }
.plan--pro:hover .plan__docchi { transform: rotate(0) translateY(-10px); }
.plan__num.is-flip { animation: flip .38s var(--ease-out); }
@media (min-width: 768px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s8) var(--s4); } }

.extras { display: grid; gap: var(--s4); margin-top: var(--s8); }
.extra { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); padding: var(--s5); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-card); }
.extra img { width: 72px; flex: none; }
.extra > div { flex: 1 1 220px; }
.extra h3 { font-size: 18px; }
.extra p { margin-top: 2px; font-size: 15px; }
.topups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.topups li { padding: 2px 12px; border-radius: var(--r-pill); background: var(--folder-tint); color: var(--folder-ink); font-size: 14px; }
.topups b { color: var(--ink); }
@media (min-width: 992px) { .extras { grid-template-columns: 1fr 1fr; } }
.fineprint { margin-top: var(--s5); text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- 16. FAQ ---------- */
.faq { display: grid; gap: var(--s6); }
.faq__docchi { width: 150px; margin: var(--s4) 0; }
.faq__more { font-size: 15px; max-width: 300px; }
.faq__list { display: grid; gap: var(--s3); }
.faq__item { border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-xs); transition: box-shadow .2s var(--ease); }
.faq__item[open] { box-shadow: var(--shadow-card); }
#faq-ai { scroll-margin-top: var(--s5); } /* jumped to before .reveal settles: it then rises 22px, under the header */
.faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 56px; padding: 14px 20px; cursor: pointer; list-style: none; color: var(--ink); font-weight: 600; font-size: 17px; line-height: 1.5; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--matcha); }
.faq__chev { flex: none; color: var(--matcha); transition: transform .3s var(--ease-out); }
.faq__item[open] .faq__chev { transform: rotate(180deg); }
.faq__a { padding: 0 20px 18px; font-size: 16px; }
@supports selector(::details-content) {
  .faq__item::details-content { block-size: 0; overflow-y: clip; transition: block-size .32s var(--ease-out), content-visibility .32s allow-discrete; }
  .faq__item[open]::details-content { block-size: auto; }
}
@media (min-width: 992px) {
  .faq { grid-template-columns: .8fr 1.5fr; gap: var(--s10); align-items: start; }
  .faq__intro { position: sticky; top: calc(var(--header-h) + 32px); }
  .faq__docchi { width: 190px; }
}

/* ---------- 17. Final CTA ---------- */
.start { padding-top: calc(var(--s12) + 40px); }
.start__card { display: grid; justify-items: center; gap: var(--s4); padding: 120px var(--s5) var(--s10); text-align: center; overflow: visible; }
.start__docchi { position: absolute; top: -96px; left: 50%; width: 190px; margin-left: -95px; }
.start__title { font-size: clamp(30px, 2.4vw + 18px, 48px); line-height: 1.25; max-width: 720px; }
.start__lead { max-width: 560px; font-size: 18px; color: #4A3F22; }
.start__note { font-size: 14px; color: #5A4B1E; }
.start__card .btn { margin-top: var(--s2); }
.start__deco { position: absolute; pointer-events: none; opacity: .9; }
.start__deco--plane { left: 2%; top: 18px; width: 120px; }
.start__deco--mug { right: 3%; bottom: 8px; width: 96px; }
@media (max-width: 767px) { .start__deco { display: none; } }

/* ---------- 18. Footer (design.md §10.13, matcha instead of purple) ---------- */
.footer { background: var(--matcha-deep); color: var(--on-dark-soft); }
.footer__grid { display: grid; gap: var(--s6); padding-block: var(--s10) var(--s8); }
.brand--footer .brand__mark { width: 60px; }
.brand--footer .brand__word { width: 128px; }
.footer__brand p { margin-top: var(--s3); max-width: 320px; font-size: 15px; }
.footer__head { font-family: var(--font-display); font-weight: 400; font-size: 18px; letter-spacing: .14em; text-transform: uppercase; color: var(--folder); margin-bottom: var(--s3); }
.footer__col ul { display: grid; gap: 6px; }
.footer__col a { color: #fff; font-size: 15px; opacity: .9; }
.footer__col a:hover { color: var(--folder); opacity: 1; }
.footer__bar { background: linear-gradient(122deg, rgba(255, 255, 255, 0) -30%, rgba(255, 255, 255, .08) 187%); border-top: 1px solid rgba(255, 255, 255, .08); }
.footer__bar-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s5); padding-block: 14px; font-size: 13px; color: rgba(215, 230, 223, .85); }
.footer__bar a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer__bar a:hover { color: var(--folder); }
@media (min-width: 768px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }

/* ---------- 18b. Legal pages (privacy, terms) ---------- */
.legal__back { margin-left: auto; }
@media (max-width: 359px) { .legal__back { display: none; } } /* The logo also goes home, and both don't fit. */
.legal { padding-block: var(--s8) var(--s10); }
.legal__inner { max-width: 760px; margin-inline: auto; }
.legal h1 { font-size: clamp(30px, 2vw + 20px, 42px); }
.legal h2 { margin-top: var(--s8); font-size: clamp(21px, .5vw + 19px, 24px); }
.legal p, .legal ul, .legal table { margin-top: var(--s3); }
.legal a { text-decoration: underline; text-underline-offset: 2px; }
.legal strong { font-weight: 600; color: var(--ink); }
.legal code { font-size: .92em; overflow-wrap: anywhere; }
.legal article > ul, .legal__summary ul { padding-left: 1.25em; list-style: disc; }
.legal li + li { margin-top: var(--s1); }
.legal__meta { font-size: 14px; color: var(--muted); }
.legal__status { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--matcha-tint); color: var(--matcha-strong); font-size: 15px; }
.legal__note { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--folder-tint); color: var(--folder-ink); font-size: 15px; }
.legal__note strong { color: inherit; }
.legal__summary { margin-top: calc(var(--s5) + 30px); padding: var(--s4) var(--s5) var(--s5); }
.legal__summary ul { margin-top: 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { padding: var(--s3) var(--s4) var(--s3) 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; }
.legal th:last-child, .legal td:last-child { padding-right: 0; }
.legal thead th { border-top: 0; padding-block: 0 var(--s2); font-size: 14px; color: var(--muted); }
.legal tbody th { width: 34%; font-weight: 600; color: var(--ink); }
@media (max-width: 559px) {
  .legal thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .legal tbody tr { display: block; padding-block: var(--s3); border-top: 1px solid var(--line); }
  .legal tbody th, .legal tbody td { display: block; width: auto; padding: 0; border: 0; }
  .legal tbody td { margin-top: var(--s1); }
}

/* ---------- 19. 404 ---------- */
.lost { display: grid; place-items: center; min-height: calc(100vh - var(--header-h)); padding: var(--s10) var(--gutter); text-align: center; }
.lost img { width: 200px; margin: 0 auto var(--s4); }
.lost h1 { font-size: clamp(28px, 2vw + 18px, 40px); }
.lost p { margin: var(--s3) auto var(--s6); max-width: 440px; font-size: 17px; }

/* ---------- Small screens ---------- */
@media (max-width: 559px) {
  .hero__actions .btn { width: 100%; }
  .hero__docchi { width: 112px; left: 0; bottom: 6px; }
  .hero__say { display: none; }
  .channels__item { flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s4) 14px; }
  .channels__icon { width: 40px; height: 40px; }
  .compare__card h3 { padding-right: 84px; }
  .compare__docchi { width: 92px; top: -40px; }
}
@media (max-width: 767px) {
  .marquee { overflow-x: auto; scrollbar-width: none; }
  .marquee::-webkit-scrollbar { display: none; }
  .marquee__track { flex-wrap: nowrap; justify-content: flex-start; width: max-content; }
}

/* =========================================================================
   Motion
   Content is visible by default; hiding-before-reveal only applies when JS
   is running (html.js) and the user has not asked for reduced motion.
   ========================================================================= */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .75s var(--ease-out), transform .75s var(--ease-out); transition-delay: var(--d, 0s); }
  html.js .reveal.is-in { opacity: 1; transform: none; }
  html.js .reveal.folder:not(.is-in) { transform: translateY(28px) rotate(-.6deg); }

  /* Hero entrance */
  html.js .hero__in { animation: rise .9s var(--ease-out) both; }
  html.js .hero__in:nth-child(2) { animation-delay: .08s; }
  html.js .hero__in:nth-child(3) { animation-delay: .16s; }
  html.js .hero__in:nth-child(4) { animation-delay: .24s; }
  html.js .hero__in:nth-child(5) { animation-delay: .32s; }
  html.js .hero__in:nth-child(6) { animation-delay: .4s; }
  html.js .marker { background-size: 0% 100%; animation: marker 1s var(--ease-out) .75s forwards; }
  html.js .hero__stage { animation: rise 1s var(--ease-out) .2s both; }
  html.js .hero__docchi { animation: pop-in .8s var(--ease-back) .7s both; }
  html.js .hero__say { animation: pop-in .5s var(--ease-back) 1.4s both; transform-origin: 20% 100%; }

  /* Docchi life: wave, blink, bob — paused when the hero is off-screen */
  .d-arm { animation: wave 3.4s var(--ease) 1.6s infinite; }
  .d-blink { animation: blink 5.2s 2s infinite; }
  .hero__docchi-btn { animation: bob 4.2s var(--ease) infinite; }
  .hero__docchi-btn.is-hop { animation: hop .6s var(--ease-back); }
  .mcp { animation: bob 4.8s var(--ease) infinite; }
  @media (min-width: 992px) {
    .hero__rig { animation: swing 7s var(--ease) infinite; }
    .mcp { animation: pop-in .6s var(--ease-back) 1s both; }
  }
  @media (min-width: 1270px) {
    /* The wide mobile: pieces arrive one by one and float, a signal climbs from each
       AI to the bulb and the bulb lights up when it lands (every 3s, one wire at a time). */
    .mcp { animation: none; }
    .mcp__wires { animation: fade-in .6s var(--ease) 1.1s both; }
    .mcp__hub { animation: pop-in .5s var(--ease-back) .9s both; }
    .mcp__logo:nth-of-type(2) { animation: pop-in .6s var(--ease-back) 1.1s both, bob 5.2s var(--ease) 1.7s infinite; }
    .mcp__logo:nth-of-type(3) { animation: pop-in .6s var(--ease-back) 1.25s both, bob 6.1s var(--ease) 1.85s infinite; }
    .mcp__logo:nth-of-type(4) { animation: pop-in .6s var(--ease-back) 1.4s both, bob 5.6s var(--ease) 2s infinite; }
    @supports (offset-path: path("M0 0")) {
      .mcp__pulse {
        display: block; position: absolute; left: 0; top: 0; width: 9px; height: 9px;
        border: 1.6px solid var(--ink); border-radius: 50%; background: var(--folder); opacity: 0; offset-rotate: 0deg;
        animation: mcp-pulse 9s var(--ease) infinite;
      }
      .mcp__pulse:nth-of-type(1) { offset-path: path("M86 8V70C86 98 26 90 26 128"); animation-delay: 2.4s; }
      .mcp__pulse:nth-of-type(2) { offset-path: path("M86 8V146"); animation-delay: 5.4s; }
      .mcp__pulse:nth-of-type(3) { offset-path: path("M86 8V70C86 98 146 90 146 128"); animation-delay: 8.4s; }
      .hero__glow { animation: bulb-on 3s var(--ease) 2.4s infinite; }
    }
  }
  .hero.is-offscreen *,.hero.is-offscreen *::before, .hero.is-offscreen *::after { animation-play-state: paused !important; }

  /* Chat demo choreography (classes toggled by site.js) */
  html.js [data-demo].is-live .msg { display: none; }
  html.js [data-demo].is-live .msg.is-shown { display: block; animation: msg-in .45s var(--ease-back) both; }
  html.js [data-demo].is-live .msg--typing.is-shown { display: inline-flex; }
  html.js [data-demo].is-live .msg.is-shown .flex__body > * { animation: rise-sm .4s var(--ease-out) both; }
  html.js [data-demo].is-live .msg.is-shown .flex__body > :nth-child(2) { animation-delay: .25s; }
  html.js [data-demo].is-live .msg.is-shown .flex__body > :nth-child(3) { animation-delay: .5s; }
  html.js [data-demo].is-live .msg.is-shown .flex__body > :nth-child(4) { animation-delay: .7s; }
  html.js [data-demo].is-live .msg.is-shown .flex__btns { animation: rise-sm .4s var(--ease-out) .85s both; }
  html.js [data-demo].is-live .tag { opacity: 0; transform: translateX(-10px) scale(.92); transition: opacity .35s var(--ease-out), transform .45s var(--ease-back); }
  html.js [data-demo].is-live .tag.is-on { opacity: 1; transform: none; }
  html.js [data-demo].is-live .chat__body.is-clearing { opacity: 0; transition: opacity .5s var(--ease); }
  html.js [data-demo].is-live .chat__avatar.is-swap { animation: pop-in .4s var(--ease-back); }

  /* Section mascots pop in */
  html.js .reveal .compare__docchi, html.js .reveal .plan__docchi, html.js .reveal.step .step__docchi, html.js .reveal .faq__docchi, html.js .reveal .secure__docchi { transition: transform .6s var(--ease-back) .25s, opacity .4s var(--ease) .25s; }
  html.js .reveal:not(.is-in) .compare__docchi, html.js .reveal:not(.is-in).step .step__docchi, html.js .reveal:not(.is-in) .faq__docchi, html.js .reveal:not(.is-in) .secure__docchi { opacity: 0; transform: translateY(16px) scale(.7) rotate(-10deg); }
  html.js .reveal:not(.is-in) .plan__docchi { opacity: 0; transform: translateY(40px) rotate(20deg); }
  .start__docchi { animation: bob 4.6s var(--ease) infinite; }
  .start__deco--plane { animation: drift 9s var(--ease) infinite; }
}

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes rise-sm { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.6) rotate(-8deg); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@keyframes marker { to { background-size: 100% 100%; } }
@keyframes wave {
  0%, 48%, 100% { transform: rotate(0); }
  8% { transform: rotate(-16deg); }
  16% { transform: rotate(10deg); }
  24% { transform: rotate(-16deg); }
  32% { transform: rotate(8deg); }
  40% { transform: rotate(-6deg); }
}
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes hop { 0% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-22px) scale(.96, 1.05) rotate(-4deg); } 60% { transform: translateY(0) scale(1.06, .94); } 100% { transform: none; } }
@keyframes swing { 0%, 100% { transform: rotate(2.2deg); } 50% { transform: rotate(-2.2deg); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(14px, -10px) rotate(-6deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes mcp-pulse { /* 15.5% of 9s = 1.4s of travel, tile to bulb */
  0% { offset-distance: 100%; opacity: 0; }
  2%, 14% { opacity: 1; }
  15.5%, 100% { offset-distance: 0%; opacity: 0; }
}
@keyframes bulb-on { /* lands at 1.4s of 3s (47%), in step with mcp-pulse */
  0%, 42% { opacity: 0; scale: .7; }
  52% { opacity: 1; scale: 1; }
  88%, 100% { opacity: 0; scale: 1.15; }
}
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes beam { 0% { top: -40px; opacity: 0; } 8% { opacity: 1; } 55% { top: 100%; opacity: 1; } 62%, 100% { top: 100%; opacity: 0; } }
@keyframes field-on {
  0%, 12% { background: var(--paper); color: var(--muted); }
  18% { background: var(--folder-tint); color: var(--ink); transform: scale(1.02); }
  26%, 88% { background: var(--paper); color: var(--ink); transform: none; }
  100% { color: var(--muted); }
}
@keyframes flip { 0% { opacity: 0; transform: translateY(-14px); } 100% { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
