/* Values come from ../DESIGN.md. Change DESIGN.md first, then the matching variable here. */
:root {
  /* colors */
  --color-primary: #3888B0;
  --color-primary-bright: #85CFFA;
  --color-on-primary: #FFFFFF;
  --color-primary-strong: #2A6F93;
  --color-primary-deep: #1F5675;
  --color-secondary: #804898;
  --color-secondary-bright: #C99BE0;
  --color-tertiary: #FDB966;
  --color-neutral: #C8C8C8;
  --color-background: #070B14;
  --color-surface: #0E1524;
  --color-surface-raised: #141D31;
  --color-outline: #24304A;
  --color-on-surface: #E8EEF7;
  --color-on-surface-muted: #9AA8BF;

  /* typography */
  --font-sans: "Hanken Grotesk", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-display: 3.5rem;
  --text-display-sm: 2.125rem;
  --text-headline: 1.375rem;
  --text-body-lg: 1.0625rem;
  --text-body-md: 0.9375rem;
  --text-label-caps: 0.75rem;
  --text-label-md: 0.875rem;
  --tracking-display: -0.01em;
  --tracking-label-caps: 0.2em;

  /* rounded */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 40px;
  --spacing-xxl: 72px;
  --spacing-page-margin: 24px;
  --spacing-page-margin-mobile: 16px;
  --spacing-content-max: 1120px;
  --spacing-card-gap: 24px;

  /* motion (DESIGN.md › Components › Motion) */
  --motion-fast: 150ms;
  --motion-enter: 600ms;
  --motion-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --motion-stagger: 80ms;

  /* depth (DESIGN.md › Elevation & Depth) */
  --glow-opacity: 0.45;
  --grid-opacity: 0.45;
  --card-shadow: none;
  --card-shadow-hover: 0 16px 40px color-mix(in srgb, var(--color-primary) 25%, transparent);

  color-scheme: dark;
}

