/* Kiwa site. Tokens mirror app/src/styles/tokens.css. */

/* Fonts are served from this site: no requests to third parties. */
@font-face { font-family: "Geist"; src: url("fonts/Geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
:root {
  --bg: #f7f6f3;
  --bg-raised: #fbfbfa;
  --surface: #ffffff;
  --line: #eaeaea;
  --line-strong: #dcdbd6;
  --ink: #111111;
  --ink-2: #2f3437;
  --muted: #787774;
  --faint: #a8a7a3;
  --shu: #d9412b;
  --red-bg: #fdebec;   --red-fg: #9f2f2d;
  --green-bg: #edf3ec; --green-fg: #346538;
  --yellow-bg: #fbf3db; --yellow-fg: #956400;
  --font-sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "Geist Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 6px;
  --radius-lg: 12px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 760px; }
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.025em; line-height: 1.05; color: var(--ink); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ambient warm light behind the hero */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(600px 420px at 50% 10%, rgba(217, 65, 43, 0.05), transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .ambient { animation: drift 26s var(--ease-in-out) infinite alternate; }
}
@keyframes drift { from { transform: translate(-50px, -10px); } to { transform: translate(50px, 30px); } }

/* ---------- buttons, tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 540;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 160ms, border-color 160ms, transform 120ms;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #333; }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--line-strong); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag--green { background: var(--green-bg); border-color: transparent; color: var(--green-fg); }
.tag--yellow { background: var(--yellow-bg); border-color: transparent; color: var(--yellow-fg); }
.tag--red { background: var(--red-bg); border-color: transparent; color: var(--red-fg); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: box-shadow 200ms;
}
.card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }

kbd {
  display: inline-block;
  min-width: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  color: var(--ink);
}

/* ---------- logo (same animation as the app) ---------- */
.logo { --logo-size: 30px; display: inline-flex; align-items: center; gap: 9px; color: var(--ink); line-height: 1; }
.logo__mark { width: var(--logo-size); height: var(--logo-size); overflow: visible; flex: none; }
.logo__frame, .logo__stem, .logo__arm-up, .logo__arm-down { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.logo__frame { stroke-width: 3; }
.logo__stem, .logo__arm-up, .logo__arm-down { stroke-width: 4.2; }
.logo__dot { fill: var(--shu); }
.logo__ripple { fill: none; stroke: var(--shu); stroke-width: 1.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.logo__word { display: inline-flex; align-items: baseline; font-weight: 620; font-size: 19px; letter-spacing: -0.045em; }
.logo__kanji { margin-left: 0.32em; font-size: 0.55em; font-weight: 500; letter-spacing: 0; color: var(--shu); position: relative; top: -0.15em; }

@media (prefers-reduced-motion: no-preference) {
  .logo--animate .logo__frame, .logo--animate .logo__stem, .logo--animate .logo__arm-up, .logo--animate .logo__arm-down {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: logo-draw var(--d, 600ms) var(--ease, var(--ease-in-out)) var(--delay, 0ms) forwards;
  }
  .logo--animate .logo__frame { --d: 700ms; }
  .logo--animate .logo__stem { --d: 380ms; --delay: 420ms; --ease: var(--ease-out); }
  .logo--animate .logo__arm-up { --d: 340ms; --delay: 720ms; --ease: cubic-bezier(0.7, 0, 0.84, 0); }
  .logo--animate .logo__arm-down { --d: 360ms; --delay: 1080ms; --ease: var(--ease-out); }
  .logo--animate .logo__dot { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: logo-dot 520ms var(--ease-out) 1040ms forwards; }
  .logo--animate .logo__ripple { animation: logo-ripple 900ms var(--ease-out) 1060ms; }
  .logo--animate .logo__letter, .logo--animate .logo__kanji {
    opacity: 0;
    animation: logo-letter 600ms var(--ease-out) calc(1150ms + var(--i, 4) * 55ms) forwards;
  }
  .logo:hover .logo__ripple { animation: logo-ripple 900ms var(--ease-out); }
}
@keyframes logo-draw { to { stroke-dashoffset: 0; } }
@keyframes logo-dot { 0% { transform: scale(0); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes logo-ripple { 0% { opacity: 0.55; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
@keyframes logo-letter { from { opacity: 0; translate: 0 0.18em; } to { opacity: 1; translate: 0 0; } }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 246, 243, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: 14.5px; color: var(--muted); }
.nav__links a { transition: color 140ms; }
.nav__links a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 96px 0 64px; }
.hero__inner { display: grid; justify-items: center; text-align: center; gap: 22px; }
.hero__title { font-size: clamp(48px, 8vw, 92px); }
.hero__lede { max-width: 56ch; font-size: 18px; color: var(--muted); }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.hero__meta { font-size: 12.5px; color: var(--faint); }

.window {
  margin: 72px auto 0;
  max-width: 880px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(17, 17, 17, 0.12);
}
.window__bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.window__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.window__body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: center;
  padding: 44px 48px;
  background: var(--bg-raised);
}
.mock-score { position: relative; display: grid; place-items: center; width: 168px; height: 168px; }
.ring { width: 168px; height: 168px; }
.ring__track { fill: none; stroke: var(--line); stroke-width: 6; }
.ring__value { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-dashoffset: 100; transition: stroke-dashoffset 1600ms var(--ease-out); }
.ring__dot { transform-origin: 84px 84px; transform: rotate(0deg); transition: transform 1600ms var(--ease-out); }
.ring__dot circle { fill: var(--shu); stroke: var(--bg-raised); stroke-width: 3; }
.window.is-in .ring__value { stroke-dashoffset: 9; }
.window.is-in .ring__dot { transform: rotate(327.6deg); }
.mock-score__value { position: absolute; display: grid; justify-items: center; gap: 2px; }
.mock-score__value .mono { font-size: 46px; font-weight: 500; color: var(--ink); line-height: 1; letter-spacing: -0.03em; }
.mock-score__value small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mock-report { display: grid; gap: 0; text-align: left; }
.mock-report .label { margin-bottom: 10px; }
.mock-metric {
  display: grid;
  grid-template-columns: 1fr auto 64px;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.mock-metric b { color: var(--ink); font-weight: 500; }
.mock-metric .tag { justify-self: end; }
.mock-note { margin-top: 10px; font-size: 13px; color: var(--faint); }
.figure-note { margin-top: 14px; text-align: center; font-size: 13px; color: var(--faint); }

/* ---------- sections ---------- */
.section { padding: 112px 0; }
.section__title { font-size: clamp(36px, 5vw, 56px); margin-top: 12px; max-width: 18ch; }

.steps {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.steps li { padding: 28px 28px 0 0; display: grid; gap: 8px; align-content: start; }
.steps li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.steps__n { font-size: 13px; color: var(--shu); }
.steps h3 { font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.steps p { color: var(--muted); }

.bento {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.bento .card { display: grid; gap: 10px; align-content: start; justify-items: start; }
.bento h3 { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.bento p { color: var(--muted); font-size: 15px; }
.bento__wide { grid-column: span 2; grid-row: span 2; }
.bento__wide h3 { font-size: 24px; }
.bios-demo {
  margin-top: 16px;
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 13px;
  color: var(--ink-2);
}
.bios-demo span { display: flex; align-items: center; gap: 10px; }
.mini-timeline { list-style: none; margin: 8px 0 0; padding: 0; width: 100%; font-size: 13px; color: var(--ink-2); }
.mini-timeline li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.mini-timeline .mono { color: var(--faint); font-size: 12px; }
.mini-timeline .is-undone { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.plans {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 820px;
}
.plan { display: grid; gap: 12px; align-content: start; }
.plan h3 { font-size: 18px; font-weight: 600; color: var(--ink); }
.plan__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan__price { display: flex; align-items: baseline; gap: 10px; }
.plan__price .mono { font-size: 36px; font-weight: 500; color: var(--ink); letter-spacing: -0.03em; }
.plan__was { font-size: 15px !important; color: var(--faint) !important; text-decoration: line-through; }
.plan__desc { color: var(--muted); font-size: 14px; }
.plan__list { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 9px; font-size: 15px; }
.plan__list li { position: relative; padding-left: 22px; }
.plan__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 9px;
  height: 5px;
  border: 2px solid var(--green-fg);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}
.plan--pro { border-color: var(--ink); }

.faq { margin-top: 40px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-size: 17px;
  font-weight: 560;
  color: var(--ink);
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-size: 20px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 64ch; }

.final { padding-bottom: 128px; }
.final__inner { display: grid; justify-items: center; text-align: center; gap: 24px; }
.final__title { font-size: clamp(36px, 5vw, 60px); max-width: 16ch; }

.footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: 14px; }
.footer__inner { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.footer__brand { font-weight: 620; letter-spacing: -0.04em; color: var(--ink); font-size: 17px; }
.footer__links { display: flex; gap: 22px; color: var(--muted); }
.footer__links a:hover { color: var(--ink); }
.footer .muted { margin-left: auto; }

/* ---------- video ---------- */
.section--video { padding-top: 48px; }
.film {
  position: relative;
  margin: 48px 0 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: 0 30px 60px -30px rgba(17, 17, 17, 0.14);
}
.film__video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--bg-raised); }
.film__play {
  position: absolute;
  left: 50%;
  bottom: 28px;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 22px 8px 8px;
  border: 0;
  border-radius: 9999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(17, 17, 17, 0.45);
  transition: scale 160ms var(--ease-out), background-color 160ms;
}
.film__play:hover { background: #333; scale: 1.03; }
.film__play:active { scale: 0.98; }
.film__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--shu);
}
.film__icon svg { translate: 2px 0; }
.film.is-playing .film__play { display: none; }

/* ---------- waitlist ---------- */
.final__lede { max-width: 52ch; color: var(--muted); font-size: 17px; }
.waitlist {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 520px;
  margin-top: 4px;
}
.waitlist__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.waitlist__input::placeholder { color: var(--faint); }
.waitlist__input:hover { border-color: var(--line-strong); }
.waitlist__input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06); }
.waitlist__input[aria-invalid="true"] { border-color: var(--red-fg); }
.waitlist__btn { height: 48px; }
.waitlist__btn[disabled] { opacity: 0.6; cursor: default; }
.waitlist__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.waitlist__status { min-height: 24px; font-size: 15px; color: var(--muted); }
.waitlist__status.is-ok { color: var(--green-fg); }
.waitlist__status.is-error { color: var(--red-fg); }
.waitlist__consent { max-width: 52ch; font-size: 13px; color: var(--faint); }
.waitlist__consent a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.waitlist.is-done { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ---------- legal pages ---------- */
.doc { padding: 72px 0 112px; }
.doc__inner { max-width: 720px; }
.doc__back { font-size: 14px; color: var(--muted); }
.doc__back:hover { color: var(--ink); }
.doc h1 { font-size: clamp(44px, 7vw, 68px); margin: 20px 0 10px; }
.doc__updated { font-size: 13px; color: var(--faint); }
.doc__summary {
  margin: 36px 0 8px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 15.5px;
}
.doc__summary ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.doc h2 { font-size: 22px; font-weight: 620; letter-spacing: -0.01em; color: var(--ink); margin: 44px 0 10px; }
.doc p, .doc li { font-size: 16px; color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 20px; display: grid; gap: 8px; margin: 12px 0; }
.doc a { text-decoration: underline; text-underline-offset: 3px; }
.doc .fill { background: var(--yellow-bg); color: var(--yellow-fg); padding: 0 6px; border-radius: 4px; }

/* ---------- reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__inner { justify-content: space-between; }
  .hero { padding-top: 64px; }
  .window__body { grid-template-columns: 1fr; justify-items: center; gap: 28px; padding: 28px 20px; }
  .mock-report { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .bento { grid-template-columns: 1fr; }
  .bento__wide { grid-column: auto; grid-row: auto; }
  .plans { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .card { padding: 24px; }
  .footer .muted { margin-left: 0; }
  .waitlist { flex-direction: column; }
  .film__play { bottom: 14px; padding: 6px 16px 6px 6px; font-size: 14px; }
  .film__icon { width: 36px; height: 36px; }
  .waitlist__btn { width: 100%; }
}
@media (max-width: 420px) {
  .mock-metric { grid-template-columns: 1fr auto; }
  .mock-metric .tag { display: none; }
}
