/* ==========================================================================
   Forge & Anvil — Bladesmith Tool & Knowledge Site
   Dark forge theme · steel texture · ember accent
   Design tokens per design.md §1–§2
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  /* forge (backgrounds) */
  --forge-950: #080606;
  --forge-900: #0F0D0C;
  --forge-800: #1A1614;
  --forge-700: #252120;
  --forge-600: #332E2C;
  --forge-500: #453F3C;
  --forge-400: #5C5551;

  /* ember (primary) */
  --ember-900: #7A2E08;
  --ember-700: #B8480F;
  --ember-500: #E8641F;
  --ember-400: #F58A3C;
  --ember-300: #FAAE72;
  --ember-200: #FCD2AC;
  --ember-100: #FDEBDC;

  /* steel (text / accents) */
  --steel-800: #3A3836;
  --steel-700: #5C5855;
  --steel-600: #7A7672;
  --steel-500: #9A9692;
  --steel-400: #B8B4B0;
  --steel-300: #D0CCC8;
  --steel-200: #E8E4E0;

  /* hot (high temperature) */
  --hot-900: #8A6A10;
  --hot-700: #B8901A;
  --hot-500: #E8B830;
  --hot-400: #F5CE5A;
  --hot-300: #FADE8A;
  --hot-100: #FCEFBE;

  /* temper (mid temperature) */
  --temper-900: #1E3A5C;
  --temper-700: #2E5A88;
  --temper-500: #4A7AB0;
  --temper-400: #7AA0C8;
  --temper-300: #B0C8E0;
  --temper-100: #D8E4F0;

  /* neutrals */
  --ink: #F0EDE8;
  --ink-2: #B8B4B0;
  --ink-3: #7A7672;
  --line: #332E2C;
  --line-strong: #453F3C;

  /* semantic */
  --danger: #D65A4A;
  --success: #5A8A5A;
  --warn: #E8B830;
  --info: #4A7AB0;

  /* radii */
  --r-xs: 2px;
  --r-card: 8px;
  --r-cta: 14px;
  --r-pill: 999px;

  /* shadows */
  --sh-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-sm: 0 2px 6px rgba(0, 0, 0, .45);
  --sh-md: 0 6px 18px rgba(0, 0, 0, .5);
  --sh-lg: 0 16px 44px rgba(0, 0, 0, .6);
  --glow-ember: 0 0 16px rgba(232, 100, 31, .35), 0 0 40px rgba(232, 100, 31, .15);
  --glow-hot: 0 0 20px rgba(245, 206, 90, .3);

  /* motion */
  --t-fast: .14s ease;
  --t-card: .28s ease;
  --t-hammer: .4s cubic-bezier(.34, 1.2, .64, 1);

  /* layout */
  --wrap: 1200px;
  --wrap-narrow: 820px;
  --wrap-wide: 1360px;
  --gutter: 22px;
  --header-h: 60px;
  --header-h-sm: 48px;

  /* type */
  --font-head: "Oswald", "Bebas Neue", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Menlo, monospace;

  /* texture */
  --hammer-noise: rgba(184, 180, 176, .04);
  --scale-noise: rgba(232, 100, 31, .06);
}

/* ------------------------------------------------------------- base/reset */
*, *::before, *::after { box-sizing: border-box; }

/* The list engine, the steel table and the calculators all hide elements by
   setting the `hidden` property. Component rules below set `display: flex`
   / `grid` on those same elements, and an author declaration beats the UA's
   `[hidden] { display: none }` on cascade origin alone — so without this the
   filters and pagination would set the attribute and change nothing on screen.
   `!important` here is load-bearing, not decoration. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--forge-900);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* hammered-steel texture over the whole page, ember oxide scale on top */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(circle at 18% 12%, var(--scale-noise) 0, transparent 42%),
    radial-gradient(circle at 82% 78%, var(--scale-noise) 0, transparent 38%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .5;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); text-transform: uppercase; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); text-transform: uppercase; }
h3 { font-size: clamp(1.18rem, 2vw, 1.4rem); }
h4 { font-size: 1.08rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--steel-300); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--ember-400); }
.prose a, .prose-block a { color: var(--ember-300); text-decoration: underline; text-decoration-color: var(--ember-900); text-underline-offset: 3px; }
.prose a:hover, .prose-block a:hover { color: var(--ember-400); text-decoration-color: var(--ember-500); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: .45em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: .88em; }
code { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 1px 6px; color: var(--ember-300); }

::selection { background: rgba(232, 100, 31, .32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ember-500);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(232, 100, 31, .4);
}

/* ------------------------------------------------------------- skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 999;
  background: var(--ember-500);
  color: var(--forge-950);
  font-weight: 700;
  font-size: .84rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; color: var(--forge-950); }

/* ---------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 2; }
.wrap-narrow { max-width: var(--wrap-narrow); }
.wrap-wide { max-width: var(--wrap-wide); }

section { padding: 60px 0; }
.section-sm { padding: 38px 0; }
.section-tight { padding: 42px 0 60px; }

.section-head { margin-bottom: 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.section-head .section-head-text { max-width: 720px; }
.section-head h2 { margin-bottom: .3em; }
.section-head p { color: var(--ink-2); margin: 0; }
.section-head-link { font-size: .84rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }

.grid-2, .grid-3, .grid-4, .grid-auto { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.stack-sm > * + * { margin-top: 12px; }
.stack > * + * { margin-top: 22px; }

/* ---------------------------------------------------------------- eyebrow */
.eyebrow {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ember-500);
  margin: 0 0 .7em;
  display: block;
}
.eyebrow::before { content: "\2692\00a0\00a0"; }

/* ==========================================================================
   HEADER — three-segment anvil construction (design.md §5)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--forge-950);
  border-bottom: 2px solid var(--ember-900);
  height: var(--header-h);
  transition: height var(--t-fast);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ember-700) 30%, var(--ember-500) 50%, var(--ember-700) 70%, transparent);
  opacity: .5;
}
.header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  position: relative;
  height: 100%;
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
/* the three steel blocks */
.hdr-seg { display: flex; align-items: center; height: 100%; position: relative; }
.hdr-seg-logo { flex: 0 0 auto; padding-right: 20px; }
.hdr-seg-nav { flex: 1 1 auto; justify-content: center; padding: 0 20px; }
.hdr-seg-actions { flex: 0 0 auto; justify-content: flex-end; gap: 12px; padding-left: 20px; }
/* vertical ember seams between the blocks */
.hdr-seg-logo::after,
.hdr-seg-nav::after {
  content: "";
  position: absolute;
  right: 0; top: 14px; bottom: 14px;
  width: 1px;
  background: var(--ember-900);
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.hdr-seg-logo:hover::after,
.hdr-seg-nav:hover::after,
.hdr-seg.is-hot::after {
  background: var(--ember-500);
  box-shadow: 0 0 10px rgba(232, 100, 31, .7);
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 32px; height: 32px;
  flex: 0 0 auto;
  border-radius: var(--r-xs);
  background: var(--ember-500);
  display: grid;
  place-items: center;
  box-shadow: var(--glow-ember);
}
.brand-mark svg { width: 20px; height: 20px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--steel-300);
  white-space: nowrap;
}
.brand-tag {
  font-size: .54rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ember-500);
  white-space: nowrap;
}
.site-header.is-scrolled { height: var(--header-h-sm); }
.site-header.is-scrolled .brand-tag { display: none; }
.site-header.is-scrolled .brand-mark { width: 26px; height: 26px; }
.site-header.is-scrolled .brand-mark svg { width: 16px; height: 16px; }