/* light theme: DESIGN.md light-* colors override the same --color-* variables */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --color-primary-bright: #2A6F93;
    --color-secondary-bright: #804898;
    --color-tertiary: #8A5300;
    --color-neutral: #5C6470;
    --color-background: #F5F7FB;
    --color-surface: #FFFFFF;
    --color-surface-raised: #EEF3F9;
    --color-outline: #D5DEEA;
    --color-on-surface: #0E1524;
    --color-on-surface-muted: #4A5872;

    --glow-opacity: 0.18;
    --grid-opacity: 0.7;
    --card-shadow:
      0 1px 2px color-mix(in srgb, #0E1524 6%, transparent),
      0 4px 16px color-mix(in srgb, #0E1524 4%, transparent);
    --card-shadow-hover:
      0 16px 40px color-mix(in srgb, var(--color-primary) 18%, transparent),
      0 2px 6px color-mix(in srgb, #0E1524 8%, transparent);

    color-scheme: light;
  }
}

/* The header switch forcing light (see DESIGN.md › Components › theme-switch). Same values as the media block
   above; check-design.sh compares the two blocks so they cannot drift. */
:root[data-theme="light"] {
  --color-primary-bright: #2A6F93;
  --color-secondary-bright: #804898;
  --color-tertiary: #8A5300;
  --color-neutral: #5C6470;
  --color-background: #F5F7FB;
  --color-surface: #FFFFFF;
  --color-surface-raised: #EEF3F9;
  --color-outline: #D5DEEA;
  --color-on-surface: #0E1524;
  --color-on-surface-muted: #4A5872;

  --glow-opacity: 0.18;
  --grid-opacity: 0.7;
  --card-shadow:
    0 1px 2px color-mix(in srgb, #0E1524 6%, transparent),
    0 4px 16px color-mix(in srgb, #0E1524 4%, transparent);
  --card-shadow-hover:
    0 16px 40px color-mix(in srgb, var(--color-primary) 18%, transparent),
    0 2px 6px color-mix(in srgb, #0E1524 8%, transparent);

  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body-md);
  line-height: 1.75;
  color: var(--color-on-surface);
  background: var(--color-background);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: calc(var(--spacing-content-max) + 2 * var(--spacing-page-margin));
  margin: 0 auto;
  padding: 0 var(--spacing-page-margin);
}

/* site-header */
.site-header {
  position: relative;
  z-index: 2;
  height: 64px;
  display: flex;
  align-items: center;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-md); }
.logo {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-on-primary);
  border-radius: var(--radius-sm);
}
.logo img { height: 28px; width: auto; }
.header-link {
  font-size: var(--text-label-md);
  font-weight: 700;
  color: var(--color-on-surface-muted);
  text-decoration: none;
  transition: color var(--motion-fast) var(--motion-ease);
}
.header-link:hover, .header-link:focus-visible { color: var(--color-primary-bright); }

/* theme-switch: 自動 / ライト / ダーク (DESIGN.md › Components › theme-switch) */
.header-actions { display: flex; align-items: center; gap: var(--spacing-md); }
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-surface) 60%, transparent);
}
.theme-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-surface-muted);
  font: inherit;
  font-size: var(--text-label-md);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color var(--motion-fast) var(--motion-ease), background-color var(--motion-fast) var(--motion-ease);
}
.theme-option:hover { color: var(--color-on-surface); }
.theme-option[aria-pressed="true"] {
  background: var(--color-surface-raised);
  color: var(--color-on-surface);
  box-shadow: inset 0 0 0 1px var(--color-outline);
}
.theme-option:focus-visible {
  outline: 2px solid var(--color-primary-bright);
  outline-offset: 2px;
}
.theme-icon { display: inline-flex; width: 16px; height: 16px; }
.theme-icon svg { width: 16px; height: 16px; display: block; }
@media (max-width: 640px) {
  .header-actions .header-link { display: none; }
  .theme-option { padding: 8px 11px; min-width: 40px; min-height: 36px; justify-content: center; }
  .theme-option .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* hero */
.hero {
  position: relative;
  padding: var(--spacing-xxl) 0;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: -64px 0 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-outline) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-outline) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: var(--grid-opacity);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 30% 35%, #000 20%, transparent 75%);
}
.glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: var(--radius-full);
  filter: blur(90px);
  opacity: var(--glow-opacity);
  animation: drift 20s ease-in-out infinite alternate;
}
.glow-blue { background: var(--color-primary); top: -160px; left: -120px; }
.glow-purple { background: var(--color-secondary); top: 40px; right: -160px; animation-delay: -10s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(60px, 40px, 0) scale(1.12); }
}

.hero-eyebrow, .demo-card-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-label-caps);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--tracking-label-caps);
  text-transform: uppercase;
}
.hero-eyebrow { margin: 0 0 var(--spacing-lg); color: var(--color-primary-bright); }
.hero-claim {
  margin: 0 0 var(--spacing-lg);
  font-weight: 700;
  line-height: 1.3;
}
.hero-claim-first {
  display: block;
  font-size: clamp(4rem, 13vw, 8.5rem);
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  color: var(--color-primary-bright);
}
.hero-claim-body { display: block; margin-top: var(--spacing-sm); font-size: clamp(1.4rem, 2.6vw, 2.1rem); max-width: 24em; }
.hero-claim small { font-size: var(--text-label-md); font-weight: 400; color: var(--color-on-surface-muted); white-space: nowrap; }
.hero-stat {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--spacing-sm) var(--spacing-md);
  margin: 0 0 var(--spacing-lg);
}
.hero-stat-num {
  font-family: var(--font-mono);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary-bright);
}
.hero-stat-unit { font-size: 0.4em; margin-left: 0.15em; }
.hero-stat-label { font-size: var(--text-body-md); color: var(--color-on-surface-muted); }
.hero-title {
  margin: 0 0 var(--spacing-lg);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: var(--tracking-display);
}
.hero-title span { display: inline-block; }
.hero-title-accent {
  color: var(--color-primary-bright);
}
.hero-lead {
  max-width: 40em;
  margin: 0 0 var(--spacing-xl);
  font-size: var(--text-body-lg);
  line-height: 1.8;
  color: var(--color-on-surface-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-md); }

