/* Tokens. The decisions behind each value are in DESIGN.md; change them there first. */
:root {
  --surface: #ffffff;      /* the page */
  --band: #f7f7f8;         /* alternate sections: setup, measurement */
  --line: #e6e6e9;         /* hairlines: header, bands, table rows, cards */
  --line-strong: #c9c9d0;  /* hovered outlines */
  --bar-other: #8c8c96;    /* other systems' bars — 3.1:1 on the band, 3.3:1 on white */
  --ink: #111114;          /* text — 18.9:1 on white */
  --ink-2: #55555e;        /* secondary text — 7.4:1 on white, 6.9:1 on the band */
  --ink-3: #6b6b75;        /* captions and notes — 5.3:1 on white, 4.9:1 on the band */
  --accent: #b23c0a;       /* actions only: links, buttons, focus — and the mark. 5.9:1 on white */
  --accent-strong: #93310a;
  --term: #111114;         /* the example terminal */
  --term-raise: #1c1c21;
  --term-line: #2c2c33;
  --term-ink: #ececf1;
  --term-dim: #a3a3ae;     /* 7.5:1 on the terminal */
  --term-key: #f0a37a;     /* prompts and tool names in the terminal — 9.2:1 */
  --wrap: 1180px;
  --gutter: 24px;
  --jp: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', Meiryo, 'Noto Sans JP', sans-serif;
  --sans: Geist, system-ui, -apple-system, 'Segoe UI', Roboto, var(--jp);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, var(--jp);
}

@font-face {
  font-family: Geist;
  src: url('/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  font-synthesis: none;
  overflow-wrap: break-word;
}

html[lang="ja"] body { line-height: 1.8; }

h1, h2 { margin: 0; font-weight: 600; text-wrap: balance; }
html[lang="ja"] h1, html[lang="ja"] h2 { word-break: auto-phrase; overflow-wrap: anywhere; font-feature-settings: "palt"; letter-spacing: 0; }

p { margin: 0 0 1rem; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--band);
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 6px;
  z-index: 10;
}