/* nav */
.nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-xs);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--steel-400);
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.nav-link:hover { background: rgba(232, 100, 31, .12); color: var(--ember-400); }
.nav-link[aria-current="page"] {
  background: rgba(232, 100, 31, .16);
  color: var(--ember-500);
  box-shadow: inset 0 -2px 0 var(--ember-500), 0 0 14px rgba(232, 100, 31, .22);
}
.nav-caret { width: 9px; height: 9px; flex: 0 0 auto; transition: transform var(--t-fast); }
.nav-item { position: relative; }
.nav-item:hover .nav-caret, .nav-item.open .nav-caret { transform: rotate(180deg); }

/* dropdown */
.dd {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 268px;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ember-500);
  border-radius: var(--r-card);
  box-shadow: var(--sh-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  z-index: 210;
}
.nav-item:hover > .dd, .nav-item.open > .dd { opacity: 1; visibility: visible; transform: translateY(0); }
.dd-link {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-xs);
  transition: background var(--t-fast), color var(--t-fast);
}
.dd-link:hover { background: var(--forge-700); color: var(--ember-400); }
.dd-ico { width: 20px; height: 20px; flex: 0 0 auto; border-radius: var(--r-xs); background: var(--ember-500); display: grid; place-items: center; margin-top: 2px; }
.dd-ico svg { width: 13px; height: 13px; }
.dd-name { font-size: .84rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--steel-300); display: block; }
.dd-link:hover .dd-name { color: var(--ember-400); }
.dd-desc { font-size: .74rem; color: var(--ink-3); line-height: 1.4; display: block; }
.dd-sep { height: 1px; background: var(--line); margin: 7px 4px; }

/* header search */
.hdr-search { position: relative; }
.hdr-search input {
  width: 180px;
  height: 34px;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .82rem;
  padding: 0 32px 0 14px;
  transition: width var(--t-card), border-color var(--t-fast), box-shadow var(--t-fast);
}
.hdr-search input::placeholder { color: var(--ink-3); }
.hdr-search input:focus { width: 240px; outline: none; border-color: var(--ember-500); box-shadow: var(--glow-ember); }
.hdr-search-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; background: transparent; color: var(--steel-600);
  display: grid; place-items: center; cursor: pointer; border-radius: 50%;
}
.hdr-search-btn:hover { color: var(--ember-500); }
.hdr-search-btn svg { width: 15px; height: 15px; }

/* header search suggestions */
.hdr-suggest {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ember-500);
  border-radius: var(--r-card);
  box-shadow: var(--sh-lg);
  padding: 6px;
  z-index: 220;
  max-height: 340px;
  overflow-y: auto;
}
.hdr-suggest a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-xs);
  font-size: .84rem;
  color: var(--ink-2);
}
.hdr-suggest a:hover { background: var(--forge-700); color: var(--ember-300); }
.hdr-suggest a b { font-weight: 600; color: var(--steel-200); }
.hdr-suggest a:hover b { color: var(--ember-300); }
.hdr-suggest a span {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: 0 0 auto;
}

.btn-3d {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--ember-500);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ember-500);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
}
.btn-3d:hover { background: rgba(232, 100, 31, .14); color: var(--ember-300); box-shadow: var(--glow-ember); }
.btn-3d svg { width: 15px; height: 15px; }

.hamburger {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--forge-800);
  color: var(--steel-300);
  cursor: pointer;
  place-items: center;
  padding: 0;
}
.hamburger:hover { border-color: var(--ember-500); color: var(--ember-500); }
.hamburger svg { width: 18px; height: 18px; }

/* mobile drawer */
.drawer {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  max-height: 0;
  overflow: hidden;
  background: var(--forge-950);
  border-bottom: 0 solid var(--ember-900);
  z-index: 190;
  transition: max-height var(--t-card), border-width var(--t-fast);
}
.drawer.open { max-height: calc(100vh - var(--header-h)); overflow-y: auto; border-bottom-width: 2px; }
.drawer-inner { padding: 14px var(--gutter) 26px; }
.drawer-link {
  display: block;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--steel-300);
}
.drawer-link:hover, .drawer-link[aria-current="page"] { color: var(--ember-500); }
.drawer-acc-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px;
  border: 0; border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-head);
  font-size: 1rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--steel-300);
  cursor: pointer;
  text-align: left;
}
.drawer-acc-btn svg { width: 13px; height: 13px; transition: transform var(--t-fast); }
.drawer-acc-btn[aria-expanded="true"] { color: var(--ember-500); }
.drawer-acc-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.drawer-sub { max-height: 0; overflow: hidden; transition: max-height var(--t-card); }
.drawer-sub.open { max-height: 640px; }
.drawer-sub a {
  display: block;
  padding: 10px 4px 10px 18px;
  font-size: .86rem;
  color: var(--ink-2);
  border-bottom: 1px solid rgba(51, 46, 44, .6);
}
.drawer-sub a:hover { color: var(--ember-400); }

/* ==========================================================================
   BUTTONS (§10)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  line-height: 1.2;
}
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn-primary { background: var(--ember-500); color: var(--forge-950); }
.btn-primary:hover { background: var(--ember-400); color: var(--forge-950); box-shadow: var(--glow-ember); }
.btn-steel { background: var(--steel-400); color: var(--forge-950); }
.btn-steel:hover { background: var(--steel-300); color: var(--forge-950); }
.btn-outline { background: var(--forge-900); color: var(--ember-500); border-color: var(--ember-500); }
.btn-outline:hover { background: rgba(232, 100, 31, .14); color: var(--ember-300); box-shadow: var(--glow-ember); }
.btn-ghost { background: var(--forge-700); color: var(--steel-300); }
.btn-ghost:hover { background: var(--forge-600); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #E06A5A; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .76rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-hammer { position: relative; }
.btn-hammer:hover { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .btn-hammer:hover { transform: none; } }

.btn-row { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   CARDS (§7) — whole card is the click target (§0.1)
   ========================================================================== */
.card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  transition: transform var(--t-card), box-shadow var(--t-card), border-color var(--t-card);
  -webkit-tap-highlight-color: transparent;
}
/* steel bevel: light top edge, dark bottom edge */
.card::before,
.card::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; pointer-events: none; z-index: 3; }
.card::before { top: 0; background: rgba(232, 228, 224, .09); }
.card::after { bottom: 0; background: rgba(0, 0, 0, .5); }
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg), 0 0 22px rgba(232, 100, 31, .13);
  border-color: var(--ember-700);
  color: inherit;
}
.card:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 2px; }
.card:active { transform: translateY(-1px); }