/* button-primary */
.button-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  height: 44px;
  padding: 0 20px;
  font-size: var(--text-label-md);
  font-weight: 700;
  line-height: 1;
  color: var(--color-on-primary);
  background: var(--color-primary-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--motion-fast) var(--motion-ease);
}
.button-primary:hover, .button-primary:focus-visible { background: var(--color-primary-deep); }

/* button-contact: お問い合わせ (the company site's contact form, new tab) */
.button-contact {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  height: 44px;
  padding: 0 20px;
  font-size: var(--text-label-md);
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary-bright);
  background: transparent;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--motion-fast) var(--motion-ease);
}
.button-contact:hover, .button-contact:focus-visible { background: var(--color-surface-raised); }
.button-contact svg, .footer-contact svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* status-chip */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 12px;
  font-size: var(--text-label-md);
  font-weight: 700;
  line-height: 1;
  color: var(--color-tertiary);
  background: var(--color-surface-raised);
  border-radius: var(--radius-full);
}
.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* demos */
.demos-section { padding: 0 0 var(--spacing-xxl); }
.section-head {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: 0 0 var(--spacing-lg);
}
.section-head h2 {
  margin: 0;
  font-size: var(--text-headline);
  line-height: 1.4;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-outline);
}
.demos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-card-gap);
}
@media (min-width: 720px) {
  .demos { grid-template-columns: repeat(2, 1fr); }
}

/* demo-card */
.demo-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  --demo-card-pad: var(--spacing-lg);
  padding: var(--demo-card-pad);
  color: var(--color-on-surface);
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-lg);
  overflow: hidden; /* the TTS waveform banner is clipped by the rounded corners */
  box-shadow: var(--card-shadow);
  text-decoration: none;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
}
.demo-card:hover, .demo-card:focus-visible {
  background: var(--color-surface-raised);
  border-color: var(--color-primary);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  outline: none;
}
.demo-card-thumbnail {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 0 0 var(--spacing-lg);
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-outline);
  background: var(--color-surface-raised);
}
.demo-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--motion-enter) var(--motion-ease);
}
.demo-card-loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity var(--motion-fast) var(--motion-ease);
}
.demo-card-thumbnail.is-playing .demo-card-loop { opacity: 1; }
.demo-card-thumbnail.is-stopping-instantly .demo-card-loop { transition: none; }
.demo-card:hover .demo-card-thumbnail img, .demo-card:focus-visible .demo-card-thumbnail img { transform: scale(1.03); }
.demo-card-kicker { margin: 0 0 var(--spacing-sm); color: var(--color-secondary-bright); }
.demo-card-title {
  margin: 0 0 var(--spacing-sm);
  font-size: var(--text-headline);
  font-weight: 700;
  line-height: 1.4;
}
.demo-card-description {
  flex: 1;
  margin: 0 0 var(--spacing-lg);
  color: var(--color-on-surface-muted);
}
.demo-card-wave {
  display: block;
  flex: none;
  height: 56px;
  /* カードの中で一番上。左右は本文と同じ内側の余白に合わせ、上は枠から 10px だけ空ける（下は 16px） */
  margin: calc(10px - var(--demo-card-pad)) 0 16px;
  border-radius: 6px;
  background-color: transparent; /* マスクが使えない環境では何も出さない */
  -webkit-mask-image: var(--wave-src);
  mask-image: var(--wave-src);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
}
@supports ((-webkit-mask-image: url(#a)) or (mask-image: url(#a))) {
  .demo-card-wave {
    background-color: var(--color-primary-bright);
    opacity: 0.55;
  }
}
.demo-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-outline);
  font-size: var(--text-label-md);
}
.demo-card-open { font-weight: 700; color: var(--color-primary-bright); }
.demo-card-open::after { content: " →"; display: inline-block; transition: transform var(--motion-fast) var(--motion-ease); }
.demo-card:hover .demo-card-open::after { transform: translateX(4px); }
.demo-card-host { font-family: var(--font-mono); font-size: var(--text-label-caps); color: var(--color-on-surface-muted); overflow-wrap: anywhere; }
.demos-error { color: var(--color-on-surface-muted); }

