/* ==========================================================================
   Silver Halide — Darkroom Film Processing Tools & Knowledge Site
   Global stylesheet. Dark darkroom theme, safelight red + film amber.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Darkroom black */
  --dark-900: #080606;
  --dark-850: #0F0D0C;
  --dark-800: #1A1716;
  --dark-700: #252120;
  --dark-600: #332E2C;
  --dark-500: #453F3C;
  --dark-400: #5C5551;

  /* Safelight red */
  --safelight-900: #5C1610;
  --safelight-800: #8A221A;
  --safelight-500: #C4342A;
  --safelight-400: #D65548;
  --safelight-300: #E88378;
  --safelight-200: #F5C0B8;
  --safelight-100: #FAE0DC;

  /* Film amber */
  --amber-900: #7A5210;
  --amber-800: #B07818;
  --amber-500: #E8A94E;
  --amber-400: #F0BC70;
  --amber-300: #F5D094;
  --amber-200: #FBE8C4;
  --amber-100: #FDF4E0;

  /* Silver halide greys */
  --silver-100: #F0EDE8;
  --silver-200: #D4CFC8;
  --silver-300: #B8B0A8;
  --silver-400: #8C847C;
  --silver-500: #5C5551;
  --silver-600: #3A3532;
  --silver-700: #252120;

  /* Semantic */
  --ok: #5A8A5A;
  --ok-bg: #142114;
  --ok-bd: #2E4A2E;
  --warn: #C4342A;
  --info: #4A7A9C;
  --info-bg: #152530;
  --info-bd: #2E5A7A;
  --info-fg: #A0C4DC;

  /* Text */
  --text: #F0EDE8;
  --text-muted: #B8B0A8;
  --text-dim: #8C847C;
  --text-on-dark: #F0EDE8;
  --text-on-dark-muted: #B8B0A8;

  /* Surfaces */
  --bg: var(--dark-850);
  --surface: #1A1716;
  --surface-2: #252120;
  --surface-3: #332E2C;
  --surface-deep: #080606;

  /* Borders */
  --border: #332E2C;
  --border-strong: #453F3C;

  /* Glow */
  --glow-red: 0 0 16px rgba(196, 52, 42, .3);
  --glow-red-soft: 0 0 16px rgba(196, 52, 42, .35);
  --glow-amber: 0 0 16px rgba(232, 169, 78, .25);
  --glow-amber-soft: 0 0 16px rgba(232, 169, 78, .3);

  /* Radius */
  --r-xs: 2px;
  --r-sm: 8px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .45);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .6);

  /* Motion */
  --t-fast: .14s ease;
  --t-med: .3s ease;
  --t-film: .5s ease-out;

  /* Layout */
  --container: 1200px;
  --container-narrow: 820px;
  --container-wide: 1360px;
  --gutter: 22px;
  --header-h: 52px;
  --filmstrip-h: 40px;

  /* Fonts */
  --font-head: "Oswald", "Bebas Neue", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", "Menlo", "DejaVu Sans Mono", monospace;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--filmstrip-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* very subtle film grain over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, video, canvas { max-width: 100%; display: block; }
img { height: auto; }

/* Every icon emitted by the generator carries .ico so it can never stretch.
   More specific rules further down (.notice svg, .btn svg, …) override this. */
.ico { width: 18px; height: 18px; flex: 0 0 auto; }

a { color: var(--amber-500); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--safelight-400); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--amber-500);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(232, 169, 78, .35);
}

::selection { background: var(--safelight-800); color: var(--safelight-100); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--safelight-500);
  color: var(--amber-100);
  padding: 10px 18px;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; color: #fff; }

.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;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--text);
  margin: 0 0 .6em;
  text-transform: none;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.18rem, 2vw, 1.4rem); }
h4 { font-size: 1.08rem; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; color: var(--silver-100); }
em { color: var(--amber-300); font-style: italic; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--safelight-500);
  margin: 0 0 .7em;
}

.lead {
  font-size: 1.06rem;
  color: var(--text-muted);
  max-width: 68ch;
}

.mono, code, kbd, samp { font-family: var(--font-mono); }

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: .1em .4em;
  font-size: .88em;
  color: var(--amber-300);
}

.param-badge {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-family: var(--font-mono);
  font-size: .8rem;
  background: var(--dark-900);
  border: 1px solid var(--amber-900);
  color: var(--amber-300);
  border-radius: var(--r-xs);
  padding: 3px 8px;
  white-space: nowrap;
}

.param-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow { max-width: var(--container-narrow); }
.container-wide { max-width: var(--container-wide); }

main { position: relative; z-index: 2; }

.section { padding: 60px 0; }
.section-sm { padding: 38px 0; }
.section-tight { padding: 42px 0 60px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .section-head-link {
  font-size: .88rem;
  font-weight: 700;
  color: var(--amber-500);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.section-head .section-head-link:hover { color: var(--safelight-400); }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--safelight-900), transparent);
  border: 0;
  margin: 0;
}

.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.split-side {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 44px;
  align-items: start;
}
.split-wide {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 34px;
  align-items: start;
}
/* Grid items default to min-width:auto, which lets a wide table or image
   force the whole track open. Let them shrink instead. */
.split-wide > * { min-width: 0; }
.split-side > * { min-width: 0; }
.calc-layout > * { min-width: 0; }
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   5. Header — dual row film strip
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--dark-900);
}

.header-row-1 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  height: var(--header-h);
  background: var(--dark-900);
  transition: height var(--t-med);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  flex-wrap: nowrap;
}

