/* Rajmandala Chronicles: site styles
   Themes are sets of custom properties switched by <html data-theme="...">.
   Add a theme by copying one block below, then add it to THEMES in build.mjs
   and to the list in theme-init.js. */

/* ---------- Fonts (self-hosted, SIL OFL 1.1) ---------- */
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/spectral-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/spectral-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/spectral-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/spectral-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/spectral-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Tiro Devanagari Sanskrit"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/tiro-devanagari-sanskrit-devanagari-400-normal.woff2) format("woff2");
  unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF,U+11B00-11B09; }

/* ---------- Tokens ---------- */
:root {
  --scale: 1;
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-text: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-deva: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", "Nirmala UI", serif;
  --wrap: 68rem;
  --gap: clamp(1rem, 0.6rem + 1.6vw, 2rem);
  --band-pad: clamp(2.6rem, 1.6rem + 4vw, 5rem);
  --radius: 6px;
}

/* Night Edition: the house style. Midnight navy, antique gold, warm ivory. */
:root, [data-theme="night-edition"] {
  color-scheme: dark;
  --bg: #15263A; --bg-alt: #1A2D44; --surface: #1D324B;
  --ink: #F4E8D0; --ink-soft: #CBC3B0; --line: #2E4663;
  --brand: #E2BC71; --on-brand: #15263A;
  --accent: #E2BC71; --accent-text: #E8C887;
  --cta: #E2BC71; --on-cta: #15263A;
  --dot: #F4E8D0;
  --link: #E8C887;
  --deep: #0F1C2C; --on-deep: #F4E8D0; --on-deep-soft: #C2BBA8; --deep-accent: #E2BC71; --deep-line: #243852;
  --focus: #E2BC71;
  --m1: rgba(226,188,113,.15); --m2: rgba(226,188,113,.08); --m3: rgba(226,188,113,.035);
  --shadow: 0 12px 34px rgba(0,0,0,.45);
}

/* Ivory: navy and brass on warm paper, like the printed brief. */
[data-theme="ivory"] {
  color-scheme: light;
  --bg: #F7EFDF; --bg-alt: #EFE3C9; --surface: #FCF8EF;
  --ink: #141B28; --ink-soft: #4C4A44; --line: #DCCCAA;
  --brand: #15263A; --on-brand: #F4E8D0;
  --accent: #B8862F; --accent-text: #8A6420;
  --cta: #15263A; --on-cta: #F4E8D0;
  --dot: #15263A;
  --link: #15263A;
  --deep: #15263A; --on-deep: #F4E8D0; --on-deep-soft: #CBC3B0; --deep-accent: #E2BC71; --deep-line: #2E4663;
  --focus: #8A6420;
  --m1: rgba(21,38,58,.15); --m2: rgba(21,38,58,.085); --m3: rgba(21,38,58,.04);
  --shadow: 0 10px 30px rgba(20,27,40,.16);
}

/* Paper: crisp white with navy, for daylight reading and printing. */
[data-theme="paper"] {
  color-scheme: light;
  --bg: #FFFFFF; --bg-alt: #E8EBF2; --surface: #FFFFFF;
  --ink: #141B28; --ink-soft: #4A5263; --line: #D6DBE6;
  --brand: #15263A; --on-brand: #FFFFFF;
  --accent: #B8862F; --accent-text: #8A6420;
  --cta: #15263A; --on-cta: #FFFFFF;
  --dot: #15263A;
  --link: #15263A;
  --deep: #15263A; --on-deep: #F4E8D0; --on-deep-soft: #CBC3B0; --deep-accent: #E2BC71; --deep-line: #2E4663;
  --focus: #8A6420;
  --m1: rgba(21,38,58,.14); --m2: rgba(21,38,58,.075); --m3: rgba(21,38,58,.035);
  --shadow: 0 10px 30px rgba(20,27,40,.14);
}

/* Midnight: near-black with gold, gentle on the eyes at night. */
[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0B0F17; --bg-alt: #111826; --surface: #151D2C;
  --ink: #EDE6D6; --ink-soft: #A9A496; --line: #263044;
  --brand: #E2BC71; --on-brand: #0B0F17;
  --accent: #E2BC71; --accent-text: #E8C887;
  --cta: #E2BC71; --on-cta: #0B0F17;
  --dot: #EDE6D6;
  --link: #E8C887;
  --deep: #05080D; --on-deep: #EDE6D6; --on-deep-soft: #A9A496; --deep-accent: #E2BC71; --deep-line: #1C2333;
  --focus: #E2BC71;
  --m1: rgba(226,188,113,.13); --m2: rgba(226,188,113,.07); --m3: rgba(226,188,113,.03);
  --shadow: 0 12px 34px rgba(0,0,0,.6);
}

