/* =============================================================
   BCAQI Labs — Design system
   Restrained, engineered, Japanese industrial-design sensibility.
   Palette: near-white ground, ink text, one deep indigo (藍) accent,
   one neutral gray for rules/tables, plus demo status colors.
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Color */
  --ground: #ffffff;
  --ground-2: #f6f7f9;      /* subtle section fill */
  --ground-3: #eef0f4;      /* deeper fill / demo canvas */
  --ink: #14161a;           /* primary text */
  --ink-2: #3f4652;         /* secondary text */
  --muted: #6b7280;         /* tertiary text */
  --rule: #e3e6ec;          /* borders / table rules */
  --rule-strong: #cbd0da;

  --accent: #223a70;        /* 紺 / deep indigo */
  --accent-2: #2f4fa2;      /* interactive indigo */
  --accent-soft: #eef1f9;   /* indigo tint background */

  --flag-ok: #1f7a54;       /* validated */
  --flag-ok-soft: #e7f3ee;
  --flag-warn: #9a6a12;     /* needs review */
  --flag-warn-soft: #fbf3e2;
  --flag-err: #b4342a;      /* failed rule */
  --flag-err-soft: #fbeceb;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans JP", sans-serif;
  --font-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Space scale (8pt) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  --maxw: 1120px;
  --maxw-narrow: 760px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .04), 0 1px 3px rgba(20, 22, 26, .06);
  --shadow-md: 0 4px 16px rgba(20, 22, 26, .06), 0 2px 6px rgba(20, 22, 26, .05);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.12; color: var(--ink); }
p { margin: 0; }
ul { margin: 0; }

::selection { background: var(--accent-soft); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s-5); }
.container.narrow { max-width: var(--maxw-narrow); }
.section { padding-block: var(--s-9); }
.section.tight { padding-block: var(--s-8); }
.section--fill { background: var(--ground-2); }
.section--ink { background: var(--ink); color: #d9dde4; }
.section--ink h1, .section--ink h2, .section--ink h3 { color: #fff; }

.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: var(--s-4);
}
.section-head { max-width: 720px; margin-bottom: var(--s-7); }
.section-head h1, .section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { margin-top: var(--s-4); color: var(--ink-2); font-size: 19px; }
.lede { font-size: 20px; color: var(--ink-2); line-height: 1.6; }

/* Grids */
.grid { display: grid; gap: var(--s-5); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand .brand-name { font-size: 17px; }
.brand .brand-name span { color: var(--accent-2); }
.nav-links { display: flex; align-items: center; gap: var(--s-6); list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); font-size: 15px; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--accent-2); }
.nav-right { display: flex; align-items: center; gap: var(--s-4); }
.nav-lang { font-size: 14px; color: var(--muted); font-weight: 500; }
.nav-lang:hover { color: var(--accent-2); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  width: 40px; height: 38px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--ink); }
.nav-toggle span::before { top: -5px; } .nav-toggle span::after { top: 5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 550; line-height: 1;
  padding: 13px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn svg { width: 16px; height: 16px; }
.section--ink .btn-ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.section--ink .btn-ghost:hover { border-color: #fff; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(64px, 9vw, 120px) var(--s-9); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s-8); align-items: center; }
.hero h1 { font-size: clamp(34px, 5.2vw, 56px); letter-spacing: -.03em; }
.hero .hero-sub-jp { display: block; margin-top: var(--s-4); font-family: var(--font-jp); font-weight: 500;
  font-size: clamp(16px, 2.2vw, 21px); color: var(--ink-2); letter-spacing: 0; line-height: 1.7; }
.hero .lede { margin-top: var(--s-5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero-note { margin-top: var(--s-4); font-size: 14px; color: var(--muted); }

/* ---------- Trust strip ---------- */
.trust-strip { border-block: 1px solid var(--rule); background: var(--ground-2); }
.trust-strip ul { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; }
.trust-strip li { padding: var(--s-5) var(--s-4); border-left: 1px solid var(--rule);
  font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.trust-strip li:first-child { border-left: none; }
.trust-strip li strong { color: var(--ink); font-weight: 600; display: block; font-size: 15px; }
.trust-strip .tick { color: var(--accent-2); flex: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--ground); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s-6); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-md); }
.card .card-idx { font-family: var(--font-mono); font-size: 13px; color: var(--accent-2); letter-spacing: .04em; }
.card h3 { font-size: 21px; margin-top: var(--s-3); }
.card p { margin-top: var(--s-3); color: var(--ink-2); font-size: 16px; }
.card ul { margin-top: var(--s-4); padding-left: 0; list-style: none; }
.card ul li { position: relative; padding-left: 22px; margin-top: var(--s-2); font-size: 15px; color: var(--ink-2); }
.card ul li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent-2); }
.card .icon { width: 40px; height: 40px; color: var(--accent); }