.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: var(--r-sm);
  background: var(--safelight-500);
  display: grid;
  place-items: center;
  box-shadow: var(--glow-red);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--silver-100);
  letter-spacing: .01em;
  white-space: nowrap;
}
.brand-tag {
  font-size: .55rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber-500);
  white-space: nowrap;
  transition: opacity var(--t-med), max-height var(--t-med);
  max-height: 12px;
  overflow: hidden;
}

.main-nav { display: flex; align-items: center; gap: 4px; margin-inline: auto; }
.main-nav a {
  font-size: .84rem;
  font-weight: 500;
  color: var(--silver-200);
  padding: 6px 10px;
  border-radius: var(--r-xs);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.main-nav a:hover { background: rgba(196, 52, 42, .12); color: var(--silver-100); }
.main-nav a[aria-current="page"] {
  color: var(--amber-500);
  box-shadow: inset 0 -2px 0 var(--amber-500);
  border-radius: var(--r-xs) var(--r-xs) 0 0;
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }

.search-box { position: relative; }
.search-box input {
  width: 180px;
  height: 32px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--dark-850);
  color: var(--text);
  padding: 0 32px 0 32px;
  font-size: .84rem;
  transition: width var(--t-med), border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-box input::placeholder { color: var(--silver-400); }
.search-box input:focus {
  width: 240px;
  outline: none;
  border-color: var(--amber-500);
  box-shadow: var(--glow-amber);
}
.search-box .search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--silver-400);
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--dark-800);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 300;
}
.search-results.open { display: block; }
.search-results .sr-item {
  display: block;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  transition: background var(--t-fast);
}
.search-results .sr-item:hover, .search-results .sr-item:focus { background: rgba(196, 52, 42, .14); }
.search-results .sr-title { font-size: .88rem; font-weight: 600; color: var(--silver-100); }
.search-results .sr-meta { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.search-results .sr-empty { padding: 14px 10px; font-size: .84rem; color: var(--text-dim); }

.btn-studio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--amber-500);
  color: var(--amber-400);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn-studio:hover { background: rgba(232, 169, 78, .12); box-shadow: var(--glow-amber); color: var(--amber-300); }
.btn-studio svg { width: 14px; height: 14px; }

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--silver-200);
  place-items: center;
  flex: 0 0 auto;
}
.nav-toggle:hover { border-color: var(--safelight-500); color: var(--safelight-300); }
.nav-toggle svg { width: 18px; height: 18px; }

/* --- Row 2: the film strip --- */
.filmstrip {
  position: relative;
  height: var(--filmstrip-h);
  background: var(--dark-850);
  border-top: 1px solid var(--safelight-900);
  border-bottom: 1px solid var(--safelight-900);
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.filmstrip-perfs {
  flex: 0 0 44px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 5px,
    var(--dark-600) 5px 13px,
    transparent 13px 20px
  );
  background-position: 8px 0;
  background-size: 12px 100%;
  border-right: 1px solid var(--dark-600);
  opacity: .9;
}
.filmstrip-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  flex: 1 1 auto;
}
.filmstrip-track::-webkit-scrollbar { display: none; }

.filmstrip-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--silver-300);
  border-left: 1px solid var(--dark-600);
  border-right: 1px solid var(--dark-600);
  margin-right: -1px;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.filmstrip-item:hover { background: rgba(232, 169, 78, .15); color: var(--silver-100); }
.filmstrip-item.is-active {
  background: var(--amber-500);
  color: var(--dark-900);
  box-shadow: var(--glow-amber);
}
.filmstrip-item.is-active::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--safelight-500);
}
.filmstrip-item .fs-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--safelight-500);
  flex: 0 0 6px;
}
.filmstrip-item.is-active .fs-dot { background: var(--dark-900); }

.filmstrip-fade {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, var(--dark-850));
  pointer-events: none;
}

/* scrolled state */
.site-header.is-scrolled .header-row-1 { height: 44px; }
.site-header.is-scrolled .brand-mark { width: 26px; height: 26px; flex-basis: 26px; }
.site-header.is-scrolled .brand-mark svg { width: 15px; height: 15px; }
.site-header.is-scrolled .brand-name { font-size: .95rem; }
.site-header.is-scrolled .brand-tag { opacity: 0; max-height: 0; }

/* mobile drawer */
.nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--dark-900);
  border-bottom: 1px solid var(--safelight-900);
  box-shadow: var(--shadow-lg);
  padding: 12px var(--gutter) 18px;
  max-height: 74vh;
  overflow-y: auto;
  z-index: 250;
}
.nav-drawer.open { display: block; }
.nav-drawer .nd-section + .nd-section { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.nav-drawer .nd-label {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--safelight-500);
  margin-bottom: 8px;
}
.nav-drawer a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-xs);
  font-size: .9rem;
  font-weight: 500;
  color: var(--silver-200);
}
.nav-drawer a:hover { background: rgba(196, 52, 42, .12); color: var(--silver-100); }
.nav-drawer a.is-active { background: rgba(232, 169, 78, .14); color: var(--amber-400); }
.nav-drawer .nd-perf {
  height: 10px;
  background-image: repeating-linear-gradient(to right, transparent 0 6px, var(--dark-600) 6px 12px, transparent 12px 18px);
  opacity: .8;
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: .93rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  transition: background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
  text-align: center;
}
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--safelight-500); color: var(--amber-100); }
.btn-primary:hover { background: var(--safelight-800); color: #fff; box-shadow: var(--glow-red); }

.btn-amber { background: var(--amber-500); color: var(--dark-900); }
.btn-amber:hover { background: var(--amber-400); color: var(--dark-900); box-shadow: var(--glow-amber); }

.btn-outline { background: var(--dark-850); color: var(--silver-100); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--amber-500); color: var(--amber-400); }

