/* The Case Converter · Horizon (DESIGN.md Register 8, the tidvane.com look) — owner decision 27.09.2026.
   Bright sky, navy type, cobalt→turquoise gradient, white cards with soft blue shadows. The tool keeps its dark
   switch (persisted in localStorage "tcc-theme"), mapped onto the Horizon dark tokens. No CDNs, no tracking. */

/* ---------- fonts (bundled variable woff2, latin subsets) ---------- */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700; src: url('../fonts/Archivo-var.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; src: url('../fonts/InstrumentSans-var.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; src: url('../fonts/IBMPlexMono-400.woff2') format('woff2'); font-display: swap; }
/* metric-matched fallbacks (Arial scaled to the web fonts' average advance + vertical metrics) keep the swap from reflowing the tool */
@font-face { font-family: 'Instrument Sans Fallback'; font-weight: 400 600; src: local('Arial'), local('ArialMT'); size-adjust: 103.25%; ascent-override: 93.95%; descent-override: 24.21%; line-gap-override: 0%; }
@font-face { font-family: 'Instrument Sans Fallback'; font-weight: 700; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 99.58%; ascent-override: 97.41%; descent-override: 25.11%; line-gap-override: 0%; }
@font-face { font-family: 'Archivo Fallback'; font-weight: 700; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 98.07%; ascent-override: 89.53%; descent-override: 21.41%; line-gap-override: 0%; }