.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--forge-950); flex: 0 0 auto; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-card); }
.card:hover .card-media img { transform: scale(1.04); }
.card-media-contain img { object-fit: contain; padding: 10px; }
.card-media-top { position: absolute; top: 9px; left: 9px; right: 9px; display: flex; justify-content: space-between; gap: 6px; z-index: 2; }
.card-body { padding: 18px; flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; }
.card-title {
  font-family: var(--font-head);
  font-size: 1.04rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}
.card-desc { font-size: .86rem; color: var(--ink-2); margin: 0; line-height: 1.55; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  flex: 0 0 auto;
}
.card-arrow { color: var(--ember-500); font-size: 1rem; transition: transform var(--t-card); }
.card:hover .card-arrow { transform: translateX(4px); }
.card-ico { width: 18px; height: 18px; color: var(--steel-600); }

/* category card — no image, square icon block */
.cat-card .card-body { padding: 22px 20px 18px; }
.cat-ico {
  width: 48px; height: 48px;
  border-radius: var(--r-xs);
  background: var(--ember-500);
  display: grid; place-items: center;
  margin-bottom: 4px;
  box-shadow: var(--glow-ember);
}
.cat-ico svg { width: 26px; height: 26px; }
.cat-count { font-family: var(--font-mono); font-size: .76rem; color: var(--ember-300); letter-spacing: .04em; }

/* tool card */
.tool-card .card-media { background: linear-gradient(160deg, var(--forge-950), var(--forge-800)); }

/* blog card */
.blog-card .card-media { aspect-ratio: 16 / 9; }
.blog-meta {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: .72rem; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}
.blog-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--steel-700); }

/* calculator card */
.calc-card .card-media { aspect-ratio: 16 / 9; }
.calc-mini {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--ember-300);
  background: var(--forge-950);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 7px 10px;
  display: flex; justify-content: space-between; gap: 8px;
}

/* studio card — deeper base, glow edge */
.studio-card { background: var(--forge-950); border-color: var(--line-strong); }
.studio-card:hover { box-shadow: var(--sh-lg), 0 0 30px rgba(232, 100, 31, .24); border-color: var(--ember-500); }
.studio-card .card-media { aspect-ratio: 16 / 9; }

/* steel card */
.steel-card .card-media { aspect-ratio: 16 / 9; }
.steel-figures { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--font-mono); font-size: .76rem; color: var(--ink-2); }
.steel-figures b { color: var(--ember-300); font-weight: 500; }

/* ==========================================================================
   TAGS / CHIPS / BADGES (§7)
   ========================================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(232, 100, 31, .16);
  color: var(--ember-300);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.6;
}
.tag-steel { background: rgba(184, 180, 176, .12); color: var(--steel-300); }
.tag-temper { background: rgba(74, 122, 176, .18); color: var(--temper-300); }
.tag-hot { background: rgba(232, 184, 48, .16); color: var(--hot-300); }
.tag-danger { background: rgba(214, 90, 74, .18); color: #E8907F; }
.tag-success { background: rgba(90, 138, 90, .2); color: #9CC49C; }
.tag-outline { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.tag-free { background: rgba(90, 138, 90, .2); color: #9CC49C; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--forge-800);
  color: var(--ink-2);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  font-family: var(--font-body);
  white-space: nowrap;
}
.chip:hover { border-color: var(--ember-500); color: var(--ember-300); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--ember-500); color: var(--forge-950); border-color: var(--ember-500); }

.chip-row { display: flex; gap: 9px; flex-wrap: wrap; }

.badge-3d {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--ember-500);
  color: var(--forge-950);
  font-size: .64rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}
.badge-3d svg { width: 11px; height: 11px; }

.badge-interactive {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: rgba(232, 100, 31, .18);
  border: 1px solid var(--ember-700);
  color: var(--ember-300);
  font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}

/* parameter / temperature / steel markers */
.param-badge {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-family: var(--font-mono);
  font-size: .78rem;
  background: var(--forge-950);
  border: 1px solid var(--ember-900);
  border-radius: var(--r-xs);
  padding: 3px 8px;
  color: var(--ember-300);
  white-space: nowrap;
}
.param-badge .pk { color: var(--ink-3); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }

.steel-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--forge-700);
  color: var(--steel-200);
  letter-spacing: .03em;
}
.steel-badge[data-carbon="low"] { background: #2A2726; color: var(--steel-400); }
.steel-badge[data-carbon="mid"] { background: #3A2C1E; color: var(--ember-200); border-color: var(--ember-900); }
.steel-badge[data-carbon="high"] { background: #4A2A12; color: var(--ember-200); border-color: var(--ember-700); }
.steel-badge[data-carbon="vhigh"] { background: #5C2A0C; color: var(--ember-100); border-color: var(--ember-500); }

.temp-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .74rem;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--forge-950);
  color: var(--steel-400);
  white-space: nowrap;
}
.temp-badge[data-band="cold"] { color: var(--steel-500); }
.temp-badge[data-band="temper"] { color: var(--temper-400); border-color: var(--temper-900); background: #101B28; }
.temp-badge[data-band="hot"] { color: var(--hot-400); border-color: var(--hot-900); background: #241E0C; }
.temp-badge[data-band="forge"] { color: var(--ember-300); border-color: var(--ember-900); background: #2E1A0A; }
.temp-badge[data-band="burn"] { color: #F09A8A; border-color: #7A2E22; background: #2E1210; }

/* ==========================================================================
   NOTICES / TIP BOXES / STRIPS (§9)
   ========================================================================== */
.notice {
  border-radius: var(--r-card);
  padding: 15px 18px;
  border: 1px solid var(--line);
  background: var(--forge-800);
  font-size: .88rem;
  line-height: 1.62;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notice svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; }
.notice strong { display: block; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .05em; font-size: .82rem; margin-bottom: 3px; }
.notice-safety { background: #2E1A0A; border-color: var(--ember-900); color: var(--ember-300); }
.notice-safety strong, .notice-safety svg { color: var(--ember-400); }
.notice-info { background: #152530; border-color: var(--temper-700); color: var(--temper-300); }
.notice-info strong, .notice-info svg { color: var(--temper-400); }
.notice-warn { background: #2E2410; border-color: var(--hot-900); color: var(--hot-300); }
.notice-warn strong, .notice-warn svg { color: var(--hot-400); }
.notice-neutral { background: var(--forge-800); border-color: var(--line-strong); color: var(--ink-2); }
.notice-neutral strong { color: var(--steel-300); }

.tip-box {
  border-left: 4px solid var(--ember-500);
  background: rgba(232, 100, 31, .07);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  padding: 14px 18px;
  font-size: .88rem;
  line-height: 1.62;
  margin: 22px 0;
}
.tip-box strong { display: block; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; margin-bottom: 5px; color: var(--ember-400); }
.tip-box-warn { border-left-color: var(--hot-500); background: rgba(232, 184, 48, .07); }
.tip-box-warn strong { color: var(--hot-400); }
.tip-box-note { border-left-color: var(--temper-500); background: rgba(74, 122, 176, .08); }
.tip-box-note strong { color: var(--temper-400); }
.tip-box-ok { border-left-color: var(--success); background: rgba(90, 138, 90, .09); }
.tip-box-ok strong { color: #9CC49C; }

.legal-note {
  background: var(--forge-800);
  border-left: 4px solid var(--ember-500);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: .84rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 26px 0;
}
.legal-note strong { color: var(--ember-400); }

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-card);
  padding: 44px 22px;
  text-align: center;
  color: var(--ink-3);
  background: var(--forge-800);
}
.empty-state svg { width: 40px; height: 40px; color: var(--forge-500); margin-bottom: 12px; }
.empty-state h3 { color: var(--ink-2); margin-bottom: .3em; }
.empty-state p { margin: 0; font-size: .9rem; }

.safety-strip {
  background: linear-gradient(90deg, rgba(232, 100, 31, .12), rgba(232, 100, 31, .03));
  border-top: 1px solid var(--ember-900);
  border-bottom: 1px solid var(--ember-900);
  padding: 11px 0;
}
.safety-strip .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.safety-strip-icons { display: flex; gap: 14px; }
.safety-strip-icons svg { width: 19px; height: 19px; color: var(--ember-400); }
.safety-strip-text {
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ember-300);
}

.temp-indicator,
.hardness-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-2);
}
.temp-indicator-bar,
.hardness-indicator-bar {
  height: 6px;
  width: 92px;
  border-radius: var(--r-pill);
  background: var(--forge-700);
  overflow: hidden;
  position: relative;
}
.temp-indicator-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--steel-400), var(--temper-500), var(--hot-500), var(--ember-500), var(--danger));
  border-radius: var(--r-pill);
}
.hardness-indicator-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--success), var(--hot-500), var(--danger));
  border-radius: var(--r-pill);
}

