/* Shared kit for the pages on design/DESIGN.md (/research, /global). Two brand colours with fixed jobs:
   藍 (indigo) is the ground: hero, contact and footer are 藍 bands; selection, source numbers and links are 藍.
   朱 (vermilion) is for doing: every CTA, and the "why now" signals.
   Paper sections sit between the bands. Light/dark follow the system; a .band is always dark inside (color-scheme: dark),
   so the ordinary tokens (--ink, --muted, --line, --shu-hi) already give light-on-藍 there: never hard-code on-dark colours.
   A .pop (product window, form) inside a band follows the page theme again.
   Every colour, shadow and radius is a token here; page stylesheets only use them. */
:root {
  color-scheme: light dark;
  --paper: light-dark(#f6f5f1, #0b111c);
  --sunk: light-dark(#ecebe5, #0f1726);
  --surface: light-dark(#ffffff, #141e30);
  --surface-2: light-dark(#f4f3ef, #1a2539);
  --ink: light-dark(#111722, #edf1f7);
  --ink-2: light-dark(#363d48, #c6cfdc);
  --muted: light-dark(#5b626d, #97a3b6);
  --faint: light-dark(#8a909a, #6b7891);
  --line: light-dark(#e2dfd7, #233049);
  --line-2: light-dark(#d1cdc3, #304063);

  --ai-deep: #0e2249;     /* band ground: fixed, bands are 藍 in both themes */
  --ai-deep-2: #1d4688;   /* band glow */
  --ac: light-dark(#24508f, #93b4ea);          /* 藍: selection, numbers, links */
  --ac-soft: light-dark(#e8eef8, #1b2c4b);
  --ac-line: light-dark(#c4d3ea, #2f4a7a);

  --shu: #c9421c;                               /* 朱: CTA fill, 4.9:1 with white */
  --shu-hover: #ad3613;
  --shu-hi: light-dark(#c9421c, #ff7a50);       /* 朱 as text/line */
  --shu-soft: light-dark(#fbeae3, #3a1d13);
  --on-shu: #fff;                               /* text on a 朱 fill; also the plate behind the logo mark */
  --band-glow: radial-gradient(60% 70% at 85% 0%, var(--ai-deep-2) 0%, transparent 70%);

  --ok: light-dark(#2e7d46, #6cc28a);
  --warn: light-dark(#9a6700, #e8b45a);
  --warn-soft: light-dark(#fbf1dc, #2e2210);
  --danger: light-dark(#b42318, #ff8a7a);

  --shadow: 0 1px 2px rgb(12 29 59 / .08);
  --shadow-lg: 0 2px 4px rgb(6 14 30 / .12), 0 30px 80px -30px rgb(6 14 30 / .55);
  --shadow-edge: -24px 0 48px -32px rgb(6 14 30 / .35);
  --shadow-shu: 0 1px 0 rgb(255 255 255 / .18) inset, 0 6px 18px -8px rgb(201 66 28 / .7);
  --shadow-shu-hover: 0 1px 0 rgb(255 255 255 / .18) inset, 0 10px 26px -10px rgb(201 66 28 / .85);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sans: "Instrument Sans", "Noto Sans JP", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-panel: 16px; --r-input: 10px; --r-tag: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.75 var(--sans); font-feature-settings: "palt" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
h1, h2, p, b, dd, summary { word-break: auto-phrase; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .86em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.muted { color: var(--muted); }

/* ---------- theme blocks ---------- */
.band { color-scheme: dark; background: var(--band-glow), var(--ai-deep); color: var(--ink); }
.band .pop { color-scheme: light dark; color: var(--ink); }
.sunk { background: var(--sunk); }

.frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
/* the one way to float something: product windows on a coloured ground (hero, stage, bands) */
.lift { box-shadow: var(--shadow-lg); border-color: transparent; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; background: var(--shu); color: var(--on-shu); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .2s var(--ease), background .2s, box-shadow .25s var(--ease), border-color .2s; box-shadow: var(--shadow-shu); }
.btn:hover { background: var(--shu-hover); box-shadow: var(--shadow-shu-hover); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: var(--ink); box-shadow: none; }
.btn-block { width: 100%; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

/* ---------- nav: 藍 over the hero, paper once scrolled ---------- */
.nav { position: sticky; top: 0; z-index: 20; color-scheme: dark; background: var(--ai-deep); color: var(--ink); transition: background .35s, box-shadow .35s; }
.nav.scrolled { color-scheme: light dark; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav-in { display: flex; align-items: center; gap: 36px; height: 68px; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; font-weight: 600; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 26px; height: 26px; align-self: center; border-radius: var(--r-tag); background: var(--on-shu); }
.brand span { font-weight: 500; font-size: 14px; color: var(--muted); letter-spacing: 0; }
.nav-links { display: flex; gap: 28px; margin-right: auto; font-size: 14px; color: var(--muted); }
.nav-links a { text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 900px) { .nav-links { display: none; } .nav-in { justify-content: space-between; } }
/* phones: the sticky bottom CTA takes over, so the header keeps only the brand */
@media (max-width: 640px) { .nav .btn { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; display: flow-root; padding-top: 72px; overflow-x: clip; }
.hero-in { position: relative; }
.hero-copy { position: relative; max-width: 760px; padding-bottom: 64px; }
.hero-title { font-size: clamp(34px, 4.4vw, 62px); line-height: 1.18; font-weight: 900; letter-spacing: -.04em; }
@media (max-width: 900px) { br.pc { display: none; } }
@media (max-width: 640px) { .hero-title { font-size: clamp(24px, 7.2vw, 34px); } }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; }
.anim .hero-title .line > span { transform: translateY(105%); animation: lineup 1s var(--ease) forwards; animation-delay: calc(var(--d, 0s) + .1s); }
@keyframes lineup { to { transform: none; } }
.hero-sub { margin-top: 26px; max-width: 40em; color: var(--ink-2); font-size: 18px; line-height: 1.85; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
@media (max-width: 900px) { .hero { padding-top: 48px; } .hero-sub { font-size: 16px; } }
.anim .reveal-up { opacity: 0; transform: translateY(16px); animation: fadeup .9s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes fadeup { to { opacity: 1; transform: none; } }

/* ---------- citation + tags ---------- */
.cite { display: inline-flex; align-items: baseline; gap: 1px; margin-left: 3px; padding: 0 2px; border: 0; border-radius: 4px; background: none; font: 600 12px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ac); cursor: default; }
.cite::before { content: "["; color: var(--faint); }
.cite::after { content: "]"; color: var(--faint); }
.cite.ok::before { content: "✓ ["; color: var(--ok); }
.tag { margin-left: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.guess { color: var(--warn); }
.tag.guess::before { content: "△ "; }
.tag.none { color: var(--faint); }

.caption { font-size: 13px; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 128px 0; }
.section-tight { padding: 104px 0; }
@media (max-width: 640px) { .section { padding: 80px 0; } .section-tight { padding: 64px 0; } }
.h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.22; font-weight: 900; letter-spacing: -.035em; text-wrap: balance; }
.lead { margin-top: 18px; max-width: 34em; color: var(--muted); font-size: 17px; line-height: 1.85; }
.anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.anim .reveal.in { opacity: 1; transform: none; }

/* ---------- contact: 藍 band ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 72px; align-items: start; }
.gets { display: grid; gap: 0; margin-top: 44px; }
.gets div { display: grid; grid-template-columns: 120px 1fr; align-items: baseline; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line-2); }
.gets dt { font-size: 26px; font-weight: 900; letter-spacing: -.03em; }
.gets dd { color: var(--ink-2); }
.after { display: grid; gap: 14px; margin-top: 36px; counter-reset: step; }
.after li { display: grid; grid-template-columns: 30px 1fr; column-gap: 14px; counter-increment: step; }
.after li::before { content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--muted); font-size: 13px; font-weight: 700; }
.after b { font-weight: 700; }
.after span { color: var(--muted); font-size: 14px; }

.form { display: grid; gap: 18px; padding: 36px; }
.field { display: grid; gap: 8px; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.opt { margin-left: 8px; font-size: 12px; color: var(--muted); font-weight: 400; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-input); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: 400 15px/1.6 var(--sans); transition: border-color .2s, box-shadow .2s, background .2s; }
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ac); background: var(--surface); box-shadow: 0 0 0 4px var(--ac-soft); }
.hint { color: var(--ac); font-size: 13px; }
.hint:empty { display: none; }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: 12.5px; color: var(--muted); text-align: center; }
.form-note a { color: var(--ac); }
.form-msg { font-size: 14px; text-align: center; }
.form-msg:empty { display: none; }
.form-msg[data-state="error"] { color: var(--danger); }
.contact-done { color-scheme: light dark; color: var(--ink); padding: 56px 36px; text-align: center; animation: fadeup .6s var(--ease); }
.contact-done strong { display: block; font-size: 22px; margin-bottom: 8px; }
.contact-done p { color: var(--muted); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 640px) { .field-2 { grid-template-columns: 1fr; } .form { padding: 22px; } .gets div { grid-template-columns: 90px 1fr; } .gets dt { font-size: 20px; } }

/* ---------- phone: keep the CTA within reach ---------- */
.sticky-cta { display: none; }
@media (max-width: 640px) {
  .sticky-cta { display: flex; justify-content: center; align-items: center; position: fixed; z-index: 15; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 52px; border-radius: 999px; background: var(--shu); color: var(--on-shu); font-weight: 700; text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(140%); transition: transform .4s var(--ease); }
  .sticky-cta.show { transform: none; }
}

/* ---------- footer ---------- */
.foot { padding: 28px 0 36px; font-size: 13px; color: var(--muted); background: var(--ai-deep); border-top: 1px solid var(--line); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