/* High contrast: maximum legibility, links always underlined. */
[data-theme="contrast"] {
  color-scheme: light;
  --bg: #FFFFFF; --bg-alt: #FFFFFF; --surface: #FFFFFF;
  --ink: #000000; --ink-soft: #1A1A1A; --line: #000000;
  --brand: #000000; --on-brand: #FFFFFF;
  --accent: #B3001B; --accent-text: #B3001B;
  --cta: #000000; --on-cta: #FFFFFF;
  --dot: #000000;
  --link: #0000C8;
  --deep: #000000; --on-deep: #FFFFFF; --on-deep-soft: #FFFFFF; --deep-accent: #FFD400; --deep-line: #FFFFFF;
  --focus: #0000C8;
  --m1: rgba(0,0,0,.14); --m2: rgba(0,0,0,.07); --m3: rgba(0,0,0,0);
  --shadow: 0 0 0 2px #000;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(125% * var(--scale)); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: 1rem; line-height: 1.6; font-feature-settings: "cv11", "ss01"; overflow-wrap: break-word; }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .6em; text-wrap: balance; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.05rem, 1.25rem + 3.4vw, 3.5rem); }
h2 { font-size: clamp(1.55rem, 1.1rem + 1.7vw, 2.3rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
p, li { text-wrap: pretty; }
a { color: var(--link); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
[data-theme="contrast"] a { text-decoration: underline !important; text-decoration-thickness: 0.12em; }
[data-theme="contrast"] :focus-visible { outline-width: 4px; }
::selection { background: var(--cta); color: var(--on-cta); }
.deva { font-family: var(--font-deva); font-weight: 400; letter-spacing: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--brand); color: var(--on-brand); padding: .6rem 1rem; border-radius: var(--radius); }
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.band { padding-block: var(--band-pad); }
.band.alt { background: var(--bg-alt); }
.band.deep { background: var(--deep); color: var(--on-deep); }
.band.deep a { color: var(--on-deep); }
.band.deep a:hover { color: var(--deep-accent); }
.band.deep .eyebrow { color: var(--deep-accent); }
.band.deep .lede, .band.deep .soft { color: var(--on-deep-soft); }
.band.tight { padding-block: calc(var(--band-pad) * .6); }
.band + .band:not(.alt):not(.deep) { border-top: 1px solid var(--line); }

.eyebrow { font-size: .78rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 .9rem; }
.lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); color: var(--ink-soft); max-width: 44rem; }
.soft { color: var(--ink-soft); }
.small { font-size: .85rem; }
.measure { max-width: 44rem; }
.section-head { max-width: 46rem; margin-bottom: clamp(1.6rem, 1rem + 2vw, 2.6rem); }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }
.band.deep .section-head p { color: var(--on-deep-soft); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; font: 600 .95rem/1.2 var(--font-text); padding: .78em 1.25em; border-radius: 999px; border: 2px solid var(--brand); color: var(--brand); background: transparent; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand); color: var(--on-brand); }
.btn.pri { background: var(--cta); border-color: var(--cta); color: var(--on-cta); }
.btn.pri:hover { filter: brightness(1.1); color: var(--on-cta); background: var(--cta); }
.band.deep .btn { border-color: var(--on-deep); color: var(--on-deep); }
.band.deep .btn:hover { background: var(--on-deep); color: var(--deep); }
.band.deep .btn.pri { background: var(--deep-accent); border-color: var(--deep-accent); color: var(--deep); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* ---------- Header ---------- */
.site-head { background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.masthead { display: flex; align-items: center; gap: 1rem; padding-block: .9rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 3rem; height: 3rem; flex: none; color: var(--brand); }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name strong { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.1rem, .95rem + .7vw, 1.45rem); text-wrap: balance; }
.brand-name .tagline { font-size: .72rem; font-weight: 550; letter-spacing: .04em; color: var(--ink-soft); margin-top: .2rem; }
.head-tools { display: flex; align-items: center; gap: .5rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; height: 2.5rem; min-width: 2.5rem; padding: 0 .8rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .85rem/1 var(--font-text); cursor: pointer; }
.icon-btn:hover { border-color: var(--brand); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; }
.head-cta { padding: .62em 1.05em; font-size: .85rem; }
.nav-row { border-top: 1px solid var(--line); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .2rem 1.6rem; flex-wrap: wrap; }
.site-nav a { display: inline-block; padding: .7rem 0; font-weight: 550; font-size: .92rem; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: var(--accent-text); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.menu-btn { display: none; }

html:not(.js) .appearance { display: none; }
.site-nav li.mobile-only { display: none; }
@media (max-width: 54em) {
  .js .menu-btn { display: inline-flex; }
  .head-cta { display: none; }
  .js .nav-row { display: none; }
  .js .nav-row.open { display: block; }
  .site-nav ul { flex-direction: column; padding-block: .4rem 1rem; }
  .site-nav a { padding: .6rem 0; font-size: 1.05rem; border-bottom: 0; }
  .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
  .site-nav li.mobile-only { display: block; }
}
@media (max-width: 30em) {
  .brand-name .tagline { display: none; }
  .brand-mark { width: 2.4rem; height: 2.4rem; }
  .icon-btn .label { display: none; }
}

/* ---------- Appearance panel ---------- */
.appearance { position: relative; }
.panel { position: absolute; right: 0; top: calc(100% + .6rem); width: min(23rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 1.1rem 1.1rem 1.2rem; z-index: 40; }
.panel[hidden] { display: none; }
.panel h2 { font-family: var(--font-text); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .6rem; }
.panel fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
.panel legend { padding: 0; font: 700 .78rem/1 var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .6rem; }
.themes { display: grid; gap: .45rem; }
.theme-opt { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .8rem; padding: .5rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; position: relative; }
.theme-opt:hover { border-color: var(--brand); }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-opt .t-name { font-weight: 650; font-size: .92rem; line-height: 1.2; }
.theme-opt .t-desc { display: block; font-size: .76rem; color: var(--ink-soft); font-weight: 400; line-height: 1.35; }
.swatch { width: 3.2rem; height: 2.2rem; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: flex-start; gap: 3px; padding: 4px; }
.swatch i { display: block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--brand); }
.swatch i + i { background: var(--dot); }
.swatch i + i + i { background: var(--accent); width: 1.1rem; height: .22rem; border-radius: 2px; margin-left: auto; align-self: flex-start; }
.swatch.auto { background: linear-gradient(135deg, #F7EFDF 50%, #15263A 50%); }
.swatch.auto i { background: #15263A; }
.swatch.auto i + i { background: #8A6420; }
.swatch.auto i + i + i { background: #E2BC71; }
.sizer { display: flex; align-items: center; gap: .5rem; }
.sizer button { flex: 1; height: 2.6rem; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; font: 650 .9rem/1 var(--font-text); cursor: pointer; }
.sizer button:hover { border-color: var(--brand); }
.sizer output { min-width: 3.6rem; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.4rem, 1.4rem + 4vw, 4.6rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); align-items: center; }
.hero h1 { max-width: 15em; }
.hero .deva-line { font-family: var(--font-deva); font-size: 1.15rem; color: var(--ink-soft); margin-bottom: .6rem; }
.hero-figure { margin: 0; }
.hero-figure figcaption { font-size: .8rem; color: var(--ink-soft); text-align: center; margin-top: .4rem; }
@media (max-width: 54em) { .hero-grid { grid-template-columns: 1fr; } .hero-figure { max-width: 30rem; margin-inline: auto; } }

.page-head { padding-block: clamp(2.2rem, 1.4rem + 3vw, 3.8rem) clamp(1.4rem, 1rem + 2vw, 2.4rem); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 18em; }
.page-head .lede { margin-bottom: 0; }

/* ---------- Mandala ---------- */
.mandala { display: block; width: 100%; height: auto; font-family: var(--font-text); }
.mandala .band-1 { fill: var(--m1); }
.mandala .band-2 { fill: var(--m2); }
.mandala .band-3 { fill: var(--m3); }
.mandala .ring { fill: none; stroke: var(--brand); stroke-width: 1.6; }
.mandala .ring.outer { stroke-width: 2.4; }
.mandala .spoke { stroke: var(--brand); stroke-width: .8; opacity: .35; }
.mandala .core { fill: var(--brand); }
.mandala .core-dot { fill: var(--accent); }
.mandala .sector { fill: transparent; transition: fill .15s; }
.mandala a:hover .sector, .mandala a:focus .sector { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.mandala a:focus { outline: none; }
.mandala a:focus-visible .sector { stroke: var(--focus); stroke-width: 3; }
.mandala .dlabel { fill: var(--ink-soft); font-size: 17px; font-weight: 600; }
.mandala a:hover .dlabel { fill: var(--accent-text); }
.mandala .rbadge { pointer-events: none; }
.mandala .rb { fill: var(--bg); stroke: var(--brand); stroke-width: 1.4; }
.mandala .rnum { fill: var(--brand); font-family: var(--font-display); font-size: 15px; font-weight: 600; text-anchor: middle; }
.mandala .dot { fill: var(--dot); stroke: var(--bg); stroke-width: 2; }
.mandala .dot.w1 { fill: var(--accent); }
.mandala a:hover .dot { stroke: var(--accent); stroke-width: 3; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; justify-content: center; font-size: .78rem; color: var(--ink-soft); margin: .5rem 0 0; padding: 0; list-style: none; }
.legend span { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .4rem; vertical-align: -.05rem; background: var(--dot); }
.legend .l-w1 { background: var(--accent); }

/* ---------- Grids and cards ---------- */
.grid { display: grid; gap: var(--gap); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, .9rem + .8vw, 1.6rem); }
.band.alt .card { border-color: transparent; }
[data-theme="contrast"] .band.alt .card { border-color: #000; }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card .kicker { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .5rem; }
.band.deep .card { background: transparent; border-color: var(--deep-line); color: var(--on-deep); }
.band.deep .card .kicker { color: var(--deep-accent); }
.band.deep .card p { color: var(--on-deep-soft); }
.numbered { counter-reset: n; }
.numbered .card { position: relative; }
.numbered .card::before { counter-increment: n; content: counter(n, decimal-leading-zero); display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--accent-text); line-height: 1; margin-bottom: .6rem; }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .55em; width: .65rem; height: .65rem; border-radius: 50%; border: 2px solid var(--accent); }

/* ---------- Rings and domains ---------- */
.rings { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.ring-card { border-top: 4px solid var(--brand); }
.ring-card .rn { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; color: var(--brand); font-weight: 600; }
.ring-card ul { padding-left: 1.1rem; margin: .6rem 0 0; }
.ring-card li { margin-bottom: .35rem; }
.domains { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.domain { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: start; scroll-margin-top: 1rem; }
.domain .code { grid-row: span 3; font: 700 .8rem/1 var(--font-text); letter-spacing: .08em; color: var(--on-brand); background: var(--brand); border-radius: 4px; padding: .5rem .5rem; min-width: 3.1rem; text-align: center; margin-top: .25rem; }
.domain h3 { font-size: 1.12rem; margin: 0; }
.domain p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.domain .more { font-size: .85rem; }
.domain:target { outline: 3px solid var(--accent); outline-offset: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.chips a, .chips span { display: inline-block; padding: .38rem .8rem; border-radius: 999px; border: 1.5px solid var(--line); font-size: .85rem; font-weight: 550; text-decoration: none; color: var(--ink); background: var(--surface); }
.chips a:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---------- Briefs ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: end; margin-bottom: 1.6rem; padding: 1rem 1.2rem; background: var(--bg-alt); border-radius: var(--radius); }
.filters[hidden] { display: none; }
.filters label { display: grid; gap: .3rem; font-size: .8rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.filters select { font: 500 .95rem/1.2 var(--font-text); padding: .55rem 2rem .55rem .7rem; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); min-width: 11rem; }
.filters .count { margin-left: auto; font-size: .9rem; color: var(--ink-soft); align-self: center; }
.briefs { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.brief { display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 1.2rem 1.3rem; scroll-margin-top: 1rem; }
.brief.w1 { border-left-color: var(--accent); }
.brief[hidden] { display: none; }
.brief:target { box-shadow: 0 0 0 3px var(--accent); }
.stamp { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font: 650 .74rem/1.3 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.stamp .id { color: var(--accent-text); }
.brief h3 { font-size: 1.3rem; margin: .1rem 0 0; }
.brief .theatre { font-size: .88rem; color: var(--ink-soft); margin: 0; }
.brief .q { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; margin: .2rem 0 .3rem; }
.brief .chips { margin-top: auto; }
.brief .chips a { font-size: .78rem; padding: .28rem .65rem; }
.status { font-size: .78rem; font-weight: 650; color: var(--ink-soft); margin: 0; }
.empty { padding: 2rem; text-align: center; color: var(--ink-soft); border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty[hidden] { display: none; }

/* ---------- Method ---------- */
.anatomy { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; counter-reset: a; }
.anatomy li { display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; align-items: baseline; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.anatomy li::before { counter-increment: a; content: counter(a); font-family: var(--font-display); font-size: 1.5rem; color: var(--accent-text); font-weight: 600; }
.anatomy strong { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.wep { width: 100%; height: auto; display: block; font-family: var(--font-text); }
.wep .track { fill: var(--bg-alt); }
.wep .bar { fill: var(--brand); }
.wep .bar.mid { fill: var(--accent); }
.wep .w { fill: var(--ink); font-size: 15px; font-weight: 600; }
.wep .r { fill: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.wep .axis { fill: var(--ink-soft); font-size: 12px; }
.wep .grid-line { stroke: var(--line); stroke-width: 1; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
td:first-child { font-weight: 700; color: var(--brand); white-space: nowrap; }
.postures { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.posture .skt { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin: 0; }
.posture .en { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 .5rem; }
.band.deep .posture .en { color: var(--deep-accent); }

/* ---------- Products ---------- */
.product { display: flex; flex-direction: column; }
.product .tier { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .4rem; }
.product h3 { font-size: 1.45rem; }
.product .who { font-size: .88rem; color: var(--ink-soft); }
.product .go { margin-top: auto; padding-top: .6rem; font-weight: 650; }

/* ---------- Stamp specimen ---------- */
.specimen { border: 2px solid var(--brand); border-radius: var(--radius); padding: 1.2rem 1.3rem; background: var(--surface); }
.specimen dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .9rem 1.4rem; margin: 0; }
.specimen dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.specimen dd { margin: .15rem 0 0; font-weight: 650; }
.specimen .sp-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: .7rem; margin-bottom: .9rem; font-weight: 700; }
.specimen .sp-head span:last-child { color: var(--accent-text); }
.band.deep .specimen { background: color-mix(in srgb, var(--on-deep) 6%, transparent); border-color: var(--on-deep-soft); color: var(--on-deep); }
.band.deep .specimen dt { color: var(--on-deep-soft); }
.band.deep .specimen .sp-head { border-color: var(--deep-line); }
.band.deep .specimen .sp-head span:last-child { color: var(--deep-accent); }

/* ---------- Follow and contact ---------- */
.social { display: flex; flex-wrap: wrap; gap: .7rem; list-style: none; padding: 0; margin: 0; }
.social a { max-width: 100%; display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1rem .6rem .8rem; border-radius: 999px; border: 1.5px solid currentColor; text-decoration: none; font-weight: 600; font-size: .92rem; }
.social svg { width: 1.2rem; height: 1.2rem; fill: currentColor; flex: none; }
.social .t { min-width: 0; overflow-wrap: anywhere; }
.social .h { font-weight: 450; opacity: .8; }
.social.compact a { padding: .55rem; border-radius: 50%; }
.social.compact .t { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.contact-line { font-size: 1.2rem; font-weight: 650; }

/* ---------- Prose pages ---------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2.2rem; font-size: 1.6rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .45rem; }
.note { border-left: 4px solid var(--accent); padding: .8rem 1.1rem; background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- Footer ---------- */
.site-foot { background: var(--deep); color: var(--on-deep); padding-block: clamp(2.4rem, 1.6rem + 3vw, 4rem) 1.6rem; }
.site-foot a { color: var(--on-deep); text-decoration: none; }
.site-foot a:hover { color: var(--deep-accent); text-decoration: underline; }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
@media (max-width: 54em) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }
a[href^="mailto:"] { overflow-wrap: anywhere; }
.foot-brand p { color: var(--on-deep-soft); font-size: .92rem; max-width: 26rem; }
.foot-brand .brand { color: var(--on-deep); }
.foot-brand .brand-mark { color: var(--deep-accent); }
.foot-brand .brand-name .tagline { color: var(--on-deep-soft); }
.site-foot h2 { font: 700 .76rem/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--deep-accent); margin-bottom: 1rem; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .92rem; }
.site-foot .social { display: flex; gap: .6rem; margin-top: 1.2rem; }
.site-foot .social a { color: var(--on-deep); }
.foot-base { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--deep-line); display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: space-between; font-size: .8rem; color: var(--on-deep-soft); }
.foot-base p { margin: 0; }

/* ---------- 404 ---------- */
.lost { text-align: center; padding-block: 5rem; }
.lost .mandala { max-width: 14rem; margin: 0 auto 1.5rem; }
.lost .lede { margin-inline: auto; }
.lost .actions { justify-content: center; }
.rings + .visually-hidden + .chips { margin-top: var(--gap); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-head, .site-foot, .filters, .actions { display: none !important; }
  body { background: #fff; color: #000; }
  .band { padding-block: 1rem; }
}