/* webgl status indicator */
.webgl-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--forge-950);
  color: var(--steel-600);
}
.webgl-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.webgl-status[data-state="loading"] { color: var(--steel-500); }
.webgl-status[data-state="ready"] { color: #7FBE7F; border-color: #2E4A2E; }
.webgl-status[data-state="fallback"] { color: var(--hot-400); border-color: var(--hot-900); }
.webgl-status[data-state="error"] { color: #E8907F; border-color: #5C2A22; }

/* ------------------------------------------------------------ page hero */
.page-hero {
  background: var(--forge-950);
  border-bottom: 3px solid var(--ember-500);
  padding: 40px 0 38px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 78% 0%, rgba(232, 100, 31, .13), transparent 58%),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='h'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23h)' opacity='.05'/%3E%3C/svg%3E");
  pointer-events: none;
}
.page-hero .wrap { position: relative; z-index: 2; }
.breadcrumb {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--steel-600); }
.breadcrumb a:hover { color: var(--ember-400); }
.breadcrumb .sep { color: var(--forge-500); }
.breadcrumb [aria-current="page"] { color: var(--ember-300); }
.page-hero h1 { margin-bottom: .35em; }
.page-hero .lede { color: var(--ink-2); font-size: 1.02rem; max-width: 760px; margin: 0; }
.page-hero-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 20px; }

/* ==========================================================================
   HERO CAROUSEL (§6.1)
   ========================================================================== */
.hero { position: relative; background: var(--forge-950); overflow: hidden; }
.hero-viewport { position: relative; height: 460px; }
.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-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, #080606 0%, rgba(15, 13, 12, .9) 46%, rgba(232, 100, 31, .18) 100%);
}
.hero-bg::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='h2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23h2)' opacity='.055'/%3E%3C/svg%3E");
}
.hero-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 660px;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 15px;
  border-radius: var(--r-pill);
  background: rgba(232, 100, 31, .16);
  border: 1px solid var(--ember-900);
  color: var(--ember-300);
  font-size: .7rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 20px;
  width: fit-content;
}
.hero h2, .hero-title {
  font-family: var(--font-head);
  font-size: clamp(1.95rem, 4.2vw, 2.9rem);
  font-weight: 700;
  line-height: 1.14;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--ink);
  margin: 0 0 .5em;
}
.hero p { color: var(--ink-2); font-size: 1.02rem; max-width: 560px; margin-bottom: 26px; }
.hero-nav {
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.hero-dots { display: flex; align-items: center; gap: 9px; }
.hero-dot {
  width: 9px; height: 9px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--steel-700);
  cursor: pointer;
  padding: 0;
  transition: width var(--t-card), background var(--t-fast), box-shadow var(--t-fast);
}
.hero-dot:hover { background: var(--steel-500); }
.hero-dot.is-active { width: 44px; background: var(--ember-500); box-shadow: var(--glow-ember); }
.hero-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(8, 6, 6, .7);
  color: var(--steel-300);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.hero-arrow:hover { background: var(--ember-500); color: var(--forge-950); border-color: var(--ember-500); }
.hero-arrow svg { width: 15px; height: 15px; }

/* ==========================================================================
   TRUST BAR (§6.2)
   ========================================================================== */
.trust-bar { background: var(--forge-950); border-bottom: 1px solid var(--line); padding: 30px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }
.trust-item { display: flex; gap: 13px; align-items: flex-start; }
.trust-item svg { width: 24px; height: 24px; color: var(--ember-500); flex: 0 0 auto; margin-top: 2px; }
.trust-item h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--steel-300); margin: 0 0 .25em; }
.trust-item p { font-size: .8rem; color: var(--ink-3); margin: 0; line-height: 1.55; }

/* ==========================================================================
   STEPS (§6.4)
   ========================================================================== */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }
.steps li { margin: 0; }
.step-card {
  position: relative;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}
.step-media { position: relative; aspect-ratio: 16 / 10; background: var(--forge-950); }
.step-media img { width: 100%; height: 100%; object-fit: cover; }
.step-num {
  position: absolute; top: 9px; left: 9px;
  width: 32px; height: 32px;
  border-radius: var(--r-xs);
  background: var(--ember-500);
  color: var(--forge-950);
  font-family: var(--font-mono);
  font-size: .92rem;
  font-weight: 700;
  display: grid; place-items: center;
  box-shadow: var(--glow-ember);
  z-index: 2;
}
.step-body { padding: 16px 18px 20px; }
.step-label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ember-500); display: block; margin-bottom: 6px; }
.step-body h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 .4em; }
.step-body p { font-size: .84rem; color: var(--ink-2); margin: 0; line-height: 1.58; }

/* ==========================================================================
   STUDIO PREVIEW (§6.5)
   ========================================================================== */
.studio-preview {
  background: var(--forge-950);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 60px 0;
}
.studio-preview-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 38px; align-items: center; }
.studio-preview-grid > * { min-width: 0; }
.studio-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-card);
  border: 1px solid var(--line-strong);
  background: radial-gradient(ellipse at 50% 42%, #241C16 0%, var(--forge-950) 72%);
  overflow: hidden;
  box-shadow: var(--sh-md);
}
.studio-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.studio-stage-hint {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--steel-500);
  background: rgba(8, 6, 6, .76);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  pointer-events: none;
}
.studio-stage-status { position: absolute; top: 12px; right: 12px; z-index: 4; }
.studio-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; }
.studio-list > * { min-width: 0; }

/* ==========================================================================
   CTA BAND (§6.8)
   ========================================================================== */