/* ---------- tokens ---------- */
:root {
  --navy: #0F2552; --ink: #33466B; --muted: #66779A; --agate: #8A98B5;
  --line: #DCE7F4; --line-mid: #D2DEEE; --paper: #FFFFFF; --sky: #F5F9FE; --tint: #EAF3FC; --panel: #F3F8FE;
  --accent: #1F6FEB; --accent-deep: #1E4FC4; --accent-2: #2EE6D0; --accent-mid: #22C3E8; --on-accent: #FFFFFF;
  --grad: linear-gradient(90deg, var(--accent-2) 0%, var(--accent-mid) 45%, var(--accent) 100%);
  --grad-button: linear-gradient(90deg, #1FB5E3, #1F6FEB);
  --grad-text: linear-gradient(90deg, #1E4FC4, #1F6FEB 55%, #22A9E8);
  --ok: #059E86; --ok-bg: #E3F8F3; --hold: #B26A00; --hold-bg: #FFF4DF;
  --shadow: 0 1px 2px rgba(15, 37, 82, .06), 0 10px 30px rgba(31, 79, 196, .10);
  --shadow-lift: 0 2px 4px rgba(15, 37, 82, .06), 0 18px 40px rgba(31, 79, 196, .16);
  --page: linear-gradient(180deg, #EAF3FC 0, #F5F9FE 340px, #FFFFFF 900px, #F4F9FE 100%);
  --display: 'Archivo', 'Archivo Fallback', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Instrument Sans', 'Instrument Sans Fallback', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4.5vw, 56px);
  color-scheme: light;
}
.theme-dark {
  --navy: #EAF2FF; --ink: #C9D6EE; --muted: #93A3C4; --agate: #7384A6;
  --line: #1F3158; --line-mid: #2A3E69; --paper: #12213F; --sky: #0B1630; --tint: #172C52; --panel: #152748;
  --accent: #5B9BFF; --accent-deep: #8AB6FF; --accent-mid: #4FD6F2; --on-accent: #FFFFFF;
  --grad-text: linear-gradient(90deg, #8AB6FF, #5B9BFF 50%, #4FD6F2);
  --ok: #3FD9BE; --ok-bg: #0F3A3A; --hold: #FFC266; --hold-bg: #3A2C12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 14px 32px rgba(0, 0, 0, .45);
  --page: linear-gradient(180deg, #172C52 0, #0B1630 360px);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--sky); }
body {
  background: var(--sky) var(--page) no-repeat; background-size: 100% 100%;
  color: var(--ink); font: 400 1rem/1.6 var(--sans); min-height: 100vh;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 3px solid rgba(31, 111, 235, .45); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(31, 111, 235, .22); color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--navy); letter-spacing: -.015em; line-height: 1.1; }
code { font-family: var(--mono); font-size: .88em; }

/* ---------- header ---------- */
.masthead { padding-top: 14px; position: relative; z-index: 2; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); min-height: 44px; min-width: 0; }
.wordmark-mark { width: 38px; height: 38px; flex: none; }
.wordmark-name { font: 700 1.12rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--navy); }
.wordmark-name em { font-style: normal; }
.wordmark:hover { color: var(--navy); }
.theme-dark .wordmark-mark circle:last-of-type { fill: #EAF2FF; }
.masthead-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.masthead-nav { display: flex; gap: 4px; padding: 4px; background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); }
.masthead-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  font: 500 .92rem/1 var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.masthead-nav a:hover { color: var(--accent); background: var(--tint); }
.masthead-nav a[aria-current="page"] { color: #fff; background: var(--grad-button); }
.theme-btn {
  font: 500 .88rem/1 var(--sans); color: var(--navy); background: var(--paper); border: 0; border-radius: 999px;
  box-shadow: var(--shadow); min-width: 44px; min-height: 44px; padding: 0 16px; cursor: pointer; white-space: nowrap;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.theme-btn:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.theme-btn .moon { display: inline; } .theme-btn .sun { display: none; }
.theme-dark .theme-btn .moon { display: none; } .theme-dark .theme-btn .sun { display: inline; }
.dateline {
  display: flex; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; padding: 10px 0 0;
  font: 500 .7rem/1.5 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.dateline .private { color: var(--accent); }
.dateline .private::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); margin-right: 8px; vertical-align: 1px; }

/* ---------- hero: headline beside a round film disc ---------- */
.hero { --disc: clamp(160px, 16vw, 208px); --pad: clamp(26px, 3.6vw, 48px); position: relative; padding: var(--pad) 0 clamp(18px, 2.6vw, 30px); }
.hero.has-film { min-height: calc(var(--disc) + var(--pad) + 44px); padding-right: calc(var(--disc) + clamp(48px, 6vw, 96px)); }
.hero h1 { font-size: clamp(2.05rem, 4.6vw, 3.7rem); line-height: 1.04; max-width: 20ch; }
.hero h1 em { font-style: normal; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .kicker { margin-bottom: 4px; }
.hero .lede { margin-top: 10px; max-width: 60ch; font-size: clamp(1rem, 1.3vw, 1.1rem); color: var(--ink); }
.hero .lede strong { color: var(--navy); font-weight: 700; }
.hero .pop-list { max-width: 720px; }
.hero-film { position: absolute; right: 22px; top: calc(var(--pad) + 18px); width: var(--disc); aspect-ratio: 1; }
.hero-film::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 2px dotted rgba(31, 111, 235, .32); }
.hero-film::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 6px rgba(91, 212, 253, .16), 0 0 60px 8px rgba(34, 195, 232, .36), inset 0 0 30px rgba(34, 195, 232, .28); }
.hero-film .disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #D9ECFA radial-gradient(circle at 50% 42%, #F2FAFE 0%, #DDEFFB 60%, #C6E3F7 100%); }
.hero-film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-film .glyph { position: absolute; right: -4px; bottom: 6%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; }
.hero-film .glyph svg { width: 62%; height: auto; }

/* ---------- tool card ---------- */
.tool, .checker, .slugger, .ai-tool {
  margin: 4px 0 0; background: var(--paper); border-radius: 24px; box-shadow: var(--shadow);
  padding: clamp(14px, 2vw, 26px); position: relative;
}
.tool::before, .checker::before, .slugger::before, .ai-tool::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad); }
.tool-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 0 0 12px; }
.tool-bar-label { font: 500 .74rem/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink); }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.act-btn {
  font: 500 .92rem/1 var(--sans); color: var(--navy); background: var(--paper);
  border: 1px solid var(--line-mid); border-radius: 999px; min-height: 44px; padding: 0 18px; cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease), background .15s var(--ease);
}
.act-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.act-btn:active:not(:disabled) { transform: translateY(1px); }
.act-btn:disabled { opacity: .45; cursor: default; }
.act-primary { color: #fff; background: var(--grad-button); border-color: transparent; box-shadow: 0 6px 16px rgba(31, 111, 235, .22); }
.act-primary:hover:not(:disabled) { color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(31, 111, 235, .32); transform: translateY(-1px); }
.tool-input {
  display: block; width: 100%; resize: vertical; min-height: 12.5rem; font: 400 1rem/1.7 var(--mono); color: var(--navy);
  background: var(--panel); border: 1px solid var(--line-mid); border-radius: 16px; padding: 14px 16px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.tool-input:focus { outline: none; border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 4px rgba(31, 111, 235, .16); }
.tool-input::placeholder { color: var(--muted); opacity: 1; }

/* stats */
.tool-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--panel); border-radius: 12px; min-width: 0; }
.stat-value { font: 400 1.12rem/1.2 var(--mono); color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-label { font: 500 .66rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* deck of case cards */
.deck { margin-top: 22px; }
.deck-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.deck-title { font-size: 1.3rem; }
.deck-hint { font-size: .9rem; color: var(--muted); }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: 10px; margin-top: 14px; }
.case-btn {
  display: flex; flex-direction: column; gap: 8px; text-align: left; font: inherit; color: var(--navy); cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 15px; min-height: 44px; position: relative; overflow: hidden;
  transition: border-color .15s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.case-btn::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .2s var(--ease); }
.case-btn:hover { border-color: var(--line-mid); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.case-btn:hover::before, .case-btn.is-active::before { transform: scaleX(1); }
.case-btn.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .14); }
.case-btn.is-preset { background: linear-gradient(180deg, var(--tint), var(--paper) 70%); border-color: var(--line-mid); }
.case-btn.is-preset .case-name::after { content: " ·"; color: var(--accent); }
.case-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.case-name { font: 700 .98rem/1.2 var(--sans); color: var(--navy); white-space: nowrap; }
.case-top .style-select { max-width: 6rem; margin-left: auto; }
.case-kbd { font: 400 .7rem/1 var(--mono); color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.case-preview {
  font: 400 .82rem/1.4 var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
  padding-top: 8px; border-top: 1px dashed var(--line-mid);
}
.case-btn.is-sample .case-preview { color: var(--muted); font-style: italic; }
.case-btn.is-active .case-preview, .case-btn:hover .case-preview { color: var(--accent); }

/* style selector (Title Case card, checker, AI model) */
.style-select {
  font: 500 .74rem/1 var(--sans); letter-spacing: .04em; color: var(--navy); background: var(--panel);
  border: 1px solid var(--line-mid); border-radius: 999px; padding: 4px 10px; cursor: pointer; min-height: 32px;
}
.style-select:hover { border-color: var(--accent); }
.style-select-lg { font-size: .92rem; padding: 0 14px; min-height: 44px; max-width: 100%; }

/* ---------- headline checker ---------- */
.checker-input { min-height: 6rem; }
.checker-style { display: flex; align-items: center; gap: 10px; }
.checker-style-label { font: 500 .7rem/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.checker-report { margin-top: 12px; padding: 16px; background: var(--panel); border-radius: 16px; }
.checker-verdict { font: 700 1rem/1.4 var(--sans); color: var(--muted); }
.checker-verdict.is-ok { color: var(--ok); }
.checker-verdict.is-bad { color: var(--hold); }
.checker-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.checker-break { flex-basis: 100%; height: 0; }
.chip-ok, .chip-bad { font: 400 .88rem/1.3 var(--mono); padding: 5px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line-mid); color: var(--navy); }
.chip-ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line-mid)); }
.chip-bad { background: var(--hold-bg); border-color: color-mix(in srgb, var(--hold) 45%, transparent); text-decoration: line-through; text-decoration-thickness: 1px; }
.chip-fix { margin-left: 6px; text-decoration: none; display: inline-block; color: var(--accent); font-weight: 400; }
.chip-fix::before { content: "→ "; color: var(--muted); }
.checker-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- slug generator ---------- */
.slug-input { min-height: 6rem; }
.slug-option { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 500 .92rem/1 var(--sans); color: var(--navy); min-height: 44px; padding: 0 4px; }
.slug-option input { accent-color: var(--accent); width: 18px; height: 18px; }
.slug-out-wrap { margin-top: 12px; padding: 14px 16px; background: var(--panel); border-radius: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slug-out { flex: 1 1 14rem; min-height: 44px; display: flex; align-items: center; font: 400 1rem/1.4 var(--mono); color: var(--accent); background: var(--paper);
  border: 1px dashed var(--line-mid); border-radius: 12px; padding: 8px 12px; overflow-wrap: anywhere; }

/* ---------- AI assistant (BYOK) ---------- */
.ai-settings { background: var(--panel); border-radius: 16px; padding: 14px 16px 16px; margin-bottom: 18px; }
.ai-key-status { font: 500 .8rem/1.3 var(--sans); color: var(--muted); }
.ai-key-status.is-ok { color: var(--ok); }
.ai-key-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-key-input { flex: 1 1 16rem; min-width: 0; min-height: 44px; font: 400 .9rem/1.2 var(--mono); color: var(--navy); background: var(--paper);
  border: 1px solid var(--line-mid); border-radius: 12px; padding: 0 14px; }
.ai-key-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 111, 235, .16); }
.ai-model-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; min-width: 0; }
.ai-model-row .style-select-lg { flex: 0 1 auto; min-width: 0; background: var(--paper); }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ai-note { font-size: .86rem; color: var(--muted); margin: 10px 0 18px; max-width: 70ch; }
.ai-out-wrap { margin-top: 4px; }
.ai-out { font: 400 .92rem/1.65 var(--mono); color: var(--navy); background: var(--panel); border-radius: 16px; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 5rem; }
.ai-out.is-error { color: var(--hold); background: var(--hold-bg); }