/* Offer / pricing card */
.offer { display: flex; flex-direction: column; }
.offer .offer-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3);
  font-size: 13px; color: var(--muted); }
.offer .offer-price { margin-top: auto; padding-top: var(--s-5); border-top: 1px solid var(--rule);
  font-size: 15px; color: var(--ink); font-weight: 600; }
.offer .offer-price span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.deliverables { margin-top: var(--s-4); }

/* ---------- Company overview table (会社概要) ---------- */
.spec-table { width: 100%; border-collapse: collapse; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.spec-table th, .spec-table td { text-align: left; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 16px; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }
.spec-table th { width: 32%; background: var(--ground-2); font-weight: 600; color: var(--ink); }
.spec-table th .jp { display: block; font-family: var(--font-jp); font-size: 13px; font-weight: 500; color: var(--muted); }
.spec-table td { color: var(--ink-2); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.timeline li { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule); }
.timeline .step { font-family: var(--font-mono); font-size: 13px; color: var(--accent-2); padding-top: 3px; min-width: 64px; }
.timeline strong { display: block; font-size: 17px; }
.timeline p { color: var(--ink-2); font-size: 15px; margin-top: 2px; }

/* ---------- Feature rows (process) ---------- */
.feature-row { display: grid; grid-template-columns: 240px 1fr; gap: var(--s-7); padding-block: var(--s-7);
  border-top: 1px solid var(--rule); }
.feature-row h3 { font-size: 24px; }
.feature-row .jp-term { font-family: var(--font-jp); color: var(--accent); font-weight: 600; }
.feature-row p { color: var(--ink-2); margin-top: var(--s-3); }
.feature-row .col-side .side-note { font-size: 14px; color: var(--muted); margin-top: var(--s-3); }

/* ---------- Portfolio ---------- */
.case-list { display: grid; gap: var(--s-6); }
.case { display: grid; grid-template-columns: 1fr; gap: var(--s-4); padding: var(--s-6);
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ground); }
.case .tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 100px; width: fit-content; }
.case h3 { font-size: 24px; margin-top: var(--s-2); }
.case dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); margin: var(--s-4) 0 0; }
.case dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.case dd { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }

/* ---------- Demo (signature element) ---------- */
.demo-wrap { border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; background: var(--ground); box-shadow: var(--shadow-md); }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); background: var(--ground-3); border-bottom: 1px solid var(--rule); }
.demo-bar .demo-title { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.demo-bar .env-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--flag-warn); background: var(--flag-warn-soft); padding: 3px 8px; border-radius: 100px; }
.demo-body { display: grid; grid-template-columns: 300px 1fr; min-height: 460px; }
.demo-samples { border-right: 1px solid var(--rule); padding: var(--s-4); background: var(--ground-2); }
.demo-samples h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: var(--s-3); }
.sample-btn { display: block; width: 100%; text-align: left; background: var(--ground); border: 1px solid var(--rule);
  border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3); cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease); }
.sample-btn:hover { border-color: var(--accent-2); }
.sample-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.sample-btn .s-name { display: block; font-weight: 600; font-size: 14px; color: var(--ink); }
.sample-btn .s-name .jp { font-family: var(--font-jp); }
.sample-btn .s-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.demo-main { padding: var(--s-5); overflow-x: auto; }
.demo-empty { color: var(--muted); font-size: 15px; display: flex; height: 100%; align-items: center; justify-content: center; text-align: center; }

.demo-doc { font-family: var(--font-jp); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  padding: var(--s-5); font-size: 14px; line-height: 1.9; color: var(--ink); }
.demo-doc .doc-title { font-weight: 700; font-size: 18px; margin-bottom: var(--s-3); }
.demo-doc .doc-row { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--rule); padding: 4px 0; }

.demo-steps { display: flex; gap: var(--s-2); margin-bottom: var(--s-4); flex-wrap: wrap; }
.demo-step { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.demo-step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-strong); }
.demo-step.done .dot { background: var(--flag-ok); }
.demo-step.active .dot { background: var(--accent-2); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
@media (prefers-reduced-motion: reduce) { .demo-step.active .dot { animation: none; } }

.result-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result-table th, .result-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.result-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.result-table .field-label { font-family: var(--font-jp); color: var(--muted); font-size: 13px; }
.result-table .field-value { font-weight: 550; color: var(--ink); }
.result-table .field-value.jp { font-family: var(--font-jp); }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 100px; }
.flag.ok { color: var(--flag-ok); background: var(--flag-ok-soft); }
.flag.warn { color: var(--flag-warn); background: var(--flag-warn-soft); }
.flag.err { color: var(--flag-err); background: var(--flag-err-soft); }
.conf { font-family: var(--font-mono); font-size: 13px; }