.cta-band {
  background: var(--ember-500);
  border-radius: var(--r-cta);
  padding: 46px 44px;
  color: var(--forge-950);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  box-shadow: var(--sh-lg);
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23c)' opacity='.11'/%3E%3C/svg%3E");
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 2; }
.cta-band h2 { color: var(--forge-950); margin: 0 0 .3em; }
.cta-band p { color: rgba(8, 6, 6, .82); margin: 0; max-width: 560px; }
.cta-band .btn-outline { background: transparent; border-color: var(--forge-950); color: var(--forge-950); }
.cta-band .btn-outline:hover { background: var(--forge-950); color: var(--ember-300); box-shadow: none; }
.cta-band .btn-primary { background: var(--forge-950); color: var(--ember-300); }
.cta-band .btn-primary:hover { background: var(--forge-800); color: var(--ember-200); box-shadow: none; }

/* ==========================================================================
   FOOTER (§11)
   ========================================================================== */
.site-footer { background: var(--forge-950); border-top: 2px solid var(--ember-900); padding: 56px 0 0; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 38px; }
.footer-col h3 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ember-500);
  margin: 0 0 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: .86rem; color: var(--ink-2); }
.footer-col a:hover { color: var(--ember-400); }
.footer-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.footer-brand .brand-name { font-size: 1.08rem; }
.footer-about { font-size: .85rem; color: var(--ink-3); line-height: 1.62; margin-bottom: 18px; max-width: 330px; }
.footer-social { display: flex; gap: 9px; margin-bottom: 16px; }
.footer-social a {
  width: 34px; height: 34px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--forge-800);
  display: grid; place-items: center;
  color: var(--steel-500);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.footer-social a:hover { border-color: var(--ember-500); color: var(--ember-500); }
.footer-social svg { width: 16px; height: 16px; }
.footer-version { font-family: var(--font-mono); font-size: .7rem; color: var(--forge-400); letter-spacing: .06em; }
.footer-sub { display: flex; gap: 8px; margin-top: 12px; }
.footer-sub input {
  flex: 1 1 auto; min-width: 0;
  height: 36px;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: .82rem;
  padding: 0 15px;
  font-family: var(--font-body);
}
.footer-sub input:focus { outline: none; border-color: var(--ember-500); box-shadow: var(--glow-ember); }
.footer-sub .btn { padding: 0 18px; height: 36px; }

.footer-safety {
  margin-top: 44px;
  border: 1px solid var(--ember-900);
  border-radius: var(--r-card);
  background: rgba(232, 100, 31, .05);
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.footer-safety svg { width: 26px; height: 26px; color: var(--ember-500); flex: 0 0 auto; margin-top: 2px; }
.footer-safety h3 { font-size: .84rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ember-400); margin: 0 0 .5em; }
.footer-safety p { font-size: .82rem; color: var(--ink-2); margin: 0 0 .7em; line-height: 1.62; }
.footer-safety p:last-child { margin-bottom: 0; }
.footer-edu { font-size: .78rem; color: var(--ink-3); font-style: italic; }

.footer-bottom {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding: 22px 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-bottom-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; }
.footer-bottom p { margin: 0; font-size: .8rem; color: var(--ink-3); }
.ppe-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ember-900);
  background: rgba(232, 100, 31, .1);
  color: var(--ember-300);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
}
.ppe-badge svg { width: 13px; height: 13px; }

/* ==========================================================================
   TOOL DETAIL PAGE (§8)
   ========================================================================== */
.split-wide { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 38px; align-items: start; }
.split-wide > * { min-width: 0; }
.split-side { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 44px; align-items: start; }
/* grid/flex children default to `min-width: auto`, which is min-content — a
   wide table or image then refuses to shrink and overflows the track */
.split-side > * { min-width: 0; }
.split-half { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 38px; align-items: start; }

.exhibit {
  background: var(--forge-950);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.exhibit::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: rgba(232, 228, 224, .1); }
.exhibit-main { aspect-ratio: 4 / 3; background: var(--forge-900); border-radius: var(--r-xs); overflow: hidden; margin-bottom: 14px; }
.exhibit-main img { width: 100%; height: 100%; object-fit: contain; }
.exhibit-main.is-3d { aspect-ratio: 4 / 3; }
.exhibit-main.is-3d canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.exhibit-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.exhibit-thumb {
  aspect-ratio: 1;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--forge-900);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color var(--t-fast);
}
.exhibit-thumb:hover { border-color: var(--ember-700); }
.exhibit-thumb.is-active { border-color: var(--ember-500); box-shadow: var(--glow-ember); }
.exhibit-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.view-toggle { display: flex; gap: 7px; margin-bottom: 12px; }
.view-toggle .chip { font-size: .72rem; padding: 5px 12px; }

/* spec table */
.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .86rem; }
.spec-table caption {
  text-align: left;
  font-family: var(--font-head);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ember-500);
  padding-bottom: 10px;
}
.spec-table th, .spec-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { font-family: var(--font-mono); font-size: .78rem; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; width: 42%; }
.spec-table td { font-family: var(--font-mono); font-size: .82rem; color: var(--ember-200); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-table tbody tr:hover { background: rgba(232, 100, 31, .04); }

.stage-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 15px;
  border-radius: var(--r-pill);
  background: rgba(232, 100, 31, .12);
  border: 1px solid var(--ember-900);
  color: var(--ember-300);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.stage-flow { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 16px 0 22px; }
.stage-flow .arrow { color: var(--forge-500); font-size: .8rem; }

.detail-block { margin-bottom: 34px; }
.detail-block h2 { font-size: 1.24rem; margin-bottom: .7em; padding-bottom: .5em; border-bottom: 1px solid var(--line); }
.detail-block h3 { font-size: 1.04rem; margin: 22px 0 .6em; }
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li { position: relative; padding-left: 24px; margin-bottom: 11px; font-size: .9rem; color: var(--ink-2); line-height: 1.62; }
.detail-list li::before { content: "\2692"; position: absolute; left: 0; top: 0; color: var(--ember-500); font-size: .82rem; }
.detail-list.is-safety li::before { content: "\26A0"; color: var(--hot-400); }

.badge-list { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================================================
   FILTER BAR / PAGINATION (§8)
   ========================================================================== */
.filter-bar {
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
  margin-bottom: 30px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.filter-field.grow { flex: 1 1 240px; }
.filter-field label {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.filter-field input, .filter-field select {
  height: 38px;
  background: var(--forge-950);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .86rem;
  padding: 0 12px;
}
.filter-field select { cursor: pointer; }
.filter-field input:focus, .filter-field select:focus { outline: none; border-color: var(--ember-500); box-shadow: 0 0 10px rgba(232, 100, 31, .25); }
.filter-count { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-3); margin-left: auto; padding-bottom: 9px; }
.filter-count b { color: var(--ember-300); font-weight: 500; }

.pagination { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 38px; flex-wrap: wrap; }
.page-btn {
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--forge-800);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: .84rem;
  cursor: pointer;
  display: inline-grid; place-items: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.page-btn:hover:not([disabled]) { border-color: var(--ember-500); color: var(--ember-300); }
.page-btn.is-active { background: var(--ember-500); border-color: var(--ember-500); color: var(--forge-950); font-weight: 700; }
.page-btn[disabled] { opacity: .35; cursor: default; }

/* ==========================================================================
   CALCULATORS (§8, §17)
   ========================================================================== */
.calc-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; align-items: start; }
.calc-form { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px; }
.calc-form h2 { font-size: 1.1rem; margin-bottom: 1em; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%;
  height: 42px;
  background: var(--forge-950);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .92rem;
  padding: 0 13px;
}
.field textarea { height: auto; min-height: 120px; padding: 12px 13px; font-family: var(--font-body); resize: vertical; }
.field select { font-family: var(--font-body); cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ember-500); box-shadow: 0 0 10px rgba(232, 100, 31, .25); }
.field-hint { font-size: .74rem; color: var(--ink-3); margin: 6px 0 0; font-family: var(--font-body); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-error { font-size: .74rem; color: #E8907F; margin: 6px 0 0; display: none; font-family: var(--font-body); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

.calc-result {
  background: var(--forge-950);
  border: 1px solid var(--ember-900);
  border-radius: var(--r-card);
  padding: 30px 28px;
  position: sticky;
  top: calc(var(--header-h) + 22px);
}
.calc-result::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--ember-500), transparent); }
.calc-result-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.calc-big {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 700;
  color: var(--ember-500);
  line-height: 1.05;
  text-shadow: 0 0 26px rgba(232, 100, 31, .45);
  word-break: break-word;
}
.calc-big small { font-size: .38em; color: var(--ember-300); margin-left: 7px; font-weight: 500; text-shadow: none; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 24px; }
.calc-cell { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 12px 14px; }
.calc-cell-k { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 5px; }
.calc-cell-v { font-family: var(--font-mono); font-size: .98rem; color: var(--ember-200); }
.calc-gauge { margin-top: 22px; }
.calc-gauge-track { height: 9px; border-radius: var(--r-pill); background: var(--forge-700); overflow: hidden; margin-top: 8px; }
.calc-gauge-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--temper-500), var(--hot-500), var(--ember-500)); transition: width var(--t-card); }
.calc-formula {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--ink-3);
  line-height: 1.7;
}
.calc-formula b { color: var(--steel-400); font-weight: 500; }

