/* ==========================================================================
   Kaimei AI — site stylesheet
   Light-first design system with a matched dark theme.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-jp: "Noto Sans JP", var(--font-sans);

  --cyan: #3ec8ff;
  --blue: #6b8cff;
  --violet: #a078ff;
  --magenta: #e86bff;
  --pink: #ff6bb5;
  --grad: linear-gradient(90deg, #3ec8ff 0%, #6b8cff 42%, #c86bff 78%, #ff6bb5 100%);
  --grad-v: linear-gradient(180deg, #3ec8ff 0%, #6b8cff 42%, #a078ff 70%, #ff6bb5 100%);
  --toward: linear-gradient(90deg, #6b8cff, #3ec8ff);
  --away: linear-gradient(270deg, #e86bff, #ff6bb5);

  --bg: #fbfbfd;
  --bg-elev: #ffffff;
  --bg-sunken: #f3f4f8;
  --bg-code: #0d0f16;
  --ink: #0b0c10;
  --ink-2: #3f424d;
  --ink-3: #6f7484;
  --ink-4: #a0a4b3;
  --line: rgba(11, 12, 16, 0.08);
  --line-strong: rgba(11, 12, 16, 0.16);
  --accent: #4f63f2;
  --accent-soft: rgba(107, 140, 255, 0.12);
  --header-bg: rgba(251, 251, 253, 0.72);
  --shadow-sm: 0 1px 2px rgba(11, 12, 16, 0.04), 0 2px 8px rgba(11, 12, 16, 0.04);
  --shadow-md: 0 2px 6px rgba(11, 12, 16, 0.05), 0 16px 40px -12px rgba(11, 12, 16, 0.14);
  --shadow-lg: 0 8px 20px -8px rgba(11, 12, 16, 0.12), 0 40px 80px -32px rgba(60, 70, 140, 0.25);
  --aurora-opacity: 0.55;
  --grain-opacity: 0.35;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #090a0f;
  --bg-elev: #111218;
  --bg-sunken: #0d0e14;
  --bg-code: #0b0c12;
  --ink: #f4f5f9;
  --ink-2: #c3c6d3;
  --ink-3: #868b9c;
  --ink-4: #585d6e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #93a4ff;
  --accent-soft: rgba(107, 140, 255, 0.16);
  --header-bg: rgba(9, 10, 15, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.3), 0 16px 40px -12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 20px -8px rgba(0, 0, 0, 0.5), 0 40px 80px -32px rgba(107, 140, 255, 0.25);
  --aurora-opacity: 0.38;
  --grain-opacity: 0.5;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
code, kbd, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(107, 140, 255, 0.28); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.container-narrow { max-width: 780px; }
.container-wide { max-width: 1360px; }
.section { padding-block: clamp(72px, 9vw, 128px); position: relative; }
.section-tight { padding-block: clamp(48px, 6vw, 80px); }
.section-sunken { background: var(--bg-sunken); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: 20px; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.reverse > :first-child { order: 0; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--grad); }
.h1, .h2, .h3, .h4 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
.h1 { font-size: clamp(2.75rem, 7.2vw, 5.75rem); letter-spacing: -0.04em; line-height: 0.98; font-weight: 600; }
.h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); }
.h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); letter-spacing: -0.02em; line-height: 1.2; }
.h4 { font-size: 1.125rem; letter-spacing: -0.01em; line-height: 1.3; }
.lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.muted { color: var(--ink-3); }
.small { font-size: 0.9rem; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.015em; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.06em; /* protect the italic overhang */
}
.jp { font-family: var(--font-jp); font-weight: 500; }
.prose p + p { margin-top: 1em; }
.prose p { color: var(--ink-2); font-size: 1.05rem; }
.prose h2, .prose h3 { margin-top: 2em; margin-bottom: 0.6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul { list-style: disc; padding-left: 1.25em; color: var(--ink-2); }
.prose li + li { margin-top: 0.4em; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid transparent; transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(107, 140, 255, 0.4), 0 12px 28px -10px rgba(107, 140, 255, 0.55); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-sunken); border-color: var(--ink-4); transform: translateY(-1px); }
.btn-grad { background: var(--grad); color: #fff; }
.btn-grad:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -12px rgba(200, 107, 255, 0.6); }
.btn-white { background: #fff; color: #0b0c10; }
.btn-white:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.4); }
.btn-outline-white { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn-outline-white:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); transform: translateY(-1px); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--accent); }
.btn-link svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.btn-link:hover svg { transform: translateX(3px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Pills, chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 8px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-elev);
  font-size: 13px; font-weight: 500; color: var(--ink-2); transition: border-color 0.2s, transform 0.2s var(--ease);
}
.pill:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.pill .dot { width: 18px; height: 18px; border-radius: 999px; background: var(--grad); display: grid; place-items: center; }
.pill .dot::after { content: ""; width: 6px; height: 6px; border-radius: 99px; background: #fff; }
.pill svg { width: 14px; height: 14px; color: var(--ink-3); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-elev); font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2);
}
.chip b { font-weight: 500; color: var(--ink); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink-2); background: var(--bg-sunken); border: 1px solid var(--line); white-space: nowrap; }
.tag.grad { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.card.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card .icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--ink);
}
.card .icon svg { width: 20px; height: 20px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: 15.5px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 68px;
  display: flex; align-items: center;
  background: transparent; transition: background 0.3s, border-color 0.3s, height 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled, .site-header.is-open {
  background: var(--header-bg); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border-bottom-color: var(--line); height: 60px;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; height: 40px; }
.logo img { height: 28px; width: auto; }
.logo .logo-dark { display: none; }
html[data-theme="dark"] .logo .logo-light { display: none; }
html[data-theme="dark"] .logo .logo-dark { display: block; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--ink); background: var(--bg-sunken); }
.nav a.is-current { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .btn-ghost { border-color: transparent; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; color: var(--ink-2);
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: var(--bg-sunken); color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-moon { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; place-items: center; color: var(--ink); }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn .i-close { display: none; }
.site-header.is-open .menu-btn .i-close { display: block; }
.site-header.is-open .menu-btn .i-menu { display: none; }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .nav, .header-actions .btn-ghost { display: none; }
  .menu-btn { display: grid; }
  .mobile-nav {
    position: fixed; inset: 60px 0 0 0; z-index: 49; padding: 24px clamp(20px, 5vw, 40px) 40px;
    background: var(--bg); border-top: 1px solid var(--line);
    flex-direction: column; gap: 4px; overflow: auto;
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease);
  }
  .mobile-nav.is-open { display: flex; opacity: 1; transform: none; pointer-events: auto; }
  .mobile-nav a { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .mobile-nav .cta-row { margin-top: 24px; }
  .mobile-nav .cta-row .btn { flex: 1; font-size: 15px; font-weight: 500; letter-spacing: 0; border-bottom: 0; padding: 0 20px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(140px, 18vw, 200px); padding-bottom: 0; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-bg .grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 100%);
}
.aurora { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--aurora-opacity); will-change: transform; }
.aurora.a1 { width: 56vw; height: 56vw; max-width: 760px; max-height: 760px; left: -12vw; top: -22vw; background: radial-gradient(circle at 40% 40%, var(--cyan), transparent 62%); animation: drift1 26s ease-in-out infinite alternate; }
.aurora.a2 { width: 50vw; height: 50vw; max-width: 700px; max-height: 700px; right: -10vw; top: -18vw; background: radial-gradient(circle at 50% 50%, var(--pink), transparent 62%); animation: drift2 30s ease-in-out infinite alternate; }
.aurora.a3 { width: 40vw; height: 40vw; max-width: 560px; max-height: 560px; left: 35vw; top: -8vw; background: radial-gradient(circle at 50% 50%, var(--violet), transparent 62%); animation: drift3 34s ease-in-out infinite alternate; opacity: calc(var(--aurora-opacity) * 0.8); }
@keyframes drift1 { to { transform: translate(8vw, 6vw) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-6vw, 7vw) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-5vw, 4vw) scale(0.95); } }
.grain {
  position: absolute; inset: 0; opacity: calc(var(--grain-opacity) * 0.22); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
html[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: calc(var(--grain-opacity) * 0.16); }
.hero-inner { text-align: center; max-width: 980px; margin-inline: auto; }
.hero-inner .pill { margin-bottom: 28px; }
.hero-inner .h1 { margin-inline: auto; }
.hero-inner .lead { max-width: 680px; margin: 28px auto 0; }
.hero-inner .cta-row { justify-content: center; margin-top: 36px; }
.hero-note { margin-top: 28px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; }
.hero-note span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 99px; background: var(--ink-4); margin-right: 10px; vertical-align: 2px; }
.hero-note span:first-child::before { display: none; }
.hero-note code { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; color: var(--ink-2); }