/* lipsync section: the in-house lipsync model and its benchmark table (bench-table) */
.lipsync-section { padding: 0 0 var(--spacing-xxl); }
.lipsync-lead {
  max-width: 48em;
  margin: 0 0 var(--spacing-lg);
  font-size: var(--text-body-lg);
  line-height: 1.8;
}
.bench-table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}
.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body-md);
  line-height: 1.6;
}
.bench-table caption {
  padding: var(--spacing-md) var(--spacing-lg) 0;
  text-align: left;
  font-size: var(--text-label-md);
  font-weight: 700;
  color: var(--color-on-surface-muted);
}
.bench-table th, .bench-table td {
  padding: var(--spacing-sm) var(--spacing-lg);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-outline);
}
.bench-table td { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.bench-table small { font-weight: 400; color: var(--color-on-surface-muted); }
.bench-table tbody tr:last-child th, .bench-table tbody tr:last-child td { border-bottom: none; }
.bench-table thead th {
  font-size: var(--text-label-md);
  color: var(--color-on-surface-muted);
  white-space: nowrap;
}
.bench-table tbody th { font-weight: 700; }
.bench-table td:nth-child(n+3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bench-table td:last-child { font-weight: 700; color: var(--color-primary-bright); }
.bench-note {
  max-width: 60em;
  margin: var(--spacing-md) 0 0;
  font-size: var(--text-label-md);
  line-height: 1.75;
  color: var(--color-on-surface-muted);
}

/* tts compare section (compare-table): one table for every TTS from tts-compare.json; our row is tinted */
.tts-compare-section { padding: 0 0 var(--spacing-xxl); }
.tts-compare-section[hidden] { display: none; }
.compare-demo-link { display: inline-block; margin-left: var(--spacing-xs); font-weight: 700; color: var(--color-primary-bright); text-decoration: none; }
.compare-demo-link:hover, .compare-demo-link:focus-visible { text-decoration: underline; }
.compare-claim { max-width: 48em; margin: 0 0 var(--spacing-md); font-size: var(--text-body-lg); font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.compare-claim strong { color: var(--color-primary-bright); font-size: 1.35em; white-space: nowrap; }
.compare-claim-mark { margin-left: 2px; font-size: var(--text-label-md); color: var(--color-on-surface-muted); text-decoration: none; vertical-align: super; }
.compare-footnote { overflow-wrap: anywhere; }
.claim-scopes, .claim-rows { margin-top: 0; padding-left: 0; list-style: none; overflow-wrap: anywhere; }
.claim-scopes { margin-bottom: var(--spacing-md); }
.claim-rows li + li { margin-top: var(--spacing-xs); }
.compare-lead { margin: 0 0 var(--spacing-md); font-size: var(--text-label-md); line-height: 1.75; color: var(--color-on-surface-muted); }
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--card-shadow);
}
.compare-table { width: 100%; min-width: 72em; border-collapse: collapse; font-size: var(--text-label-md); line-height: 1.55; }
.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  white-space: nowrap;
  font-weight: 700;
  color: var(--color-on-surface-muted);
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-outline);
}
.compare-table tbody th, .compare-table tbody td {
  padding: var(--spacing-sm) var(--spacing-md);
  vertical-align: top;
  border-top: 1px solid var(--color-outline);
}
.compare-table tbody tr:first-child th, .compare-table tbody tr:first-child td { border-top: none; }
.compare-table thead th:first-child { left: 0; z-index: 3; }
.compare-table .compare-engine { position: sticky; left: 0; z-index: 1; width: 12em; min-width: 12em; text-align: left; background: var(--color-surface); }
.compare-table .compare-name { display: block; font-size: var(--text-body-md); font-weight: 700; line-height: 1.4; }
.compare-table .compare-sub { display: block; margin-top: 2px; font-size: var(--text-label-sm); font-weight: 400; line-height: 1.5; color: var(--color-on-surface-muted); white-space: normal; }
.compare-table .compare-speed-line { display: flex; align-items: baseline; gap: var(--spacing-sm); white-space: nowrap; }
.compare-table .compare-times { font-size: var(--text-body-lg); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.compare-table .compare-rtf { font-family: var(--font-mono); font-size: var(--text-label-sm); color: var(--color-on-surface-muted); font-variant-numeric: tabular-nums; }
.compare-table .compare-note { display: block; margin-top: 2px; font-size: var(--text-label-sm); line-height: 1.5; color: var(--color-on-surface-muted); white-space: normal; }
.compare-table .compare-size { width: 13em; }
.compare-table .compare-speed { width: 10em; }
.compare-table .compare-browser { width: 12em; }
.compare-table .compare-style { width: 15em; }
.compare-table .compare-pitch { width: 12em; }
.compare-table .compare-commercial { width: 14em; }
.compare-table td { overflow-wrap: anywhere; }
/* our row: a tinted background plus a left accent so it stands out at a glance (kojira 2026-10-26) */
.compare-table tr.compare-ours > th,
.compare-table tr.compare-ours > td {
  background: color-mix(in srgb, var(--color-primary) 22%, var(--color-surface));
}
.compare-table tr.compare-ours > th { box-shadow: inset 3px 0 0 var(--color-primary-bright); }
.compare-table tr.compare-ours .compare-times { color: var(--color-primary-bright); }
.compare-how-block { margin: var(--spacing-lg) 0 0; }
.compare-how-title { cursor: pointer; font-size: var(--text-label-md); font-weight: 700; color: var(--color-on-surface-muted); }
.compare-how-title::marker { color: var(--color-on-surface-muted); }
.compare-how-block[open] .compare-how-title { margin-bottom: var(--spacing-sm); }
.compare-how { margin: 0; padding-left: 1.2em; font-size: var(--text-label-md); line-height: 1.75; color: var(--color-on-surface-muted); }
.compare-sources a { color: var(--color-primary-bright); overflow-wrap: anywhere; }

/* lip-sync CPU comparison (2026-10-26): 4 columns that fit without scrolling; the p90 column is desktop only */
.compare-table.compare-4col { min-width: 0; }
.compare-table.compare-4col .compare-engine { position: static; left: auto; width: 38%; min-width: 0; }
.compare-table.compare-4col .compare-speed { width: 22%; }
.compare-table.compare-4col .compare-size { width: 22%; }
.compare-table.compare-4col .compare-slow { width: 18%; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .compare-table.compare-4col .compare-engine { width: 46%; }
  .compare-table.compare-4col .compare-speed { width: 30%; }
  .compare-table.compare-4col .compare-size { width: 24%; }
}

/* narrow screens (kojira 2026-10-26): エンジン / 合成速度 / 必要なダウンロード の 3 列だけを出し、横スクロールをなくす */
.compare-narrow-note { display: none; margin: var(--spacing-sm) 0 0; font-size: var(--text-label-sm); line-height: 1.6; color: var(--color-on-surface-muted); }
@media (max-width: 640px) {
  .compare-table-wrap { overflow-x: visible; }
  .compare-table { min-width: 0; width: 100%; table-layout: fixed; }
  .compare-table thead th { width: auto; }
  .compare-table thead th:nth-child(n+4),
  .compare-table tbody td:nth-child(n+4),
  .compare-table .compare-browser,
  .compare-table .compare-style,
  .compare-table .compare-pitch,
  .compare-table .compare-commercial { display: none; }
  .compare-table .compare-engine { position: static; left: auto; width: 34%; min-width: 0; }
  .compare-table .compare-speed { width: 30%; }
  .compare-table .compare-size { width: 36%; }
  .compare-table .compare-speed-line { flex-wrap: wrap; gap: var(--spacing-xs); }
  .compare-table .compare-times { font-size: var(--text-body-md); }
  .compare-narrow-note { display: block; }
}

@media (max-width: 640px) {
  /* headers may wrap and the sticky column is not needed when everything fits */
  .compare-table thead th { white-space: normal; position: static; overflow-wrap: anywhere; }
  .compare-table thead th, .compare-table tbody th, .compare-table tbody td { padding: var(--spacing-xs) var(--spacing-sm); }
  .compare-table .compare-speed-line { white-space: normal; }
}

/* terms page (terms.html): one readable column on the page background */
.terms { padding: var(--spacing-xl) 0 var(--spacing-xxl); }
.terms .container { max-width: calc(46rem + 2 * var(--spacing-page-margin)); }
.terms-title { margin: 0; font-size: var(--text-display-sm); font-weight: 700; line-height: 1.3; letter-spacing: var(--tracking-display); }
.terms-version { margin: var(--spacing-sm) 0 var(--spacing-lg); font-family: var(--font-mono); font-size: var(--text-label-md); color: var(--color-on-surface-muted); }
.terms section { margin-top: var(--spacing-lg); padding-top: var(--spacing-md); border-top: 1px solid var(--color-outline); }
.terms h2 { margin: 0 0 var(--spacing-sm); font-size: var(--text-headline); font-weight: 700; line-height: 1.4; }
.terms p, .terms li { font-size: var(--text-body-lg); line-height: 1.85; overflow-wrap: anywhere; }
.terms ol { margin: 0; padding-left: 1.6em; }
.terms li + li { margin-top: var(--spacing-xs); }
.terms a { color: var(--color-primary-bright); }
.terms-sign { margin-top: var(--spacing-xl); color: var(--color-on-surface-muted); text-align: right; }

/* site-footer */
.site-footer {
  padding: var(--spacing-xl) 0;
  border-top: 1px solid var(--color-outline);
  font-size: var(--text-body-md);
  color: var(--color-neutral);
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--spacing-sm); }
.site-footer a { color: var(--color-neutral); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--color-primary-bright); }
.site-footer .footer-contact { display: inline-flex; align-items: center; gap: var(--spacing-xs); color: var(--color-primary-bright); font-weight: 700; }