/* ==========================================================================
   STEEL DATABASE (§8)
   ========================================================================== */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--forge-800); }
.steel-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 900px; }
.steel-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--forge-950);
  border-bottom: 2px solid var(--ember-900);
  padding: 13px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.steel-table thead th:hover { color: var(--ember-400); }
.steel-table thead th[data-sort]::after { content: " \2195"; color: var(--forge-500); font-size: .8em; }
.steel-table thead th.is-sorted-asc::after { content: " \2191"; color: var(--ember-500); }
.steel-table thead th.is-sorted-desc::after { content: " \2193"; color: var(--ember-500); }
.steel-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.steel-table tbody tr { cursor: pointer; transition: background var(--t-fast); }
.steel-table tbody tr:hover { background: rgba(232, 100, 31, .06); }
.steel-table tbody tr.is-open { background: rgba(232, 100, 31, .09); }
.steel-table .cell-id { font-family: var(--font-mono); font-weight: 600; color: var(--ember-300); white-space: nowrap; }
.steel-table .cell-num { font-family: var(--font-mono); }
.steel-detail-row td { background: var(--forge-950); padding: 0; border-bottom: 1px solid var(--line); }
.steel-detail-inner { padding: 22px 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steel-detail-inner h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .11em; color: var(--ember-500); margin: 0 0 .7em; }
.steel-detail-inner ul { list-style: none; padding: 0; margin: 0; font-size: .84rem; }
.steel-detail-inner li { position: relative; padding-left: 17px; margin-bottom: 7px; color: var(--ink-2); line-height: 1.55; }
.steel-detail-inner li::before { content: "\2022"; position: absolute; left: 0; color: var(--ember-500); }
.steel-notes { grid-column: 1 / -1; font-size: .88rem; color: var(--ink-2); line-height: 1.65; border-top: 1px solid var(--line); padding-top: 18px; }
.compare-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--forge-950);
  border: 1px solid var(--ember-900);
  border-radius: var(--r-card);
  padding: 13px 18px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--sh-lg);
}
.compare-bar-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.compare-slots { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.compare-slot {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: rgba(232, 100, 31, .14);
  border: 1px solid var(--ember-900);
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--ember-200);
}
.compare-slot button { border: 0; background: transparent; color: var(--ember-400); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.compare-slot button:hover { color: #fff; }
.compare-panel { margin-top: 22px; }
.compare-panel table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.compare-panel th, .compare-panel td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; }
.compare-panel thead th { background: var(--forge-950); font-family: var(--font-head); text-transform: uppercase; letter-spacing: .05em; color: var(--ember-300); font-size: .86rem; }
.compare-panel tbody th { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 500; }
.compare-panel td { font-family: var(--font-mono); color: var(--ink-2); }
.compare-panel tbody tr:hover { background: rgba(232, 100, 31, .04); }

/* ==========================================================================
   BLOG (§8, §18)
   ========================================================================== */
.featured-post {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-card), box-shadow var(--t-card), border-color var(--t-card);
  margin-bottom: 40px;
  position: relative;
}
.featured-post:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--ember-700); color: inherit; }
.featured-media { position: relative; min-height: 330px; background: var(--forge-950); }
.featured-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.featured-body { padding: 36px 34px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.featured-body h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
.featured-body p { color: var(--ink-2); margin: 0; font-size: .94rem; }

.post-hero { background: var(--forge-950); border-bottom: 3px solid var(--ember-500); padding: 44px 0 38px; position: relative; overflow: hidden; }
.post-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 10%, rgba(232, 100, 31, .12), transparent 60%); }
.post-hero .wrap { position: relative; z-index: 2; }
.post-hero h1 { max-width: 860px; }
.post-hero .post-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; font-size: .8rem; color: var(--ink-3); }
.post-hero .post-meta .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ember-900);
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: .8rem; color: var(--ember-200);
  border: 1px solid var(--ember-700);
}
.post-lead { font-size: 1.06rem; color: var(--steel-300); line-height: 1.7; }
.post-lead p { margin-bottom: 1.1em; }

.toc {
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px 22px;
  position: sticky;
  top: calc(var(--header-h) + 22px);
  margin-bottom: 22px;
}
.toc h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .13em; color: var(--ember-500); margin: 0 0 14px; }
.toc ol { list-style: none; counter-reset: toc; padding: 0; margin: 0; }
.toc li { counter-increment: toc; margin-bottom: 4px; }
.toc a {
  display: block;
  font-size: .82rem;
  color: var(--ink-2);
  padding: 6px 9px 6px 30px;
  border-radius: var(--r-xs);
  position: relative;
  line-height: 1.45;
  border-left: 2px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 9px; top: 6px;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--forge-400);
}
.toc a:hover { background: var(--forge-700); color: var(--ember-400); }
.toc a.is-active { background: rgba(232, 100, 31, .12); color: var(--ember-300); border-left-color: var(--ember-500); }
.toc a.is-active::before { color: var(--ember-500); }