.btn-ghost-light { background: transparent; color: var(--silver-200); border-color: transparent; }
.btn-ghost-light:hover { background: rgba(196, 52, 42, .12); color: var(--silver-100); }

.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------------------------
   7. Cards, tags, chips, badges
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t-med), transform var(--t-med), border-color var(--t-med);
  position: relative;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--safelight-500);
}
.card:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-sm);
  box-shadow: var(--glow-red);
  pointer-events: none;
}
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--dark-900); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-med); }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 9px; flex: 1 1 auto; }
.card-title { font-size: 1.06rem; font-weight: 600; margin: 0; }
.card-title a { color: var(--silver-100); }
.card-title a:hover { color: var(--amber-400); }
.card-text { font-size: .9rem; color: var(--text-muted); margin: 0; }
.card-foot {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .78rem;
  color: var(--text-dim);
}

/* category card */
.cat-card { padding: 20px; gap: 12px; display: flex; flex-direction: column; }
.cat-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-sm);
  background: rgba(196, 52, 42, .14);
  border: 1px solid var(--safelight-900);
  display: grid;
  place-items: center;
  color: var(--safelight-500);
}
.cat-icon svg { width: 24px; height: 24px; }
.cat-count { font-size: .78rem; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }
.cat-arrow { margin-left: auto; color: var(--amber-500); transition: transform var(--t-fast); }
.cat-card:hover .cat-arrow { transform: translateX(4px); }

/* tool card */
.tool-card .card-media {
  aspect-ratio: 4 / 3;
  background: var(--dark-900);
  display: grid;
  place-items: center;
  padding: 14px;
}
.tool-card .card-media img { object-fit: contain; height: 100%; }
.tool-card:hover .card-media img { transform: scale(1.03); }

/* blog card */
.blog-card .card-media { aspect-ratio: 16 / 9; }
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.blog-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--silver-500); }

/* calculator card */
.calc-card { padding: 20px; gap: 10px; display: flex; flex-direction: column; }
.calc-card .calc-mini {
  margin-top: 4px;
  background: var(--dark-900);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--amber-300);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.calc-card .calc-mini span:last-child { color: var(--silver-300); }

/* studio card */
.studio-card {
  background: linear-gradient(160deg, var(--dark-900), #14100F);
  border: 1px solid var(--amber-900);
  box-shadow: 0 0 0 1px rgba(232, 169, 78, .06), var(--shadow-sm);
}
.studio-card:hover { border-color: var(--amber-500); }
.studio-card:hover::after { box-shadow: var(--glow-amber); }
.studio-card .card-media {
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 50% 45%, rgba(232, 169, 78, .14), transparent 65%), var(--dark-900);
}
.studio-card .card-media img { object-fit: contain; padding: 10px; }

/* film card — one frame of film */
.film-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  position: relative;
  padding: 22px 18px;
  overflow: hidden;
}
.film-card::before, .film-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 9px;
  background-image: repeating-linear-gradient(to right, transparent 0 6px, var(--dark-500) 6px 13px, transparent 13px 19px);
  opacity: .75;
}
.film-card::before { top: 0; }
.film-card::after { bottom: 0; }

/* tags & chips */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag-red { background: rgba(196, 52, 42, .18); color: var(--safelight-300); border: 1px solid var(--safelight-900); }
.tag-amber { background: rgba(232, 169, 78, .16); color: var(--amber-400); border: 1px solid var(--amber-900); }
.tag-silver { background: var(--dark-700); color: var(--silver-200); border: 1px solid var(--border-strong); }
.tag-green { background: rgba(90, 138, 90, .16); color: #8FBE8F; border: 1px solid var(--ok-bd); }
.tag-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border-strong); }

.badge-3d {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--amber-500);
  color: var(--dark-900);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.badge-3d svg { width: 11px; height: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--dark-850);
  color: var(--silver-200);
  font-size: .82rem;
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--amber-500); color: var(--amber-400); }
.chip.is-active { background: var(--amber-500); color: var(--dark-900); border-color: var(--amber-500); }

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: rgba(196, 52, 42, .13);
  border: 1px solid var(--safelight-900);
  color: var(--safelight-300);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stage-pill .n {
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--safelight-500);
  color: var(--amber-100);
  display: grid;
  place-items: center;
  font-size: .64rem;
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   8. Notices & strips
   -------------------------------------------------------------------------- */
.notice {
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 14px 16px;
  font-size: .9rem;
  color: var(--text-muted);
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.notice svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 3px; }
.notice strong { display: block; color: inherit; margin-bottom: 3px; }
.notice-safety { background: #2E2418; border-color: var(--amber-900); color: var(--amber-300); }
.notice-safety svg { color: var(--amber-500); }
.notice-info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }
.notice-info svg { color: var(--info); }
.notice-warn { background: #2E1210; border-color: var(--safelight-800); color: var(--safelight-300); }
.notice-warn svg { color: var(--safelight-500); }
.notice-neutral { background: var(--surface); border-color: var(--border); color: var(--text-muted); }

.tip-box {
  border-left: 4px solid var(--amber-500);
  background: var(--surface);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 18px;
  margin: 22px 0;
  font-size: .92rem;
  color: var(--text-muted);
}
.tip-box .tip-label {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--amber-500);
  margin-bottom: 5px;
}
.tip-box strong { color: var(--silver-100); }
.tip-box.warn { border-left-color: var(--safelight-500); }
.tip-box.warn .tip-label { color: var(--safelight-500); }
.tip-box.note { border-left-color: var(--info); }
.tip-box.note .tip-label { color: var(--info); }
.tip-box.ok { border-left-color: var(--ok); }
.tip-box.ok .tip-label { color: #8FBE8F; }

.legal-note {
  background: var(--dark-900);
  border-left: 4px solid var(--safelight-500);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  padding: 13px 16px;
  font-size: .84rem;
  color: var(--text-dim);
  margin-top: 26px;
}
.legal-note strong { color: var(--silver-300); }

.empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  padding: 42px 22px;
  text-align: center;
  color: var(--text-dim);
  background: rgba(26, 23, 22, .5);
}
.empty-state svg { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--silver-500); }
.empty-state h3 { color: var(--silver-200); margin-bottom: 6px; }

