/* Sakura Circuit — color, layout and motion. Content lives in content.js. */
:root {
  color-scheme: light;
  --bg: #fff8fb;
  --surface: #fffcfe;
  --glass: rgba(255, 252, 254, .46);
  --soft: #f7edf4;
  --text: #493643;
  --muted: #624958;
  --primary: #82415f;
  --primary-fg: #fffafd;
  --accent: #68497f;
  --border: #e4d2de;
  --strong: #c7a6bd;
  --wash: #f8dce8;
  --lavender: #ece5f7;
  --shadow: 0 18px 55px rgba(100, 63, 86, .055);
  --serif: Georgia, 'Noto Serif SC', 'Songti SC', SimSun, serif;
  --sans: Inter, 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: 'Cascadia Code', ui-monospace, Consolas, monospace;
  --max: 1200px;
  --radius-panel: 24px;
  --radius-inset: 16px;
  --radius-control: 12px;
  --radius-tag: 7px;
  --panel-surface: color-mix(in srgb, var(--surface) 30%, transparent);
  --panel-fill: linear-gradient(130deg, color-mix(in srgb, var(--surface) 48%, transparent), color-mix(in srgb, var(--surface) 20%, transparent) 62%, color-mix(in srgb, var(--lavender) 32%, transparent));
  --panel-blur: 28px;
  --glass-edge: rgba(255, 255, 255, .8);
  --glass-highlight: rgba(255, 255, 255, .82);
  --glass-shadow: 0 18px 55px rgba(100, 63, 86, .13);
  --scene-pink: #edc0d7;
  --scene-lilac: #ccbbe6;
  --scene-rose: #d9b4cc;
  --ribbon-pink: #d890b5;
  --ribbon-lilac: #ae8fce;
  --control-surface: color-mix(in srgb, var(--surface) 64%, transparent);
  --overlay-surface: color-mix(in srgb, var(--surface) 84%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #211c26; --surface: #2b2430; --glass: rgba(43, 36, 48, .48);
    --soft: #332b3c; --text: #f4eaf1; --muted: #c8b7c6;
    --primary: #edb5cf; --primary-fg: #301e2b; --accent: #cdb8ed;
    --border: #4e3f54; --strong: #987b9d; --wash: #463044; --lavender: #373049;
    --shadow: 0 18px 55px rgba(0, 0, 0, .1);
    --glass-edge: rgba(235, 211, 241, .24); --glass-highlight: rgba(242, 222, 248, .23);
    --glass-shadow: 0 18px 55px rgba(8, 4, 14, .24);
    --scene-pink: #58324d; --scene-lilac: #47385f; --scene-rose: #593f55;
    --ribbon-pink: #92567e; --ribbon-lilac: #7f63ab;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #211c26; --surface: #2b2430; --glass: rgba(43, 36, 48, .48);
  --soft: #332b3c; --text: #f4eaf1; --muted: #c8b7c6;
  --primary: #edb5cf; --primary-fg: #301e2b; --accent: #cdb8ed;
  --border: #4e3f54; --strong: #987b9d; --wash: #463044; --lavender: #373049;
  --shadow: 0 18px 55px rgba(0, 0, 0, .1);
  --glass-edge: rgba(235, 211, 241, .24); --glass-highlight: rgba(242, 222, 248, .23);
  --glass-shadow: 0 18px 55px rgba(8, 4, 14, .24);
  --scene-pink: #58324d; --scene-lilac: #47385f; --scene-rose: #593f55;
  --ribbon-pink: #92567e; --ribbon-lilac: #7f63ab;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; scrollbar-gutter: stable; }
body { margin: 0; min-width: 0; isolation: isolate; background: var(--bg); color: var(--text); font: 15px/1.85 var(--sans); transition: background-color .4s ease, color .3s ease; }
body::before { content: ''; position: fixed; z-index: -2; inset: -8%; pointer-events: none; background: radial-gradient(ellipse at 90% 15%, var(--scene-pink), transparent 58%), radial-gradient(ellipse at 4% 65%, var(--scene-lilac), transparent 58%), radial-gradient(ellipse at 65% 88%, var(--scene-rose), transparent 54%); }
.atmosphere { position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.atmosphere svg { display: block; width: 100%; height: 100%; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button, summary, select { cursor: pointer; }
button { background: none; border: 0; }
a { color: inherit; text-underline-offset: .22em; }
a, button, summary, input, select { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
.icon { display: block; width: 16px; height: 16px; flex: 0 0 16px; }
.withIcon { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; }
::selection { background: var(--wash); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
main:focus { outline: none; }
.project:focus-visible { outline: none; }
[hidden] { display: none !important; }
.wrap { width: min(var(--max), calc(100% - 80px)); margin-inline: auto; }
.skip { position: fixed; top: 8px; left: 20px; z-index: 100; padding: 8px 16px; background: var(--surface); transform: translateY(-160%); }
.skip:focus { transform: none; }
.top { position: sticky; top: 14px; z-index: 20; width: min(1240px, calc(100% - 32px)); margin: 14px auto 0; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--glass); backdrop-filter: blur(22px) saturate(130%); box-shadow: 0 5px 24px color-mix(in srgb, var(--primary) 5%, transparent), inset 0 1px 0 var(--surface); transition: transform .45s cubic-bezier(.22,.7,.3,1), box-shadow .45s ease, border-color .35s ease, background-color .35s ease; }
.top::after { content: ''; position: absolute; left: 22px; right: 22px; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary)); transform: scaleX(var(--reading-progress, 0)); transform-origin: left; opacity: .65; pointer-events: none; }
.top.scrolled { transform: translateY(-4px); border-color: color-mix(in srgb, var(--strong) 65%, var(--border)); box-shadow: 0 10px 34px color-mix(in srgb, var(--primary) 9%, transparent), inset 0 1px 0 var(--surface); }
.topin.wrap { width: 100%; margin: 0; padding: 0 20px; }
.topin { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; font: 600 15px/1.3 var(--mono); letter-spacing: -.03em; }
.seal { width: 38px; height: 38px; flex: 0 0 auto; color: var(--primary); }
.brand small { display: block; margin-top: 6px; color: var(--muted); font: 10px var(--sans); letter-spacing: .28em; }
.brand .seal { transition: transform .55s cubic-bezier(.22,.7,.3,1); }
.brand:hover .seal { transform: rotate(16deg) scale(1.04); }
.nav { position: relative; isolation: isolate; display: flex; gap: 3px; align-items: center; padding: 4px; border: 1px solid color-mix(in srgb, var(--border) 65%, transparent); border-radius: var(--radius-inset); background: color-mix(in srgb, var(--soft) 45%, transparent); }
.nav::before { content: ''; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: var(--nav-width, 0px); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); box-shadow: 0 2px 7px color-mix(in srgb, var(--primary) 7%, transparent); transform: translateX(var(--nav-x, 0px)); opacity: var(--nav-opacity, 0); transition: transform .4s cubic-bezier(.22,.7,.3,1), width .4s cubic-bezier(.22,.7,.3,1), opacity .2s ease; pointer-events: none; }
.nav a, .nav button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 9px 13px; border-radius: var(--radius-control); text-decoration: none; font-size: 12px; line-height: 1; white-space: nowrap; color: var(--muted); transition: color .25s ease; }
.nav a:hover, .nav button:hover, .nav [aria-current] { color: var(--primary); }
.nav [aria-current] { color: var(--primary); }
.preferences { position: relative; }
.preferences summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--control-surface); color: var(--muted); font-size: 12px; line-height: 1; list-style: none; }
.preferences summary::-webkit-details-marker { display: none; }
.preferences summary:hover, .preferences[open] summary { border-color: var(--strong); color: var(--primary); background: var(--soft); }
.preferences summary:focus-visible { outline-offset: 3px; border-radius: var(--radius-control); }
.preferences summary .icon { transition: transform .18s ease; }
.preferences[open] summary .icon { transform: rotate(180deg); }
.preferencesPanel { position: absolute; top: calc(100% + 12px); right: 0; width: 300px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--overlay-surface); backdrop-filter: blur(24px); box-shadow: 0 12px 40px color-mix(in srgb, var(--text) 12%, transparent), 0 2px 6px color-mix(in srgb, var(--text) 4%, transparent); }
.themeField { min-width: 0; margin: 0; padding: 0; border: 0; }
.themeField legend, dialog label { padding: 0; font-size: 12px; line-height: 1.5; font-weight: 600; }
.themeChoices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 12px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--soft); }
.themeChoice { position: relative; min-width: 0; cursor: pointer; }
.themeChoice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.themeChoice>span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 1px solid transparent; border-radius: var(--radius-control); color: var(--muted); font-size: 12px; line-height: 1; white-space: nowrap; pointer-events: none; transition: background-color .25s ease, color .25s ease, box-shadow .25s ease; }
.themeChoice:hover>span { color: var(--primary); }
.themeChoice input:checked+span { border-color: var(--border); background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 7%, transparent); }
.themeChoice input:focus-visible { outline: 0; }
.themeChoice input:focus-visible+span { outline: 2px solid var(--accent); outline-offset: 2px; }
.motionSetting { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 14px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); cursor: pointer; }
.settingCopy { display: grid; gap: 5px; }
.settingTitle { font-size: 12px; line-height: 1.5; font-weight: 600; }
.settingHint { font-size: 11px; line-height: 1.7; color: var(--muted); }
#quietMotion { appearance: none; position: relative; display: block; width: 34px; height: 20px; margin: 0; border: 1px solid var(--strong); border-radius: 999px; background: var(--soft); cursor: pointer; transition: background .18s ease, border-color .18s ease; }
#quietMotion::before { content: ''; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform .18s ease, background .18s ease; }
#quietMotion:checked { border-color: var(--primary); background: var(--primary); }
#quietMotion:checked::before { transform: translateX(14px); background: var(--primary-fg); }
.preferencesPanel small { display: block; margin-top: 16px; font-size: 10px; line-height: 1.6; color: var(--muted); }
.selectField { position: relative; margin: 10px 0 20px; }
.selectField select { appearance: none; display: block; width: 100%; min-height: 44px; margin: 0; padding: 10px 42px 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--control-surface); font: 13px/1.5 var(--sans); color: var(--text); text-overflow: ellipsis; }
.selectField select:hover { border-color: var(--strong); }
.selectField select:focus-visible { outline-offset: 2px; border-radius: var(--radius-control); }
.selectField>.icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.hero { position: relative; display: grid; grid-template-columns: 1.15fr .9fr; gap: 0 68px; align-items: center; padding-top: 72px; padding-bottom: 42px; }
.heroCopy { padding: 26px 0; }
.eyebrow, .label { font: 500 10px/1.6 var(--mono); letter-spacing: .11em; color: var(--accent); }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--primary); }
h1, h2, h3, h4, p { overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; }
h1 { margin: 25px 0; font-size: clamp(36px, 4.8vw, 67px); line-height: 1.32; letter-spacing: -.05em; }
h1 em { display: block; font-style: normal; color: var(--primary); }
.intro { max-width: 560px; color: var(--muted); font-size: 16px; line-height: 2; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 24px; min-height: 46px; padding: 9px 20px; border: 1px solid var(--strong); border-radius: var(--radius-control); background: var(--control-surface); color: var(--text); text-decoration: none; font-size: 13px; line-height: 1.5; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 13%, transparent); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.btn.small { min-height: 38px; padding: 7px 13px; gap: 20px; font-size: 12px; }
.heroNote { margin: 30px 0 0; font: 10px/1.6 var(--mono); color: var(--muted); }
.fieldIndex { position: relative; padding: 22px 25px 10px; border: 1px solid var(--glass-edge); border-radius: var(--radius-panel); background: var(--panel-fill); backdrop-filter: blur(var(--panel-blur)) saturate(135%); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 color-mix(in srgb, var(--glass-highlight) 30%, transparent); overflow: hidden; }
.fieldTop { display: flex; justify-content: space-between; font: 8px var(--mono); letter-spacing: .08em; color: var(--accent); }
.botanical { display: block; width: calc(100% + 50px); height: 160px; margin: -5px -25px -9px; color: var(--primary); }
.indexHeading h2 { margin: 0; font: 500 18px var(--serif); }
.indexHeading p { margin: 8px 0 15px; color: var(--muted); font-size: 11px; }
.projectPaths { padding-bottom: 14px; }
.projectPaths a { display: grid; grid-template-columns: 22px 1fr 16px; gap: 12px; align-items: center; padding: 11px 0; text-decoration: none; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.5; transition: color .2s, transform .2s; }
.projectPaths .icon { justify-self: end; }
.projectPaths a:hover { color: var(--primary); transform: translateX(3px); }
.pathNumber { font: 10px var(--mono); color: var(--accent); }
.projectPaths small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.signal { grid-column: 1 / -1; display: grid; grid-template-columns: .8fr .8fr .8fr 1fr; margin-top: 54px; padding: 24px 0; border-block: 1px solid var(--border); }
.signal>div { display: flex; align-items: baseline; gap: 14px; padding-inline: 25px; border-left: 1px solid var(--border); }
.signal>div:first-child { padding-left: 0; border: 0; }
.signal strong { font: 500 30px/1.2 var(--serif); letter-spacing: -.035em; white-space: nowrap; }
.signal>div:last-child strong { font-size: 23px; }
.signal span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.section { padding-top: 65px; padding-bottom: 20px; }
.sectionHead { display: grid; grid-template-columns: 1fr 390px; gap: 70px; align-items: end; margin-bottom: 30px; }
.sectionHead h2 { display: flex; align-items: center; gap: 24px; margin: 12px 0 0; font-size: 38px; line-height: 1.4; letter-spacing: -.04em; }
.headingMark { color: var(--primary); font: 26px var(--serif); opacity: .5; }
.sectionHead p { margin: 0 0 3px; font-size: 13px; color: var(--muted); }
.workTools { display: flex; gap: 18px; justify-content: space-between; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { min-height: 40px; padding: 8px 12px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 12px; color: var(--muted); white-space: nowrap; }
.filters button span { margin-left: 6px; font: 10px var(--mono); opacity: .85; }
.filters button:hover { background: var(--soft); }
.filters button[aria-pressed="true"] { border-color: var(--strong); background: var(--soft); color: var(--primary); }
.searchBox { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 13px; width: 285px; flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--control-surface); }
.searchBox>.icon { color: var(--muted); transition: color .25s ease; }
.searchBox input { width: 100%; min-width: 0; padding: 9px 0; background: transparent; border: 0; border-radius: 0; font-size: 12px; caret-color: var(--primary); }
.searchBox input:focus { outline: none; }
.searchBox input::placeholder { color: var(--muted); }
.searchBox input::-webkit-search-cancel-button { display: none; }
.searchBox button { display: grid; place-items: center; min-width: 28px; min-height: 32px; padding: 0; }
.resultRow { display: flex; justify-content: space-between; align-items: center; min-height: 46px; color: var(--muted); font-size: 11px; }
.resultRow p { margin: 0; }
.cases { display: grid; gap: 22px; }
.project { scroll-margin-top: 105px; }
.case { position: relative; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 42px; padding: 35px 38px; border: 1px solid var(--glass-edge); border-radius: var(--radius-panel); background: var(--panel-fill); backdrop-filter: blur(var(--panel-blur)) saturate(135%); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 color-mix(in srgb, var(--glass-highlight) 30%, transparent); }
.case:target, .compact:target { border-color: var(--glass-edge); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight), 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
.caseMeta { padding-top: 4px; }
.num, .n { font: 10px var(--mono); color: var(--accent); }
.category { display: inline-block; color: var(--primary); font-size: 10px; line-height: 1.6; padding: 3px 8px; border-radius: var(--radius-tag); background: var(--soft); }
.caseMeta .category { display: block; width: fit-content; margin-top: 22px; }
.role { margin: 15px 0; font-size: 11px; color: var(--muted); }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.stack span { padding: 3px 7px; border: 1px solid var(--border); border-radius: var(--radius-tag); font: 10px/1.6 var(--mono); color: var(--muted); }
.caseBody h3 { margin: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.4; letter-spacing: -.03em; }
.lead { margin: 13px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.95; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 24px 0; }
h4 { margin: 0 0 12px; font-weight: 600; font-size: 13px; }
.split>div+div { padding-left: 24px; border-left: 1px solid var(--border); }
.split p, .compact>p, li { font-size: 13px; color: var(--muted); }
.split p { margin: 0; }
ul { margin: 0; padding-left: 17px; }
li { margin: 7px 0; padding-left: 2px; }
li::marker { color: var(--primary); font-size: 10px; }
.boundary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.boundaryBox { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-inset); background: color-mix(in srgb, var(--soft) 60%, transparent); }
.boundaryBox.agent { background: color-mix(in srgb, var(--lavender) 48%, transparent); }
.boundaryBox .label { margin-bottom: 12px; }
.evidencePreview { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--border); }
.evidenceCaption { font-size: 11px; color: var(--accent); }
.evidenceCaption small { color: var(--muted); font-size: 10px; }
.evidenceChips { display: flex; gap: 7px; }
.evidenceChip { padding: 2px 7px; border: 1px solid var(--border); border-radius: var(--radius-tag); color: var(--accent); text-decoration: none; font: 10px/1.9 var(--mono); }
.evidenceChip:hover { border-color: var(--accent); }
.evidenceChip:nth-child(n+3) { display: none; }
.cardActions { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 18px; }
.cardPrimaryActions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.textlink { color: var(--primary); font-size: 12px; text-decoration: none; }
.textlink:hover { text-decoration: underline; }
.copyLink { padding: 7px 0; color: var(--muted); font-size: 11px; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: .3em; }
.copyLink:hover { color: var(--primary); text-decoration-color: var(--primary); }
.compactGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.compact { display: flex; flex-direction: column; min-width: 0; padding: 28px 30px; border: 1px solid var(--glass-edge); border-radius: var(--radius-panel); background: var(--panel-fill); backdrop-filter: blur(var(--panel-blur)) saturate(135%);  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
.compactMeta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 13px; }
.compact h3 { margin: 0; font-size: 27px; line-height: 1.4; }
.compact .lead { margin-bottom: 0; }
.compact .stack { margin: 16px 0; }
.compact .evidencePreview { margin-top: auto; }
.compact>ul, .compact>p:last-of-type { margin-bottom: 22px; }
.compact .cardActions { align-items: flex-start; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 10px 0; border-block: 1px solid var(--border); }
.metrics div { padding: 13px 4px; }
.metrics strong { display: block; font: 24px/1.5 var(--serif); color: var(--primary); }
.metrics span { font-size: 9px; color: var(--muted); }
.emptyState { padding: 60px 20px; border: 1px dashed var(--strong); border-radius: var(--radius-panel); text-align: center; }
.emptyState h3 { margin: 0; font-size: 24px; }
.emptyState p { color: var(--muted); font-size: 13px; }
.method { display: grid; grid-template-columns: 260px 1fr; gap: 65px; padding-top: 45px; margin-top: 10px; border-top: 1px solid var(--border); }
.methodIntro h2 { margin: 16px 0; font-size: 32px; line-height: 1.55; white-space: pre-line; }
.methodOrnament { display: flex; align-items: center; gap: 22px; margin-top: 40px; }
.methodOrnament .seal { width: 76px; height: 76px; opacity: .5; }
.methodOrnament span { font: 8px/1.8 var(--mono); color: var(--muted); letter-spacing: .15em; }
.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 35px; }
.principle { position: relative; padding: 0 0 22px; border-bottom: 1px solid var(--border); }
.principle h3 { margin: 10px 0 8px; font: 600 14px var(--sans); }
.principle p { margin: 0; font-size: 13px; color: var(--muted); }
.aiNote { padding: 23px 26px; margin-top: 28px; border: 1px solid var(--glass-edge); border-radius: var(--radius-panel); background: var(--panel-fill); backdrop-filter: blur(var(--panel-blur)) saturate(135%);  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
.aiNote h3 { font-size: 22px; margin: 12px 0 10px; line-height: 1.6; }
.aiNote p { margin: 0; font-size: 13px; color: var(--muted); }
footer { padding-top: 65px; padding-bottom: 32px; }
.footerActions { display: flex; flex-wrap: wrap; align-items: center; gap: 25px; padding-bottom: 22px; }
.footerActions>a:last-child { margin-left: auto; font-size: 11px; text-decoration: none; color: var(--muted); }
.foot { display: flex; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font: 9px/1.7 var(--mono); }
dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 8px; overflow: hidden; color: var(--text); background: var(--overlay-surface); backdrop-filter: blur(24px) saturate(110%); border: 1px solid var(--strong); border-radius: var(--radius-panel); box-shadow: 0 25px 100px #24142d33, inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent); }
dialog::backdrop { background: #24172e55; backdrop-filter: blur(10px); }
.dialogScroll { max-height: calc(100dvh - 66px); padding: 20px 24px; overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-inset); scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--strong) transparent; }
.dialogScroll:focus-visible { outline: 1px solid var(--strong); outline-offset: -2px; }
.dialogScroll::-webkit-scrollbar { width: 6px; }
.dialogScroll::-webkit-scrollbar-track { background: transparent; }
.dialogScroll::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--strong); }
.dialogTop { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.closeDialog { display: grid; place-items: center; min-width: 36px; min-height: 36px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-control); line-height: 1; }
.closeDialog:hover { background: var(--soft); }
dialog h2 { margin: 8px 0 15px; font-size: 32px; line-height: 1.4; }
.dialogIntro, .dialogNote { font-size: 12px; color: var(--muted); }
.dialogIntro { margin: 0 0 20px; }
.dialogNote { margin: 22px 0 0; padding-top: 15px; border-top: 1px solid var(--border); }
.evidenceGroup { margin-top: 20px; }
.evidenceGroup h3 { font-size: 21px; line-height: 1.5; margin: 12px 0 4px; }
.evidenceGroup>p { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.evidenceList { display: grid; gap: 8px; padding: 0; list-style: none; }
.evidenceList li { padding: 0; margin: 0; }
.evidenceList a { display: grid; grid-template-columns: 80px 1fr 16px; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-control); text-decoration: none; line-height: 1.7; background: color-mix(in srgb, var(--surface) 45%, transparent); }
.evidenceList a:hover { border-color: var(--accent); background: var(--soft); }
.evidenceList code { font: 10px var(--mono); color: var(--accent); }
.evidenceList span { font-size: 12px; color: var(--text); }
#copyDialog { width: min(550px, calc(100% - 32px)); }
#copyDialog h2 { font-size: 24px; }
#copyDialog p { font-size: 13px; color: var(--muted); }
#manualLink { width: 100%; min-height: 46px; padding: 10px; border: 1px solid var(--strong); border-radius: var(--radius-control); background: var(--soft); font: 12px var(--mono); }
.toast { position: fixed; z-index: 50; bottom: 28px; left: 50%; transform: translate(-50%, 15px); max-width: calc(100% - 40px); padding: 10px 22px; border: 1px solid var(--strong); border-radius: var(--radius-control); background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.noscript { padding-block: 60px; }
/* Motion is enabled after setup; content remains readable without JavaScript. */
.motion-enabled .motion-pending { opacity: 0; }
.motion-enabled body::before { animation: atmosphereDrift 22s ease-in-out infinite alternate; }
.fieldIndex { isolation: isolate;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
.fieldIndex::before { content: ''; position: absolute; z-index: -1; inset: -20%; border-radius: 50%; background: radial-gradient(ellipse at 65% 30%, var(--wash), transparent 56%); opacity: .45; pointer-events: none; }
.motion-enabled .fieldIndex.ambient-visible::before { animation: mistBreathe 11s ease-in-out infinite alternate; }
.petalBloom { transform-origin: 258px 123px; }
.motion-enabled .ambient-visible .petalBloom { animation: petalBreathe 12s ease-in-out infinite alternate; }
.motion-enabled .ambient-visible .orbit { stroke-dasharray: 3 11; animation: orbitFlow 30s linear infinite; }
.motion-enabled .ambient-visible .orbitBack { animation-direction: reverse; animation-duration: 38s; }
.motion-enabled .ambient-visible .sparkle { animation: sparkleBreathe 6s ease-in-out infinite alternate; }
.motion-enabled .ambient-visible .sparkleLate { animation-delay: -3s; }
.page-paused body::before, .page-paused .fieldIndex::before, .page-paused .botanical * { animation-play-state: paused !important; }
.withIcon .icon, .btn .icon { transition: transform .3s cubic-bezier(.22,.7,.3,1); }
.filters button, .evidenceChip, .evidenceList a, .searchBox { transition: background-color .25s ease, border-color .25s ease, box-shadow .35s ease, transform .3s ease; }
.searchBox:focus-within { border-color: var(--primary); background: color-mix(in srgb, var(--surface) 94%, var(--wash)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent), 0 4px 16px color-mix(in srgb, var(--primary) 5%, transparent); }
.searchBox:focus-within>.icon { color: var(--primary); }
.btn:active { transform: translateY(0) scale(.98); }
.filters button:active { transform: scale(.97); }
.foot>span:last-child { color: var(--primary); }
dialog[open]::backdrop { animation: backdropIn .3s ease both; }
/* The SVG ring is the fallback; the native dot stays precise during elastic motion. */
:root {
  --cursor-dot: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Ccircle%20cx%3D%228%22%20cy%3D%228%22%20r%3D%223.5%22%20fill%3D%22%23df87af%22%2F%3E%3C%2Fsvg%3E") 8 8, auto;
  --cursor-default: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%20viewBox%3D%220%200%2048%2048%22%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%2214.4%22%20fill%3D%22none%22%20stroke%3D%22%23c478a0%22%20stroke-width%3D%221.2%22%2F%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%223.5%22%20fill%3D%22%23df87af%22%2F%3E%3C%2Fsvg%3E") 24 24, auto;
  --cursor-link: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%20viewBox%3D%220%200%2048%2048%22%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%2218.4%22%20fill%3D%22none%22%20stroke%3D%22%23c478a0%22%20stroke-width%3D%221.2%22%2F%3E%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%223.5%22%20fill%3D%22%23df87af%22%2F%3E%3C%2Fsvg%3E") 24 24, pointer;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  :root:not([data-motion="reduced"]) { cursor: var(--cursor-default); }
  :root:not([data-motion="reduced"]) :is(a[href], button, summary, select, label[for], .themeChoice, input[type="checkbox"], input[type="radio"], [role="button"]) { cursor: var(--cursor-link); }
  :root.elastic-pointer:not([data-motion="reduced"]), :root.elastic-pointer:not([data-motion="reduced"]) :is(a[href], button, summary, select, label[for], .themeChoice, input[type="checkbox"], input[type="radio"], [role="button"]) { cursor: var(--cursor-dot); }
  :root:not([data-motion="reduced"]) :is(input:not([type="checkbox"]):not([type="radio"]), textarea, [contenteditable="true"]) { cursor: text; }
  :root:not([data-motion="reduced"]) :is(:disabled, [aria-disabled="true"]) { cursor: not-allowed !important; }
}
#cursorHalo { position: fixed; z-index: 100; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; pointer-events: none; user-select: none; }
#cursorHalo::backdrop { background: transparent; pointer-events: none; }
.cursorHaloPosition { position: absolute; top: 0; left: 0; width: 0; height: 0; --halo-angle: 0rad; --halo-stretch: 1; }
.cursorHaloRing { position: absolute; top: 0; left: 0; width: 30px; height: 30px; border: 1.25px solid #c478a0; border-radius: 50%; background: #df87af00; box-shadow: none; opacity: 1; transform: translate(-50%, -50%) rotate(var(--halo-angle)) scaleX(var(--halo-stretch)) scaleY(calc(2 - var(--halo-stretch))); transition: width .26s cubic-bezier(.22,.7,.3,1), height .26s cubic-bezier(.22,.7,.3,1), border-color .2s ease, background-color .2s ease; }
#cursorHalo.is-link .cursorHaloRing { width: 38px; height: 38px; border-color: #b76795; background: #df87af0a; }
#cursorHalo.is-pressed .cursorHaloRing { width: 25px; height: 25px; background: #df87af20; }
:root[data-motion="reduced"] #cursorHalo { display: none !important; }
@media (prefers-reduced-motion: reduce), (forced-colors: active), (pointer: coarse) { #cursorHalo { display: none !important; } }
@media (forced-colors: active) {
  .searchBox:focus-within { outline: 2px solid Highlight; outline-offset: 2px; }
}
@media (hover: hover) and (pointer: fine) {
  .motion-enabled .evidenceChip:hover { transform: translateY(-2px); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 8%, transparent); }
  .motion-enabled .withIcon:hover .icon, .motion-enabled .btn:hover .icon { transform: translate(2px, -2px); }
  .motion-enabled .evidenceList a:hover { transform: translateX(3px); }
}
@keyframes atmosphereDrift { from { transform: translate(-1%, -1%) scale(1.02); } to { transform: translate(2%, 2%) scale(1.06); } }
@keyframes mistBreathe { from { transform: translate(-2%, 0); opacity: .35; } to { transform: translate(3%, 2%); opacity: .65; } }
@keyframes petalBreathe { from { transform: rotate(-3deg) scale(.985); } to { transform: rotate(3deg) scale(1.025); } }
@keyframes orbitFlow { to { stroke-dashoffset: -140; } }
@keyframes sparkleBreathe { from { opacity: .35; } to { opacity: .85; } }
@keyframes backdropIn { from { background-color: #24172e00; backdrop-filter: blur(0); } to { background-color: #24172e55; backdrop-filter: blur(10px); } }
@media (max-width: 1100px) {
  .wrap { width: calc(100% - 56px); }
  .hero { gap: 0 36px; grid-template-columns: 1.1fr 1fr; }
  .signal>div { display: block; }
  .signal span { display: block; margin-top: 8px; }
  .workTools { align-items: flex-start; flex-direction: column; gap: 12px; }
  .searchBox { width: 100%; }
  .case { grid-template-columns: 160px minmax(0, 1fr); gap: 28px; padding: 28px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .method { grid-template-columns: 220px 1fr; gap: 35px; }
  .sectionHead { grid-template-columns: 1fr 350px; gap: 35px; }
}
@media (max-width: 800px) {
  :root { --panel-blur: 20px; }
  .wrap { width: calc(100% - 40px); }
  .topin { gap: 12px; min-height: 64px; }
  .topin.wrap { padding-inline: 16px; }
  .nav { gap: 2px; }
  .nav a, .nav button { padding-inline: 10px; }
  .nav .navGithub { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 35px; }
  .heroCopy { padding: 20px 0 36px; }
  h1 { font-size: clamp(38px, 7.4vw, 60px); }
  .intro { max-width: 620px; }
  .fieldIndex { padding-inline: 24px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .botanical { position: absolute; right: 0; top: 30px; width: 55%; height: 150px; margin: 0; opacity: .7; pointer-events: none; }
  .indexHeading { position: relative; padding-top: 30px; max-width: 56%; }
  .projectPaths { position: relative; }
  .projectPaths a { grid-template-columns: 30px 1fr 20px; padding-block: 13px; }
  .signal { margin-top: 32px; }
  .signal strong { font-size: 26px; }
  .signal>div:last-child strong { font-size: 18px; }
  .signal>div { padding-inline: 15px; }
  .section { padding-top: 40px; }
  .sectionHead { grid-template-columns: 1fr; gap: 15px; }
  .sectionHead p { max-width: 520px; }
  .case { grid-template-columns: 1fr; gap: 22px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .caseMeta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .caseMeta .category { margin: 0; }
  .caseMeta .role { margin: 0; }
  .caseMeta .stack { flex-basis: 100%; margin: 0; }
  .compactGrid { grid-template-columns: 1fr; }
  .compact { padding: 28px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .method { grid-template-columns: 1fr; gap: 25px; padding-top: 30px; }
  .methodIntro h2 { white-space: normal; }
  .methodOrnament { display: none; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .top { top: 10px; width: calc(100% - 20px); margin-top: 10px; border-radius: var(--radius-panel); }
  .top.scrolled { transform: translateY(-2px); }
  .topin.wrap { padding: 10px 12px 9px; }
  .topin { flex-wrap: wrap; gap: 0 12px; }
  .brand { font-size: 13px; }
  .brand .seal { width: 29px; height: 29px; }
  .brand small { font-size: 8px; margin-top: 4px; }
  .preferences { order: 2; }
  .preferences summary { min-height: 36px; font-size: 11px; padding: 0 10px; }
  .nav { order: 3; flex-basis: 100%; justify-content: space-between; gap: 0; margin-top: 9px; padding: 4px; }
  .nav a, .nav button { font-size: 11px; min-height: 32px; padding: 8px 10px; }
  .nav .navGithub { display: inline-flex; }
  html { scroll-padding-top: 145px; }
  .project { scroll-margin-top: 20px; }
  .hero { padding-top: 15px; padding-bottom: 10px; }
  .heroCopy { padding: 24px 0 32px; }
  .eyebrow { font-size: 8px; letter-spacing: .05em; }
  h1 { font-size: clamp(33px, 8.9vw, 48px); margin-block: 22px; }
  .intro { font-size: 14px; line-height: 2; }
  .heroNote { font-size: 8px; margin-top: 23px; }
  .fieldIndex { padding: 20px 20px 10px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .fieldTop { font-size: 7px; }
  .indexHeading { padding-top: 25px; max-width: 70%; }
  .indexHeading h2 { font-size: 16px; }
  .indexHeading p { font-size: 10px; max-width: 190px; }
  .botanical { right: -20px; top: 25px; width: 55%; }
  .projectPaths a { gap: 8px; font-size: 12px; }
  .projectPaths small { font-size: 10px; }
  .signal { grid-template-columns: 1fr 1fr; padding: 0; margin-top: 28px; }
  .signal>div { padding: 18px 15px; }
  .signal>div:first-child { padding-left: 15px; }
  .signal>div:nth-child(3) { border-left: 0; }
  .signal>div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .signal strong { font-size: 28px; }
  .signal>div:last-child strong { font-size: 22px; }
  .sectionHead h2 { font-size: 30px; }
  .sectionHead p { font-size: 12px; }
  .filters { gap: 3px; }
  .filters button { padding: 7px 9px; font-size: 11px; }
  .filters button span { margin-left: 4px; }
  .case { padding: 22px 19px; gap: 18px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .caseBody h3 { font-size: 27px; }
  .lead { font-size: 13px; }
  .split, .boundary { grid-template-columns: 1fr; gap: 20px; }
  .split>div+div { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .boundaryBox { padding: 18px; }
  .cardActions { align-items: flex-start; gap: 8px; }
  .cardPrimaryActions { gap: 14px; }
  .compact { padding: 22px 19px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .compact h3 { font-size: 24px; }
  .metrics strong { font-size: 23px; }
  .principles { grid-template-columns: 1fr; gap: 18px; }
  .methodIntro h2 { font-size: 27px; }
  .aiNote { padding: 20px;  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight); }
  .aiNote h3 { font-size: 21px; }
  footer { padding-top: 40px; }
  .footerActions { gap: 12px 18px; }
  .foot { flex-direction: column; gap: 8px; }
  dialog { padding: 6px; max-height: calc(100dvh - 28px); }
  .dialogScroll { max-height: calc(100dvh - 42px); padding: 16px 14px; }
  dialog h2 { font-size: 27px; }
  .evidenceList a { grid-template-columns: 1fr 16px; gap: 5px; padding: 12px;  background: color-mix(in srgb, var(--surface) 45%, transparent);}
  .evidenceList code { grid-column: 1 / -1; }
  .preferencesPanel { width: min(300px, calc(100vw - 48px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
:root[data-motion="reduced"], :root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .motion-pending { opacity: 1 !important; } }
:root[data-motion="reduced"] .motion-pending { opacity: 1 !important; }
@media print {
  #cursorHalo { display: none !important; }
  .case, .compact, .aiNote { backdrop-filter: none; }
  .aiNote { background: #fff; box-shadow: none; }
  :root { --text: #222; --muted: #444; --surface: #fff; --glass: #fff; --bg: #fff; --soft: #f7f7f7; --lavender: #f7f7f7; --primary: #5c4050; --border: #ccc; --accent: #555; }
  body { min-width: 0; background: #fff !important; color: #222; font-size: 11pt; }
  body::before, .atmosphere, .top, .skip, .fieldIndex, .actions, .workTools, .resultRow, .cardActions, .footerActions, dialog, .toast, .emptyState { display: none !important; }
  .wrap { width: 100%; }
  .hero, .method { display: block; padding-top: 0; }
  .heroCopy { padding: 0; }
  h1 { font-size: 34px; }
  .signal { margin-top: 25px; }
  .signal>div { display: block; }
  .signal span { display: block; }
  .section { padding-top: 30px; }
  .sectionHead { display: block; }
  .sectionHead h2 { font-size: 27px; }
  .case, .compact { display: block !important; margin-bottom: 22px; padding: 18px; box-shadow: none; break-inside: avoid; background: #fff; }
  .case[hidden], .compact[hidden] { display: block !important; }
  .caseMeta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
  .caseMeta .category { margin: 0; }
  .caseMeta .stack, .role { display: none; }
  .compactGrid { display: block; }
  .caseBody h3 { font-size: 25px; }
  .lead { margin-bottom: 14px; }
  .methodIntro h2 { font-size: 27px; }
  .methodOrnament { display: none; }
  .evidenceChips a::after { content: ' ' attr(href); font: 7px var(--mono); overflow-wrap: anywhere; }
  .evidenceChips { flex-direction: column; }
  .evidenceChip:nth-child(n+3) { display: inline-flex; }
  .motion-pending { opacity: 1 !important; transform: none !important; }
  footer { padding-top: 20px; }
}