.sidebar-block { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; margin-bottom: 22px; }
.sidebar-block h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .13em; color: var(--ember-500); margin: 0 0 14px; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { margin-bottom: 12px; }
.sidebar-list li:last-child { margin-bottom: 0; }
.sidebar-list a { font-size: .84rem; color: var(--ink-2); line-height: 1.5; display: block; }
.sidebar-list a:hover { color: var(--ember-400); }
.sidebar-list .meta { font-size: .7rem; color: var(--ink-3); font-family: var(--font-mono); display: block; margin-top: 3px; }

.post-body h2 { margin-top: 1.9em; padding-bottom: .4em; border-bottom: 1px solid var(--line); font-size: clamp(1.3rem, 2.2vw, 1.6rem); scroll-margin-top: 90px; }
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { margin-top: 1.7em; font-size: 1.1rem; }
.post-body p { font-size: 1rem; line-height: 1.78; color: var(--ink-2); }
.post-body ul, .post-body ol { color: var(--ink-2); line-height: 1.75; }
.post-body li { margin-bottom: .6em; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body img { border-radius: var(--r-card); border: 1px solid var(--line); margin: 26px 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: .86rem; }
.post-body table th { background: var(--forge-950); text-align: left; padding: 11px 13px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ember-300); border-bottom: 1px solid var(--ember-900); }
.post-body table td { padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.post-body table tr:hover { background: rgba(232, 100, 31, .04); }
/* A table reports its columns' min-content width as its own. Left bare inside
   a one-column grid track it pins the track — and the whole article — wider
   than the viewport. The wrapper has a min-content of 0, so a wide table
   scrolls within its column instead of pushing the page sideways. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; margin: 26px 0; }
.table-scroll > table { margin: 0; min-width: 100%; }

.step-block {
  display: flex;
  gap: 16px;
  margin: 22px 0;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px 20px;
}
.step-block-num {
  width: 52px; height: 52px;
  flex: 0 0 auto;
  border-radius: var(--r-xs);
  background: var(--ember-500);
  color: var(--forge-950);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  display: grid; place-items: center;
  box-shadow: var(--glow-ember);
}
.step-block-body { flex: 1 1 auto; }
.step-block-body h4 { font-size: .98rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .4em; }
.step-block-body p { margin: 0; font-size: .88rem; color: var(--ink-2); line-height: 1.62; }

.takeaways { background: var(--forge-800); border: 1px solid var(--ember-900); border-radius: var(--r-card); padding: 26px 28px; margin: 40px 0; }
.takeaways h2 { font-size: 1.1rem; margin: 0 0 1em; border: 0; padding: 0; }
.takeaways ol { list-style: none; counter-reset: tk; padding: 0; margin: 0; }
.takeaways li { counter-increment: tk; position: relative; padding-left: 36px; margin-bottom: 13px; font-size: .92rem; color: var(--ink-2); line-height: 1.62; }
.takeaways li::before {
  content: counter(tk);
  position: absolute; left: 0; top: 0;
  width: 24px; height: 24px;
  border-radius: var(--r-xs);
  background: rgba(232, 100, 31, .16);
  border: 1px solid var(--ember-900);
  color: var(--ember-300);
  font-family: var(--font-mono);
  font-size: .74rem;
  display: grid; place-items: center;
}

.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 0;
  background: transparent; border: 0;
  text-align: left;
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
}
.faq-q:hover { color: var(--ember-400); }
.faq-q svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--ember-500); transition: transform var(--t-fast); }
.faq-q[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height var(--t-card); }
.faq-a p { padding: 0 0 18px; margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.68; }

.author-box {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ember-500);
  border-radius: var(--r-card);
  padding: 22px 24px;
  margin: 40px 0;
}
.author-box .avatar {
  width: 52px; height: 52px; flex: 0 0 auto;
  border-radius: var(--r-xs);
  background: var(--ember-900);
  border: 1px solid var(--ember-700);
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 1.1rem; color: var(--ember-200);
}
.author-box h3 { font-size: .92rem; margin: 0 0 .3em; text-transform: uppercase; letter-spacing: .05em; }
.author-box p { font-size: .84rem; color: var(--ink-2); margin: 0; line-height: 1.6; }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 40px 0; }
.post-nav-item {
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px 20px;
  transition: border-color var(--t-fast), transform var(--t-card);
}
.post-nav-item:hover { border-color: var(--ember-700); transform: translateY(-3px); color: inherit; }
.post-nav-item .dir { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 7px; }
.post-nav-item .t { font-family: var(--font-head); font-size: .98rem; text-transform: uppercase; letter-spacing: .03em; color: var(--steel-300); }
.post-nav-item:hover .t { color: var(--ember-400); }
.post-nav-item.next { text-align: right; }

.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--ember-500);
  z-index: 300;
  width: 0;
  box-shadow: 0 0 10px rgba(232, 100, 31, .8);
  transition: width .1s linear;
}
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 44px; height: 44px;
  border-radius: var(--r-xs);
  border: 1px solid var(--ember-900);
  background: var(--forge-800);
  color: var(--ember-400);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t-card), transform var(--t-card), visibility var(--t-card), background var(--t-fast);
  box-shadow: var(--sh-md);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--ember-500); color: var(--forge-950); }
.to-top svg { width: 18px; height: 18px; }

/* ==========================================================================
   INFO / CONTACT / PRIVACY (§8)
   ========================================================================== */
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin: 34px 0; }
.info-card { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.info-card svg { width: 26px; height: 26px; color: var(--ember-500); margin-bottom: 14px; }
.info-card h3 { font-size: .96rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .5em; }
.info-card p { font-size: .86rem; color: var(--ink-2); margin: 0; line-height: 1.62; }

.prose-block { max-width: 820px; }
.prose-block h2 { margin-top: 1.7em; padding-bottom: .4em; border-bottom: 1px solid var(--line); }
.prose-block h2:first-child { margin-top: 0; }
.prose-block h3 { margin-top: 1.5em; }
.prose-block p, .prose-block li { color: var(--ink-2); font-size: .96rem; line-height: 1.75; }

.form-card { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-card); padding: 30px; }
.form-status { margin-top: 18px; display: none; }
.form-status.show { display: block; }

/* ==========================================================================
   STUDIO / 3D TOOL PAGES (§16)
   ========================================================================== */
.studio-page { padding: 22px 0 60px; }
.studio-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--forge-800);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 13px 18px;
  margin-bottom: 20px;
}
.studio-toolbar-title { font-family: var(--font-head); font-size: .96rem; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.studio-toolbar-spacer { flex: 1 1 auto; }

.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.studio-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 380px;
  border-radius: var(--r-card);
  border: 1px solid var(--line-strong);
  background: radial-gradient(ellipse at 50% 40%, #2A2018 0%, var(--forge-950) 74%);
  overflow: hidden;
  box-shadow: var(--sh-md);
}
.studio-canvas-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.studio-canvas-wrap:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 2px; }

.sc-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(8, 6, 6, .9);
  text-align: center;
  padding: 30px;
  transition: opacity var(--t-card), visibility var(--t-card);
}
.sc-overlay.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.sc-overlay h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; margin: 0; color: var(--ember-300); }
.sc-overlay p { font-size: .84rem; color: var(--ink-2); margin: 0; max-width: 380px; line-height: 1.6; }
.sc-spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 3px solid var(--forge-600);
  border-top-color: var(--ember-500);
  animation: fa-spin .9s linear infinite;
}
@keyframes fa-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sc-spinner { animation-duration: 3s; } }
.sc-progress { width: 200px; height: 4px; border-radius: var(--r-pill); background: var(--forge-700); overflow: hidden; }
.sc-progress span { display: block; height: 100%; width: 30%; background: var(--ember-500); border-radius: var(--r-pill); transition: width var(--t-card); }