.safety-strip {
  background: linear-gradient(90deg, rgba(196, 52, 42, .16), rgba(196, 52, 42, .05));
  border-bottom: 1px solid var(--safelight-900);
  border-top: 1px solid var(--safelight-900);
  padding: 9px 0;
  font-size: .8rem;
}
.safety-strip .ss-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--safelight-200);
}
.safety-strip .ss-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--safelight-400);
  font-size: .72rem;
}
.safety-strip .ss-title svg { width: 14px; height: 14px; }
.safety-strip .ss-items { display: flex; gap: 16px; flex-wrap: wrap; }
.safety-strip .ss-items span { display: inline-flex; align-items: center; gap: 6px; color: var(--silver-200); }
.safety-strip .ss-items svg { width: 14px; height: 14px; color: var(--safelight-500); }

.chem-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.chem-indicator .ci-bar {
  width: 56px; height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, #5A8A5A, var(--amber-500) 55%, var(--safelight-500));
}
.chem-indicator .ci-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 8px currentColor;
}
.chem-indicator.lv-low .ci-dot { background: #5A8A5A; }
.chem-indicator.lv-med .ci-dot { background: var(--amber-500); }
.chem-indicator.lv-high .ci-dot { background: var(--safelight-500); }
.chem-indicator.lv-low { color: #8FBE8F; }
.chem-indicator.lv-med { color: var(--amber-400); }
.chem-indicator.lv-high { color: var(--safelight-300); }

/* --------------------------------------------------------------------------
   9. Home modules
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  height: 460px;
  overflow: hidden;
  background: var(--dark-900);
  border-bottom: 3px solid var(--safelight-500);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #080606 0%, rgba(15, 13, 12, .9) 46%, rgba(196, 52, 42, .2) 100%);
}
.hero-inner {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  align-items: center;
}
.hero-content { max-width: 620px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: var(--r-pill);
  background: rgba(196, 52, 42, .2);
  border: 1px solid var(--safelight-800);
  color: var(--safelight-200);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(1.95rem, 4.2vw, 2.9rem);
  line-height: 1.12;
  margin: 0 0 14px;
  color: var(--silver-100);
}
.hero-title .hl { color: var(--amber-500); }
.hero-text { font-size: 1rem; color: var(--silver-200); max-width: 52ch; margin-bottom: 22px; }
.hero-controls {
  position: absolute;
  bottom: 20px;
  left: 0; right: 0;
  z-index: 4;
}
.hero-controls .hc-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.hero-dots { display: flex; gap: 8px; align-items: center; }
.hero-dots button {
  width: 30px; height: 5px;
  border-radius: var(--r-pill);
  background: var(--dark-500);
  transition: width var(--t-med), background var(--t-med), box-shadow var(--t-med);
}
.hero-dots button[aria-selected="true"] {
  width: 46px;
  background: var(--safelight-500);
  box-shadow: var(--glow-red);
}
.hero-arrows { display: flex; gap: 8px; }
.hero-arrows button {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(8, 6, 6, .6);
  color: var(--silver-200);
  display: grid;
  place-items: center;
  transition: border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.hero-arrows button:hover { border-color: var(--safelight-500); color: var(--safelight-300); box-shadow: var(--glow-red); }
.hero-arrows svg { width: 16px; height: 16px; }

.trust-bar { background: var(--dark-900); border-bottom: 1px solid var(--border); padding: 26px 0; }
.trust-bar .tb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-item .ti-icon {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: var(--r-sm);
  background: rgba(196, 52, 42, .13);
  border: 1px solid var(--safelight-900);
  display: grid; place-items: center;
  color: var(--safelight-500);
}
.trust-item .ti-icon svg { width: 19px; height: 19px; }
.trust-item h3 { font-size: .95rem; margin: 0 0 3px; color: var(--silver-100); }
.trust-item p { font-size: .82rem; color: var(--text-dim); margin: 0; line-height: 1.5; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); counter-reset: step; }
.step-item { position: relative; }
.step-item .step-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--dark-900);
  border: 1px solid var(--border);
}
.step-item .step-media img { width: 100%; height: 100%; object-fit: cover; }
.step-item .step-num {
  position: absolute;
  top: 10px; left: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--safelight-500);
  color: var(--amber-100);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 700;
  box-shadow: var(--glow-red);
  z-index: 2;
}
.step-item .step-label {
  display: inline-block;
  margin-top: 14px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--safelight-500);
}
.step-item h3 { font-size: 1.08rem; margin: 4px 0 6px; }
.step-item p { font-size: .86rem; color: var(--text-muted); margin: 0; }

.studio-preview {
  background: radial-gradient(circle at 78% 40%, rgba(232, 169, 78, .1), transparent 55%), var(--dark-900);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
}
.studio-preview-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 40px;
  align-items: center;
}
.studio-stage {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: var(--r-sm);
  border: 1px solid var(--amber-900);
  background: radial-gradient(circle at 50% 45%, rgba(196, 52, 42, .14), transparent 62%), var(--dark-900);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.studio-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.studio-stage canvas:active { cursor: grabbing; }
.studio-stage .ss-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}
.studio-stage .ss-fallback img { max-height: 100%; object-fit: contain; }
.studio-stage .ss-hint {
  position: absolute;
  left: 12px; bottom: 10px;
  font-size: .7rem;
  color: var(--text-dim);
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(8, 6, 6, .6);
  padding: 4px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}
.studio-preview-copy .studio-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.cta-band {
  background: var(--safelight-500);
  border-radius: var(--r-lg);
  padding: 44px;
  box-shadow: var(--glow-red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin: 0 0 8px; }
.cta-band p { color: var(--safelight-100); margin: 0; max-width: 56ch; }
.cta-band .btn-amber { background: var(--dark-900); color: var(--amber-400); }
.cta-band .btn-amber:hover { background: var(--dark-800); color: var(--amber-300); }

/* --------------------------------------------------------------------------
   10. Page hero / breadcrumbs
   -------------------------------------------------------------------------- */
.page-hero {
  background: linear-gradient(180deg, var(--dark-900), var(--dark-850));
  border-bottom: 3px solid var(--safelight-500);
  padding: 40px 0 34px;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 46%;
  background: radial-gradient(ellipse at 80% 50%, rgba(196, 52, 42, .18), transparent 68%);
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { margin: 0 0 12px; }
.page-hero .lead { margin: 0; }
.page-hero .ph-perf {
  height: 11px;
  margin-top: 26px;
  background-image: repeating-linear-gradient(to right, transparent 0 7px, var(--dark-600) 7px 15px, transparent 15px 22px);
  opacity: .7;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--amber-400); }
.breadcrumbs .sep { color: var(--silver-500); }
.breadcrumbs [aria-current="page"] { color: var(--amber-500); }

/* --------------------------------------------------------------------------
   11. Tool detail
   -------------------------------------------------------------------------- */
.exhibit-frame {
  background: var(--dark-900);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 18px;
  position: relative;
  box-shadow: inset 0 0 40px rgba(74, 122, 156, .07), var(--shadow-sm);
}
.exhibit-frame .ex-main {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.exhibit-frame .ex-main img { object-fit: contain; max-height: 100%; transition: opacity var(--t-med); }
.exhibit-frame .ex-badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
}
.exhibit-frame .ex-view-toggle {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  gap: 4px;
  background: rgba(8, 6, 6, .75);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
  z-index: 3;
}
.exhibit-frame .ex-view-toggle button {
  font-size: .7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  color: var(--text-dim);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.exhibit-frame .ex-view-toggle button.is-active { background: var(--amber-500); color: var(--dark-900); }
.exhibit-frame .ex-3d { aspect-ratio: 4 / 3; display: none; }
.exhibit-frame.is-3d .ex-main { display: none; }
.exhibit-frame.is-3d .ex-3d { display: block; }

/* The thumbnails are <img> elements carrying width="320" attributes, so an
   `auto` minimum track size would resolve to 320px+padding per column and
   blow the whole page out sideways. minmax(0, 1fr) lets the tracks shrink. */
.ex-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ex-thumbs button {
  aspect-ratio: 4 / 3;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--dark-850);
  padding: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ex-thumbs button:hover { border-color: var(--amber-500); }
.ex-thumbs button.is-active { border-color: var(--safelight-500); box-shadow: var(--glow-red); }
.ex-thumbs img { max-width: 100%; max-height: 100%; object-fit: contain; }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: .86rem; }
.spec-table caption {
  text-align: left;
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--silver-100);
  padding-bottom: 10px;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec-table th { color: var(--text-dim); font-weight: 600; width: 42%; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.spec-table td { color: var(--silver-200); font-family: var(--font-mono); font-size: .82rem; overflow-wrap: anywhere; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.detail-block { margin-bottom: 30px; }
.detail-block > h2 {
  font-size: 1.28rem;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 15px;
}
.detail-list { display: grid; gap: 9px; }
.detail-list li {
  display: flex;
  gap: 10px;
  font-size: .9rem;
  color: var(--text-muted);
  align-items: flex-start;
}
.detail-list li::before {
  content: "";
  flex: 0 0 6px;
  width: 6px; height: 6px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--safelight-500);
}
.detail-list.amber li::before { background: var(--amber-500); }

.compat-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------------------
   12. Filter bar, pagination, results
   -------------------------------------------------------------------------- */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 26px;
}
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1 1 150px; }
.filter-field label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.filter-field input, .filter-field select {
  height: 38px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--dark-900);
  color: var(--text);
  padding: 0 11px;
  font-size: .87rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.filter-field input:focus, .filter-field select:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: var(--glow-amber);
}
.filter-field.grow { flex: 2 1 220px; }
.filter-actions { display: flex; gap: 10px; align-items: center; }
.result-count {
  font-size: .82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.result-count b { color: var(--amber-400); }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 34px; flex-wrap: wrap; }