/* Rotating word */
.rotator { display: inline-grid; vertical-align: baseline; text-align: center; }
.rotator > span { grid-area: 1 / 1; white-space: nowrap; opacity: 0; transform: translateY(0.35em); filter: blur(6px); transition: opacity 0.45s var(--ease) 0.2s, transform 0.6s var(--ease) 0.2s, filter 0.45s var(--ease) 0.2s; }
.rotator > span.is-active { opacity: 1; transform: none; filter: blur(0); }
.rotator > span.is-exit { opacity: 0; transform: translateY(-0.3em); filter: blur(6px); transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), filter 0.25s var(--ease); }

/* ---------- Hero demo (explanation panel) ---------- */
.hero-demo-wrap { margin-top: clamp(48px, 6vw, 80px); position: relative; }
.demo {
  position: relative; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow-lg); overflow: hidden; text-align: left;
}
.demo::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(62, 200, 255, 0.12), transparent 30%, transparent 70%, rgba(255, 107, 181, 0.12));
  opacity: 0.8;
}
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-sunken) 60%, transparent); }
.demo-dots { display: flex; gap: 6px; }
.demo-dots i { width: 10px; height: 10px; border-radius: 99px; background: var(--line-strong); }
.demo-title { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.demo-title b { color: var(--ink); font-weight: 500; }
.demo-tabs { display: flex; gap: 4px; padding: 10px 14px 0; overflow-x: auto; scrollbar-width: none; }
.demo-tabs::-webkit-scrollbar { display: none; }
.demo-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--ink-3); border: 1px solid transparent; transition: all 0.2s;
}
.demo-tab:hover { color: var(--ink); background: var(--bg-sunken); }
.demo-tab.is-active { color: var(--ink); background: var(--bg-sunken); border-color: var(--line); }
.demo-tab .sw { width: 8px; height: 8px; border-radius: 99px; background: var(--ink-4); }
.demo-tab.is-active .sw { background: var(--grad); }
.demo-body { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 0; }
.demo-inputs { padding: 18px 20px 22px; border-right: 1px solid var(--line); }
.demo-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.demo-input-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.demo-input {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.demo-input small { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.demo-input b { font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-input.is-hot { border-color: var(--blue); box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-1px); }
.demo-method { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.demo-method .tag.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.demo-result { padding: 18px 22px 20px; min-width: 0; }
.demo-pred { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.demo-pred .word { font-size: clamp(1.9rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.demo-pred .word[data-outcome="survived"] { background: var(--toward); -webkit-background-clip: text; background-clip: text; color: transparent; }
.demo-pred .word[data-outcome="died"] { background: var(--away); -webkit-background-clip: text; background-clip: text; color: transparent; }
.demo-pred .prob { font-family: var(--font-mono); font-size: 14px; color: var(--ink-2); white-space: pre; }
.demo-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.demo-legend { display: flex; gap: 16px; margin: 16px 0 10px; font-size: 12.5px; color: var(--ink-3); }
.demo-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.demo-legend .t i { background: var(--toward); }
.demo-legend .a i { background: var(--away); }
.attr { display: grid; gap: 7px; }
.attr-row { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) 72px; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12.5px; cursor: default; }
.attr-name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attr-name span { color: var(--ink-3); }
.attr-track { position: relative; height: 14px; }
.attr-track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.attr-bar { position: absolute; top: 2px; height: 10px; width: 0; border-radius: 3px; transition: width 0.9s var(--ease), opacity 0.3s; }
.attr-bar.toward { left: 50%; background: var(--toward); border-radius: 0 3px 3px 0; }
.attr-bar.away { right: 50%; background: var(--away); border-radius: 3px 0 0 3px; }
.attr-val { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.attr-row:hover .attr-name, .attr-row.is-hot .attr-name { color: var(--accent); }
.attr-row.is-dim .attr-bar { opacity: 0.35; }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); background: color-mix(in srgb, var(--bg-sunken) 60%, transparent); }
.demo-foot a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.demo-foot a:hover { color: var(--accent); }
.demo-foot a svg { width: 14px; height: 14px; }
.demo-foot code { font-size: 12px; color: var(--ink-3); }
@media (max-width: 760px) {
  .demo-body { grid-template-columns: minmax(0, 1fr); }
  .demo-inputs { border-right: 0; border-bottom: 1px solid var(--line); }
  .demo-input-list { grid-template-columns: repeat(4, 1fr); }
  .attr-row { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) 62px; font-size: 11.5px; gap: 8px; }
  .demo-foot { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) { .demo-input-list { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Framework strip ---------- */
.strip { padding-block: 36px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: clamp(64px, 8vw, 110px); }
.strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.strip-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.strip-items { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.strip-items .chip { height: 34px; font-size: 13px; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }
.step { padding: 28px 26px 30px; border-right: 1px solid var(--line); position: relative; display: flex; flex-direction: column; gap: 14px; transition: background 0.3s; }
.step:last-child { border-right: 0; }
.step:hover { background: var(--bg-sunken); }
.step-num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.step-num::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.step h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.015em; }
.step p { color: var(--ink-2); font-size: 15px; flex: 1; }
.step code { display: block; font-size: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-code); color: #d7dbe8; overflow-x: auto; white-space: pre; line-height: 1.55; }
@media (max-width: 980px) {
  .steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
}

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.tile { grid-column: span 2; display: flex; flex-direction: column; min-height: 320px; overflow: hidden; padding: 0; }
.tile-wide { grid-column: span 3; }
.tile-full { grid-column: span 6; }
.tile-body { padding: 28px 28px 0; }
.tile-body p { margin-top: 10px; }
.tile-media { margin-top: auto; padding: 24px 28px 0; position: relative; }
.tile-media img { border-radius: 12px 12px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow-md); background: #fff; }
.tile-media.pad { padding-bottom: 28px; }
.tile-media.pad img { border-radius: 12px; border-bottom: 1px solid var(--line); }
.tile-media .fade { position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to bottom, transparent, var(--bg-elev)); pointer-events: none; }
.tile ul.check { margin-top: 16px; display: grid; gap: 8px; }
.tile ul.check li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.tile ul.check li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 99px; background: var(--grad); -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='8' fill='black'/><path d='M4.5 8.5l2.3 2.3L11.5 6' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='8' fill='black'/><path d='M4.5 8.5l2.3 2.3L11.5 6' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat; }
@media (max-width: 980px) { .tile, .tile-wide { grid-column: span 3; } }
@media (max-width: 640px) { .tile, .tile-wide, .tile-full { grid-column: span 6; } }

/* Mini visuals inside tiles */
.mini-cf { padding: 18px 20px 20px; margin: 24px 28px 28px; border-radius: 14px; background: var(--bg-sunken); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); display: grid; gap: 10px; }
.mini-cf .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mini-cf .row b { font-weight: 500; color: var(--ink); }
.mini-cf .row .from { color: var(--ink-3); text-decoration: line-through; margin-right: 6px; }
.mini-cf .row .frozen { color: var(--ink-3); }
.mini-cf .flip { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line-strong); display: flex; justify-content: space-between; }
.mini-cf .flip .to { background: var(--toward); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 500; }
.mini-versions { margin: 24px 28px 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mini-versions .v { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-sunken); font-size: 12.5px; }
.mini-versions .v .tag { margin-bottom: 10px; }
.mini-versions .v .line { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; color: var(--ink-2); font-family: var(--font-mono); font-size: 11.5px; }
.mini-versions .v .line b { font-weight: 500; color: var(--ink); }
.mini-versions .v .line .bad { color: #e0479a; }
.mini-versions .v .line .good { color: #1f9d6a; }
.mini-byo { margin: 24px 28px 28px; display: grid; gap: 8px; }
.mini-byo .opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-sunken); font-size: 13.5px; color: var(--ink-2); }
.mini-byo .opt code { font-size: 11.5px; color: var(--ink); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; margin-left: auto; white-space: nowrap; }
.mini-byo .opt .k { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-elev); border: 1px solid var(--line); flex: none; }
.mini-byo .opt .k svg { width: 14px; height: 14px; color: var(--ink-2); }
.method-chips { margin: 20px 28px 28px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Screenshot frame ---------- */
.frame { position: relative; border-radius: 18px; background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; }
.frame-bar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.frame-bar i { width: 10px; height: 10px; border-radius: 99px; background: var(--line-strong); }
.frame-bar .url { margin-left: 12px; flex: 1; max-width: 320px; height: 24px; border-radius: 6px; background: var(--bg-elev); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; }
.frame img { width: 100%; }
html[data-theme="dark"] .frame img.screen, html[data-theme="dark"] .tile-media img, html[data-theme="dark"] .figure img { filter: brightness(0.9) contrast(1.02); }
.frame-wrap { position: relative; }
.frame-glow { position: absolute; inset: -20% -10% auto -10%; height: 70%; background: radial-gradient(ellipse at center, rgba(107, 140, 255, 0.28), transparent 60%); filter: blur(40px); z-index: -1; pointer-events: none; }

/* ---------- Code ---------- */
.code-panel { border-radius: 18px; background: var(--bg-code); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: var(--shadow-lg); overflow: hidden; color: #d7dbe8; }
.code-tabs { display: flex; align-items: center; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.02); }
.code-tab { height: 38px; padding: 0 14px; border-radius: 10px 10px 0 0; font-family: var(--font-mono); font-size: 12.5px; color: #8b91a5; position: relative; transition: color 0.2s; }
.code-tab:hover { color: #d7dbe8; }
.code-tab.is-active { color: #fff; }
.code-tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--grad); border-radius: 2px; }
.code-tabs .copy { margin-left: auto; margin-bottom: 6px; height: 30px; padding: 0 12px; border-radius: 8px; font-family: var(--font-mono); font-size: 12px; color: #a3a9bd; border: 1px solid rgba(255, 255, 255, 0.1); display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
.code-tabs .copy:hover { color: #fff; border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.04); }
.code-tabs .copy svg { width: 13px; height: 13px; }
.code-pane { display: none; }
.code-pane.is-active { display: block; }
.code-panel pre { margin: 0; padding: 22px 24px 26px; font-size: 13.25px; line-height: 1.65; overflow-x: auto; tab-size: 4; }
.code-panel code { font-family: var(--font-mono); }
.tk-kw { color: #c792ea; }
.tk-fn { color: #82aaff; }
.tk-str { color: #9ce0a6; }
.tk-num { color: #f78c6c; }
.tk-cm { color: #6b7389; font-style: italic; }
.tk-key { color: #ffcb6b; }
.tk-op { color: #89ddff; }
.tk-cls { color: #ffcb6b; }
.code-inline { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--ink); }
pre.code-block { margin: 0; padding: 18px 20px; border-radius: 14px; background: var(--bg-code); color: #d7dbe8; font-size: 13px; line-height: 1.65; overflow-x: auto; border: 1px solid rgba(255, 255, 255, 0.08); }

/* ---------- Dev section ---------- */
.dev-links { display: grid; gap: 10px; margin-top: 28px; }
.dev-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-elev); transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s; }
.dev-link:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.dev-link .k { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-sunken); border: 1px solid var(--line); flex: none; }
.dev-link .k svg { width: 18px; height: 18px; color: var(--ink); }
.dev-link b { display: block; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.dev-link span { display: block; color: var(--ink-3); font-size: 13.5px; }
.dev-link .ext { margin-left: auto; width: 16px; height: 16px; color: var(--ink-4); flex: none; }

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; border-top: 1px solid var(--line); }
.principle { padding: 36px 0 8px; }
.principle .num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-bottom: 18px; }
.principle h3 { font-size: 1.3rem; margin-bottom: 12px; }
.principle p { color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 900px) { .principles { grid-template-columns: minmax(0, 1fr); border-top: 0; } .principle { padding-top: 28px; border-top: 1px solid var(--line); } }

/* ---------- Narrative ---------- */
.narrative { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.narrative .statement { font-size: clamp(1.75rem, 3.4vw, 2.75rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; }
.narrative .statement .serif { font-size: 1.08em; }
.narrative .copy { margin-top: 24px; color: var(--ink-2); font-size: 1.05rem; }
.figure { position: relative; }
.figure img { border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-md); background: #fff; }
.figure figcaption { margin-top: 14px; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
@media (max-width: 900px) { .narrative { grid-template-columns: minmax(0, 1fr); } }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(56px, 8vw, 104px) clamp(24px, 6vw, 80px); text-align: center; color: #fff; background: #0b0c10; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 180deg at 50% 50%, #3ec8ff, #6b8cff, #a078ff, #ff6bb5, #3ec8ff); filter: blur(80px); opacity: 0.75; z-index: -1; animation: spin 28s linear infinite; }
.cta-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 12, 16, 0.25), rgba(11, 12, 16, 0.55)); z-index: -1; }
@keyframes spin { to { transform: rotate(1turn); } }
.cta-band .h2 { color: #fff; }
.cta-band .lead { color: rgba(255, 255, 255, 0.82); max-width: 620px; margin: 20px auto 0; }
.cta-band .cta-row { justify-content: center; margin-top: 36px; }
.cta-band .mark { width: 56px; height: 56px; margin: 0 auto 28px; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(56px, 6vw, 80px) 0 40px; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-brand .logo img { height: 30px; }
.footer-brand p { margin-top: 18px; color: var(--ink-3); font-size: 14.5px; max-width: 320px; }
.footer-brand .jp-line { margin-top: 14px; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.footer-brand .jp-line .jp { font-size: 15px; color: var(--ink); }
.footer-col h4 { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 16px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { color: var(--ink-2); font-size: 14.5px; transition: color 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.footer-col a:hover { color: var(--ink); }
.footer-col a svg { width: 12px; height: 12px; color: var(--ink-4); }
.footer-bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--ink-3); }
.footer-bottom .links { display: flex; gap: 20px; }
.footer-bottom a:hover { color: var(--ink); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-brand { grid-column: span 2; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } .footer-brand { grid-column: span 1; } }

/* ---------- Sub-page hero ---------- */
.page-hero { position: relative; padding-top: clamp(130px, 16vw, 180px); padding-bottom: clamp(40px, 5vw, 64px); }
.page-hero .h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero .lead { margin-top: 24px; max-width: 680px; }
.page-hero .cta-row { margin-top: 32px; }
.page-hero.center { text-align: center; }
.page-hero.center .lead, .page-hero.center .h1 { margin-inline: auto; }
.page-hero.center .cta-row { justify-content: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev); }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--bg-sunken); }
.table tr:last-child td { border-bottom: 0; }
.table td code { font-size: 12.5px; }
.table .yes { color: #1f9d6a; font-weight: 500; }
.table .no { color: var(--ink-3); }
.table .partial { color: #c77d12; font-weight: 500; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { flex: none; width: 24px; height: 24px; border-radius: 99px; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink-3); transition: transform 0.3s var(--ease), background 0.2s; }
.faq summary .plus svg { width: 12px; height: 12px; }
.faq details[open] summary .plus { transform: rotate(45deg); background: var(--ink); color: var(--bg); border-color: var(--ink); }
.faq .answer { padding: 0 0 24px; color: var(--ink-2); max-width: 720px; font-size: 15.5px; }
.faq .answer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 32px 28px; }
.plan.featured { border-color: transparent; background: linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box, var(--grad) border-box; box-shadow: var(--shadow-md); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-head h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
.plan .price { margin-top: 20px; display: flex; align-items: baseline; gap: 6px; }
.plan .price .amt { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.plan .price .per { color: var(--ink-3); font-size: 14px; }
.plan .desc { margin-top: 12px; color: var(--ink-2); font-size: 15px; min-height: 48px; }
.plan .btn { margin-top: 24px; width: 100%; }
.plan ul { margin-top: 26px; display: grid; gap: 11px; padding-top: 24px; border-top: 1px solid var(--line); }
.plan li { display: flex; gap: 10px; font-size: 14.5px; color: var(--ink-2); align-items: flex-start; }
.plan li svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--accent); }
.plan li b { color: var(--ink); font-weight: 500; }
@media (max-width: 900px) { .plans { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; } }

/* ---------- Docs cards ---------- */
.guide { display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.guide .num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.guide h3 { font-size: 1.15rem; margin: 0; }
.guide p { flex: 1; }
.guide .links { display: flex; gap: 14px; flex-wrap: wrap; }
.guide .links a { font-size: 13.5px; font-weight: 500; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.guide .links a svg { width: 13px; height: 13px; }
.guide .feats { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.reasons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.reason { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; text-align: left; }
.reason b { font-size: 14.5px; font-weight: 600; }
.reason span { font-size: 13px; color: var(--ink-3); }
.reason.is-active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--accent-soft); }
.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 560px) { .form .row { grid-template-columns: minmax(0, 1fr); } .reasons { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--bg-elev); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 12px 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .hint { font-size: 13px; color: var(--ink-3); }
.contact-aside { display: grid; gap: 14px; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 120px 20px 80px; }
.notfound .code { font-family: var(--font-mono); font-size: clamp(5rem, 18vw, 11rem); font-weight: 500; letter-spacing: -0.06em; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Login (redirect) ---------- */
.redirect { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.redirect .logo { justify-content: center; margin-bottom: 32px; }
.redirect .logo img { height: 36px; }
.spinner { width: 28px; height: 28px; border-radius: 99px; border: 2px solid var(--line-strong); border-top-color: var(--accent); margin: 24px auto 0; animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(1turn); } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.hero .reveal { transform: translateY(14px); }
.hero .reveal[data-delay="1"] { transition-delay: 0.1s; }
.hero .reveal[data-delay="2"] { transition-delay: 0.2s; }
.hero .reveal[data-delay="3"] { transition-delay: 0.3s; }
.hero .reveal[data-delay="4"] { transition-delay: 0.45s; }

/* ---------- Responsive helpers ---------- */
.pill .pill-short { display: none; }
@media (max-width: 640px) {
  .pill .pill-long { display: none; }
  .pill .pill-short { display: inline; }
  .hide-sm { display: none !important; }
  .demo-head > .demo-meta { display: none; }
  .demo-title { white-space: nowrap; }
}

/* ---------- Kanji card (about) ---------- */
.kanji-card { position: relative; overflow: hidden; padding: clamp(32px, 5vw, 56px); border-radius: 24px; background: var(--bg-elev); border: 1px solid var(--line); text-align: center; box-shadow: var(--shadow-md); }
.kanji-card::before { content: ""; position: absolute; inset: -30%; background: radial-gradient(circle at 30% 20%, rgba(62, 200, 255, 0.18), transparent 50%), radial-gradient(circle at 75% 80%, rgba(255, 107, 181, 0.18), transparent 50%); pointer-events: none; }
.kanji { position: relative; font-family: var(--font-jp); font-weight: 500; font-size: clamp(6rem, 14vw, 10.5rem); line-height: 1; letter-spacing: 0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kanji-parts { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 28px; }
.kanji-parts div { padding: 16px; border-radius: 14px; background: var(--bg-sunken); border: 1px solid var(--line); }
.kanji-parts .ch { font-family: var(--font-jp); font-size: 1.6rem; font-weight: 500; line-height: 1; }
.kanji-parts .ro { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-top: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.kanji-parts .me { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.kanji-card .def { position: relative; margin-top: 20px; font-family: var(--font-serif); font-style: italic; font-size: 1.35rem; color: var(--ink-2); }

/* ---------- Misc ---------- */
.kicker-list { display: flex; flex-wrap: wrap; gap: 8px; }
.divider { height: 1px; background: var(--line); }
.stat { padding: 24px 0; border-top: 1px solid var(--line); }
.stat .n { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stat .l { margin-top: 8px; color: var(--ink-3); font-size: 14px; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.method { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-elev); }
.method b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.method span { font-size: 13.5px; color: var(--ink-2); }
.method .tag { margin-bottom: 10px; }
@media (max-width: 900px) { .method-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 560px) { .method-grid { grid-template-columns: minmax(0, 1fr); } }
.values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .values { grid-template-columns: minmax(0, 1fr); } }
.timeline { display: grid; gap: 0; border-left: 1px solid var(--line-strong); margin-left: 8px; }
.timeline li { position: relative; padding: 0 0 28px 28px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 7px; width: 9px; height: 9px; border-radius: 99px; background: var(--grad); }
.timeline li b { display: block; font-weight: 600; margin-bottom: 4px; }
.timeline li span { color: var(--ink-2); font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Grid children must never force a track wider than the viewport (classic grid blowout) */
.grid > *, .split > *, .bento > *, .plans > *, .values > *, .narrative > *, .contact-grid > *, .footer-grid > *, .steps > *, .method-grid > *, .principles > *, .demo-body > *, .kanji-parts > *, .mini-versions > *, .reasons > *, .form .row > * { min-width: 0; }
.frame-bar .url { min-width: 0; }