.demo-tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-4); }
.demo-tab { background: none; border: none; padding: 10px 14px; font-size: 14px; font-weight: 550; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.demo-tab.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.demo-panel { display: none; }
.demo-panel.active { display: block; }
pre.json { background: var(--ink); color: #d7dbe3; padding: var(--s-4); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6; overflow-x: auto; }
pre.json .k { color: #9fb4ff; } pre.json .s { color: #a5d6a7; } pre.json .n { color: #ffcc80; }

.audit-log { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 13px; }
.audit-log li { display: grid; grid-template-columns: 92px auto 1fr; gap: var(--s-3); padding: 8px 0;
  border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.audit-log .t { color: var(--muted); } .audit-log .lv { font-weight: 600; }
.audit-log .lv.ok { color: var(--flag-ok); } .audit-log .lv.warn { color: var(--flag-warn); }

.review-queue { display: grid; gap: var(--s-3); }
.review-item { border: 1px solid var(--flag-warn-soft); border-left: 3px solid var(--flag-warn); border-radius: var(--radius-sm);
  padding: var(--s-3) var(--s-4); background: var(--ground); }
.review-item .ri-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.review-item .ri-field { font-family: var(--font-jp); font-weight: 600; }
.review-item .ri-actions { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.review-item .ri-actions button { font-size: 12px; padding: 5px 12px; border-radius: var(--radius-sm); border: 1px solid var(--rule-strong); background: var(--ground); cursor: pointer; }
.review-item .ri-actions button.approve { border-color: var(--flag-ok); color: var(--flag-ok); }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s-4); }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 550; color: var(--ink); }
.field label .jp { font-family: var(--font-jp); color: var(--muted); font-weight: 500; }
.field .req { color: var(--flag-err); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 16px; color: var(--ink); background: var(--ground);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); padding: 11px 14px; width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent-2); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.form-note { font-size: 13px; color: var(--muted); }

/* ---------- Contact block ---------- */
.contact-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: var(--s-8); align-items: start; }
.contact-facts { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: var(--s-4); }
.contact-facts li { display: grid; grid-template-columns: 120px 1fr; gap: var(--s-3); font-size: 15px; }
.contact-facts .k { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #aab1bd; padding-block: var(--s-8) var(--s-6); }
.site-footer a { color: #d3d8e0; }
.footer-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: var(--s-6); padding-bottom: var(--s-7); border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand .brand-name { color: #fff; font-weight: 650; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.footer-brand p { margin-top: var(--s-4); font-size: 14px; max-width: 34ch; color: #8b93a1; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--s-4); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { font-size: 15px; } .footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding-top: var(--s-5); font-size: 13px; color: #7b8391; flex-wrap: wrap; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(26px, 4vw, 38px); }
.cta-band p { margin-top: var(--s-4); color: #aab1bd; font-size: 19px; }
.cta-band .hero-actions { justify-content: center; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Japanese page typography ---------- */
:lang(ja), .jp-page { }
.jp-page body, .jp-page { font-family: var(--font-jp); }
.jp-page { line-height: 1.85; }
.jp-page h1, .jp-page h2, .jp-page h3, .jp-page h4 { font-family: var(--font-jp); letter-spacing: 0; line-height: 1.4; font-weight: 700; }
.jp-page p, .jp-page li { word-break: normal; overflow-wrap: break-word; line-break: strict; }
.jp-page .lede { line-height: 1.9; }

/* ---------- Utilities ---------- */
.mt-0{margin-top:0}.mt-4{margin-top:var(--s-4)}.mt-6{margin-top:var(--s-6)}.mt-7{margin-top:var(--s-7)}
.text-muted{color:var(--muted)}.small{font-size:14px}
.divider{height:1px;background:var(--rule);border:0;margin:0}
.badge-inline{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--accent);background:var(--accent-soft);padding:4px 10px;border-radius:100px}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links, .nav-right .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  /* Open mobile menu: stack links + CTA + language in normal flow so all are reachable. */
  .site-header.open .nav { height: auto; flex-wrap: wrap; padding-bottom: var(--s-4); align-items: center; }
  .site-header.open .brand { order: 1; }
  .site-header.open .nav-toggle { order: 2; margin-left: auto; }
  .site-header.open .nav > nav { order: 3; flex-basis: 100%; }
  .site-header.open .nav-links { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-4);
    padding-top: var(--s-4); margin-top: var(--s-3); border-top: 1px solid var(--rule); }
  .site-header.open .nav-right { order: 4; flex-basis: 100%; justify-content: flex-start; gap: var(--s-5);
    align-items: center; }
  .site-header.open .nav-right .btn { display: inline-flex; }
  .hero-grid, .contact-split, .grid-3, .grid-2, .demo-body, .feature-row, .footer-top { grid-template-columns: 1fr; }
  .demo-samples { border-right: none; border-bottom: 1px solid var(--rule); }
  .feature-row { gap: var(--s-4); }
  .trust-strip ul { grid-template-columns: 1fr 1fr; }
  .trust-strip li:nth-child(-n+2) { border-top: none; }
  .trust-strip li:nth-child(odd) { border-left: none; }
  .case dl, .form-row { grid-template-columns: 1fr 1fr; }
  .footer-top { gap: var(--s-6); } .footer-bottom { justify-content: flex-start; }
  .section { padding-block: var(--s-8); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .trust-strip ul { grid-template-columns: 1fr; }
  .trust-strip li { border-left: none; border-top: 1px solid var(--rule); }
  .trust-strip li:first-child { border-top: none; }
  .case dl { grid-template-columns: 1fr; }
  .spec-table th { width: 40%; }
  .container { padding-inline: var(--s-4); }
}

/* =============================================================
   PREMIUM MOTION & DEPTH  (fast, GPU-friendly, reduced-motion safe)
   Transform/opacity only — no layout thrash, no WebGL.
   ============================================================= */

/* Scroll progress bar (injected by JS) */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200; transition: width .1s linear; will-change: width;
}

/* Header: elevate on scroll */
.site-header { transition: box-shadow .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease); }
.site-header.scrolled { box-shadow: 0 1px 0 rgba(20,22,26,.04), 0 8px 30px rgba(20,22,26,.06); background: rgba(255,255,255,.9); }

/* Hero depth — soft drifting aurora glows behind content (very subtle) */
.hero { position: relative; isolation: isolate; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(70px); opacity: .55; pointer-events: none; will-change: transform;
}
.hero::before {
  width: 560px; height: 560px; top: -180px; right: -120px;
  background: radial-gradient(closest-side, rgba(47,79,162,.18), rgba(47,79,162,0) 70%);
  animation: drift1 22s var(--ease) infinite alternate;
}
.hero::after {
  width: 480px; height: 480px; bottom: -220px; left: -140px;
  background: radial-gradient(closest-side, rgba(34,58,112,.14), rgba(34,58,112,0) 70%);
  animation: drift2 26s var(--ease) infinite alternate;
}
@keyframes drift1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-60px,40px,0) scale(1.12); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(50px,-30px,0) scale(1.1); } }