.pagination button {
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--dark-850);
  color: var(--silver-200);
  font-size: .86rem;
  font-weight: 700;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.pagination button:hover:not([disabled]) { border-color: var(--amber-500); color: var(--amber-400); }
.pagination button[aria-current="page"] { background: var(--safelight-500); border-color: var(--safelight-500); color: var(--amber-100); }
.pagination button[disabled] { opacity: .38; cursor: default; }

/* --------------------------------------------------------------------------
   13. Calculators
   -------------------------------------------------------------------------- */
.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 24px;
}
.calc-form .field { margin-bottom: 16px; }
.calc-form .field:last-child { margin-bottom: 0; }
.calc-form label {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.calc-form input, .calc-form select {
  width: 100%;
  height: 42px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--dark-900);
  color: var(--text);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: .9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.calc-form input:focus, .calc-form select:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: var(--glow-amber);
}
.calc-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc-form .field-hint { font-size: .74rem; color: var(--text-dim); margin-top: 5px; }
.calc-form .field-error { font-size: .74rem; color: var(--safelight-400); margin-top: 5px; display: none; }
.calc-form .field.has-error input, .calc-form .field.has-error select { border-color: var(--safelight-500); }
.calc-form .field.has-error .field-error { display: block; }

.result-card {
  background: var(--dark-900);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 60px rgba(196, 52, 42, .07);
}
.result-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--safelight-500), var(--amber-500));
}
.result-card .rc-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--safelight-500);
  margin-bottom: 6px;
}
.result-card .rc-value {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  line-height: 1;
  color: var(--safelight-500);
  text-shadow: 0 0 22px rgba(196, 52, 42, .45);
  margin: 0 0 4px;
  letter-spacing: .01em;
}
.result-card .rc-unit { font-size: .86rem; color: var(--text-dim); margin-bottom: 20px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.result-cell {
  background: var(--dark-850);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 12px 14px;
}
.result-cell .k {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}
.result-cell .v { font-family: var(--font-mono); font-size: 1rem; color: var(--amber-300); }
.result-cell.wide { grid-column: 1 / -1; }

.gauge { margin-bottom: 18px; }
.gauge .g-head {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}
.gauge .g-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--dark-700);
  overflow: hidden;
  position: relative;
}
.gauge .g-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--amber-900), var(--amber-500) 60%, var(--safelight-500));
  transition: width var(--t-med);
  box-shadow: var(--glow-amber);
}

