@layer reset, base, tokens, layout, components, utilities, overrides;

/* ---- reset.css ---- */
/* House reset (web-studio, 2026-09). Source: modern-css-2026.md section 3.
   Comeau 2026-06-03 base + the three Andy Bell rules + house theming, motion and JP typography defaults.
   The house owns this file; edit per project, never pull a reset from npm. */
@layer reset {
  /* 1. Box model and margins (Comeau 2026) */
  *, *::before, *::after { box-sizing: border-box; }
  *:not(dialog) { margin: 0; }

  /* 2. Root: text sizing, colour scheme, smooth keyword sizing (Bell 2023 + Comeau 2026) */
  html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    color-scheme: light dark;        /* house default; .register-dark or data-theme overrides */
    hanging-punctuation: first last; /* Safari only, harmless elsewhere */
  }
  @media (prefers-reduced-motion: no-preference) {
    html { interpolate-size: allow-keywords; scroll-behavior: smooth; }
  }

  /* 3. Body: readable line-height, full height, stacking root */
  body {
    min-height: 100vh;               /* Bell: do not switch to dvh */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    isolation: isolate;
  }

  /* 4. Headings and controls */
  h1, h2, h3, h4, button, input, label { line-height: 1.15; }
  h1, h2, h3, h4 { text-wrap: balance; }
  p, li, figcaption, blockquote { text-wrap: pretty; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

  /* 5. Lists with role=list keep semantics in Safari VoiceOver (Bell) */
  ul[role='list'], ol[role='list'] { list-style: none; padding-inline: 0; }

  /* 6. Media */
  img, picture, video, canvas, svg, model-viewer { display: block; max-width: 100%; }
  img, video { height: auto; }

  /* 7. Forms */
  input, button, textarea, select { font: inherit; color: inherit; }
  textarea:not([rows]) { min-height: 10em; }
  textarea { field-sizing: content; }

  /* 8. Links and anchors */
  a:not([class]) { color: currentColor; text-decoration-skip-ink: auto; }
  :target { scroll-margin-block: 5ex; }

  /* 9. Japanese text defaults (JP pages set lang="ja" on <html>) */
  :lang(ja) {
    line-break: strict;
    text-autospace: normal;          /* Safari/Chrome; ignored elsewhere */
    text-spacing-trim: space-first;  /* Chrome/Safari; ignored elsewhere */
    font-feature-settings: "palt" 0;
  }
  :lang(ja) :is(h1, h2, h3) { word-break: auto-phrase; } /* Chrome-only phrase breaking, harmless elsewhere */

  /* 10. Motion respect: GSAP reads this too (see motion doctrine) */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ---- tokens.css ---- */
/* tokens.css : house colour tokens (web-studio, 2026-09). Source: color-theming-tokens.md R3.
   DEFAULT LADDERS: warm neutrals on hue 90, gold accent "kin" on hue 87.
   Per brand: set colour.neutral_hue / accent_hue / accent_seed in site.json and colour.generate=true,
   then build.py runs tools/tokens.py to rewrite this file. Do not hand-edit the ladders after that.
   Every pair was contrast-checked: light fg/bg 16.3:1, fg-2 5.2:1, accent 3.5:1, accent-text 5.2:1;
   dark fg 16.3:1, fg-2 7.6:1, accent 7.6:1, accent-text 10.7:1. */
@layer tokens {
:root {
  color-scheme: light dark;

  /* 1. PRIMITIVES, named by appearance. Never use these in components. */
  /* neutral ladder, hue 90 */
  --neutral-50:  oklch(0.98 0.007 90);   /* #faf8f3  paper */
  --neutral-100: oklch(0.95 0.007 90);   /* #f0eee9 */
  --neutral-200: oklch(0.90 0.008 90);   /* #e0ded8  light rules */
  --neutral-300: oklch(0.82 0.009 90);   /* #c6c4be */
  --neutral-400: oklch(0.72 0.011 90);   /* #a7a49d  dark-mode secondary text */
  --neutral-500: oklch(0.62 0.012 90);   /* #89867e  placeholders, 3:1 both modes */
  --neutral-600: oklch(0.52 0.011 90);   /* #6b6962  light-mode secondary text */
  --neutral-700: oklch(0.43 0.009 90);   /* #52504a */
  --neutral-800: oklch(0.34 0.008 90);   /* #393833  dark raised surface, dark rules */
  --neutral-900: oklch(0.25 0.006 90);   /* #23221e  dark secondary ground */
  --neutral-950: oklch(0.18 0.006 90);   /* #13110f  sumi, the dark ground */
  /* accent ladder, hue 87 (kin, gold). One hue only. */
  --kin-50:  oklch(0.98 0.023 87);       /* #fff8e8 */
  --kin-100: oklch(0.95 0.048 87);       /* #fcedcb */
  --kin-200: oklch(0.90 0.060 87);       /* #efdcb1  light selection */
  --kin-300: oklch(0.82 0.080 87);       /* #dac188  dark-mode accent text */
  --kin-400: oklch(0.72 0.105 87);       /* #c1a052  dark-mode accent thread */
  --kin-500: oklch(0.62 0.127 87);       /* #a78000  light-mode accent thread, 3.5:1 */
  --kin-600: oklch(0.52 0.105 87);       /* #836404  light-mode accent text, 5.2:1 */
  --kin-700: oklch(0.43 0.083 87);       /* #634c0c */
  --kin-800: oklch(0.34 0.060 87);       /* #45360d  dark selection */
  --kin-900: oklch(0.25 0.038 87);       /* #29200b */
  --kin-brand: oklch(0.688 0.112 87.6);  /* #b8963f  the exact brand gold: rules, marks, display over 24px on dark grounds only */

  /* 2. SEMANTIC, named by role. Components use only these. */
  --color-bg:          light-dark(var(--neutral-50),  var(--neutral-950));
  --color-bg-2:        light-dark(var(--neutral-100), var(--neutral-900));
  --color-bg-raised:   light-dark(oklch(0.995 0.004 90), var(--neutral-800));
  --color-fg:          light-dark(var(--neutral-950), var(--neutral-100));
  --color-fg-2:        light-dark(var(--neutral-600), var(--neutral-400));
  --color-fg-3:        var(--neutral-500);                      /* placeholders, disabled: 3:1 in both modes */
  --color-line:        light-dark(var(--neutral-200), var(--neutral-800));
  --color-line-strong: light-dark(var(--neutral-400), var(--neutral-600));
  --color-accent:      light-dark(var(--kin-500), var(--kin-400));   /* the thread: rules, marks, eyebrows at 18.66px bold or larger, icons */
  --color-accent-text: light-dark(var(--kin-600), var(--kin-300));   /* any accent that is body-size text or a link */
  --color-accent-ink:  var(--neutral-950);                            /* text on a solid accent fill, both modes */
  --color-selection:   light-dark(var(--kin-200), var(--kin-800));
  --color-focus:       var(--color-accent-text);
  --color-veil:        color-mix(in oklab, var(--color-fg) 8%, transparent);
  --color-scrim:       color-mix(in oklab, var(--neutral-950) 60%, transparent);
  --color-accent-hover: light-dark(var(--kin-600), var(--kin-300));  /* static default; refined below when relative colours exist */
}

/* user override (only when the brief asks for a toggle) and dark-by-design registers */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"]  { color-scheme: dark; }
.register-dark           { color-scheme: only dark; }   /* story pages, launch pages, hero sections */

/* preference and enhancement layers */
@media (prefers-contrast: more) {
  :root { --color-fg-2: var(--color-fg); --color-fg-3: var(--color-fg-2); --color-line: var(--color-line-strong); }
}
@supports (color: oklch(from red l c h)) {
  :root { --color-accent-hover: oklch(from var(--color-accent) calc(l - 0.06) c h); }
}

/* fallbacks: custom properties cannot fall back inline, so these blocks are the only working path */
@supports not (color: oklch(0 0 0)) {
  :root {
    --neutral-50: #faf8f3; --neutral-100: #f0eee9; --neutral-200: #e0ded8; --neutral-300: #c6c4be;
    --neutral-400: #a7a49d; --neutral-500: #89867e; --neutral-600: #6b6962; --neutral-700: #52504a;
    --neutral-800: #393833; --neutral-900: #23221e; --neutral-950: #13110f;
    --kin-50: #fff8e8; --kin-100: #fcedcb; --kin-200: #efdcb1; --kin-300: #dac188; --kin-400: #c1a052;
    --kin-500: #a78000; --kin-600: #836404; --kin-700: #634c0c; --kin-800: #45360d; --kin-900: #29200b;
    --kin-brand: #b8963f;
  }
}
@supports not (color: light-dark(#000, #fff)) {
  :root {
    --color-bg: var(--neutral-50); --color-bg-2: var(--neutral-100); --color-bg-raised: #fefdfb;
    --color-fg: var(--neutral-950); --color-fg-2: var(--neutral-600);
    --color-line: var(--neutral-200); --color-line-strong: var(--neutral-400);
    --color-accent: var(--kin-500); --color-accent-text: var(--kin-600); --color-selection: var(--kin-200);
    --color-accent-hover: var(--kin-600);
  }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --color-bg: var(--neutral-950); --color-bg-2: var(--neutral-900); --color-bg-raised: var(--neutral-800);
    --color-fg: var(--neutral-100); --color-fg-2: var(--neutral-400);
    --color-line: var(--neutral-800); --color-line-strong: var(--neutral-600);
    --color-accent: var(--kin-400); --color-accent-text: var(--kin-300); --color-selection: var(--kin-800);
    --color-accent-hover: var(--kin-300);
  } }
  html[data-theme="dark"], .register-dark {
    --color-bg: var(--neutral-950); --color-bg-2: var(--neutral-900); --color-bg-raised: var(--neutral-800);
    --color-fg: var(--neutral-100); --color-fg-2: var(--neutral-400);
    --color-line: var(--neutral-800); --color-line-strong: var(--neutral-600);
    --color-accent: var(--kin-400); --color-accent-text: var(--kin-300); --color-selection: var(--kin-800);
    --color-accent-hover: var(--kin-300);
  }
}
}
/* registered so CSS transitions can interpolate the accent token (kept outside the layer on purpose) */
@property --color-accent { syntax: "<color>"; inherits: true; initial-value: #a78000; }

/* ---- type.css ---- */
/* type.css : house type stack (web-studio, 2026-09). Source: typography-web-jp.md R2.
   Family names come from site.json (build.py appends a tokens-layer block that overrides the :root
   values below). @font-face blocks live in fonts.css (tools/fonts.py) or assets/fonts/sliced/*.css.
   Without either, the metric-matched local fallbacks below carry the page with no CLS. */

/* metric-matched fallbacks (Baseline 2023): JP glyphs are 1em wide, so size-adjust stays 100% */
@font-face { font-family: "JP Serif Fallback"; src: local("Hiragino Mincho ProN"), local("HiraMinProN-W3"), local("Yu Mincho"), local("YuMincho");
  ascent-override: 116%; descent-override: 28.8%; line-gap-override: 0%; size-adjust: 100%; }
@font-face { font-family: "JP Sans Fallback"; src: local("Hiragino Sans"), local("Hiragino Kaku Gothic ProN"), local("Yu Gothic"), local("YuGothic"), local("Meiryo");
  ascent-override: 116%; descent-override: 28.8%; line-gap-override: 0%; size-adjust: 100%; }

@layer tokens {
  :root {
    --jp-display: "Shippori Mincho B1", "Shippori Mincho B1 Sliced", "JP Serif Fallback", serif;
    --jp-body: "Noto Serif JP", "Noto Serif JP Sliced", "JP Serif Fallback", serif;
    --jp-ui: "Zen Kaku Gothic New", "Zen Kaku Gothic New Sliced", "JP Sans Fallback", sans-serif;
    --en-display: "Cormorant Garamond", "Shippori Mincho B1", serif;
    --en-body: "Source Serif 4", "Noto Serif JP", serif;
    --en-ui: "Inter", "Zen Kaku Gothic New", sans-serif;
    /* fluid scale: 360px/16px ratio 1.2 -> 1240px/18px ratio 1.25 (rem term keeps zoom working) */
    --step--2: clamp(0.6944rem, 0.684rem + 0.0465vw, 0.72rem);
    --step--1: clamp(0.8333rem, 0.8061rem + 0.1212vw, 0.9rem);
    --step-0: clamp(1rem, 0.9489rem + 0.2273vw, 1.125rem);
    --step-1: clamp(1.2rem, 1.116rem + 0.375vw, 1.406rem);
    --step-2: clamp(1.44rem, 1.31rem + 0.5778vw, 1.758rem);
    --step-3: clamp(1.728rem, 1.536rem + 0.8532vw, 2.197rem);
    --step-4: clamp(2.074rem, 1.798rem + 1.224vw, 2.747rem);
    --step-5: clamp(2.488rem, 2.102rem + 1.718vw, 3.433rem);
    --step-6: clamp(3rem, 2.4rem + 2.8vw, 5rem);
    --lh-prose-ja: 1.9; --lh-prose-en: 1.6; --lh-head: 1.35; --lh-display: 1.15;
    --track-body-ja: 0.03em; --track-head-ja: 0.06em; --track-display-ja: 0.12em; --track-label: 0.18em;
    --measure-ja: 38em; --measure-en: 65ch;
  }
}

@layer base {
  html { font-family: var(--jp-body); font-size: 100%; line-height: var(--lh-prose-ja);
    font-kerning: normal; font-optical-sizing: auto;
    text-autospace: normal;              /* Baseline 2025-11; do not hand-type spaces between kanji and Latin */
    text-spacing-trim: normal;           /* Chromium only; acts only on fonts with halt/chws (the Noto pair) */
    hanging-punctuation: first allow-end; /* Safari only, harmless elsewhere */
  }
  :lang(ja) { line-break: strict; word-break: normal; overflow-wrap: break-word; letter-spacing: var(--track-body-ja); }
  :lang(en) { font-family: var(--en-body); line-height: var(--lh-prose-en); letter-spacing: 0; hyphens: auto; overflow-wrap: break-word; }
  body { font-size: var(--step-0); }     /* 16px floor on phones (DADS), 18px at 1240px */

  /* headings and display */
  h1, h2, h3, .display { font-family: var(--jp-display); font-weight: 400; line-height: var(--lh-head);
    text-wrap: balance; letter-spacing: var(--track-head-ja);
    font-feature-settings: "palt";       /* Shippori B1 + Noto have palt; no-op on Zen Kaku / Zen Old / Yuji */
    text-box: trim-both cap alphabetic; } /* Baseline 2026-08; ideographic edges not implemented yet */
  h1:lang(ja), h2:lang(ja), .display:lang(ja), .hero-copy:lang(ja) { word-break: auto-phrase; } /* Chromium; BudouX fills in for Safari/Firefox */
  h1:lang(en), h2:lang(en), .display:lang(en) { font-family: var(--en-display); font-size: 1.06em; letter-spacing: 0; } /* Latin serif reads ~6% smaller beside kanji at equal size */

  /* ruby */
  ruby { ruby-position: over; }
  rt { font-size: 0.5em; letter-spacing: 0; font-feature-settings: normal; }
}

@layer components {
  /* prose */
  .prose { max-inline-size: var(--measure-ja); text-wrap: pretty; }
  .prose:lang(en) { max-inline-size: var(--measure-en); }
  .prose p + p { margin-block-start: 1em; }
  .prose:lang(ja) p + p { margin-block-start: 0; text-indent: 1em; }   /* 字下げ paragraphs for editorial registers; use margins for UI copy */
  .prose h2, .prose h3 { margin-block: 2em 0.6em; }
  .prose h2 { font-size: var(--step-2); }
  .prose h3 { font-size: var(--step-1); }
  .prose ul, .prose ol { padding-inline-start: 1.4em; margin-block: 1em; }
  .prose li + li { margin-block-start: 0.4em; }
  .prose a { color: var(--color-accent-text); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
  .prose a:hover { color: var(--color-accent-hover); }

  .display { font-size: var(--step-5); line-height: var(--lh-display); letter-spacing: var(--track-display-ja); }
  .display-xl { font-size: var(--step-6); line-height: 1.05; letter-spacing: 0.02em; }
  .display-l { font-size: var(--step-5); line-height: 1.2; }
  .display-m { font-size: var(--step-3); line-height: 1.45; }
  .display-s { font-size: var(--step-1); line-height: 1.6; }
  .display-xl:lang(en), .display-l:lang(en) { letter-spacing: 0; }
  .lede { font-size: var(--step-1); line-height: 1.9; }
  .lede:lang(en) { line-height: 1.6; }
  .small { font-size: var(--step--1); line-height: 1.8; color: var(--color-fg-2); }
  .hero-tagline { font-family: var(--hero-face, var(--jp-display)); }

  /* labels, kickers, numerals */
  .label, .eyebrow { display: block; font-family: var(--jp-ui); font-size: var(--step--1); letter-spacing: var(--track-label); text-transform: uppercase; font-variant-numeric: tabular-nums; }
  .eyebrow { font-size: var(--step--2); letter-spacing: 0.3em; color: var(--color-accent-text); font-weight: 500; }
  .eyebrow-2 { color: var(--color-fg-2); }
  :lang(en) .label, :lang(en) .eyebrow { font-family: var(--en-ui); }
  .num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum"; }

  /* vertical accents only */
  .tate { writing-mode: vertical-rl; text-orientation: mixed; font-feature-settings: "palt" 0, "vpal"; letter-spacing: 0.1em; line-height: 1.7; }
  .tate .tcy { text-combine-upright: all; }

  /* phrase-wrap convention for JP headings: <span class="nw">phrase</span><span class="nw">phrase</span>;
     build.py inserts <wbr> between adjacent .nw spans so lines break only at phrase edges. */
  .nw { white-space: nowrap; display: inline-block; }
  .measure { max-width: var(--measure-ja); }
  .measure:lang(en) { max-width: var(--measure-en); }
}

/* ---- fonts.css (generated by tools/fonts.py) ---- */
/* Inter variable, Latin only (OFL 1.1, from @fontsource-variable/inter 5.2.5). Japanese stays on system fallbacks until the December rebuild. */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---- brand values from site.json ---- */
@layer tokens { :root {
  --jp-display: "Shippori Mincho B1", "Shippori Mincho B1 Sliced", "JP Serif Fallback", serif;
  --jp-body: "Noto Sans JP", "Noto Sans JP Sliced", "JP Serif Fallback", serif;
  --jp-ui: "Noto Sans JP", "Noto Sans JP Sliced", "JP Sans Fallback", sans-serif;
  --en-display: "Inter", "Shippori Mincho B1", serif;
  --en-body: "Inter", "Noto Sans JP", serif;
  --en-ui: "Inter", "Noto Sans JP", sans-serif;
} }
@layer overrides { html[data-mood="light"] { color-scheme: only light; } }

/* ---- site.css ---- */
/* site.css : house layout + components (web-studio, 2026-09). Lifted from jindai/public/assets/site.css
   and rebuilt on the token/type layers. Colours: semantic tokens only (--color-*). Never hide content
   here: initial hidden states are gsap.set() in site.js; the only opacity:0 rules sit behind html.js,
   [popover] or @starting-style (tools/check.py enforces this). Comments use commas and colons, no dashes. */

/* ---------- page transitions (native, cross-document; Firefox gets a plain navigation) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 320ms; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
}

@layer tokens {
  :root {
    --gutter: clamp(20px, 5vw, 72px);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-inout: cubic-bezier(.87, 0, .13, 1);
    --frame-z: 60;
    --wrap: 1240px;
    --wrap-n: 920px;
  }
}

@layer base {
  body { background: var(--color-bg); color: var(--color-fg); overflow-x: clip; text-rendering: optimizeLegibility; }
  @media (prefers-reduced-motion: no-preference) { body { transition: background-color .6s var(--ease-inout), color .6s var(--ease-inout); } }
  html.lenis, html.lenis body { height: auto; }
  .lenis.lenis-smooth { scroll-behavior: auto !important; }
  .lenis.lenis-stopped { overflow: hidden; }
  a { color: inherit; text-decoration: none; }
  a:not([class]):hover { text-decoration: underline; text-underline-offset: .18em; }
  ul, ol { list-style: none; padding: 0; }
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
  ::selection { background: var(--color-selection); }
  :focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
  main { position: relative; }
  hr { border: 0; height: 1px; background: var(--color-line); }
  .mark, .frame-top .mark { view-transition-name: site-mark; }
}

/* ---------- layout primitives ---------- */
@layer layout {
  .wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
  .wrap-n { width: min(var(--wrap-n), 100% - 2 * var(--gutter)); margin-inline: auto; }
  .section { padding: clamp(72px, 12vh, 140px) 0; }
  .section-tight { padding: clamp(48px, 7vh, 80px) 0; }
  .section + .section { padding-top: 0; }
  .grid { display: grid; gap: clamp(24px, 4vw, 64px); }
  .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g5-7 { grid-template-columns: 5fr 7fr; align-items: center; }
  .g7-5 { grid-template-columns: 7fr 5fr; align-items: center; }
  .stack { display: grid; gap: 18px; }
  .stack-l { display: grid; gap: 28px; }
  .stack-xl { display: grid; gap: 44px; }
  .below-fold { content-visibility: auto; contain-intrinsic-size: auto 60rem; }
  @media (max-width: 900px) {
    .g2, .g3, .g5-7, .g7-5 { grid-template-columns: 1fr; }
  }
}

@layer components {
  /* ---------- persistent frame (Izanami-style chrome; lifted from Jindai layout.html L42-69) ---------- */
  .skip-link { position: absolute; left: -999px; top: 12px; z-index: 100; padding: 10px 16px; background: var(--color-bg); color: var(--color-fg); border: 1px solid var(--color-line-strong); font-family: var(--jp-ui); font-size: var(--step--1); }
  .skip-link:focus { left: var(--gutter); }
  .frame-top { position: fixed; inset: 0 0 auto 0; z-index: var(--frame-z); display: flex; justify-content: space-between; align-items: center; padding: 26px var(--gutter); pointer-events: none; }
  .frame-top > * { pointer-events: auto; }
  .mark { display: flex; align-items: center; gap: 10px; }
  .mark-svg { width: 26px; height: 26px; color: var(--color-accent); }
  .mark-word { font-family: var(--jp-display); font-size: 19px; letter-spacing: .2em; font-weight: 500; line-height: 1; margin-top: 2px; }
  .mark-romaji { font-family: var(--jp-ui); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--color-accent-text); margin-top: 4px; }
  .frame-right { display: flex; align-items: center; gap: 22px; }
  .lang { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; border: 1px solid color-mix(in oklab, var(--color-fg) 34%, transparent); padding: 7px 13px 6px; border-radius: 999px; transition: border-color .3s, color .3s; min-height: 24px; }
  .lang:hover { border-color: var(--color-accent); color: var(--color-accent-text); }
  .menu-btn { position: relative; font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; padding: 8px 2px 6px; min-height: 24px; }
  .menu-btn::before { content: ""; position: absolute; top: 0; left: 50%; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: var(--color-accent); }
  .frame-rail { position: fixed; left: calc(var(--gutter) / 2); top: 50%; z-index: var(--frame-z); transform: translate(-50%, -50%) rotate(-90deg); transform-origin: center; pointer-events: none; }
  .rail-label { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase; color: var(--color-fg-2); white-space: nowrap; }
  .frame-bottom { position: fixed; inset: auto 0 0 0; z-index: var(--frame-z); display: flex; justify-content: space-between; align-items: flex-end; padding: 22px var(--gutter); pointer-events: none; font-family: var(--jp-ui); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--color-fg-2); }
  .frame-scroll { display: flex; align-items: center; gap: 12px; transition: opacity .5s; }
  .frame-scroll::after { content: ""; width: 36px; height: 1px; background: currentColor; transform-origin: left; animation: scrollcue 2.2s var(--ease-inout) infinite; }
  @keyframes scrollcue { 0% { transform: scaleX(0); transform-origin: left; } 45% { transform: scaleX(1); transform-origin: left; } 55% { transform: scaleX(1); transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
  html.js body.scrolled .frame-scroll { opacity: 0; }
  @media (max-width: 900px) {
    .frame-rail, .frame-bottom { display: none; }
    .frame-top { padding: 18px var(--gutter); }
  }

  /* ---------- menu overlay: native popover (works with JS off), fades via @starting-style ---------- */
  .menu { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--color-bg); color: var(--color-fg); }
  .menu::backdrop { background: transparent; }
  [popover].menu { opacity: 0; transition: opacity .5s var(--ease-inout), display .5s allow-discrete, overlay .5s allow-discrete; }
  [popover].menu:popover-open { opacity: 1; }
  @starting-style { [popover].menu:popover-open { opacity: 0; } }
  .menu-top { display: flex; justify-content: space-between; align-items: center; padding: 26px var(--gutter); }
  .menu-inner { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter) 84px; overflow: auto; }
  .menu-list { display: grid; gap: clamp(6px, 1.4vh, 18px); }
  .menu-list a { display: flex; align-items: baseline; gap: 22px; padding: 6px 0; }
  .menu-main { font-family: var(--jp-display); font-size: clamp(30px, min(7vw, 9.5vh), 84px); line-height: 1.15; letter-spacing: .06em; transition: color .3s; }
  :lang(en) .menu-main { font-family: var(--en-display); letter-spacing: 0; }
  .menu-sub { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--color-accent-text); }
  .menu-list a:hover .menu-main, .menu-list a[aria-current="page"] .menu-main { color: var(--color-accent-text); }
  .menu-foot { margin-top: 6vh; display: flex; gap: 32px; align-items: center; flex-wrap: wrap; font-family: var(--jp-ui); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--color-fg-2); }
  .menu-lang { border-bottom: 1px solid var(--color-line-strong); padding-bottom: 2px; }
  @media (max-width: 560px) { .menu-list a { flex-direction: column; gap: 4px; } }

  /* ---------- intro (optional, home once per session; entirely JS-driven) ---------- */
  .intro { position: fixed; inset: 0; z-index: 80; background: var(--color-bg); color: var(--color-fg); display: grid; place-items: center; align-content: center; gap: 26px; }
  html:not(.js) .intro { display: none; }
  html.js .intro-line { opacity: 0; }
  .intro-line { font-family: var(--jp-display); font-size: var(--step-1); letter-spacing: .14em; line-height: 1.9; text-align: center; }
  .intro-mark { width: 104px; height: 104px; color: var(--color-accent); }
  .intro-mark circle, .intro-mark path { stroke-dasharray: 1; stroke-dashoffset: 1; }

  /* ---------- heroes ---------- */
  .hero { position: relative; isolation: isolate; overflow: clip; }
  .hero-manifesto { min-height: 100svh; display: grid; align-items: end; padding-bottom: clamp(72px, 14vh, 150px); }
  .hero-media { position: absolute; inset: 0; z-index: -2; }
  .hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
  .hero-manifesto::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--color-scrim) 0%, transparent 30%, transparent 58%, var(--color-bg) 100%); }
  .hero-body { padding: 0 var(--gutter); display: grid; gap: 18px; justify-items: start; max-width: min(100%, 860px); }
  .hero-line { font-family: var(--jp-display); font-size: clamp(23px, 3.2vw, 46px); letter-spacing: .1em; line-height: 1.7; font-weight: 500; text-shadow: 0 1px 24px color-mix(in oklab, var(--color-scrim) 60%, transparent); }
  .hero-line:lang(en) { font-family: var(--en-display); letter-spacing: .01em; line-height: 1.3; font-size: clamp(30px, 4.2vw, 60px); }
  .hero-sub { font-family: var(--jp-ui); font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--color-accent); }
  .hero-under { font-size: var(--step--1); letter-spacing: .14em; color: var(--color-fg-2); }
  .hero-index { min-height: 70svh; display: grid; align-items: end; padding: clamp(130px, 22vh, 220px) 0 clamp(48px, 8vh, 96px); }
  .hero-index .display-xl { max-width: 14em; }
  .hero-index-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; font-family: var(--jp-ui); font-size: var(--step--1); letter-spacing: .12em; color: var(--color-fg-2); border-top: 1px solid var(--color-line); padding-top: 18px; }
  .hero-index-list dt { text-transform: uppercase; letter-spacing: .24em; font-size: var(--step--2); }
  .hero-product { padding-top: clamp(120px, 18vh, 200px); }
  .spine-line { font-family: var(--jp-display); font-size: clamp(30px, 5vw, 68px); letter-spacing: .1em; line-height: 1.5; }
  .spine-line:lang(en) { font-family: var(--en-display); font-size: clamp(26px, 3.2vw, 44px); letter-spacing: .01em; line-height: 1.35; }
  @media (max-width: 900px) { .hero-index { min-height: 56svh; } }

  /* ---------- media frames ---------- */
  .frame-img { position: relative; overflow: clip; background: var(--color-bg-2); }
  .frame-img img, .frame-img picture { width: 100%; height: 100%; }
  .frame-img img { object-fit: cover; }
  .frame-img.plx { aspect-ratio: 4 / 5; }
  .frame-img.plx img { position: absolute; inset: -12% 0; height: 124%; }
  .frame-img.r34 { aspect-ratio: 3 / 4; }
  .frame-img.r45 { aspect-ratio: 4 / 5; }
  .frame-img.r1 { aspect-ratio: 1; }
  .frame-img.r32 { aspect-ratio: 3 / 2; }
  .frame-img.r169 { aspect-ratio: 16 / 9; }
  .cap { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .2em; color: var(--color-fg-2); margin-top: 12px; }

  /* ---------- manifesto block (centered measure) ---------- */
  .manifesto { text-align: center; display: grid; gap: 34px; justify-items: center; }
  .manifesto p { max-width: 30em; font-size: var(--step-0); line-height: 2.3; letter-spacing: .06em; }
  .manifesto p:lang(en) { letter-spacing: .02em; line-height: 1.9; max-width: 36em; }
  .manifesto .display-m { letter-spacing: .14em; }
  .manifesto .display-m:lang(en) { letter-spacing: 0; }

  /* ---------- split: sticky media + scrolling text ---------- */
  .split { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(24px, 5vw, 96px); align-items: start; }
  .split.flip .split-media { order: 2; }
  .split-media { position: sticky; top: clamp(72px, 10vh, 120px); }
  .split-text { display: grid; gap: clamp(64px, 14vh, 160px); padding-block: clamp(24px, 6vh, 80px); }
  .split-step { display: grid; gap: 18px; }
  .split-no { font-family: var(--jp-display); font-size: 13px; letter-spacing: .34em; color: var(--color-accent-text); }
  .split-step h3 { font-size: var(--step-2); line-height: 1.6; letter-spacing: .06em; }
  .split-step h3:lang(en) { font-family: var(--en-display); letter-spacing: 0; line-height: 1.25; font-size: var(--step-3); }
  @media (max-width: 900px) {
    .split { grid-template-columns: 1fr; }
    .split-media, .split.flip .split-media { order: -1; position: static; }
    .split-text { gap: clamp(48px, 10vh, 96px); }
  }

  /* ---------- band: full-bleed media with an offset caption ---------- */
  .band { display: grid; grid-template-rows: 1fr auto; }
  .band > figure, .band > picture { grid-area: 1 / 1 / 3 / 2; width: 100%; }
  .band > figure img, .band > picture img { width: 100%; height: clamp(360px, 72vh, 820px); object-fit: cover; }
  .band-cap { grid-area: 2 / 1 / 3 / 2; justify-self: end; margin-inline-end: var(--gutter); max-width: 34em; background: var(--color-bg); padding: clamp(20px, 3vw, 36px) clamp(22px, 3vw, 40px); display: grid; gap: 10px; z-index: 1; }
  .band-cap p { font-size: var(--step--1); line-height: 1.9; color: var(--color-fg-2); }
  @media (max-width: 900px) { .band-cap { margin-inline: var(--gutter); max-width: none; } }

  /* ---------- index: numbered rows with hover media ---------- */
  .index { position: relative; border-top: 1px solid var(--color-line); }
  .index-row { display: grid; grid-template-columns: 3em 1fr auto; gap: 0 clamp(14px, 2vw, 32px); align-items: baseline; padding: clamp(18px, 2.4vh, 28px) 0; border-bottom: 1px solid var(--color-line); position: relative; }
  .index-no { font-family: var(--jp-ui); font-size: var(--step--2); letter-spacing: .3em; color: var(--color-accent-text); }
  .index-title { font-family: var(--jp-display); font-size: var(--step-3); line-height: 1.3; letter-spacing: .04em; transition: color .3s; }
  .index-title:lang(en) { font-family: var(--en-display); letter-spacing: 0; }
  .index-meta { font-family: var(--jp-ui); font-size: var(--step--2); letter-spacing: .2em; text-transform: uppercase; color: var(--color-fg-2); }
  .index-row:hover .index-title { color: var(--color-accent-text); }
  .index-row a::after { content: ""; position: absolute; inset: 0; }   /* whole row clickable */
  .index-media { grid-column: 1 / -1; margin-top: 12px; width: min(100%, 320px); aspect-ratio: 4 / 3; overflow: clip; background: var(--color-bg-2); }
  .index-media img { width: 100%; height: 100%; object-fit: cover; }
  @media (hover: hover) and (min-width: 901px) {
    html.js .index-media { position: absolute; right: 4em; top: 50%; translate: 0 -50%; width: 240px; margin: 0; opacity: 0; scale: .96; transition: opacity .35s var(--ease-out), scale .5s var(--ease-out); pointer-events: none; z-index: 2; }
    html.js .index-row:hover .index-media, html.js .index-row:focus-within .index-media { opacity: 1; scale: 1; }
  }

  /* ---------- stat table ---------- */
  .stat-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 4vw, 56px); }
  .stat { display: grid; gap: 8px; border-top: 1px solid var(--color-line); padding-top: 22px; }
  .stat-n { font-family: var(--jp-display); font-size: clamp(46px, 6.5vw, 96px); line-height: 1; letter-spacing: .02em; }
  .stat-n small { font-size: .34em; letter-spacing: .1em; margin-left: .2em; }
  .stat dt { font-family: var(--jp-ui); font-size: var(--step--2); letter-spacing: .24em; text-transform: uppercase; color: var(--color-fg-2); order: 2; }
  .stat p { font-size: var(--step--1); line-height: 1.9; color: var(--color-fg-2); }
  @media (max-width: 900px) { .stat-table { grid-template-columns: 1fr; gap: 28px; } }

  /* ---------- cta band ---------- */
  .cta-band { border-block: 1px solid var(--color-line); background: var(--color-bg-2); padding: clamp(56px, 9vh, 110px) 0; text-align: center; }
  .cta-band .wrap-n { display: grid; gap: 26px; justify-items: center; }

  /* ---------- spec list, price, dims (product) ---------- */
  .spec { display: grid; grid-template-columns: max-content 1fr; gap: 0 32px; border-top: 1px solid var(--color-line); }
  .spec > * { padding: 16px 0; border-bottom: 1px solid var(--color-line); font-size: var(--step--1); line-height: 1.9; }
  .spec dt { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .24em; color: var(--color-fg-2); padding-top: 21px; }
  .dims { display: flex; align-items: baseline; gap: .35em; font-family: var(--jp-display); font-size: clamp(40px, 6vw, 88px); line-height: 1; letter-spacing: .02em; }
  .dims small { font-family: var(--jp-ui); font-size: 11px; letter-spacing: .24em; color: var(--color-accent-text); }
  .price { font-family: var(--jp-display); font-size: clamp(30px, 3.6vw, 46px); letter-spacing: .06em; line-height: 1.2; color: var(--color-accent-text); }
  .price small { font-size: .42em; letter-spacing: .14em; color: var(--color-fg-2); margin-left: .4em; }
  .list { display: grid; gap: 10px; }
  .list li { position: relative; padding-left: 1.4em; }
  .list li::before { content: ""; position: absolute; left: 0; top: 1em; width: .6em; height: 1px; background: var(--color-accent); }
  .steps { counter-reset: s; display: grid; gap: 14px; }
  .steps li { display: grid; grid-template-columns: 2.4em 1fr; gap: 12px; font-size: var(--step--1); line-height: 1.9; }
  .steps li::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .2em; color: var(--color-accent-text); padding-top: .5em; }
  .legal-table { display: grid; grid-template-columns: max-content 1fr; gap: 0 32px; border-top: 1px solid var(--color-line); }
  .legal-table > * { padding: 14px 0; border-bottom: 1px solid var(--color-line); font-size: var(--step--1); line-height: 1.9; }
  .legal-table dt { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .2em; color: var(--color-fg-2); padding-top: 19px; }
  @media (max-width: 640px) { .spec, .legal-table { grid-template-columns: 1fr; } .spec dt, .legal-table dt { padding-bottom: 0; border-bottom: 0; } }

  /* ---------- buttons and links ---------- */
  .teaser { display: inline-flex; align-items: center; gap: 18px; font-family: var(--jp-ui); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; padding: 8px 0; min-height: 24px; }
  .teaser::before { content: ""; width: 44px; height: 1px; background: currentColor; transition: width .5s var(--ease-out); }
  .teaser:hover::before { width: 72px; }
  .teaser:hover { color: var(--color-accent-text); }
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--jp-ui); font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; border: 1px solid currentColor; padding: 18px 30px 16px; min-width: 220px; min-height: 44px; transition: background .4s var(--ease-out), color .4s var(--ease-out), border-color .4s, translate .15s; }
  .btn:hover { background: var(--color-fg); color: var(--color-bg); border-color: var(--color-fg); }
  .btn:active { translate: 0 1px; }
  .btn-accent { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
  @supports (color: contrast-color(red)) { .btn-accent { color: contrast-color(var(--color-accent)); } }
  .btn-accent:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: var(--color-accent-ink); }
  .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
  .note { font-size: var(--step--1); line-height: 1.9; color: var(--color-fg-2); }

  /* ---------- forms (Netlify Forms pattern, lifted from Jindai register.html L53-67) ---------- */
  .form { display: grid; gap: 26px; }
  .field { display: grid; gap: 8px; }
  .field label { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--color-fg-2); }
  .field input, .field textarea, .field select { font-family: var(--jp-ui); font-size: max(16px, var(--step-0)); color: var(--color-fg); background: transparent; border: 0; border-bottom: 1px solid var(--color-line-strong); padding: 10px 0; border-radius: 0; transition: border-color .3s; min-height: 44px; }
  .field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-bottom-color: var(--color-accent); }
  .field :user-invalid { border-bottom-color: oklch(0.55 0.18 25); }
  .field :user-invalid + .field-msg { display: block; }
  .field-msg { display: none; font-size: var(--step--2); color: oklch(0.55 0.18 25); letter-spacing: .06em; }
  .field textarea { min-height: 96px; resize: vertical; }
  .field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
  .check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--step--1); line-height: 1.8; color: var(--color-fg-2); }
  .check input { margin-top: .55em; accent-color: var(--color-accent); width: 18px; height: 18px; }
  .f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
  form[aria-busy="true"] .btn { opacity: .6; pointer-events: none; }
  @media (max-width: 640px) { .f2 { grid-template-columns: 1fr; } }

  /* ---------- footer (always dark: the register flips every token) ---------- */
  .site-foot { background: var(--color-bg); color: var(--color-fg); padding: clamp(72px, 10vh, 120px) 0 120px; margin-top: clamp(72px, 12vh, 140px); border-top: 1px solid var(--color-line); }
  .foot-inner { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; display: grid; gap: 56px; }
  .foot-essence { font-family: var(--jp-display); font-size: clamp(20px, 2.6vw, 34px); letter-spacing: .12em; line-height: 1.7; }
  .foot-essence:lang(en) { font-family: var(--en-display); letter-spacing: 0; line-height: 1.3; }
  .foot-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; font-size: var(--step--1); line-height: 2; color: var(--color-fg-2); }
  .foot-cols .eyebrow { margin-bottom: 10px; }
  .foot-cols a:hover { color: var(--color-accent-text); }
  .foot-nav { display: grid; gap: 4px; }
  .foot-copy { font-family: var(--jp-ui); font-size: 10px; letter-spacing: .2em; color: var(--color-fg-3); }
  @media (max-width: 900px) { .foot-cols { grid-template-columns: 1fr; gap: 28px; } }

  /* ---------- reveals (initial states set in JS only) ---------- */
  .fx-reveal .fx-mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
  .fx-reveal .fx-word, .fx-reveal .fx-char { display: inline-block; will-change: transform; }

  /* ---------- 404 ---------- */
  .notfound { min-height: 80svh; display: grid; align-content: center; gap: 22px; padding-top: 20vh; }
}