/* enter motion */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal var(--motion-enter) var(--motion-ease) forwards;
  animation-delay: calc(var(--reveal-index, 0) * var(--motion-stagger));
}
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
  .container { padding: 0 var(--spacing-page-margin-mobile); }
  .logo img { height: 24px; }
  .hero { padding: var(--spacing-xl) 0 var(--spacing-xxl); }
  .hero-title { font-size: var(--text-display-sm); line-height: 1.2; }
  .hero-lead { font-size: var(--text-body-md); }
  .demo-card { --demo-card-pad: var(--spacing-md); padding: var(--demo-card-pad); }
  .lipsync-lead { font-size: var(--text-body-md); }
  .bench-table th, .bench-table td { padding: var(--spacing-sm) var(--spacing-md); }
  .compare-table thead th, .compare-table tbody th, .compare-table tbody td { padding: var(--spacing-xs) var(--spacing-sm); }
  .glow { width: 320px; height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 2026-10-26 (kojira: 表の間に隙間がない): spacing between the CPU lip-sync table, its narrow note and the device table */
.lipsync-section .compare-table-wrap { margin: 16px 0 10px; }
.lipsync-section .compare-narrow-note { margin: 0 0 18px; }
.lipsync-section .bench-table-wrap { margin-top: 22px; }

/* 2026-10-26 (kojira): the device fps table — the value cells were right-aligned (copied from the numeric bench table)
   while the header reads from the left. Align both to the left so the values sit under the header. */
.lipsync-section .bench-table th,
.lipsync-section .bench-table td { text-align: left; }

/* 2026-10-26 (kojira): column headers sit in the vertical middle of their cell (the first column is one line, the
   others two or three, so top-aligned headers looked off) */
.lipsync-section .bench-table th,
.lipsync-section .compare-table thead th { vertical-align: middle; }

/* 2026-10-26: the repository note under each section (text only until the repos go public) */
.repo-note { margin-top: 14px; }
.repo-note .repo-link-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