.formula-note {
  font-size: .8rem;
  color: var(--text-dim);
  border-top: 1px dashed var(--border-strong);
  padding-top: 14px;
  font-family: var(--font-mono);
  line-height: 1.7;
}
.formula-note b { color: var(--silver-300); }

/* test strip */
.test-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 16px 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--border-strong);
  min-height: 58px;
}
.test-strip .ts-cell { padding: 16px 4px 8px; text-align: center; }
.test-strip .ts-cell .ts-time {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--dark-900);
  background: rgba(240, 237, 232, .78);
  border-radius: var(--r-xs);
  padding: 2px 5px;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   14. 3D studio pages
   -------------------------------------------------------------------------- */
.studio-page { background: var(--dark-900); }
.studio-shell {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
  padding: 22px 0 40px;
}
.studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.studio-toolbar .st-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--silver-100);
  margin-right: auto;
}
.studio-canvas-wrap {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: radial-gradient(circle at 50% 45%, rgba(196, 52, 42, .13), transparent 65%), #060505;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 340px;
}
.studio-canvas-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.studio-canvas-wrap canvas:active { cursor: grabbing; }
.studio-canvas-wrap .sc-overlay {
  position: absolute;
  left: 12px; top: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.studio-canvas-wrap .sc-chip {
  background: rgba(8, 6, 6, .78);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: .72rem;
  color: var(--silver-200);
  letter-spacing: .05em;
  pointer-events: auto;
}
.studio-canvas-wrap .sc-chip b { color: var(--amber-400); }
.studio-canvas-wrap .sc-hint {
  position: absolute;
  right: 12px; bottom: 12px;
  background: rgba(8, 6, 6, .78);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: .7rem;
  color: var(--text-dim);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.studio-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  text-align: center;
  background: var(--dark-900);
  z-index: 4;
}
.studio-fallback.show { display: grid; }
.studio-fallback img { max-height: 62%; margin: 0 auto 14px; }
.studio-fallback p { font-size: .86rem; color: var(--text-muted); max-width: 46ch; margin: 0 auto; }
/* §16 opt-in control shown when a small screen defers the 3D scene */
.studio-fallback .switch-3d { margin-top: 15px; }

.studio-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 18px;
  position: sticky;
  top: calc(var(--header-h) + var(--filmstrip-h) + 16px);
}
.studio-panel h2 { font-size: 1rem; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.studio-panel .field { margin-bottom: 15px; }
.studio-panel label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.studio-panel label .lv { font-family: var(--font-mono); color: var(--amber-400); letter-spacing: 0; font-size: .8rem; }
.studio-panel select, .studio-panel input[type="text"] {
  width: 100%;
  height: 38px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--dark-900);
  color: var(--text);
  padding: 0 11px;
  font-size: .86rem;
  font-family: var(--font-mono);
}
.studio-panel select:focus, .studio-panel input:focus { outline: none; border-color: var(--amber-500); box-shadow: var(--glow-amber); }
.studio-panel input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--dark-600);
  outline: none;
}
.studio-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--safelight-500);
  box-shadow: var(--glow-red);
  cursor: pointer;
  border: 2px solid var(--dark-900);
}
.studio-panel input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--safelight-500);
  border: 2px solid var(--dark-900);
  cursor: pointer;
}
.studio-panel .panel-actions { display: flex; gap: 8px; margin-top: 18px; }
.studio-panel .panel-actions .btn { flex: 1 1 auto; }

.studio-readout {
  margin-top: 16px;
  background: var(--dark-900);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--amber-300);
  line-height: 1.75;
  white-space: pre-line;
}
.studio-readout .rk { color: var(--text-dim); }

