/* ==========================================================================
   息間 Stillroom — design tokens
   All colour / type / spacing decisions live here so the look can be retuned
   quickly when new reference material arrives. Change values, not selectors.
   ========================================================================== */
:root {
  /* — palette: white gallery base, accents sampled from the concept images — */
  --c-paper:        #fbfaf7;   /* page background (warm off-white) */
  --c-paper-2:      #f4f1ec;   /* alternate band / cards */
  --c-white:        #ffffff;
  --c-ink:          #1d1c1a;   /* primary text */
  --c-ink-2:        #57544f;   /* secondary text */
  --c-ink-3:        #8d8982;   /* captions, meta */
  --c-line:         #e3dfd8;   /* hairlines */
  --c-line-strong:  #cfc9bf;
  --c-lavender:     #8c7bb8;   /* from zone 1 purple light */
  --c-lavender-soft:#e9e4f3;
  --c-amber:        #c8964a;   /* from zone 1 bowls / zone 3 lamps */
  --c-amber-soft:   #f4e9d6;
  --c-moss:         #6f7a5a;   /* from zone 2 */
  --c-night:        #0f1424;   /* from zone 4 */

  /* — type — */
  --f-serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", serif;
  --f-sans:  "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --f-latin: "Cormorant Garamond", "Noto Serif TC", serif;   /* numerals + English display */

  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.8125rem;  /* 13 */
  --fs-base: 0.9375rem;  /* 15 */
  --fs-md:   1.0625rem;  /* 17 */
  --fs-lg:   clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  --fs-xl:   clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
  --fs-2xl:  clamp(2.1rem, 1.4rem + 3.2vw, 4.25rem);
  --fs-3xl:  clamp(2.6rem, 1.5rem + 5vw, 6rem);

  --lh-tight: 1.35;
  --lh-body:  1.95;
  --ls-cjk:   0.06em;    /* CJK body tracking */
  --ls-head:  0.1em;     /* CJK headline tracking */
  --ls-caps:  0.28em;    /* latin small caps labels */

  --w-light: 300; --w-reg: 400; --w-med: 500;

  /* — layout — */
  --page-max: 1360px;
  --margin:   clamp(20px, 5.5vw, 88px);
  --gutter:   clamp(16px, 2vw, 28px);
  --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: 144px;
  --section: clamp(96px, 14vw, 200px);  /* vertical rhythm between sections */
  --hair: 1px;
  --radius: 2px;
  --radius-pill: 999px;

  /* — motion — */
  --ease: cubic-bezier(.22, .61, .2, 1);
  --t-fast: 240ms; --t-med: 600ms; --t-slow: 1200ms;

  /* — 3D-space overlay (white glass on dark scenes) — */
  --ov-bg:     rgba(251, 250, 247, 0.86);
  --ov-bg-2:   rgba(251, 250, 247, 0.62);
  --ov-blur:   18px;
  --ov-text:   var(--c-ink);
  --ov-line:   rgba(29, 28, 26, 0.12);
}

/* — languages — paired blocks: <x data-l="zh|en|ja|ko"> — */
html:not(.L-zh) [data-l="zh"], html:not(.L-en) [data-l="en"], html:not(.L-ja) [data-l="ja"], html:not(.L-ko) [data-l="ko"] { display: none !important; }
html [data-l].is-l-fallback { display: revert !important; }
html[lang="en"] {
  --ls-cjk: 0.005em; --ls-head: 0.01em; --lh-body: 1.7;
  --f-serif: "Cormorant Garamond", "Noto Serif TC", serif;
  /* Latin-first sans so English punctuation (’ “ ” —) uses proportional Latin glyphs, not full-width CJK ones */
  --f-sans: "Noto Sans", "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
html.L-ja {
  --f-serif: "Noto Serif JP", "Noto Serif TC", serif;
  --f-sans: "Noto Sans JP", "Noto Sans", "Noto Sans TC", system-ui, sans-serif;
  --ls-cjk: 0.04em; --ls-head: 0.06em;
}
html.L-ko {
  --f-serif: "Noto Serif KR", "Noto Serif TC", serif;
  --f-sans: "Noto Sans KR", "Noto Sans", "Noto Sans TC", system-ui, sans-serif;
  --ls-cjk: 0.02em; --ls-head: 0.04em;
}
/* language toggle / 4-language switcher */
.lang { display: inline-flex; align-items: center; gap: .45em; height: 30px; padding: 0 .9em; border: 1px solid var(--c-line-strong); border-radius: var(--radius-pill);
  background: transparent; color: var(--c-ink-3); font: var(--w-reg) 11px/1 var(--f-sans); letter-spacing: .16em; cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); }
.lang:hover { border-color: var(--c-ink); color: var(--c-ink); }
.lang [data-code] { transition: color var(--t-fast); }
.lang [data-code].is-on { color: var(--c-ink); }
.lang i { width: 1px; height: 10px; background: currentColor; opacity: .35; }
.lang:focus-visible { outline: 1px solid var(--c-lavender); outline-offset: 3px; }

.lang-switch { position: relative; display: inline-flex; align-items: center; }
.lang-switch__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 30px; padding: 0 .75em; border: 1px solid var(--c-line-strong); border-radius: var(--radius-pill);
  background: transparent; color: var(--c-ink); font: var(--w-reg) 11px/1 var(--f-sans); letter-spacing: .08em; cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.lang-switch__btn:hover { border-color: var(--c-ink); }
.lang-switch__menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: grid; gap: 2px; min-width: 7.5em; padding: 6px; margin: 0; list-style: none;
  background: rgba(251, 250, 247, .96); border: 1px solid var(--ov-line, var(--c-line)); border-radius: 14px; box-shadow: 0 10px 28px rgba(40, 28, 16, .1); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.lang-switch__menu[hidden] { display: none !important; }
.lang-switch__menu button { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  font: var(--w-reg) 12px/1.2 var(--f-sans); letter-spacing: .06em; color: var(--c-ink-2); }
.lang-switch__menu button:hover, .lang-switch__menu button.is-on { background: rgba(29, 28, 26, .06); color: var(--c-ink); }
.lang-switch.is-open .lang-switch__btn { border-color: var(--c-ink); }