/* Faint engineered grid texture over the hero */
.hero::before, .hero::after { mix-blend-mode: multiply; }
.hero-grid { position: relative; z-index: 1; }

/* Gradient accent text (used sparingly on hero) */
.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 55%, #4f6fd6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Interactive tilt on the hero demo card */
.hero-demo { perspective: 1200px; }
.hero-demo .demo-wrap {
  transform: rotateX(var(--ry,0deg)) rotateY(var(--rx,0deg)) translateZ(0);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  transform-style: preserve-3d; will-change: transform;
}
.hero-demo.tilting .demo-wrap { transition: transform .05s linear; box-shadow: 0 30px 70px rgba(20,22,26,.16); }

/* Buttons: subtle depth + press */
.btn-primary { box-shadow: 0 1px 2px rgba(34,58,112,.28), 0 6px 18px rgba(34,58,112,.18); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(34,58,112,.3), 0 12px 26px rgba(34,58,112,.24); }
.btn:active { transform: translateY(0) scale(.99); }
.btn-lg { position: relative; overflow: hidden; }

/* Cards lift a touch more, with a hairline top highlight */
.card { will-change: transform; }
.card:hover { transform: translateY(-3px); }

/* Case & offer cards: animated accent bar on hover */
.case, .offer { position: relative; }
.case::after, .card.offer::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: var(--radius) var(--radius) 0 0; transition: width .35s var(--ease);
}
.case:hover::after, .card.offer:hover::after { width: 100%; }

/* Reveal system — richer, with directional + stagger (delay set inline by JS) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-scale { transform: translateY(22px) scale(.98); }

/* Animated underline for text links in prose */
.link-underline { position: relative; }
.link-underline::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.link-underline:hover::after { transform: scaleX(1); }

/* Demo pipeline step: animated connector */
.demo-steps { position: relative; }

/* FAQ (accordion) */
.faq { display: grid; gap: var(--s-3); max-width: 820px; }
.faq details {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ground);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.faq details[open] { border-color: var(--rule-strong); box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s-5); font-weight: 600; font-size: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { flex: none; width: 20px; height: 20px; color: var(--accent-2); transition: transform .25s var(--ease); }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq .faq-body { padding: 0 var(--s-5) var(--s-5); color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.faq .faq-body :lang(ja), .faq .faq-body .jp { font-family: var(--font-jp); }

/* Marquee-free logo/《credential》 row could go here if needed later */

@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after { animation: none; }
  .scroll-progress { display: none; }
  .hero-demo .demo-wrap { transform: none !important; }
  .btn-primary:hover, .card:hover { transform: none; }
}