.studio-steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.studio-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  font-size: .82rem;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.studio-steps li .sn {
  width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 50%;
  background: var(--dark-700);
  color: var(--text-dim);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: .68rem;
}
.studio-steps li.is-active { background: rgba(196, 52, 42, .12); border-color: var(--safelight-900); color: var(--silver-100); }
.studio-steps li.is-active .sn { background: var(--safelight-500); color: var(--amber-100); }
.studio-steps li.is-done { color: var(--text-muted); }
.studio-steps li.is-done .sn { background: var(--ok); color: #fff; }

.zone-strip {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  height: 74px;
  border-radius: var(--r-xs);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  margin-bottom: 8px;
}
.zone-strip .zs { position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.zone-strip .zs .zs-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(196, 52, 42, .72);
  transition: height var(--t-med);
}
.zone-strip .zs .zs-n {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: rgba(8, 6, 6, .8);
  mix-blend-mode: hard-light;
}
.zone-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-dim); font-family: var(--font-mono); }

.zone-canvas-wrap {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--dark-900);
  display: grid;
  place-items: center;
  min-height: 220px;
}
.zone-canvas-wrap canvas { max-width: 100%; max-height: 320px; }
.zone-hist { width: 100%; height: 110px; display: block; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--dark-900); }

/* --------------------------------------------------------------------------
   15. Blog
   -------------------------------------------------------------------------- */
.featured-post {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 30px;
}
.featured-post .fp-media { min-height: 300px; background: var(--dark-900); }
.featured-post .fp-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-post .fp-body { padding: 34px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.featured-post h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); margin: 0; }
.featured-post h2 a { color: var(--silver-100); }
.featured-post h2 a:hover { color: var(--amber-400); }

.post-hero { padding: 38px 0 26px; border-bottom: 3px solid var(--safelight-500); background: linear-gradient(180deg, var(--dark-900), var(--dark-850)); }
.post-hero h1 { max-width: 22ch; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: .82rem;
  color: var(--text-dim);
}
.post-meta .pm-item { display: inline-flex; align-items: center; gap: 6px; }
.post-meta svg { width: 14px; height: 14px; }

.post-figure { margin: 26px 0; }
.post-figure img { border-radius: var(--r-sm); border: 1px solid var(--border); width: 100%; }
.post-figure figcaption { font-size: .78rem; color: var(--text-dim); margin-top: 9px; text-align: center; }

.prose-block { font-size: 1rem; color: var(--silver-200); }
.prose-block h2 { margin-top: 38px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.prose-block h3 { margin-top: 26px; color: var(--amber-300); }
.prose-block ul, .prose-block ol { margin: 0 0 1.1em; padding-left: 0; }
.prose-block ul li, .prose-block ol li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.prose-block ul li::before {
  content: "";
  position: absolute;
  left: 4px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--safelight-500);
}
.prose-block ol { counter-reset: olc; }
.prose-block ol li { counter-increment: olc; }
.prose-block ol li::before {
  content: counter(olc) ".";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: .84rem;
  color: var(--amber-500);
  font-weight: 700;
}
.prose-block a { text-decoration: underline; text-decoration-color: var(--amber-900); text-underline-offset: 3px; }
.prose-block a:hover { text-decoration-color: var(--safelight-400); }
.prose-block blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--safelight-500);
  color: var(--silver-300);
  font-style: italic;
}
.prose-block table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .88rem; }
.prose-block th, .prose-block td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; }
.prose-block th { background: var(--surface-2); color: var(--silver-100); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.prose-block td { color: var(--text-muted); }

.step-block {
  display: flex;
  gap: 16px;
  margin: 26px 0;
  align-items: flex-start;
}
.step-block .sb-num {
  width: 52px; height: 52px; flex: 0 0 52px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--safelight-900);
  color: var(--safelight-400);
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-size: 1.2rem;
}
.step-block .sb-body h3 { margin: 6px 0 8px; }
.step-block .sb-body p { font-size: .94rem; color: var(--text-muted); }

.side-sticky { position: sticky; top: calc(var(--header-h) + var(--filmstrip-h) + 20px); }
.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 18px;
  margin-bottom: 20px;
}
.side-card h3 {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--safelight-500);
  margin: 0 0 12px;
}
.toc ol { counter-reset: toc; display: grid; gap: 3px; }
.toc a {
  display: block;
  font-size: .85rem;
  color: var(--text-muted);
  padding: 5px 8px;
  border-left: 2px solid var(--border);
  transition: all var(--t-fast);
}
.toc a:hover { color: var(--amber-400); border-left-color: var(--amber-500); background: rgba(232, 169, 78, .06); }
.toc a.is-current { color: var(--amber-500); border-left-color: var(--safelight-500); background: rgba(196, 52, 42, .1); }
.toc .toc-sub a { padding-left: 20px; font-size: .8rem; }

.author-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber-500);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 18px;
  margin: 36px 0;
}
.author-box .ab-avatar {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 50%;
  background: var(--safelight-500);
  display: grid; place-items: center;
  font-family: var(--font-head);
  color: var(--amber-100);
  font-size: 1.1rem;
}
.author-box h3 { margin: 0 0 4px; font-size: 1rem; }
.author-box p { font-size: .85rem; color: var(--text-muted); margin: 0; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 34px; }
.post-nav a {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 15px 18px;
  background: var(--surface);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.post-nav a:hover { border-color: var(--safelight-500); transform: translateY(-2px); }
.post-nav .pn-dir {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--safelight-500);
  display: block;
  margin-bottom: 5px;
}
.post-nav .pn-title { font-size: .92rem; font-weight: 600; color: var(--silver-100); }
.post-nav .pn-next { text-align: right; }

.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--safelight-500), var(--amber-500));
  z-index: 400;
  box-shadow: var(--glow-red);
  transition: width .1s linear;
}
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--silver-200);
  display: grid; place-items: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med), border-color var(--t-fast), box-shadow var(--t-fast);
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { border-color: var(--safelight-500); box-shadow: var(--glow-red); color: var(--safelight-300); }
.to-top svg { width: 17px; height: 17px; }