/* ---------- sections ---------- */
.section { padding: clamp(48px, 6vw, 80px) 0 0; }
.kicker { font: 500 .76rem/1.5 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 30ch; }
.section > p { margin-top: 14px; max-width: 66ch; }
.card { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(16px, 2vw, 24px); margin: 18px 0; }
.card code { color: var(--navy); overflow-wrap: anywhere; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: clamp(12px, 1.6vw, 20px); margin-top: 24px; }
.feature { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(18px, 2vw, 26px); }
.feature h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feature p { color: var(--ink); font-size: .96rem; }
.feature .num { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; background: var(--grad); color: #fff;
  font: 700 .8rem/1 var(--display); letter-spacing: .04em; margin-bottom: 14px; }
.pop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 10px; margin-top: 22px; padding: 0; list-style: none; }
.pop-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 10px 16px;
  font: 500 .96rem/1.25 var(--sans); color: var(--navy); text-decoration: none; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), color .15s var(--ease);
}
.pop-list a::after { content: "→"; color: var(--accent); transition: transform .2s var(--ease); }
.pop-list a:hover { color: var(--accent); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.pop-list a:hover::after { transform: translateX(3px); }

/* FAQ */
.faq details { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); margin-top: 10px; }
.faq details:first-of-type { margin-top: 22px; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding: 12px 18px; cursor: pointer; list-style: none;
  font: 700 1rem/1.35 var(--sans); color: var(--navy); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--accent); font: 500 1.1rem/1 var(--sans); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink); max-width: 70ch; padding: 0 18px 16px; }