@layer utilities {
  .center { text-align: center; margin-inline: auto; }
  .muted { color: var(--color-fg-2); }
  .accent { color: var(--color-accent-text); }
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .rule { height: 1px; border: 0; background: linear-gradient(90deg, var(--color-line) 0 46%, transparent 46% 54%, var(--color-line) 54%); }
}

@layer overrides {
  /* ?static capture mode (site.js adds body.static): fixed hero height for deterministic screenshots */
  .static .hero-manifesto { min-height: 900px; }
  .static .intro { display: none; }
  .static .frame-scroll::after { animation: none; }
  /* reduced motion: loops stop (not slow), intro never shows, the frame cue is a plain rule */
  @media (prefers-reduced-motion: reduce) {
    .frame-scroll::after { animation: none; transform: none; }
    .intro { display: none; }
    .frame-img.plx img { position: static; inset: auto; height: 100%; }
    .split-media { position: static; }
  }
}

/* ==== Trunk Works skin (2026-10-28 fast lane). Source: trunk/brand/01-BRAND-GUIDELINES.md and the live
   trunk/public/index.html tokens. Charcoal ground, cream text, amber as a thread, sand for breaths.
   EN headings are sans (brand rule), JP display is Mincho, JP body is Gothic. Fonts fall back to the
   system faces until font files are self-hosted (December rebuild). ==== */