/* --------------------------------------------------------------------------
   16. Content pages
   -------------------------------------------------------------------------- */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.info-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 22px;
}
.info-cell h3 { font-size: 1rem; margin: 0 0 8px; }
.info-cell p { font-size: .88rem; color: var(--text-muted); margin: 0; }
.info-cell .ic-k {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--safelight-500);
  letter-spacing: .1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 26px;
}
.form-card .field { margin-bottom: 16px; }
.form-card label {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.form-card label .req { color: var(--safelight-500); }
.form-card input, .form-card select, .form-card textarea {
  width: 100%;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--dark-900);
  color: var(--text);
  padding: 11px 12px;
  font-size: .9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-card textarea { min-height: 130px; resize: vertical; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: var(--glow-amber);
}
.form-card .field-error { font-size: .74rem; color: var(--safelight-400); margin-top: 5px; display: none; }
.form-card .field.has-error input, .form-card .field.has-error select, .form-card .field.has-error textarea { border-color: var(--safelight-500); }
.form-card .field.has-error .field-error { display: block; }
.form-status { margin-top: 16px; display: none; }
.form-status.show { display: block; }

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--dark-900);
  border-top: 1px solid var(--safelight-900);
  margin-top: 60px;
  position: relative;
  z-index: 2;
}
.footer-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding: 52px 0 36px;
}
.footer-col h3 {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--safelight-500);
  margin: 0 0 14px;
}
.footer-col ul { display: grid; gap: 9px; }
.footer-col a { font-size: .87rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--amber-400); }
.footer-brand p { font-size: .85rem; color: var(--text-dim); margin: 14px 0 16px; max-width: 40ch; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.footer-social a:hover { border-color: var(--safelight-500); color: var(--safelight-300); box-shadow: var(--glow-red); }
.footer-social svg { width: 16px; height: 16px; }

.newsletter { display: flex; gap: 8px; margin-top: 12px; }
.newsletter input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--dark-850);
  color: var(--text);
  padding: 0 15px;
  font-size: .85rem;
}
.newsletter input:focus { outline: none; border-color: var(--amber-500); box-shadow: var(--glow-amber); }
.newsletter button { flex: 0 0 auto; padding: 0 18px; height: 40px; }
.newsletter-msg { font-size: .76rem; margin-top: 8px; display: none; }
.newsletter-msg.show { display: block; }
.newsletter-msg.ok { color: #8FBE8F; }
.newsletter-msg.err { color: var(--safelight-400); }

.footer-disclaimer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 30px;
}
.safety-declaration {
  display: flex;
  gap: 14px;
  background: rgba(196, 52, 42, .07);
  border: 1px solid var(--safelight-900);
  border-radius: var(--r-sm);
  padding: 18px;
}
.safety-declaration .sd-icon {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: var(--r-sm);
  background: rgba(196, 52, 42, .18);
  display: grid; place-items: center;
  color: var(--safelight-500);
}
.safety-declaration .sd-icon svg { width: 20px; height: 20px; }
.safety-declaration h3 { font-size: .95rem; margin: 0 0 6px; }
.safety-declaration p { font-size: .82rem; color: var(--text-muted); margin: 0; }
.edu-declaration { font-size: .82rem; color: var(--text-dim); }
.edu-declaration h3 { font-size: .95rem; margin: 0 0 6px; color: var(--silver-200); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: .8rem;
  color: var(--text-dim);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--amber-400); }
.age-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--text-muted);
}
/* content advisory pill */
.age-badge.age-16 {
  color: var(--amber-400);
  border-color: var(--amber-900);
  background: rgba(232, 169, 78, .08);
  letter-spacing: .08em;
}

/* --------------------------------------------------------------------------
   18. Utilities
   -------------------------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 10px; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   19. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px; }
  .studio-preview-grid { grid-template-columns: 1fr; gap: 28px; }
  .split-side { grid-template-columns: 1fr; gap: 30px; }
  .side-sticky { position: static; }
}

@media (max-width: 1000px) {
  .search-box input { width: 140px; }
  .search-box input:focus { width: 180px; }
  .split-wide { grid-template-columns: 320px 1fr; gap: 26px; }
  .studio-shell { grid-template-columns: 1fr; }
  .studio-panel { position: static; }
}

@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .main-nav { display: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .trust-bar .tb-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .filmstrip { display: none; }
  .split-wide { grid-template-columns: 1fr; }
  .calc-layout { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .fp-media { min-height: 220px; }
  .footer-disclaimer { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .pn-next { text-align: left; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .trust-bar .tb-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .hero { height: 460px; }
  .hero-content { max-width: 100%; }
  .hero-controls { bottom: 14px; }
  .footer-main { grid-template-columns: 1fr; gap: 26px; }
  .result-grid { grid-template-columns: 1fr; }
  .calc-form .field-row { grid-template-columns: 1fr; }
  .cta-band { padding: 28px 22px; }
  .ex-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zone-strip { height: 60px; }
  .test-strip { grid-template-columns: repeat(3, 1fr); }
  .studio-canvas-wrap { aspect-ratio: 4 / 3; }
  .section { padding: 44px 0; }
  .search-box { display: none; }
  .page-hero { padding: 30px 0 26px; }
}

/* --------------------------------------------------------------------------
   20. Motion & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .card:hover { transform: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .to-top, .read-progress, .hero-controls { display: none !important; }
  .card, .notice, .tip-box { border-color: #ccc; box-shadow: none; }
}