/* prose / legal pages: the document on a white sheet */
.prose { max-width: 920px; margin: clamp(20px, 4vw, 48px) auto 0; background: var(--paper); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(22px, 5vw, 60px); }
.prose h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); margin-bottom: 8px; }
.prose h2 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin: 1.8em 0 .5em; max-width: none; }
.prose h3 { font: 700 1.05rem/1.3 var(--sans); color: var(--navy); margin: 1.4em 0 .4em; }
.prose p, .prose li { margin: .6em 0; max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose .meta { font: 500 .74rem/1.5 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 4px 0 26px; }
.prose code { background: var(--panel); border-radius: 6px; padding: .08em .35em; }
.prose .card { background: var(--panel); box-shadow: none; }
.prose p a, .prose li a { overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.footer { margin-top: clamp(64px, 8vw, 104px); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 62%, transparent); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px var(--gutter); padding: clamp(40px, 5vw, 60px) 0 26px; }
.footer-brand .wordmark { gap: 10px; }
.footer-brand .wordmark-mark { width: 34px; height: 34px; }
.footer-brand .wordmark-name { font-size: 1rem; }
.footer-brand p { color: var(--muted); font-size: .95rem; max-width: 34ch; margin-top: 12px; }
.footer-brand .mail { display: inline-block; margin-top: 8px; padding: 8px 0; font-weight: 500; }
.footer h3 { font: 500 .72rem/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.footer ul { list-style: none; }
.footer li a { display: inline-block; padding: 7px 0; color: var(--ink); text-decoration: none; font-size: .95rem; }
.footer li a:hover { color: var(--accent); }
.footer-house { display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 18px 0 28px; font-size: .9rem; color: var(--muted); }
.footer-house-left { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.copyline { color: var(--muted); }
.footer-house .mail { display: inline-block; padding: 10px 0; margin: -10px 0; color: var(--ink); }
.attribution { color: var(--muted); }
.attribution a { display: inline-block; padding: 10px 0; margin: -10px 0; color: var(--navy); font-weight: 700; text-decoration-color: var(--accent-mid); }

/* ---------- motion & a11y ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .masthead-inner { flex-wrap: wrap; }
  .masthead-side { display: contents; }
  .masthead-inner > .wordmark { flex: 1 1 auto; }
  .theme-btn { order: 2; }
  .masthead-nav { order: 3; flex: 0 1 auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .masthead-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .masthead { padding-top: 8px; }
  .masthead-inner { min-height: 52px; gap: 8px; }
  .wordmark { gap: 10px; }
  .wordmark-mark { width: 32px; height: 32px; }
  .wordmark-name { font-size: .98rem; letter-spacing: .07em; }
  .masthead-nav a { padding: 0 12px; font-size: .88rem; }
  .masthead-nav { flex: 1 1 100%; justify-content: space-between; }
  .theme-btn { padding: 0 12px; font-size: .84rem; }
  .dateline { font-size: .62rem; letter-spacing: .16em; padding-top: 8px; }
  .hero, .hero.has-film { display: block; min-height: 0; padding: 18px 0 14px; }
  .hero::after { content: ""; display: block; clear: both; }
  .hero-film { position: relative; right: auto; top: auto; transform: none; float: right; width: 96px; margin: 4px 4px 8px 14px; shape-outside: circle(50% at 50% 50%); shape-margin: 10px; }
  .hero-film::before { inset: -8px; }
  .hero-film::after { inset: -3px; box-shadow: 0 0 0 4px rgba(91, 212, 253, .16), 0 0 26px 4px rgba(34, 195, 232, .32); }
  .hero-film .glyph { display: none; }
  .hero h1 { font-size: clamp(1.8rem, 8.4vw, 2.2rem); }
  .hero .lede { font-size: .98rem; margin-top: 8px; line-height: 1.55; }
  .tool, .checker, .slugger, .ai-tool { border-radius: 20px; padding: 12px; }
  .tool-actions { width: 100%; }
  .act-btn { flex: 1 1 auto; padding: 0 12px; font-size: .88rem; }
  .tool > .tool-bar .tool-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tool > .tool-bar .act-btn { grid-column: span 2; padding: 0 6px; }
  .tool > .tool-bar .act-btn:nth-child(n+4) { grid-column: span 3; }
  .tool-input { min-height: 10.5rem; padding: 12px 13px; }
  .tool-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .stat { grid-column: span 2; }
  .stat:nth-child(n+4) { grid-column: span 3; }
  .stat { padding: 8px 10px; }
  .deck-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
}
@media (max-width: 380px) {
  .wordmark-name { font-size: .88rem; letter-spacing: .06em; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* print: the tool is useless on paper, the text isn't */
@media print {
  .masthead, .deck, .tool-bar, .footer, .section, .hero-film { display: none; }
  .tool { box-shadow: none; }
  .tool-input { border: none; background: none; }
}