@layer overrides {
  :root, .register-dark {
    color-scheme: only dark;
    --color-bg: #211e1a; --color-bg-2: #191713; --color-bg-raised: #2b2620;
    --color-fg: #f2ead9; --color-fg-2: #c8b896; --color-fg-3: #8f8676;
    --color-line: rgba(191,166,128,.18); --color-line-strong: rgba(191,166,128,.34);
    --color-accent: #c9a87e; --color-accent-text: #d6b98f; --color-accent-hover: #e2c9a3;
    --color-accent-ink: #211e1a; --color-selection: #5a4a35; --color-focus: #e2c9a3;
    --jp-display: "Shippori Mincho B1", "JP Serif Fallback", serif;
    --jp-body: "Noto Sans JP", "JP Sans Fallback", sans-serif;
    --jp-ui: "Noto Sans JP", "JP Sans Fallback", sans-serif;
    --en-display: "Inter", -apple-system, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
    --en-body: "Inter", -apple-system, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
    --en-ui: "Inter", -apple-system, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  }
  body { background: var(--color-bg); color: var(--color-fg); }
  h1:lang(en), h2:lang(en), h3:lang(en), .display:lang(en), .hero-line:lang(en), .spine-line:lang(en) {
    font-family: var(--en-display); font-weight: 600; letter-spacing: -0.02em; }
  :lang(en) p, :lang(en) dd, :lang(en) li { font-weight: 400; }
  :lang(ja) p, :lang(ja) dd { line-height: 1.95; }
  .tick { width: 8px; height: 8px; background: var(--color-accent); transform: rotate(45deg); display: inline-block; flex-shrink: 0; margin-inline-end: .7em; }
  .mark { align-items: center; }
  .eyebrow::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--color-accent); transform: rotate(45deg) translateY(-2px); margin-inline-end: .7em; }

  /* sand breath: proof and process sections */
  .sand { --color-bg: #bfa680; --color-bg-2: #b39a74; --color-fg: #211e1a; --color-fg-2: #3a3228; --color-fg-3: #4d4337;
    --color-line: rgba(33,30,26,.18); --color-line-strong: rgba(33,30,26,.34);
    --color-accent: #211e1a; --color-accent-text: #211e1a; --color-accent-hover: #000;
    background: var(--color-bg); color: var(--color-fg); }
  .sand ::selection { background: #211e1a; color: #f2ead9; }

  /* what we build: a ruled list */
  .build-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--color-line-strong); }
  .build-list li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .4rem 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--color-line); }
  .build-list .no { font-variant-numeric: tabular-nums; color: var(--color-fg-3); font-size: var(--step--1); padding-top: .35em; }
  .build-list h3 { font-size: var(--step-1); margin: 0; }
  .build-list p { grid-column: 2; margin: 0; color: var(--color-fg-2); max-width: 46ch; }

  /* the clock rail: the signature piece on the overnight case */
  .clock { list-style: none; margin: 0; padding: 0; position: relative; }
  .clock::before { content: ""; position: absolute; inset-block: .6rem; inset-inline-start: 4.6rem; width: 1px; background: var(--color-line-strong); }
  .clock li { display: grid; grid-template-columns: 4.6rem 1fr; gap: 0 1.6rem; padding: .7rem 0; position: relative; }
  .clock li::after { content: ""; position: absolute; inset-inline-start: calc(4.6rem - 3.5px); top: 1.2rem; width: 8px; height: 8px; background: var(--color-bg); border: 1px solid var(--color-accent); transform: rotate(45deg); }
  .clock li.key::after { background: var(--color-accent); }
  .clock time { font-variant-numeric: tabular-nums; font-family: var(--en-ui); font-weight: 600; letter-spacing: .02em; padding-top: .1em; }
  .clock time small { display: block; font-weight: 400; color: var(--color-fg-3); font-size: .78em; }
  .clock p { margin: 0; padding-inline-start: .4rem; max-width: 52ch; }
  .clock li.day { padding-top: 1.4rem; }

  .pull { font-size: var(--step-2); line-height: 1.35; max-width: 22ch; margin: 0; }
  .pull + .cap { margin-top: .8rem; }
  .loop { width: 100%; height: auto; display: block; background: var(--color-bg-2); }
  .case-next { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
  .figs { display: grid; gap: clamp(1rem, 3vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); align-items: start; }
  .figs figure { margin: 0; }
  .figs .frame-img, .frame-img:has(figcaption) { background: none; height: auto; }
  .figs .frame-img picture { display: block; aspect-ratio: 4 / 5; overflow: clip; background: var(--color-bg-2); }
  .figs .frame-img img { height: 100%; width: 100%; object-fit: cover; }
  .mailto { font-size: var(--step-2); word-break: break-all; }
}
@layer overrides {
  /* Trunk keeps a solid nav bar (live site pattern): text never runs under the mark */
  .frame-top { background: var(--color-bg); border-bottom: 1px solid var(--color-line); }
}
@layer overrides {
  /* JP display lines are phrase-locked (.nw); on phones the size must let the longest phrase fit */
  @media (max-width: 640px) {
    .display-xl:lang(ja) { font-size: clamp(1.9rem, 8.2vw, 3rem); letter-spacing: .02em; }
    .spine-line:lang(ja) { font-size: clamp(1.45rem, 6.4vw, 2.4rem); letter-spacing: .04em; }
    .display-m:lang(ja) { font-size: clamp(1.3rem, 5.6vw, 1.8rem); }
  }
}
@layer overrides {
  .mark-word { white-space: nowrap; letter-spacing: .12em; font-weight: 600; }
  @media (max-width: 640px) { .mark-romaji { display: none; } .mark-word { font-size: 16px; } }
}

