/* General Sans (Fontshare Free Font License — permits self-hosting/commercial use).
   Display face for headlines/brand text; demo replicas stay on the system stack
   so they look native macOS (DESIGN.md → Type). */
@font-face {
  font-family: "General Sans";
  src: url("/fonts/general-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "General Sans";
  src: url("/fonts/general-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "General Sans";
  src: url("/fonts/general-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallback: swap alone causes CLS; size-adjust keeps line boxes
   stable while the webfont loads (eng review, outside voice #8). */
@font-face {
  font-family: "General Sans Fallback";
  src: local("Helvetica Neue"), local("Arial");
  size-adjust: 103%;
  ascent-override: 96%;
  descent-override: 24%;
  line-gap-override: 0%;
}

:root {
  --ink: #0a1113;
  --muted: #667174;
  --line: rgba(10, 17, 19, 0.12);
  --teal: #006e78; /* app Branding.swift teal */
  --teal-dark: #003340; /* app deepTeal */
  --aqua: #dff7f7;
  --aqua-soft: #f1fbfb;
  --paper: #ffffff;
  --soft: #f6f7f5;
  /* Issue categories — app taxonomy (UnderlineOverlayWindow.swift), at Apple's
     increased-contrast shades so 10px labels hold 4.5:1 on white. */
  --cat-correctness: #d70015;
  --cat-clarity: #0066cc;
  --cat-engagement: #248a3d;
  --cat-delivery: #8944ab;
  --cat-style: #6c6c70;
  --cat-voice: #d30f45;
  /* Radii — app scale: correction card 12, panel surfaces 16, shells 24. */
  --radius-s: 12px;
  --radius-m: 16px;
  --radius-l: 24px;
  --sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --display: "General Sans", "General Sans Fallback", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --page: clamp(22px, 4vw, 68px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: white;
  background: var(--teal);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid #00a4ad;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 15px;
  color: white;
  background: var(--ink);
  border-radius: 999px;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  position: relative;
  height: min(820px, calc(100svh - 72px));
  min-height: 760px;
  margin: 16px;
  overflow: hidden;
  border-radius: 30px;
  background: #bfeff1;
  isolation: isolate;
}

@media (min-width: 1041px) {
  .hero {
    height: min(868px, calc(100svh - 56px));
    min-height: 808px;
  }
}

.hero-atmosphere,
.closing-section > img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-atmosphere {
  transform: scale(1.035);
  filter: saturate(0.8) contrast(0.94);
  animation: ocean-drift 18s var(--ease-soft) infinite alternate;
}

.hero-wash {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(235, 253, 253, 0.38) 0%, rgba(225, 249, 250, 0.05) 44%, rgba(5, 89, 97, 0.2) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 34%, rgba(255, 255, 255, 0.08));
}

@keyframes ocean-drift {
  from {
    transform: scale(1.035) translate3d(-0.4%, -0.2%, 0);
  }
  to {
    transform: scale(1.075) translate3d(0.6%, 0.5%, 0);
  }
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  min-height: 78px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(22px, 3.2vw, 52px);
}

.brand,
.footer-brand {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
}

.brand img,
.footer-brand img,
.closing-wordmark {
  display: block;
  width: auto;
  object-fit: contain;
}

.brand img {
  height: 30px;
}

.nav-links {
  display: flex;
  font-family: var(--display);
  align-items: center;
  gap: clamp(22px, 2.8vw, 42px);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-links a,
footer a {
  position: relative;
}

.nav-links a,
footer nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.nav-links a::after,
footer nav a::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 1px;
  content: "";
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms var(--ease-out);
}

.menu-button {
  display: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.hero-copy {
  position: relative;
  z-index: 4;
  max-width: 900px;
  margin: clamp(44px, 6.5vh, 72px) auto 0;
  padding: 0 var(--page);
  text-align: center;
}

.hero-kicker,
.section-kicker,
.section-index,
.document-label,
.canvas-label {
  margin: 0;
  font-family: var(--display);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-kicker {
  margin-bottom: 18px;
  color: rgba(5, 37, 40, 0.73);
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(48px, 5.1vw, 76px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-demo {
  /* Rail lives at the TOP of the window (toolbar), so this bleed can only ever
     clip exhibit whitespace — never controls (design-improvement-plan.md 14A). */
  --demo-bleed: -24px;
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: var(--demo-bleed);
  left: 0;
  width: min(1160px, calc(100% - 88px));
  margin: auto;
  perspective: 1400px;
}

.demo-chips {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.chip-group {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(13, 39, 42, 0.1);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.chip {
  min-height: 30px;
  font-family: var(--display);
  padding: 0 14px;
  color: #4a5456;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  transition: color 180ms ease, background 180ms ease;
}

.chip.is-active {
  color: white;
  background: var(--teal);
}

.chip-replay {
  min-height: 36px;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(13, 39, 42, 0.12);
}

.demo-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.demo-window {
  --demo-x: 0deg;
  --demo-y: 0deg;
  --timeline-h: 52px;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 420px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.91);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: 0 35px 85px rgba(4, 60, 66, 0.22), inset 0 1px rgba(255, 255, 255, 0.84);
  transform: rotateX(var(--demo-x)) rotateY(var(--demo-y));
  transform-style: preserve-3d;
  transition: transform 180ms var(--ease-out);
  backdrop-filter: blur(26px) saturate(120%);
}

.demo-titlebar {
  display: flex;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  color: #707779;
  border-bottom: 1px solid rgba(13, 39, 42, 0.08);
  font-size: 12px;
  font-weight: 550;
}

.demo-titlebar .traffic,
.voice-traffic {
  display: inline-flex;
  gap: 6px;
  margin-right: 12px;
}

.demo-titlebar .traffic i {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #e3e6e4;
  border-radius: 50%;
}

.titlebar-hint {
  color: #9aa2a3;
  font-size: 11px;
}

.demo-exhibit {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Between-pass resets fade instead of cutting — the engine adds .is-resetting
   to the demo root, resets behind the fade, then fades back in. */
.demo-exhibit,
.story-exhibit,
.correction-exhibit,
.voice-card-app {
  transition: opacity 260ms var(--ease-out);
}

.is-resetting .demo-exhibit,
.is-resetting .story-exhibit,
.is-resetting .correction-exhibit,
.is-resetting .voice-card-app {
  opacity: 0;
}

.demo-document {
  position: relative;
  /* Reserve the right half for the docked suggestion card: evidence is never covered. */
  max-width: min(640px, calc(100% - 440px));
  padding: 26px clamp(34px, 4vw, 60px);
}

.compose-meta {
  margin: 0 0 6px;
  color: #8b9395;
  font-size: 12.5px;
}

.compose-meta span {
  color: #3c4547;
}

.demo-document .document-line,
.document-support {
  max-width: 610px;
  margin: 14px 0 0;
  color: #273033;
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.65;
}

.document-line {
  position: relative;
  border-radius: 4px;
  transition: background 180ms ease, box-shadow 180ms ease;
}

.document-line.is-selected {
  background: rgba(81, 153, 255, 0.18);
  box-shadow: 0 0 0 4px rgba(81, 153, 255, 0.18);
}

.document-line.is-accepted {
  background: color-mix(in srgb, var(--teal) 9%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 9%, transparent);
}

.demo-issue,
.issue-mark {
  --issue-color: var(--cat-correctness);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
}

.demo-issue {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  line-height: inherit;
}

.demo-issue::after,
.issue-mark::after {
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--issue-color);
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms var(--ease-out);
}

.issue-clarity {
  --issue-color: var(--cat-clarity);
}

.issue-engagement {
  --issue-color: var(--cat-engagement);
}

.issue-correctness {
  --issue-color: var(--cat-correctness);
}

.demo-window.is-marked .demo-issue::after,
.correction-canvas.is-playing .issue-mark::after {
  transform: scaleX(1);
}

.healed-word {
  color: var(--teal);
  font-weight: 600;
  animation: healed-settle 1200ms var(--ease-out) forwards;
}

@keyframes healed-settle {
  to {
    color: inherit;
    font-weight: 400;
  }
}

.demo-allclear {
  margin: 18px 0 0;
  color: var(--teal);
  font-size: 13.5px;
  font-weight: 600;
}

.hotkey-chip {
  position: absolute;
  top: 22px;
  right: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  animation: chip-in 300ms var(--ease-out);
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.hotkey-chip[hidden] {
  display: none;
}

.hotkey-chip .kbd,
.inline-kbd {
  padding: 1px 6px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 11px;
}

.suggestion-slot {
  position: absolute;
  top: 16px;
  right: 30px;
  display: flex;
  justify-content: flex-end;
  width: min(396px, 42%);
}

.keel-rewrite-card {
  width: 396px;
  max-width: 100%;
  padding: 16px;
  color: #15191b;
  background: rgba(247, 247, 248, 0.9);
  border: 1px solid rgba(10, 17, 19, 0.11);
  border-radius: var(--radius-l);
  box-shadow: 0 22px 55px rgba(16, 41, 45, 0.18), inset 0 1px rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(125%);
}

.hero-suggestion {
  width: 100%;
  opacity: 0;
  transform: translateY(10px) scale(0.975);
  transform-origin: center right;
  transition: opacity 160ms var(--ease-out), transform 200ms var(--ease-out);
}

.keel-correction-card.hero-suggestion,
.suggestion-slot .keel-correction-card {
  width: 264px;
}

.suggestion-slot .is-in {
  opacity: 1;
  transform: none;
}

.suggestion-slot .is-leaving {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
}

.hero-suggestion.keel-rewrite-card {
  padding: 13px;
}

.hero-suggestion .rewrite-card-copy {
  min-height: 0;
  font-size: 14px;
}

.hero-suggestion .rewrite-refine {
  margin-top: 10px;
}

.rewrite-card-header {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 7px;
  min-height: 20px;
}

.rewrite-card-header img {
  width: 50px;
  height: 18px;
  object-fit: contain;
}

.rewrite-card-header > span {
  color: #93989a;
  font-size: 12px;
  font-weight: 550;
}

.rewrite-card-header > button {
  width: 24px;
  height: 24px;
  justify-self: end;
  padding: 0;
  color: #62696b;
  background: rgba(10, 17, 19, 0.045);
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
}

.rewrite-card-loading,
.rewrite-card-result {
  display: none;
  margin-top: 14px;
}

.hero-suggestion .rewrite-card-result,
.story-stage[data-state="loading"] .story-rewrite-card .rewrite-card-loading,
.story-stage[data-state="result"] .story-rewrite-card .rewrite-card-result {
  display: block;
}

.rewrite-card-copy .diff-del {
  color: var(--muted);
  text-decoration-color: color-mix(in srgb, var(--muted) 75%, transparent);
  text-decoration-thickness: 1.5px;
}

.rewrite-card-copy .diff-ins {
  color: var(--teal);
  font-style: normal;
  font-weight: 600;
}

.rewrite-thinking,
.rewrite-card-copy {
  background: rgba(10, 17, 19, 0.05);
  border: 1px solid rgba(10, 17, 19, 0.06);
  border-radius: 13px;
}

.rewrite-thinking {
  display: flex;
  height: 52px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
}

.rewrite-thinking b {
  font-size: 13px;
  font-weight: 570;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.thinking-dots[hidden] {
  display: none;
}

.thinking-dots i {
  width: 4px;
  height: 4px;
  background: var(--teal);
  border-radius: 50%;
  animation: thinking-pulse 480ms ease-in-out infinite alternate;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 80ms;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 160ms;
}

@keyframes thinking-pulse {
  from {
    opacity: 0.3;
    transform: scale(0.78);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.rewrite-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.rewrite-card-label small,
.rewrite-refine small {
  color: #959b9d;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.rewrite-card-label span {
  color: #a0a5a7;
  font-size: 10px;
}

.rewrite-card-copy {
  min-height: 82px;
  margin: 0;
  padding: 11px 13px;
  font-size: 15px;
  line-height: 1.42;
}

.rewrite-refine {
  margin-top: 12px;
}

.rewrite-refine > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 6px;
}

.rewrite-refine button,
.rewrite-decisions button {
  min-height: 28px;
  padding: 0 9px;
  color: #656c6e;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(10, 17, 19, 0.07);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 560;
}

.rewrite-decisions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(10, 17, 19, 0.09);
}

.rewrite-decisions button:last-child {
  min-width: 92px;
  color: white;
  background: var(--teal);
  border-color: transparent;
}

.rewrite-decisions button span {
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}

.keel-correction-card {
  width: 264px;
  padding: 6px;
  color: #22282a;
  background: rgba(247, 247, 249, 0.88);
  border: 1px solid rgba(10, 17, 19, 0.12);
  border-radius: var(--radius-s);
  box-shadow: 0 20px 50px rgba(20, 35, 38, 0.2), inset 0 1px rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(120%);
}

.correction-apply,
.correction-dictionary,
.correction-dismiss {
  display: flex;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease;
}

.keel-correction-card {
  --issue-color: var(--cat-correctness);
}

.keel-correction-card[data-category="clarity"] {
  --issue-color: var(--cat-clarity);
}

.keel-correction-card[data-category="engagement"] {
  --issue-color: var(--cat-engagement);
}

.keel-correction-card[data-category="delivery"] {
  --issue-color: var(--cat-delivery);
}

.correction-apply small {
  color: var(--issue-color);
  font-size: 10px;
  font-weight: 700;
}

.correction-apply span {
  margin-top: 4px;
  color: #6b7173;
  font-size: 13px;
}

.correction-apply strong {
  margin-top: 2px;
  color: var(--issue-color);
  font-size: 17px;
}

.correction-dictionary,
.correction-dismiss {
  min-height: 32px;
  color: #697072;
  font-size: 13px;
}

.correction-dictionary[hidden] {
  display: none;
}

.demo-timeline {
  display: grid;
  height: var(--timeline-h);
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(13, 39, 42, 0.08);
  background: rgba(248, 250, 249, 0.7);
}

.demo-timeline button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  color: #727a7c;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: color 220ms ease, background 220ms ease;
}

.demo-timeline button + button {
  border-left: 1px solid rgba(13, 39, 42, 0.07);
}

.demo-timeline button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
}

.demo-timeline button.is-active {
  color: var(--ink);
  background: rgba(0, 110, 120, 0.035);
}

.demo-timeline button.is-active::after {
  transform: scaleX(1);
}

.demo-timeline span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
}

.demo-timeline b {
  font-size: inherit;
  font-weight: inherit;
}

.js [data-reveal="header"],
.js [data-reveal="hero"],
.js [data-reveal="product"] {
  opacity: 0;
}

.js [data-reveal="header"] {
  transform: translateY(-12px);
}

.js [data-reveal="hero"] {
  transform: translateY(24px);
}

.js [data-reveal="product"] {
  transform: translateY(70px) scale(0.97);
}

.js body.is-ready [data-reveal="header"],
.js body.is-ready [data-reveal="hero"],
.js body.is-ready [data-reveal="product"] {
  opacity: 1;
  transform: none;
  transition: opacity 520ms var(--ease-out), transform 680ms var(--ease-out);
}

.js body.is-ready [data-reveal="header"] {
  transition-delay: 30ms;
}

.js body.is-ready .hero-kicker[data-reveal="hero"] {
  transition-delay: 80ms;
}

.js body.is-ready .hero h1[data-reveal="hero"] {
  transition-delay: 130ms;
}

.js body.is-ready [data-reveal="product"] {
  transition-delay: 250ms;
}

.intro-section {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(108px, 10vw, 150px) var(--page) clamp(120px, 14vw, 200px);
  text-align: center;
}

.intro-section .section-kicker {
  margin-bottom: 18px;
}

.intro-section h2,
.story-copy h2,
.voice-heading h2,
.voice-heading-copy h2,
.privacy-copy h2,
.closing-content h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.intro-section h2 {
  font-size: clamp(42px, 5.2vw, 74px);
}

.section-copy {
  max-width: 620px;
  margin: 27px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
}

.story-section {
  display: grid;
  max-width: 1400px;
  min-height: 760px;
  grid-template-columns: minmax(280px, 0.72fr) minmax(620px, 1.55fr);
  align-items: center;
  gap: clamp(54px, 7vw, 110px);
  margin: 0 auto;
  padding: clamp(92px, 10vw, 150px) var(--page);
}

.story-copy {
  max-width: 460px;
}

.section-index {
  margin-bottom: 24px;
}

.story-copy h2,
.voice-heading-copy h2 {
  font-size: clamp(43px, 4.7vw, 68px);
}

.story-copy > p:not(.section-index) {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.62;
}

.text-button,
.canvas-replay {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 0 4px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms ease;
}

.text-button {
  margin-top: 28px;
}

.story-stage {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  padding: clamp(44px, 5vw, 78px);
  background: var(--aqua-soft);
  border: 1px solid rgba(0, 110, 120, 0.09);
  border-radius: 30px;
}

.story-stage::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), transparent 62%);
  pointer-events: none;
}

.message-context {
  position: relative;
  z-index: 1;
  width: min(620px, 82%);
  min-height: 370px;
  padding: 34px clamp(30px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(10, 17, 19, 0.08);
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(38, 95, 100, 0.09);
}

.message-to {
  margin: 0 0 4px;
  color: #90999b;
  font-size: 12px;
}

.message-subject {
  margin: 0 0 44px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.message-text {
  margin: 0 0 18px;
  color: #30393b;
  font-size: 17px;
  line-height: 1.65;
}

.selection-copy {
  padding: 2px 0;
  background: rgba(81, 153, 255, 0.21);
  box-shadow: 3px 0 rgba(81, 153, 255, 0.21), -3px 0 rgba(81, 153, 255, 0.21);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.story-stage[data-state="result"] .selection-copy {
  background: rgba(0, 110, 120, 0.08);
  box-shadow: 3px 0 rgba(0, 110, 120, 0.08), -3px 0 rgba(0, 110, 120, 0.08);
}

.actual-rewrite-panel {
  position: absolute;
  z-index: 3;
  right: clamp(18px, 4vw, 60px);
  bottom: 66px;
  width: min(396px, 53%);
}

.story-rewrite-card {
  width: 100%;
}

.playback-status {
  position: absolute;
  z-index: 4;
  bottom: 23px;
  left: clamp(30px, 5vw, 76px);
  display: flex;
  align-items: center;
  gap: 9px;
  color: #667174;
  font-size: 11px;
}

.playback-status span {
  width: 7px;
  height: 7px;
  background: #22a78c;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(34, 167, 140, 0.11);
  animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse {
  50% {
    box-shadow: 0 0 0 9px rgba(34, 167, 140, 0);
  }
}

.correction-story {
  grid-template-columns: minmax(620px, 1.55fr) minmax(280px, 0.72fr);
}

.correction-canvas {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  padding: clamp(48px, 6vw, 88px);
  background: #f3f4f2;
  border-radius: 30px;
}

.canvas-label {
  color: #92999a;
}

.correction-sentence {
  max-width: 690px;
  margin: clamp(94px, 11vw, 150px) 0 0;
  font-size: clamp(31px, 3.4vw, 52px);
  font-weight: 480;
  letter-spacing: -0.047em;
  line-height: 1.18;
}

.correction-panel {
  --card-left: 52%;
  --card-top: 58%;
  position: absolute;
  z-index: 3;
  top: var(--card-top);
  left: var(--card-left);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.97);
  transform-origin: top left;
  transition: opacity 140ms var(--ease-out), transform 180ms var(--ease-out);
}

.correction-canvas.is-playing .correction-panel {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition-delay: 220ms;
}

.canvas-replay {
  position: absolute;
  right: 28px;
  top: 26px;
  min-width: 44px;
}

.voice-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(120px, 13vw, 200px) var(--page);
}

/* 03/Learn follows the same section grammar as 01 and 02: kicker directly
   above its heading (design-improvement-plan.md 15A). */
.voice-heading-copy {
  max-width: 760px;
}

.voice-heading-copy .section-index {
  margin-bottom: 20px;
}

.voice-heading-copy p:not(.section-index) {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.voice-product {
  max-width: 1120px;
  margin-top: clamp(60px, 8vw, 110px);
  margin-right: auto;
  margin-left: auto;
}

.voice-window {
  position: relative;
  overflow: hidden;
  background: rgba(246, 247, 246, 0.98);
  border: 1px solid rgba(10, 17, 19, 0.11);
  border-radius: var(--radius-l);
  box-shadow: 0 35px 90px rgba(18, 65, 69, 0.12);
}

.voice-titlebar {
  display: grid;
  min-height: 48px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px;
  color: #7d8587;
  border-bottom: 1px solid rgba(10, 17, 19, 0.08);
  font-size: 12px;
  font-weight: 600;
}

.voice-titlebar > span:nth-child(2) {
  color: #555e60;
}

.voice-titlebar > span:last-child {
  justify-self: end;
}

.voice-traffic {
  display: flex;
  gap: 6px;
}

.voice-traffic i {
  width: 9px;
  height: 9px;
  background: #d5d8d7;
  border-radius: 50%;
}

.voice-card-app {
  padding: clamp(24px, 4vw, 44px);
  background: linear-gradient(145deg, rgba(232, 249, 249, 0.78), rgba(246, 250, 249, 0.92));
}

.voice-card-app h3 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.voice-card-group {
  padding: 18px;
  background: rgba(255, 255, 255, 0.67);
  border: 1px solid rgba(10, 17, 19, 0.08);
  border-radius: var(--radius-m);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.82), 0 13px 35px rgba(25, 72, 76, 0.06);
  transition: opacity 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}

.voice-card-group h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 690;
}

.descriptor-row,
.variant-row,
.exemplar-copy,
.voice-input-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #30383a;
  font-size: 13px;
}

.descriptor-row + .descriptor-row {
  border-top: 1px solid rgba(10, 17, 19, 0.055);
}

.descriptor-row button,
.voice-input-row button,
.exemplar-copy button,
.voice-save {
  min-height: 28px;
  padding: 0 12px;
  color: #777f81;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(10, 17, 19, 0.08);
  border-radius: 9px;
  font-size: 12px;
}

.voice-input-row {
  min-height: 36px;
  margin-top: 8px;
  padding-left: 10px;
  color: #9a9fa1;
  background: rgba(10, 17, 19, 0.045);
  border: 1px solid rgba(10, 17, 19, 0.045);
  border-radius: 10px;
}

.voice-input-row button {
  align-self: stretch;
  border-radius: 0 9px 9px 0;
}

.voice-exemplars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.variant-row {
  min-height: 24px;
  color: #596365;
}

.variant-row small {
  color: #979d9f;
  font-size: 10px;
}

.exemplar-copy {
  min-height: 54px;
  align-items: flex-start;
  padding: 8px 0;
  line-height: 1.38;
}

.exemplar-copy button {
  width: 28px;
  flex: 0 0 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
}

.voice-save {
  min-width: 70px;
  margin-top: 18px;
  color: white;
  background: var(--teal);
  border-color: transparent;
}

.voice-window[data-focus="descriptors"] .voice-descriptors,
.voice-window[data-focus="languages"] .exemplar-card {
  box-shadow: inset 0 0 0 2px rgba(0, 110, 120, 0.5), 0 14px 38px rgba(0, 110, 120, 0.1);
  transform: translateY(-2px);
}

.voice-window[data-focus="descriptors"] .exemplar-card,
.voice-window[data-focus="languages"] .voice-descriptors {
  opacity: 0.68;
}

.voice-notes {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.voice-notes button {
  min-height: 44px;
  padding: 0 17px;
  color: #667174;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
}

.voice-notes button.is-active {
  color: white;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.privacy-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(100px, 12vw, 180px) var(--page);
  border-top: 1px solid var(--line);
}

/* One privacy composition built from real product artifacts (10A) — not a
   numbered feature grid. */
.privacy-composition {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(40px, 6vw, 100px);
}

.privacy-copy h2 {
  font-size: clamp(44px, 5.4vw, 78px);
}

.privacy-copy .section-kicker {
  margin-bottom: 18px;
}

.privacy-copy > p:not(.section-kicker):not(.privacy-flow) {
  max-width: 520px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.privacy-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 0;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.privacy-flow span:not(.flow-arrow) {
  padding: 7px 14px;
  background: var(--aqua-soft);
  border: 1px solid rgba(0, 110, 120, 0.16);
  border-radius: 999px;
}

.flow-arrow {
  color: var(--teal);
}

.privacy-window {
  overflow: hidden;
  background: rgba(246, 247, 246, 0.98);
  border: 1px solid rgba(10, 17, 19, 0.11);
  border-radius: var(--radius-m);
  box-shadow: 0 30px 80px rgba(18, 65, 69, 0.13);
}

.privacy-window-body {
  padding: 8px 18px 14px;
}

.privacy-window-body p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 13px 4px;
}

.privacy-window-body p + p {
  border-top: 1px solid rgba(10, 17, 19, 0.07);
}

.privacy-window-body b {
  font-size: 14px;
  font-weight: 600;
}

.privacy-window-body span {
  color: var(--muted);
  font-size: 12.5px;
}

.closing-section {
  position: relative;
  display: grid;
  min-height: 690px;
  place-items: center;
  margin: 16px;
  overflow: hidden;
  border-radius: 30px;
  isolation: isolate;
}

.closing-section > img {
  transform: scale(1.04) rotate(180deg);
  filter: saturate(0.78) contrast(0.94);
}

.closing-wash {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(229, 252, 252, 0.42);
  backdrop-filter: blur(1px);
}

.closing-content {
  max-width: 780px;
  padding: 80px var(--page);
  text-align: center;
}

.closing-wordmark {
  height: 42px;
  margin: 0 auto 36px;
}

.closing-content h2 {
  font-size: clamp(55px, 7vw, 100px);
  line-height: 0.94;
}

.closing-content p {
  margin: 28px 0 25px;
  color: #3f5558;
  font-size: 17px;
}

footer {
  display: grid;
  max-width: 1400px;
  min-height: 150px;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: clamp(26px, 4vw, 64px);
  margin: 0 auto;
  padding: 30px var(--page);
  color: #687174;
  font-size: 13px;
}

.footer-brand img {
  height: 27px;
}

footer nav {
  display: flex;
  gap: 28px;
}

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(34px);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 850ms var(--ease-out), transform 950ms var(--ease-out);
}

/* --- Rebuild additions (PR3) --- */

.story-rewrite-card {
  opacity: 1;
  transition: opacity 240ms var(--ease-out), transform 260ms var(--ease-out);
}

.story-stage[data-state="select"] .story-rewrite-card {
  opacity: 0;
  transform: translateY(8px);
}

.message-context {
  width: min(560px, 58%);
}

.actual-rewrite-panel {
  width: min(396px, 40%);
}

.correction-canvas.is-resolved .correction-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition-delay: 0ms;
}

.correction-canvas.is-resolved .issue-mark::after {
  transform: scaleX(0);
}

.issue-mark.is-healed {
  color: var(--teal);
  font-weight: 600;
  animation: healed-settle 1200ms var(--ease-out) forwards;
}

.app-row {
  display: flex;
  max-width: 720px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 36px auto 0;
}

.app-row span {
  padding: 8px 16px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .message-context,
  .actual-rewrite-panel {
    width: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover::after,
  footer nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .correction-apply:hover,
  .correction-dictionary:hover,
  .correction-dismiss:hover {
    background: color-mix(in srgb, var(--issue-color, var(--cat-correctness)) 8%, transparent);
  }

  .text-button:hover,
  .canvas-replay:hover {
    color: var(--teal);
  }

}

@media (max-width: 1040px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
  }

  .menu-button {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 66px;
    right: 22px;
    display: flex;
    min-width: 230px;
    padding: 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(10, 17, 19, 0.08);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(8, 45, 49, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 200ms ease, transform 260ms var(--ease-out);
    backdrop-filter: blur(18px);
  }

  .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-links a {
    padding: 11px 9px;
  }

  .story-section,
  .correction-story {
    grid-template-columns: 1fr;
  }

  .rewrite-story .story-copy {
    order: 0;
  }

  .rewrite-story .story-stage {
    order: 1;
  }

  .correction-story .correction-canvas {
    order: 1;
  }

  .correction-story .story-copy {
    order: 0;
  }

  .story-copy {
    max-width: 650px;
  }

}

@media (max-width: 720px) {
  .hero {
    height: auto;
    min-height: 0;
    margin: 8px;
    padding-bottom: 26px;
    border-radius: 22px;
  }

  .site-header {
    min-height: 66px;
    gap: 16px;
    padding: 0 18px;
  }

  .brand img {
    height: 26px;
  }

  .hero-copy {
    margin-top: 48px;
    padding: 0 18px;
  }

  .hero-kicker {
    margin-bottom: 14px;
    font-size: 10px;
  }

  .hero h1 {
    font-size: clamp(43px, 12.5vw, 60px);
    line-height: 0.96;
  }

  .hero-demo {
    position: static;
    width: calc(100% - 24px);
    margin: 30px auto 0;
    perspective: none;
  }

  .demo-window {
    border-radius: 18px 18px 0 0;
  }

  .demo-titlebar {
    height: 42px;
    padding: 0 14px;
    font-size: 10px;
  }

  .demo-window {
    height: auto;
    border-radius: 18px;
  }

  .demo-exhibit {
    overflow: visible;
  }

  /* 15A: below 720px the card sits in normal flow BELOW the text, never overlaid. */
  .demo-document {
    width: 100%;
    max-width: 100%;
    padding: 20px 22px 0;
  }

  .demo-document .document-line,
  .document-support {
    font-size: 14px;
    line-height: 1.58;
  }

  .suggestion-slot {
    position: static;
    width: 100%;
    margin: 0;
    padding: 18px 22px 22px;
    justify-content: flex-start;
    transform: none;
  }

  .hotkey-chip {
    position: static;
    margin: 16px 22px 0;
  }

  .titlebar-hint {
    display: none;
  }

  .demo-timeline {
    height: 64px;
  }

  .demo-timeline button {
    display: block;
    padding: 10px 8px;
    font-size: 10px;
    text-align: center;
  }

  .demo-timeline span {
    display: block;
    margin-bottom: 3px;
  }

  .intro-section {
    padding-top: 110px;
    padding-bottom: 110px;
  }

  .intro-section h2 {
    font-size: 43px;
  }

  .section-copy {
    font-size: 17px;
  }

  .story-section,
  .correction-story {
    min-height: 0;
    gap: 48px;
    padding-top: 90px;
    padding-bottom: 90px;
  }

  .story-copy h2,
  .voice-heading-copy h2 {
    font-size: 43px;
  }

  .story-copy > p:not(.section-index) {
    font-size: 16px;
  }

  .story-stage {
    min-height: 540px;
    padding: 22px;
    border-radius: 22px;
  }

  .message-context {
    width: 100%;
    min-height: 330px;
    padding: 28px 24px;
  }

  .message-subject {
    margin-bottom: 30px;
  }

  .message-text {
    font-size: 14px;
  }

  .actual-rewrite-panel {
    position: static;
    width: 100%;
    margin: 18px 0 34px;
  }

  .playback-status {
    bottom: 18px;
    left: 25px;
  }

  .correction-canvas {
    min-height: 650px;
    padding: 34px 26px;
    border-radius: 22px;
  }

  .correction-sentence {
    margin-top: 88px;
    font-size: 32px;
  }

  .correction-panel {
    position: static;
    width: min(264px, 100%);
    margin: 26px 0 0;
  }

  .voice-section {
    padding-top: 100px;
    padding-bottom: 100px;
  }

  .voice-heading-copy p:not(.section-index) {
    font-size: 15px;
  }

  .voice-product {
    margin-top: 55px;
  }

  .voice-window {
    width: 100%;
    margin-left: 0;
    border-radius: 18px;
  }

  .voice-titlebar {
    min-height: 42px;
    padding: 0 12px;
    font-size: 10px;
  }

  .voice-card-app {
    padding: 16px;
  }

  .voice-card-app h3 {
    margin-bottom: 14px;
    font-size: 20px;
  }

  .voice-card-group {
    padding: 14px;
    border-radius: 14px;
  }

  .voice-exemplars {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  .descriptor-row,
  .variant-row,
  .exemplar-copy,
  .voice-input-row {
    font-size: 12px;
  }

  .voice-input-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .voice-notes {
    align-items: stretch;
    flex-direction: column;
  }

  .privacy-section {
    padding-top: 90px;
    padding-bottom: 90px;
  }

  .privacy-composition {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .privacy-copy h2 {
    font-size: 52px;
  }

  .privacy-flow {
    flex-wrap: wrap;
  }

  .closing-section {
    min-height: 620px;
    margin: 8px;
    border-radius: 22px;
  }

  .closing-content h2 {
    font-size: 56px;
  }

  footer {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-top: 45px;
    padding-bottom: 45px;
  }

  footer nav {
    justify-self: end;
  }

  footer > p:last-child {
    justify-self: end;
  }

}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-atmosphere {
    transform: scale(1.04);
  }
}
