/* 健三 · shared: tokens, type, nav, buttons, seals, toasts */
@font-face { font-family: "Brush"; src: url(/fonts/brush.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "SerifSC"; src: url(/fonts/serif-sc.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Garamond"; src: url(/fonts/display.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Mono"; src: url(/fonts/mono.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #0b0a09;
  --ink-2: #131110;
  --ink-3: #1c1916;
  --line: rgba(236, 228, 212, .12);
  --line-2: rgba(217, 178, 106, .32);
  --paper: #ece4d4;
  --paper-2: #c9bfad;
  --muted: #8f8676;
  --cinnabar: #d8321f;
  --cinnabar-hi: #ff4a2e;
  --cinnabar-deep: #7d160c;
  --gold: #d9b26a;
  --gold-hi: #f3d9a0;
  --jade: #6fbf8e;
  --serif: "Garamond", "SerifSC", "Songti SC", "Noto Serif SC", serif;
  --sc: "SerifSC", "Songti SC", "Noto Serif SC", "Garamond", serif;
  --brush: "Brush", "SerifSC", "Kaiti SC", serif;
  --mono: "Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --mx: 50vw; --my: 30vh;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--ink); }
body { margin: 0; background: var(--ink); color: var(--paper); font: 400 17px/1.7 var(--sc); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
html[data-lang="en"] body { font-family: var(--serif); font-size: 18px; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--cinnabar); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: .01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.zh { font-family: var(--sc); }
.brush { font-family: var(--brush); font-weight: 400; }

/* film grain + vignette over everything (no text, no HUD) */
body::after { content: ""; position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0) } 20% { transform: translate(-3%, 2%) } 40% { transform: translate(2%, -3%) } 60% { transform: translate(-2%, -1%) } 80% { transform: translate(3%, 3%) } 100% { transform: translate(0, 0) } }
.kz-dust { position: fixed; inset: 0; z-index: 160; pointer-events: none; width: 100%; height: 100%; }
html.lang-swap [data-t], html.lang-swap [data-th] { animation: swap .45s var(--ease); }
@keyframes swap { 0% { opacity: 0; filter: blur(6px); transform: translateY(4px) } 100% { opacity: 1; filter: none; transform: none } }

/* ------------------------------------------------------------ top bar */
.bar { position: fixed; inset: 0 0 auto; z-index: 70; display: flex; align-items: center; gap: 18px; padding: 14px clamp(16px, 4vw, 44px);
  transition: background .4s, border-color .4s, padding .4s; border-bottom: 1px solid transparent; }
.bar.solid { background: rgba(11, 10, 9, .82); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-color: var(--line); padding-block: 10px; }
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.mark img { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2), 0 6px 20px rgba(217, 178, 106, .25); }
.mark b { font: 400 26px/1 var(--brush); letter-spacing: .04em; color: var(--paper); }
.mark small { display: block; font: 600 10px/1 var(--mono); letter-spacing: .34em; color: var(--gold); margin-top: 4px; }
.bar nav { display: flex; gap: 26px; margin-left: auto; }
.bar nav a { text-decoration: none; font-size: 15px; color: var(--paper-2); position: relative; padding: 4px 0; }
.bar nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--cinnabar); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.bar nav a:hover { color: var(--paper); }
.bar nav a:hover::after { transform: scaleX(1); }
.bar .end { display: flex; align-items: center; gap: 10px; }
.bar nav + .end { margin-left: 8px; }
.lang { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; background: rgba(19, 17, 16, .6); cursor: pointer; }
.lang span { padding: 5px 11px; border-radius: 999px; font: 600 13px/1 var(--sc); color: var(--muted); transition: background .3s, color .3s; }
.lang span[data-en] { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.lang span.on { background: var(--gold); color: var(--ink); }

/* ------------------------------------------------------------ buttons */
.btn { --b: var(--cinnabar); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px;
  border: 0; border-radius: 4px; background: var(--b); color: #fff7ea; font: 600 17px/1 var(--sc); letter-spacing: .06em; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 220, 170, .35), 0 10px 30px -10px rgba(216, 50, 31, .7); transition: transform .25s var(--ease), box-shadow .25s, background .25s; overflow: hidden; isolation: isolate; }
html[data-lang="en"] .btn { font-family: var(--serif); font-size: 18px; letter-spacing: .02em; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 230, 190, .35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn:hover::before { transform: translateX(120%); }
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255, 220, 170, .5), 0 16px 40px -12px rgba(216, 50, 31, .9); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: rgba(217, 178, 106, .08); box-shadow: inset 0 0 0 1px var(--gold); }
.btn.gold { --b: linear-gradient(180deg, #f3d9a0, #c9974a); color: #1a1208; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 10px 30px -10px rgba(217, 178, 106, .7); }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* seal (印章) chips used everywhere */
.seal { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--cinnabar); border-radius: 6px; color: var(--cinnabar);
  font: 400 26px/1 var(--brush); transform: rotate(-4deg); box-shadow: inset 0 0 0 2px rgba(216, 50, 31, .18); }
.seal.filled { background: var(--cinnabar); color: #fff1e4; }

/* toast */
.kz-toast { position: fixed; left: 50%; bottom: 26px; z-index: 120; max-width: min(92vw, 460px); padding: 13px 20px; border-radius: 6px; background: #1d1a17; border: 1px solid var(--line-2);
  color: var(--paper); font-size: 15px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .35s var(--ease); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.kz-toast.show { transform: translate(-50%, 0); opacity: 1; }
.kz-toast.bad { border-color: var(--cinnabar); }

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); filter: blur(4px); }
[data-reveal].seen { opacity: 1; transform: none; filter: none; }
[data-reveal="ink"] { clip-path: inset(0 100% 0 0); transform: none; filter: none; transition: clip-path 1.4s cubic-bezier(.7, 0, .2, 1), opacity .6s; }
[data-reveal="ink"].seen { clip-path: inset(0 0 0 0); }

/* footer */
.foot { position: relative; padding: 70px clamp(16px, 5vw, 60px) 44px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; }
.foot .bigseal { width: 92px; margin: 0 auto 18px; opacity: .95; }
.foot .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 26px; margin: 14px 0; }
.foot a { color: var(--paper-2); text-decoration: none; }
.foot a:hover { color: var(--gold); }
.foot .nfa { font-size: 13px; letter-spacing: .08em; }

@media (max-width: 860px) {
  .bar nav { display: none; }
  .bar .end { margin-left: auto; }
  .mark b { font-size: 22px; }
}
@media (max-width: 420px) {
  .bar { gap: 10px; }
  .bar .end .btn.sm { padding: 0 12px; font-size: 14px; }
  .mark small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; clip-path: none; }
}