/* 2D overlays inside the 3D stage: cross-section and temperature curve */
.sc-section,
.sc-curve {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  border-radius: var(--r-xs);
  box-shadow: var(--sh-md);
  pointer-events: none;
}
.sc-section { width: 200px; height: 125px; }
.sc-curve { width: 320px; height: 150px; left: 12px; right: auto; }
@media (max-width: 900px) {
  .sc-section { width: 140px; height: 88px; }
  .sc-curve { width: 200px; height: 96px; }
}

.studio-fallback { display: none; }
.studio-fallback.show { display: block; }
.studio-fallback img { width: 100%; height: auto; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--forge-950); }
.studio-fallback-inner { padding: 22px; }
.studio-fallback h3 { font-size: .98rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ember-300); margin: 0 0 .6em; }
.studio-fallback p { font-size: .86rem; color: var(--ink-2); line-height: 1.62; }

.studio-hint {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.studio-hint svg { width: 15px; height: 15px; color: var(--ember-500); flex: 0 0 auto; }

.panel { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin-bottom: 16px; }
.panel h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ember-500); margin: 0 0 16px; }
.panel-sub { font-size: .78rem; color: var(--ink-3); margin: -8px 0 16px; line-height: 1.5; }

.ctrl { margin-bottom: 17px; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ctrl-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ctrl-value { font-family: var(--font-mono); font-size: .82rem; color: var(--ember-300); }
.ctrl input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--forge-600);
  outline: none;
  cursor: pointer;
  margin: 0;
}
.ctrl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--ember-500);
  border: 2px solid var(--forge-950);
  box-shadow: 0 0 10px rgba(232, 100, 31, .6);
  cursor: pointer;
}
.ctrl input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--ember-500);
  border: 2px solid var(--forge-950);
  box-shadow: 0 0 10px rgba(232, 100, 31, .6);
  cursor: pointer;
}
.ctrl input[type="range"]:focus-visible { outline: 2px solid var(--ember-500); outline-offset: 4px; }
.ctrl select, .ctrl input[type="number"] {
  width: 100%;
  height: 36px;
  background: var(--forge-950);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .84rem;
  padding: 0 11px;
}
.ctrl select:focus, .ctrl input[type="number"]:focus { outline: none; border-color: var(--ember-500); }

.btn-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn-group .btn { padding: 8px 10px; font-size: .72rem; }
.btn-group-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.readout {
  background: var(--forge-950);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.85;
  color: var(--ink-2);
}
.readout .rk { color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }
.readout b { color: var(--ember-300); font-weight: 500; }
.readout .ok { color: #9CC49C; }
.readout .warn { color: var(--hot-400); }
.readout .bad { color: #E8907F; }

.gauge-row { margin-top: 14px; }
.gauge-row-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 6px; }
.gauge-track { height: 7px; border-radius: var(--r-pill); background: var(--forge-700); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--temper-500), var(--hot-500), var(--ember-500)); transition: width var(--t-card); }
.gauge-fill.is-good { background: linear-gradient(90deg, #3E6B3E, var(--success)); }
.gauge-fill.is-warn { background: linear-gradient(90deg, var(--hot-700), var(--hot-500)); }
.gauge-fill.is-bad { background: linear-gradient(90deg, #7A2E22, var(--danger)); }

.studio-note { font-size: .8rem; color: var(--ink-3); line-height: 1.6; }

/* ==========================================================================
   MISC
   ========================================================================== */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }
.stat { background: var(--forge-800); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; text-align: center; }
.stat-v { font-family: var(--font-mono); font-size: 1.9rem; color: var(--ember-500); line-height: 1.1; }
.stat-k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 7px; }

.divider-hammer { display: flex; align-items: center; gap: 14px; margin: 40px 0; color: var(--forge-500); }
.divider-hammer::before, .divider-hammer::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.divider-hammer svg { width: 18px; height: 18px; color: var(--ember-900); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-preview-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .split-wide { grid-template-columns: 320px minmax(0, 1fr); gap: 28px; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 1000px) {
  .hdr-search input { width: 130px; }
  .hdr-search input:focus { width: 170px; }
  .split-side { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .toc { position: static; }
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .calc-result { position: static; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steel-detail-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --gutter: 18px; }
  .hdr-seg-nav { display: none; }
  .hdr-seg-logo::after { display: none; }
  .hamburger { display: grid; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-wide { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .split-half { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .featured-post { grid-template-columns: minmax(0, 1fr); }
  .featured-media { min-height: 220px; }
  .studio-layout { grid-template-columns: minmax(0, 1fr); }
  .studio-canvas-wrap { aspect-ratio: 3 / 2; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .exhibit { position: static; }
  .cta-band { padding: 34px 26px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  /* The three-segment anvil header carries a brand, a search field, a 3D link
     and a menu button. The search input has a fixed width and the actions
     segment is `flex: 0 0 auto`, so below ~520px the row cannot fit and the
     header pushes the whole document sideways. Give the flexible track room to
     shrink instead of overflowing. */
  .hdr-seg { min-width: 0; }
  .hdr-seg-actions { flex: 0 1 auto; gap: 8px; padding-left: 12px; }
  .hdr-search { flex: 1 1 auto; min-width: 0; }
  .hdr-search input,
  .hdr-search input:focus { width: 100%; }
  section { padding: 42px 0; }
  .section-sm { padding: 30px 0; }
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .trust-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-viewport { height: 460px; }
  .hero-nav { bottom: 16px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .btn-group { grid-template-columns: minmax(0, 1fr); }
  .studio-canvas-wrap { aspect-ratio: 1 / 1; min-height: 300px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .cta-band { padding: 28px 20px; }
  .cta-band .btn-row { width: 100%; }
  .cta-band .btn { width: 100%; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .steel-detail-inner { grid-template-columns: minmax(0, 1fr); }
  .compare-bar { flex-direction: column; align-items: stretch; }
  .split-side { gap: 26px; }
  .exhibit-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .post-hero { padding: 30px 0 28px; }
}

/* A nowrap pill label is wider than a phone. A full-width button may wrap its
   label instead of pinning its grid track and pushing the document sideways. */
@media (max-width: 480px) {
  .btn-block { white-space: normal; }
}

/* Phones: drop the brand wordmark and the 3D label so the mark, the search
   field and the menu button all fit without shrinking the search to nothing. */
@media (max-width: 560px) {
  .brand-text { display: none; }
  .hdr-seg-logo { padding-right: 10px; }
  .btn-3d { padding: 0 9px; }
  .btn-3d span { display: none; }
}

/* print */
@media print {
  body::before, body::after, .site-header, .site-footer, .to-top, .read-progress, .studio-panel-col { display: none !important; }
  body { background: #fff; color: #111; }
  a { color: #111; }
}