.skip:focus { top: 0.75rem; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 18px; text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.mark { width: 26px; height: 26px; flex: none; }

.nav-row { display: flex; align-items: center; gap: 24px; }
.nav { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: underline; }

/* The language switch appears only when the script that drives it has run. */
.lang { display: none; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.js .lang { display: inline-flex; }
.lang button { appearance: none; margin: 0; border: 0; background: transparent; color: var(--ink-2); font: 500 13px/1 var(--sans); padding: 8px 10px; cursor: pointer; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 500 16px/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

html[lang="ja"] .btn { font-feature-settings: "palt"; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 7px; }

/* Hero */

.hero { padding: 88px 0 96px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.01em; }
html[lang="ja"] .hero h1 { font-size: clamp(32px, 3.9vw, 48px); line-height: 1.3; }
.lead { margin: 24px 0 36px; max-width: 34em; color: var(--ink-2); font-size: 19px; }
html[lang="ja"] .lead { font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.works { margin: 28px 0 0; color: var(--ink-3); font-size: 15px; }
.works strong { color: var(--ink-2); font-weight: 500; }

/* The example: a terminal-like panel, drawn from what the product does. */

.example { margin: 0; }
.term { overflow: hidden; border: 1px solid #000; border-radius: 14px; background: var(--term); color: var(--term-ink); box-shadow: 0 30px 60px -30px rgba(17, 17, 20, 0.45); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--term-line); }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3a42; }
.term-title { margin-left: 10px; color: var(--term-dim); font: 500 13px/1 var(--mono); }
.session { padding: 18px 20px; font: 400 14px/1.65 var(--mono); }
html[lang="ja"] .session { line-height: 1.8; }
.session + .session { border-top: 1px dashed var(--term-line); }
.session-head { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--term-dim); font: 500 12px/1 var(--sans); }
.you { color: #fff; }
.you::before { content: '> '; color: var(--term-key); }
.agent { margin-top: 8px; color: var(--term-dim); }
.tool { display: inline-block; margin-top: 8px; padding: 2px 8px; border: 1px solid var(--term-line); border-radius: 5px; background: var(--term-raise); color: var(--term-key); }
.quote { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--term-key); border-radius: 0 6px 6px 0; background: var(--term-raise); color: var(--term-ink); }
.quote small { display: block; margin-top: 6px; color: var(--term-dim); font-size: 12px; }
.example figcaption { margin: 12px 4px 0; color: var(--ink-3); font-size: 13px; }

/* Sections */

.section { padding: 88px 0; }
.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.section h2 { font-size: 34px; line-height: 1.15; letter-spacing: -0.005em; margin-bottom: 18px; }
html[lang="ja"] .section h2 { font-size: 28px; line-height: 1.4; }
.section p { color: var(--ink-2); }
.section p strong { color: var(--ink); font-weight: 600; }

/* The setup prompt: shown in full at every width, never in an inner scroll box. */

.prompt-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.prompt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.prompt-label { font-weight: 500; font-size: 15px; }
.prompt {
  margin: 0;
  padding: 20px 18px;
  color: var(--ink);
  font: 400 15px/1.65 var(--sans);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
html[lang="ja"] .prompt { line-height: 1.85; }
.prompt:focus-visible { outline-offset: -3px; }

/* Copy feedback: shown only after the visitor presses a copy button. */

.copy-status { margin: 16px 0 0; padding: 8px 0 8px 14px; border-left: 3px solid var(--ink); color: var(--ink); font-size: 15px; }
.copy-status[data-state="error"] { border-left-color: var(--accent); }
.copy-status[hidden] { display: none; }
.prompt-panel .copy-status { margin: 0; padding: 12px 18px; border-left: 0; border-top: 1px solid var(--line); }
.prompt-panel .copy-status[data-state="error"] { box-shadow: inset 3px 0 0 var(--accent); }

/* Links and the measurement table */

.links, .footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 16px; padding: 0; list-style: none; }
.note { color: var(--ink-3); font-size: 15px; }

/* Measured figures under the opening: each number links to how it was measured below. */

.proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; margin: 64px 0 0; padding: 28px 0 0; border-top: 1px solid var(--line); list-style: none; }
.proof li { display: flex; flex-direction: column; gap: 6px; }
.proof-n { font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
html[lang="ja"] .proof-n { letter-spacing: 0; font-feature-settings: "palt"; }
.proof-l { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.proof-more { margin: 16px 0 0; font-size: 15px; }

/* Token comparison: one horizontal bar per system, on one linear scale from zero. CPersona's rows are
   ink and named; the others are grey. Every value is printed, so nothing depends on colour or hover. */

.tokens { margin: 0 0 16px; }
.tokens figcaption { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.bars, .bars thead, .bars tbody { display: block; width: 100%; }
.bars tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bars tbody tr:last-child { border-bottom: 1px solid var(--line); }
.bars thead tr { padding: 0 0 8px; border-top: 0; }
.bars thead th { color: var(--ink-3); font-size: 13px; font-weight: 500; text-align: left; }
.bars thead th:nth-child(2) { text-align: right; }
.bars tbody th { font-weight: 500; text-align: left; }
.bars .acc { color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.bars .bar-cell { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.bar { display: block; flex: none; height: 10px; width: calc(var(--v) / 12379 * (100% - 72px)); min-width: 4px; border-radius: 0 4px 4px 0; background: var(--bar-other); }
.bars .val { color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.bars .ours .bar { background: var(--ink); }
.bars .ours th, .bars .ours .acc, .bars .ours .val { color: var(--ink); font-weight: 600; }
.tag { margin-left: 6px; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Partner page */

.partner-hero .lead { max-width: 40em; }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; padding: 0; list-style: none; }
.roles li { padding: 18px 0; border-top: 1px solid var(--line); }
.roles h3, .split-roles dt { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.roles p { margin: 0; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding: 12px 0 12px 26px; border-top: 1px solid var(--line); color: var(--ink-2); }
.checklist li:last-child { border-bottom: 1px solid var(--line); }
.checklist li::before { content: ''; position: absolute; left: 4px; top: 1.15em; width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }
.terms-lead { color: var(--ink) !important; font-size: 19px; font-weight: 600; }
.split-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; margin: 24px 0; }
.split-roles div { padding-top: 14px; border-top: 2px solid var(--ink); }
.split-roles dd { margin: 0; color: var(--ink-2); }

/* The partner invitation on the home page */

.invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.invite p { max-width: 40em; margin: 0; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-links { margin: 0; font-size: 15px; }

/* Narrow screens */

@media (max-width: 900px) {
  .hero { padding: 48px 0 56px; }
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .section { padding: 56px 0; }
  .header-cta { display: none; }
  .proof { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 40px; }
  .roles, .split-roles { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .lead { font-size: 17px; }
  .actions .btn { flex: 1 1 100%; }
  .nav-row, .nav { gap: 14px; }
  .session { padding: 16px; font-size: 13px; }
  .section h2 { font-size: 28px; }
  html[lang="ja"] .section h2 { font-size: 24px; }
}

@media (max-width: 400px) {
  .header-row { gap: 8px; }
  .nav-row, .nav { gap: 10px; }
  .nav a { font-size: 14px; }
  .lang button { padding: 7px 7px; }
  .wordmark { gap: 8px; font-size: 17px; }
}