/* ==== 2026-11 audit. Spacing rules, in one place: every band keeps its own padding, and only two plain dark
   sections in a row may share a gap. Kit defaults built for long sticky pages are switched off for these
   short case pages. ==== */
@layer overrides {
  :root { --sec: clamp(72px, 11vh, 128px); }
  :lang(en) { hyphens: manual; }
  .section { padding-block: var(--sec); }
  .section + .section { padding-top: 0; }
  .section.sand, .section.paper, .section.sand + .section, .section.paper + .section { padding-top: var(--sec); }
  .below-fold { content-visibility: visible; contain-intrinsic-size: none; }
  .split-text.stack-l { gap: 28px; padding-block: 0; }
  .site-foot { margin-top: 0; border-top: 0; }
  .foot-cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  .frame-bottom { transition: opacity .4s var(--ease-out); }
  .frame-rail { transition: opacity .4s var(--ease-out); }
  html.js body.scrolled .frame-bottom, html.js body.scrolled .frame-rail { opacity: 0; }
  /* the mark matches the live home: sans, tracked, one line */
  .frame-top .mark-word, .menu .mark-word { font-family: var(--en-ui); font-size: 13px; font-weight: 600; letter-spacing: .22em; }
  /* English headings run tight; the kit's roomy line-heights are for Japanese */
  .display-m:lang(en), .spine-line:lang(en) { line-height: 1.14; letter-spacing: -.015em; }
  .spine-line:lang(en) { font-size: clamp(36px, 4.6vw, 64px); }
  .display-m:lang(en) { font-size: var(--step-4); }

  /* heroes: label sits clear of the headline, the headline's lines stay tight, the image fits one screen */
  .hero-index { min-height: 0; padding-top: clamp(128px, 20vh, 200px); padding-bottom: var(--sec); }
  .hero .eyebrow { margin-bottom: 4px; }
  .hero h1:lang(en) { line-height: 1.04; }
  /* :lang(en) sets a prose line-height on every element, so the reveal's word spans were forcing 1.6 onto
     headings once JS ran (static captures never showed it). The spans now inherit; padding keeps descenders. */
  .fx-mask, .fx-word, .fx-char { line-height: inherit; }
  .fx-mask { vertical-align: bottom; padding-block: .1em .16em; margin-block: -.1em -.16em; }
  .hero-product { padding-bottom: var(--sec); }
  .hero-product .frame-img { aspect-ratio: auto; height: auto; background: none; overflow: visible; }
  .hero-product .frame-img picture { display: block; height: min(70svh, 680px); overflow: clip; background: var(--color-bg-2); }
  .hero-product .frame-img img { height: 100%; object-position: 42% 100%; }
  .tw-shot img { object-position: 50% 100%; }
  .hero-index + .section { padding-top: 0; }
  .tw-top p { margin: 0; }
  .tw-thread-foot p { margin: 0; }
  @media (min-width: 881px) { .tw-figs { display: none; } }
  .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }

  /* header: two visible links and one action on desktop, MENU on phones */
  .frame-nav { display: flex; align-items: center; gap: 26px; }
  .frame-nav a { font-family: var(--jp-ui); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--color-fg); }
  .frame-nav a:hover { color: var(--color-accent-text); }
  .frame-cta { font-family: var(--jp-ui); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; background: var(--color-accent); color: var(--color-accent-ink); padding: 9px 16px 8px; border-radius: 999px; white-space: nowrap; }
  .frame-cta:hover { background: var(--color-accent-hover); }
  .menu-btn { display: none; }
  .menu .menu-btn { display: block; }
  @media (max-width: 900px) {
    .frame-nav, .frame-cta { display: none; }
    .menu-btn { display: block; }
  }

  /* selected work: the photo is the argument, so it never hides behind a hover */
  .case-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--color-line); }
  .case-row { border-top: 1px solid var(--color-line); }
  .case-row a { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 64px); align-items: center; padding-block: clamp(20px, 3vh, 32px); color: inherit; }
  .case-row .frame-img { aspect-ratio: 3 / 2; }
  .case-row img { transition: scale .9s var(--ease-out); }
  .case-row a:hover img { scale: 1.03; }
  .case-text { display: grid; gap: 12px; }
  .case-title { font-size: var(--step-4); line-height: 1.15; margin: 0; transition: color .3s; }
  .case-title:lang(ja) { font-family: var(--jp-display); font-size: var(--step-3); line-height: 1.5; font-weight: 500; }
  .case-row a:hover .case-title { color: var(--color-accent-text); }
  .case-text p { margin: 0; color: var(--color-fg-2); max-width: 52ch; }
  .case-meta { font-family: var(--jp-ui); font-size: var(--step--2); letter-spacing: .18em; text-transform: uppercase; color: var(--color-fg-3); }
  @media (max-width: 760px) { .case-row a { grid-template-columns: 1fr; } }

  /* section head + ruled list on one grid */
  .sec-head { display: grid; gap: 16px; align-content: start; }
  .sec-head p { margin: 0; color: var(--color-fg-2); max-width: 44ch; }
  .proc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-line-strong); }
  .proc li { display: grid; grid-template-columns: 3.2rem 1fr; gap: 4px 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--color-line); }
  .proc .no { font-variant-numeric: tabular-nums; font-size: var(--step--1); color: var(--color-fg-3); padding-top: .2em; }
  .proc h3 { font-size: var(--step-1); margin: 0; }
  .proc p { grid-column: 2; margin: 0; color: var(--color-fg-2); max-width: 54ch; }

  /* who you work with */
  .people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-line-strong); }
  .person { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 10px clamp(20px, 4vw, 64px); padding-block: clamp(22px, 3.2vh, 34px); border-bottom: 1px solid var(--color-line); }
  .person-role { font-family: var(--jp-ui); font-size: var(--step--2); letter-spacing: .18em; text-transform: uppercase; color: var(--color-accent-text); display: block; margin-bottom: 8px; }
  .person-name { font-size: var(--step-2); line-height: 1.25; margin: 0; }
  .person-name:lang(ja) { font-family: var(--jp-display); font-weight: 500; line-height: 1.5; }
  .person p { margin: 0; color: var(--color-fg-2); max-width: 62ch; }
  @media (max-width: 760px) { .person { grid-template-columns: 1fr; } }

  /* paper ground: where the thread lives */
  .paper { --color-bg: #f2ead9; --color-bg-2: #e6dabf; --color-fg: #211e1a; --color-fg-2: #3a3228; --color-fg-3: #5f5546;
    --color-line: rgba(33,30,26,.16); --color-line-strong: rgba(33,30,26,.34);
    --color-accent: #8a6f3e; --color-accent-text: #6f5730; --color-accent-hover: #211e1a; --color-accent-ink: #f2ead9;
    background: var(--color-bg); color: var(--color-fg); }
  .paper ::selection { background: #211e1a; color: #f2ead9; }

  /* the thread: ported from the private viewing page, Trunk tokens, no client names */
  .tw-head { display: grid; gap: 16px; margin-bottom: clamp(32px, 6vh, 56px); max-width: 62ch; }
  .tw-wrap { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(24px, 3.5vw, 56px); align-items: start; }
  .tw-clock { position: sticky; top: 92px; display: grid; gap: 14px; }
  .tw-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
  .tw-day { opacity: .55; }
  .tw-top .tw-time { font-family: var(--en-display); font-weight: 700; font-size: clamp(2.8rem, 5.5vw, 4.4rem); line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin: 0; }
  .tw-status { color: var(--color-accent-text); }
  .tw-top { display: grid; gap: 4px; }
  .tw-bar { position: relative; height: 2px; background: var(--color-line-strong); margin: 22px 0 26px; }
  .tw-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--color-fg); transition: width .6s var(--ease-out); }
  .tw-mark { position: absolute; left: var(--at); top: -4px; width: 1px; height: 10px; background: var(--color-line-strong); }
  .tw-mark i { position: absolute; top: 13px; left: 0; translate: -50% 0; font-style: normal; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; white-space: nowrap; }
  .tw-mark:first-of-type i { translate: 0 0; }
  .tw-mark.is-up i { top: -19px; }
  .tw-mark.is-doors { background: var(--color-fg); }
  .tw-mark.is-doors i { translate: -100% 0; opacity: 1; font-weight: 600; }
  .tw-stage { position: relative; aspect-ratio: 3 / 4; max-height: 50svh; width: 100%; overflow: clip; background: var(--color-bg-2); }
  .tw-shot { position: absolute; inset: 0; transition: opacity .7s var(--ease-out); }
  html.js .tw-shot { opacity: 0; }
  .tw-shot picture, .tw-shot img { width: 100%; height: 100%; display: block; }
  .tw-shot img { object-fit: cover; }
  html.js .tw-shot.is-on { opacity: 1; }
  .tw-thread { background: #ece1c8; border: 1px solid var(--color-line); border-radius: 8px; overflow: hidden; }
  .tw-thread-head, .tw-thread-foot { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: #e6dabf; }
  .tw-thread-head { border-bottom: 1px solid var(--color-line); }
  .tw-thread-foot { border-top: 1px solid var(--color-line); justify-content: space-between; gap: 16px; }
  .tw-thread-foot .tw-mono { opacity: .6; text-transform: none; letter-spacing: .03em; }
  .tw-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: #211e1a; color: #c9a87e; display: grid; place-items: center; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
  .tw-name { font-weight: 600; font-size: 15px; line-height: 1.2; margin: 0; }
  .tw-meta { opacity: .55; margin: 2px 0 0; font-size: 10px; }
  .tw-ctrl { margin-left: auto; display: flex; gap: 8px; }
  .tw-btn { border: 1px solid var(--color-line-strong); padding: 6px 12px; border-radius: 999px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; background: none; color: inherit; cursor: pointer; transition: background .25s, color .25s; }
  .tw-btn:hover { background: #211e1a; color: #f2ead9; }
  html:not(.js) .tw-ctrl, html:not(.js) #t-replay, .static .tw-ctrl, .static #t-replay { display: none; }
  .tw-msgs { list-style: none; margin: 0; padding: 18px 16px 20px; display: grid; gap: 9px; max-height: min(64svh, 620px); overflow-y: auto; overscroll-behavior: contain; }
  html:not(.js) .tw-msgs, .static .tw-msgs { max-height: none; overflow: visible; }
  .tw-sys { text-align: center; opacity: .55; padding: 11px 0 5px; }
  .tw-msg { max-width: 78%; padding: 10px 13px 8px; border-radius: 10px; font-size: 15px; line-height: 1.5; }
  .tw-msg p { margin: 0; }
  .tw-msg .tw-img { margin-top: 8px; border-radius: 6px; overflow: clip; width: min(100%, 230px); aspect-ratio: 3 / 4; }
  .tw-msg .tw-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .tw-msg time { display: block; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 9.5px; letter-spacing: .08em; opacity: .5; margin-top: 5px; text-align: right; }
  .tw-who { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .55; margin-bottom: 3px !important; }
  .tw-emoji { font-size: 24px; line-height: 1.2; }
  .tw-them { justify-self: start; background: #f2ead9; border: 1px solid var(--color-line); border-bottom-left-radius: 3px; }
  .tw-me { justify-self: end; background: #211e1a; color: #f2ead9; border-bottom-right-radius: 3px; box-shadow: inset 2px 0 0 #c9a87e; }
  /* hiding sits behind the html.js gate, so JS-off and ?static read the whole thread */
  html.js:not(:has(body.static)) .tw-msgs > li { display: none; }
  html.js:not(:has(body.static)) .tw-msgs > li.shown { display: block; animation: twin .45s var(--ease-out) both; }
  @keyframes twin { from { transform: translateY(14px); } to { transform: none; } }
  html.js .tw-msg.is-typing > * { display: none; }
  html.js .tw-msg.is-typing::after { content: ""; display: block; width: 34px; height: 12px; margin: 2px 0; background: radial-gradient(circle 2.5px, currentColor 90%, transparent) 3px 6px / 10px 10px repeat-x; opacity: .55; animation: twdots 1s steps(2) infinite; }
  @keyframes twdots { 50% { opacity: .25; } }
  @media (max-width: 880px) {
    .tw-wrap { grid-template-columns: 1fr; }
    .tw-clock { position: static; gap: 10px; }
    .tw-stage { display: none; }
    .tw-msgs { max-height: 58svh; }
    .tw-mark:not(.is-doors):not(:first-of-type) i { display: none; }
    .tw-thread-head { flex-wrap: wrap; }
  }
  @media (prefers-reduced-motion: reduce) { html.js .tw-msgs > li.shown { animation: none; } }
}
