/* ==========================================================================
   Ember & Glass — Night Furnace Theme
   Design tokens + components. Pure static, no external assets.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Night scale */
  --night-950: #060C12;
  --night-900: #0E1720;
  --night-800: #152230;
  --night-700: #1E2E3E;
  --night-600: #2A3E50;
  --night-500: #3A5266;
  --night-400: #4E6A80;

  /* Ember scale */
  --ember-900: #7A2E08;
  --ember-700: #B8480F;
  --ember-500: #E8641F;
  --ember-400: #F58A3C;
  --ember-300: #FAAE72;
  --ember-200: #FCD2AC;
  --ember-100: #FDEBDC;

  /* Glass scale */
  --glass-900: #1E4A56;
  --glass-700: #2E6E7E;
  --glass-500: #4AA8B8;
  --glass-400: #6EC4D2;
  --glass-300: #A0DCE6;
  --glass-200: #CEEDF2;
  --glass-100: #E6F6F9;

  /* Incandescent highlights */
  --inc-100: #FFF4E8;
  --inc-200: #FFE0C0;
  --inc-300: #FFCC94;
  --inc-400: #FFB868;

  /* Neutrals */
  --text: #EFF4F6;
  --text-muted: #B8C4CE;
  --text-dim: #7A8894;
  --border: #3A4A58;
  --border-deep: #2A3844;

  /* Semantic */
  --danger: #D65A4A;
  --success: #5AA88A;
  --info: #4AA8B8;

  /* Glow */
  --glow-ember: 0 0 20px rgba(232, 100, 31, .35), 0 0 40px rgba(232, 100, 31, .15);
  --glow-glass: 0 0 20px rgba(74, 168, 184, .3);

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

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

  /* Transitions */
  --t-fast: .15s ease;
  --t-med: .3s ease;
  --t-pulse: .6s ease-out;

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

  /* Type */
  --font-display: "Space Grotesk", "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: Consolas, Menlo, "SFMono-Regular", monospace;
}

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

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

body {
  margin: 0;
  background: var(--night-900);
  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;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 .5em;
}
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; }

a { color: var(--glass-400); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--ember-400); }
.prose a, .article-body a {
  color: var(--glass-400);
  text-decoration: underline;
  text-decoration-color: var(--glass-700);
  text-underline-offset: 3px;
}
.prose a:hover, .article-body a:hover { color: var(--ember-400); text-decoration-color: var(--ember-500); }

ul, ol { margin: 0 0 1.05em; padding-left: 1.25em; }
li { margin-bottom: .4em; }

code, kbd, samp, .mono { font-family: var(--font-mono); font-size: .9em; }
code {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-xs);
  padding: 1px 6px;
  color: var(--ember-300);
}
hr { border: 0; border-top: 1px solid var(--border-deep); margin: 34px 0; }

:focus-visible {
  outline: 3px solid var(--ember-400);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(232, 100, 31, .4);
  border-radius: var(--r-xs);
}

::selection { background: rgba(232, 100, 31, .35); color: var(--inc-100); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 500;
  background: var(--ember-500);
  color: var(--night-950);
  padding: 10px 18px;
  font-weight: 700;
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; color: var(--night-950); }

.sr-only {
  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. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow { max-width: var(--container-narrow); }
.container-wide { max-width: var(--container-wide); }

.section { padding: 60px 0; }
.section-sm { padding: 38px 0; }
.section-tight { padding: 42px 0 60px; }
.section-alt { background: var(--night-950); }

.section-head { margin-bottom: 30px; }
.section-head.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: .25em; }
.section-head p { color: var(--text-muted); margin: 0; max-width: 68ch; }

.grid-2, .grid-3, .grid-4 { 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 { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.split-wide { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 34px; align-items: start; }
.split-side { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 38px; align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; align-items: start; }

.stack-sm > * + * { margin-top: 10px; }
.stack > * + * { margin-top: 20px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Ember hairline divider between dark modules */
.rule-ember {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember-900), transparent);
  margin: 0;
}

/* --------------------------------------------------------------------------
   4. Eyebrow / tags / chips / badges
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ember-500);
  margin-bottom: .7em;
}
.eyebrow-glass { color: var(--glass-400); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  line-height: 1.5;
}
.tag-ember { background: var(--ember-500); color: var(--night-950); }
.tag-glass { background: var(--glass-500); color: var(--night-950); }
.tag-inc { background: var(--inc-200); color: var(--night-950); }
.tag-green { background: var(--success); color: var(--night-950); }
.tag-red { background: var(--danger); color: var(--night-950); }
.tag-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.tag-night { background: var(--night-700); color: var(--text-muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  font-family: inherit;
}
.chip:hover { border-color: var(--ember-900); color: var(--ember-300); }
.chip.is-active { background: var(--ember-500); border-color: var(--ember-500); color: var(--night-950); }

.badge-hot, .badge-3d, .badge-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.badge-hot { background: var(--ember-500); color: var(--night-950); }
.badge-3d { background: var(--glass-500); color: var(--night-950); }
.badge-new { background: var(--inc-200); color: var(--night-950); }

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--night-800);
  border: 1px solid var(--glass-900);
  color: var(--glass-300);
}
.stage-pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--glass-400);
  box-shadow: 0 0 8px var(--glass-500);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: .93rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-med), transform var(--t-fast), border-color var(--t-fast);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
/* Icons are inline-flex children with no intrinsic size, so they must be given
   an explicit box. Without this a bare <svg> stretches to fill the button. */
.btn svg { flex: 0 0 auto; width: 16px; height: 16px; }
.btn-lg svg { width: 18px; height: 18px; }
.btn-sm svg { width: 14px; height: 14px; }

.btn-primary { background: var(--ember-500); color: var(--night-950); }
.btn-primary:hover { background: var(--ember-400); color: var(--night-950); box-shadow: var(--glow-ember); }

.btn-glass { background: var(--glass-500); color: var(--night-950); }
.btn-glass:hover { background: var(--glass-400); color: var(--night-950); box-shadow: var(--glow-glass); }

.btn-outline { background: var(--night-800); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--ember-500); color: var(--ember-300); background: var(--night-700); }

.btn-ghost-light { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost-light:hover { background: rgba(232, 100, 31, .12); color: var(--ember-300); border-color: var(--ember-700); }

.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

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

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--night-950);
  border-bottom: 1px solid var(--ember-900);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  position: relative;
  min-height: var(--header-h);
  padding: 0 var(--gutter);
  max-width: var(--container-wide);
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--ember-400), var(--ember-900));
  display: grid;
  place-items: center;
  box-shadow: 0 0 14px rgba(232, 100, 31, .35);
  flex: 0 0 auto;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--inc-100);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-tag {
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--glass-400);
  white-space: nowrap;
}

.main-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-list > li { position: relative; margin: 0; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.nav-link:hover { background: rgba(232, 100, 31, .14); color: var(--ember-300); }
.nav-link[aria-current="page"] {
  color: var(--ember-500);
  box-shadow: inset 0 -2px 0 var(--ember-500), 0 0 10px rgba(232, 100, 31, .25);
}
.nav-caret { flex: 0 0 auto; width: 13px; height: 13px; font-size: .6rem; opacity: .75; transition: transform var(--t-fast); }
.nav-link[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 268px;
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 8px;
  display: none;
  z-index: 210;
}
.dropdown.is-open { display: block; }
.dd-head {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 10px 4px;
}
.dd-link {
  display: block;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: .86rem;
  transition: background var(--t-fast), color var(--t-fast);
}
.dd-link:hover { background: var(--night-700); color: var(--ember-400); }
.dd-desc { display: block; font-size: .72rem; color: var(--text-dim); line-height: 1.45; margin-top: 1px; }
.dd-sep { height: 1px; background: var(--border-deep); margin: 6px 4px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.btn-studio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ember-500);
  background: rgba(232, 100, 31, .1);
  color: var(--ember-300);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: box-shadow var(--t-med), background var(--t-fast), color var(--t-fast);
}
.btn-studio:hover { background: var(--ember-500); color: var(--night-950); box-shadow: var(--glow-ember); }
.btn-studio svg { width: 14px; height: 14px; }

.search-form { position: relative; flex: 0 0 auto; }
.search-input {
  width: 180px;
  padding: 7px 32px 7px 14px;
  border-radius: var(--r-pill);
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  transition: width var(--t-med), border-color var(--t-fast), box-shadow var(--t-med);
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  width: 240px;
  outline: none;
  border-color: var(--ember-500);
  box-shadow: var(--glow-ember);
}
.search-btn {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--text-dim);
  border-radius: 50%;
}
.search-btn:hover { color: var(--ember-400); }
.search-btn svg { width: 15px; height: 15px; }

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 6px;
  display: none;
  z-index: 210;
}
.suggest.is-open { display: block; }
.suggest-item {
  display: block;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: .85rem;
}
.suggest-item:hover, .suggest-item.is-active { background: var(--night-700); color: var(--ember-300); }
.suggest-item small { display: block; color: var(--text-dim); font-size: .72rem; }
.suggest-empty { padding: 12px 10px; color: var(--text-dim); font-size: .84rem; }

.nav-toggle {
  display: none;
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  cursor: pointer;
  padding: 0;
  place-items: center;
}
/* The three bars are absolutely centred so the open-state cross is exact:
   grid rows plus margins left the diagonals offset from each other. */
.nav-toggle span {
  position: absolute;
  left: 50%; top: 50%;
  width: 17px; height: 2px;
  margin: 0;
  background: var(--text-muted);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav-toggle span:nth-child(1) { transform: translate(-50%, calc(-50% - 5px)); }
.nav-toggle span:nth-child(3) { transform: translate(-50%, calc(-50% + 5px)); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

/* --------------------------------------------------------------------------
   7. Hero carousel
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  height: 460px;
  overflow: hidden;
  background: var(--night-950);
  border-bottom: 1px solid var(--ember-900);
}
.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;
  position: absolute;
  inset: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #060C12 0%, rgba(14, 23, 32, .88) 46%, rgba(232, 100, 31, .22) 100%);
}
.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 660px;
  padding: 0 var(--gutter);
  margin: 0 auto;
  width: 100%;
  max-width: var(--container);
}
.hero h1, .hero .hero-title-lg {
  font-size: clamp(1.95rem, 4.2vw, 2.9rem);
  margin: 0 0 .4em;
  max-width: 20ch;
}
.hero .hero-title-lg {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--text);
}
.hero p { color: var(--text-muted); font-size: 1.02rem; max-width: 56ch; }
.hero-kicker svg { flex: 0 0 auto; width: 14px; height: 14px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  background: rgba(232, 100, 31, .14);
  border: 1px solid var(--ember-900);
  color: var(--ember-300);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 16px;
}
.hero-dots {
  position: absolute;
  left: 0; right: 0;
  bottom: 22px;
  display: flex;
  justify-content: center;
  gap: 9px;
  z-index: 3;
}
.hero-dot {
  width: 30px; height: 4px;
  border-radius: var(--r-pill);
  background: rgba(239, 244, 246, .28);
  border: 0; padding: 0; cursor: pointer;
  transition: width var(--t-med), background var(--t-med), box-shadow var(--t-med);
}
.hero-dot.is-active {
  width: 46px;
  background: var(--ember-500);
  box-shadow: 0 0 12px rgba(232, 100, 31, .6);
}
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(6, 12, 18, .72);
  border: 1px solid var(--border-deep);
  color: var(--text-muted);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.hero-arrow:hover { background: var(--ember-500); color: var(--night-950); border-color: var(--ember-500); }
.hero-arrow.prev { left: 16px; }
.hero-arrow.next { right: 16px; }
.hero-arrow svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   8. Trust strip & steps
   -------------------------------------------------------------------------- */
.trust-strip {
  background: var(--night-950);
  border-bottom: 1px solid var(--border-deep);
  padding: 30px 0;
}
.trust-item { display: flex; gap: 13px; align-items: flex-start; }
.trust-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: rgba(232, 100, 31, .12);
  border: 1px solid var(--ember-900);
  display: grid; place-items: center;
  color: var(--ember-400);
}
.trust-icon svg { width: 19px; height: 19px; }
.trust-item h4 { margin: 0 0 .15em; font-size: .96rem; color: var(--inc-100); }
.trust-item p { margin: 0; font-size: .82rem; color: var(--text-dim); line-height: 1.5; }

ol.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
  counter-reset: step;
}
ol.steps > li { position: relative; margin: 0; }
.step-media {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  aspect-ratio: 16 / 10;
}
.step-media img { width: 100%; height: 100%; object-fit: cover; }
.step-num {
  position: absolute;
  top: 10px; left: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ember-500);
  color: var(--night-950);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .92rem;
  box-shadow: 0 0 16px rgba(232, 100, 31, .5);
}
.step-label {
  display: block;
  margin: 13px 0 4px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ember-500);
}
.step-title { font-family: var(--font-display); font-size: 1.04rem; font-weight: 700; margin: 0 0 .3em; }
ol.steps p { font-size: .85rem; color: var(--text-dim); margin: 0; }

/* --------------------------------------------------------------------------
   9. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t-med), transform var(--t-med), border-color var(--t-med);
}
.card:hover {
  box-shadow: var(--sh-lg), 0 0 0 1px rgba(232, 100, 31, .35);
  transform: translateY(-3px);
  border-color: var(--ember-900);
}
.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--night-900);
  border-bottom: 1px solid var(--border-deep);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px; display: flex; flex-direction: column; flex: 1 1 auto; }
.card-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  margin: 0 0 .35em;
  line-height: 1.3;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--ember-400); }
.card-text { font-size: .87rem; color: var(--text-muted); margin: 0 0 14px; flex: 1 1 auto; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-deep);
  font-size: .78rem;
  color: var(--text-dim);
  margin-top: auto;
}
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-arrow { color: var(--glass-400); font-weight: 700; transition: color var(--t-fast), transform var(--t-fast); }
.card:hover .card-arrow { color: var(--ember-400); transform: translateX(3px); }

/* Variants */
.cat-card .card-body { padding: 20px; }
.cat-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  background: rgba(232, 100, 31, .13);
  border: 1px solid var(--ember-900);
  display: grid; place-items: center;
  color: var(--ember-400);
  margin-bottom: 14px;
}
.cat-icon svg { width: 24px; height: 24px; }
.cat-count { font-family: var(--font-mono); font-size: .78rem; color: var(--text-dim); }

.tool-card .card-media { background: var(--night-900); padding: 12px; }
.tool-card .card-media img { object-fit: contain; }

.blog-card .card-media { aspect-ratio: 16 / 9; }
.blog-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.calc-card { border-color: var(--glass-900); }
.calc-card:hover { box-shadow: var(--sh-lg), 0 0 0 1px rgba(74, 168, 184, .4); border-color: var(--glass-900); }
.calc-card .card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.studio-card {
  background: linear-gradient(160deg, var(--night-950) 0%, var(--night-800) 100%);
  border: 1px solid var(--glass-900);
  position: relative;
}
.studio-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
  pointer-events: none;
  box-shadow: inset 0 0 40px rgba(74, 168, 184, .1);
}
.studio-card:hover {
  box-shadow: var(--sh-lg), 0 0 0 1px var(--glass-500), var(--glow-glass);
  border-color: var(--glass-500);
}
.studio-card .card-media { aspect-ratio: 16 / 10; }
.studio-thumb { width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   10. Page hero
   -------------------------------------------------------------------------- */
.page-hero {
  background: var(--night-950);
  border-bottom: 3px solid var(--ember-500);
  padding: 34px 0 30px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: -120px; right: -60px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(232, 100, 31, .16), transparent 68%);
  pointer-events: none;
}
.page-hero .container { position: relative; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  list-style: none;
  padding: 0;
}
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "/"; color: var(--border); }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--ember-400); }
.page-hero h1 { margin: 0 0 .3em; }
.page-hero .lede { color: var(--text-muted); font-size: 1.02rem; max-width: 74ch; margin: 0; }

/* --------------------------------------------------------------------------
   11. Notices / tip boxes / legal
   -------------------------------------------------------------------------- */
.notice {
  border-radius: var(--r-md);
  border: 1px solid var(--border-deep);
  padding: 15px 17px;
  font-size: .88rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.6;
}
.notice svg { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 2px; }
.notice p:last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: 2px; }
.notice-safety { background: #2E1A0A; border-color: var(--ember-900); color: var(--ember-300); }
.notice-info { background: #0E2A30; border-color: var(--glass-900); color: var(--glass-300); }
.notice-warn { background: #2E1410; border-color: #7A2E20; color: #E8A08C; }
.notice-neutral { background: var(--night-800); color: var(--text-muted); }

.tip-box {
  border-left: 4px solid var(--ember-500);
  background: var(--night-800);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  margin: 0 0 22px;
  font-size: .89rem;
}
.tip-box:last-child { margin-bottom: 0; }
.tip-box strong:first-child { display: block; margin-bottom: 4px; font-family: var(--font-display); }
.tip-box p:last-child { margin-bottom: 0; }
.tip-box.tip-warn { border-left-color: var(--danger); }
.tip-box.tip-warn strong:first-child { color: #E8A08C; }
.tip-box.tip-note { border-left-color: var(--glass-500); }
.tip-box.tip-note strong:first-child { color: var(--glass-300); }
.tip-box.tip-ok { border-left-color: var(--success); }
.tip-box.tip-ok strong:first-child { color: #9FD8C2; }
.tip-box.tip-tip strong:first-child { color: var(--ember-300); }

.legal-note {
  background: var(--night-800);
  border-left: 4px solid var(--ember-500);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 13px 16px;
  font-size: .84rem;
  color: var(--text-muted);
  margin: 24px 0;
}
.legal-note p:last-child { margin-bottom: 0; }

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  padding: 40px 22px;
  text-align: center;
  color: var(--text-dim);
  background: var(--night-800);
}
.empty-state svg { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--border); }

.safety-strip {
  background: linear-gradient(90deg, rgba(214, 90, 74, .16), rgba(232, 100, 31, .08));
  border: 1px solid #7A2E20;
  border-left: 4px solid var(--danger);
  border-radius: var(--r-md);
  padding: 13px 17px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: #F0B9A8;
  margin-bottom: 26px;
}
.safety-strip .pp-icons { display: flex; gap: 9px; }
.safety-strip .pp-icons svg { width: 20px; height: 20px; color: var(--ember-300); }
.safety-strip strong { color: var(--inc-100); font-family: var(--font-display); }

/* Temperature indicator */
.temp-indicator {
  --temp: 50%;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--night-900);
  border: 1px solid var(--border-deep);
  position: relative;
  overflow: hidden;
}
.temp-indicator::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--temp);
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--glass-500), var(--ember-400) 60%, var(--ember-500));
  transition: width var(--t-med);
}
.temp-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-dim);
  margin-top: 5px;
}
.temp-value {
  font-family: var(--font-mono);
  font-size: .82rem;
  background: var(--night-900);
  border: 1px solid var(--ember-900);
  border-radius: var(--r-xs);
  padding: 2px 8px;
  color: var(--ember-300);
}

/* --------------------------------------------------------------------------
   12. Spec table
   -------------------------------------------------------------------------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.spec-table caption {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  padding: 0 0 10px;
  color: var(--text);
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-deep);
  vertical-align: top;
}
.spec-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: .8rem;
  width: 42%;
}
.spec-table td { color: var(--text); font-family: var(--font-mono); font-size: .82rem; }
.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, .05); }

.data-list { list-style: none; padding: 0; margin: 0; }
.data-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-deep);
  font-size: .88rem;
  margin: 0;
}
.data-list li:last-child { border-bottom: 0; }
.data-list .k { flex: 0 0 42%; color: var(--text-dim); }
.data-list .v { flex: 1 1 auto; font-family: var(--font-mono); font-size: .82rem; }

/* --------------------------------------------------------------------------
   13. Tool detail layout
   -------------------------------------------------------------------------- */
.exhibit {
  background: var(--night-950);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: inset 0 0 60px rgba(74, 168, 184, .07);
}
.exhibit-frame {
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--night-900);
  border: 1px solid var(--border-deep);
}
.exhibit-frame img { width: 100%; }
.thumb-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.thumb {
  border: 1px solid var(--border-deep);
  border-radius: var(--r-sm);
  background: var(--night-900);
  padding: 3px;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.thumb img { width: 100%; border-radius: var(--r-xs); }
.thumb:hover { border-color: var(--ember-900); }
.thumb.is-active { border-color: var(--ember-500); box-shadow: var(--glow-ember); }
.view-switch { display: flex; gap: 6px; margin-top: 12px; }

/* --------------------------------------------------------------------------
   14. Filter bar / pagination
   -------------------------------------------------------------------------- */
.filter-bar {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 26px;
}
.filter-bar .field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; min-width: 140px; }
.filter-bar .field-narrow { flex: 0 1 150px; }
.filter-bar label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.filter-bar .filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.result-count {
  font-size: .82rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}
.result-count strong { color: var(--ember-400); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

.pagination {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}
.pagination button, .pagination a {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: .85rem;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.pagination button:hover, .pagination a:hover { border-color: var(--ember-900); color: var(--ember-300); }
.pagination .is-active { background: var(--ember-500); border-color: var(--ember-500); color: var(--night-950); font-weight: 700; }
.pagination [disabled] { opacity: .35; pointer-events: none; }

/* --------------------------------------------------------------------------
   15. Forms
   -------------------------------------------------------------------------- */
.form-card {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: var(--sh-sm);
}
.form-row { margin-bottom: 16px; }
.form-row label, .field-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.hint { font-size: .76rem; color: var(--text-dim); margin-top: 5px; display: block; }

input[type="text"], input[type="email"], input[type="number"], input[type="search"],
input[type="tel"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--night-900);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-xs);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-med);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
input[type="number"] { font-family: var(--font-mono); }
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ember-500);
  box-shadow: var(--glow-ember);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 14px rgba(214, 90, 74, .3);
}
.field-error { display: block; font-size: .76rem; color: #E8A08C; margin-top: 5px; min-height: 1em; }

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--night-600);
  outline: none;
  padding: 0;
  border: 0;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ember-500);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(232, 100, 31, .55);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--ember-500);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(232, 100, 31, .55);
}
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ember-300);
  min-width: 62px;
  text-align: right;
}

.checkbox-row { display: flex; gap: 9px; align-items: flex-start; font-size: .85rem; color: var(--text-muted); }
.checkbox-row input { width: auto; margin-top: 4px; flex: 0 0 auto; }
.checkbox-row label { text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 400; color: var(--text-muted); margin: 0; }

/* --------------------------------------------------------------------------
   16. Calculator layout
   -------------------------------------------------------------------------- */
.calc-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; align-items: start; }
.result-card {
  background: var(--night-950);
  border: 1px solid var(--ember-900);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: var(--sh-md), inset 0 0 50px rgba(232, 100, 31, .07);
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.result-hero {
  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);
  margin: 0;
}
.result-hero small { font-size: .3em; color: var(--text-muted); font-weight: 400; display: block; text-shadow: none; margin-top: 6px; }
.result-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.result-cell {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-sm);
  padding: 11px 13px;
}
.result-cell .k { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-dim); }
.result-cell .v { font-family: var(--font-mono); font-size: 1rem; color: var(--inc-200); }
.gauge { margin-top: 20px; }
.formula-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-deep);
  font-size: .78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   17. Blog / article
   -------------------------------------------------------------------------- */
.featured-post {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 34px;
}
.featured-post .fp-media { aspect-ratio: 16 / 10; }
.featured-post .fp-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-post .fp-body { padding: 26px 26px 26px 0; }
.featured-post h2 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }

.post-hero { padding-bottom: 26px; }
.post-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  font-size: .8rem;
  color: var(--text-dim);
  margin-top: 14px;
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

.article-body { font-size: 1rem; }
.article-body h2 { margin-top: 1.7em; padding-top: .2em; }
.article-body h3 { margin-top: 1.5em; color: var(--inc-200); }
.article-body > *:first-child { margin-top: 0; }
.article-body img { border-radius: var(--r-md); margin: 22px 0; }

.step-block {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.step-block .sb-num {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--night-800);
  border: 1px solid var(--ember-900);
  color: var(--ember-400);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
.step-block h3 { margin: 8px 0 .4em; }
.step-block p:last-child { margin-bottom: 0; }

.toc {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 22px;
}
.toc h2 { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 10px; font-family: var(--font-body); font-weight: 800; }
.toc ol { margin: 0; padding-left: 1.15em; }
.toc li { margin-bottom: .35em; font-size: .86rem; }
.toc a { color: var(--text-muted); }
.toc a:hover, .toc a.is-active { color: var(--ember-400); }

.side-sticky { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 22px; }
.side-card {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 18px;
}
.side-card h3 { font-size: .95rem; margin-bottom: .6em; }
.side-card ul { list-style: none; padding: 0; margin: 0; }
.side-card li { margin-bottom: .5em; font-size: .85rem; }
.side-card li:last-child { margin-bottom: 0; }
.side-card a { color: var(--text-muted); }
.side-card a:hover { color: var(--ember-400); }

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 20px;
  margin: 32px 0;
}
.author-avatar {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--glass-500), var(--night-700));
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--night-950);
  font-size: 1.05rem;
}
.author-box h3 { font-size: .95rem; margin: 0 0 .2em; }
.author-box p { font-size: .85rem; color: var(--text-dim); margin: 0; }

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 34px 0;
}
.post-nav a {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: block;
  transition: border-color var(--t-fast), box-shadow var(--t-med);
}
.post-nav a:hover { border-color: var(--ember-900); box-shadow: var(--sh-md); }
.post-nav .pn-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); display: block; margin-bottom: 5px; }
.post-nav .pn-title { font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: .95rem; }
.post-nav .next { text-align: right; }

.read-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--ember-700), var(--ember-400));
  box-shadow: 0 0 12px rgba(232, 100, 31, .6);
  z-index: 190;
  transition: width .1s linear;
}
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--night-800);
  border: 1px solid var(--ember-900);
  color: var(--ember-400);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 180;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med), box-shadow var(--t-med), background var(--t-fast);
  box-shadow: var(--sh-md);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--ember-500); color: var(--night-950); box-shadow: var(--glow-ember); }
.to-top svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   18. Studio (3D) pages
   -------------------------------------------------------------------------- */
.studio-shell { background: var(--night-950); }
.studio-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--night-900);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.studio-bar .sb-title { font-family: var(--font-display); font-weight: 700; font-size: .98rem; margin-right: auto; }
.studio-bar .sb-title small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .76rem; color: var(--text-dim); }

.studio-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.canvas-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 42%, #14212E 0%, #060C12 72%);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  overflow: hidden;
  min-height: 460px;
  box-shadow: inset 0 0 90px rgba(74, 168, 184, .09);
}
.canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.canvas-overlay {
  position: absolute;
  left: 14px; top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 4;
  pointer-events: none;
}
.canvas-overlay > * { pointer-events: auto; }
.canvas-hud {
  position: absolute;
  left: 14px; bottom: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-muted);
  z-index: 4;
  pointer-events: none;
}
.hud-pill {
  background: rgba(6, 12, 18, .82);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  backdrop-filter: blur(6px);
}
.hud-pill b { color: var(--ember-400); font-weight: 700; }
.canvas-hint {
  position: absolute;
  right: 14px; top: 14px;
  max-width: 230px;
  background: rgba(6, 12, 18, .82);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: .76rem;
  color: var(--text-dim);
  z-index: 4;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.panel {
  background: var(--night-900);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 18px;
}
.panel + .panel { margin-top: 16px; }
.panel h3 {
  font-size: .74rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 800;
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-deep);
}
.ctrl { margin-bottom: 15px; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.ctrl-head label { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.ctrl-head output { font-family: var(--font-mono); font-size: .78rem; color: var(--ember-300); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.tool-btn {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  padding: 9px 6px;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  font-family: inherit;
  line-height: 1.3;
}
.tool-btn:hover { border-color: var(--ember-900); color: var(--ember-300); }
.tool-btn.is-active { background: var(--ember-500); border-color: var(--ember-500); color: var(--night-950); }
.tool-btn svg { width: 20px; height: 20px; margin: 0 auto 5px; display: block; }

.swatch-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 2px solid var(--border-deep);
  cursor: pointer;
  padding: 0;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.swatch:hover { transform: scale(1.07); }
.swatch.is-active { border-color: var(--inc-200); box-shadow: 0 0 12px rgba(255, 224, 192, .45); }

.studio-output { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.out-cell {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.out-cell .k { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-dim); }
.out-cell .v { font-family: var(--font-mono); font-size: .98rem; color: var(--inc-200); }

.studio-note { font-size: .78rem; color: var(--text-dim); margin-top: 12px; line-height: 1.6; }

.fallback-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.fallback-media {
  background: var(--night-900);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 20px;
  display: grid;
  place-items: center;
  min-height: 420px;
}
.fallback-media img { max-height: 380px; width: auto; }

/* Phase stepper for simulator */
.phase-track { display: flex; gap: 6px; flex-wrap: wrap; }
.phase {
  flex: 1 1 0;
  min-width: 82px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-deep);
  background: var(--night-800);
  padding: 8px 10px;
  font-size: .74rem;
  color: var(--text-dim);
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.phase.is-active { background: rgba(232, 100, 31, .16); border-color: var(--ember-700); color: var(--ember-300); }
.phase.is-done { color: var(--success); border-color: rgba(90, 168, 138, .4); }

.preset-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.curve-wrap {
  position: relative;
  background: var(--night-950);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 14px;
  min-height: 420px;
}
.curve-wrap canvas { width: 100%; height: 380px; display: block; touch-action: none; }
.curve-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .76rem; color: var(--text-dim); margin-top: 10px; }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-key i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

.stress-bead {
  display: grid;
  place-items: center;
  padding: 8px;
}
.stress-bead svg { width: 150px; height: 150px; }

/* --------------------------------------------------------------------------
   19. CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(120deg, var(--ember-500), var(--ember-700));
  border-radius: var(--r-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
  box-shadow: 0 0 60px rgba(232, 100, 31, .22);
}
.cta-band h2 { color: var(--night-950); margin: 0 0 .3em; }
.cta-band p { color: rgba(6, 12, 18, .82); margin: 0; max-width: 56ch; font-size: .95rem; }
.cta-band .btn { background: var(--night-950); color: var(--inc-100); border-color: var(--night-950); }
.cta-band .btn:hover { background: var(--night-800); color: var(--inc-100); box-shadow: 0 0 24px rgba(6, 12, 18, .5); }

/* --------------------------------------------------------------------------
   20. Content pages
   -------------------------------------------------------------------------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.info-card {
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  border-radius: var(--r-md);
  padding: 22px;
}
.info-card h3 { font-size: 1.02rem; margin-bottom: .5em; }
.info-card p { font-size: .88rem; color: var(--text-muted); margin: 0; }
.info-card .num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--ember-500);
  display: block;
  margin-bottom: 8px;
}
.prose-block { max-width: 72ch; }
.prose-block h2 { margin-top: 1.6em; }
.prose-block h2:first-child { margin-top: 0; }

/* --------------------------------------------------------------------------
   21. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--night-950);
  border-top: 1px solid var(--ember-900);
  margin-top: 0;
  padding-top: 46px;
  font-size: .88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding-bottom: 34px;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .55em; }
.footer-col a { color: var(--text-muted); font-size: .86rem; }
.footer-col a:hover { color: var(--ember-400); }
.footer-about p { color: var(--text-dim); font-size: .84rem; line-height: 1.65; margin: 14px 0; max-width: 38ch; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--night-800);
  border: 1px solid var(--border-deep);
  display: grid; place-items: center;
  color: var(--text-muted);
}
.footer-social a:hover { color: var(--ember-400); border-color: var(--ember-900); }
.footer-social svg { width: 16px; height: 16px; }

.newsletter { display: flex; gap: 8px; margin-top: 12px; }
.newsletter input { flex: 1 1 auto; font-size: .84rem; }
.newsletter .btn { flex: 0 0 auto; }

.footer-disclaimer {
  border-top: 1px solid var(--border-deep);
  padding: 26px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.disclaimer-block {
  background: var(--night-900);
  border: 1px solid var(--ember-900);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  gap: 14px;
}
.disclaimer-block svg { flex: 0 0 auto; width: 26px; height: 26px; color: var(--ember-500); }
.disclaimer-block h4 { font-size: .88rem; margin: 0 0 .4em; color: var(--ember-300); }
.disclaimer-block p { margin: 0; font-size: .82rem; color: var(--text-dim); line-height: 1.62; }
.disclaimer-block ul { margin: .5em 0 0; padding-left: 1.1em; font-size: .82rem; color: var(--text-dim); }

.footer-bottom {
  border-top: 1px solid var(--border-deep);
  padding: 20px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--text-dim);
}
.footer-bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--ember-400); }
.age-pill {
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px 12px;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   22. Search page
   -------------------------------------------------------------------------- */
.search-hero-form { display: flex; gap: 10px; margin: 22px 0 8px; }
.search-hero-form input { font-size: 1rem; padding: 13px 16px; }
.search-scope { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.search-result {
  border-bottom: 1px solid var(--border-deep);
  padding: 18px 0;
}
.search-result:last-child { border-bottom: 0; }
.search-result h3 { margin: 0 0 .3em; font-size: 1.05rem; }
.search-result h3 a { color: var(--text); }
.search-result h3 a:hover { color: var(--ember-400); }
.search-result p { font-size: .87rem; color: var(--text-muted); margin: 0 0 .5em; }
.search-result mark { background: rgba(232, 100, 31, .28); color: var(--inc-200); padding: 0 2px; border-radius: 2px; }

/* --------------------------------------------------------------------------
   23. Animations
   -------------------------------------------------------------------------- */
@keyframes emberPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(232, 100, 31, .28), 0 0 32px rgba(232, 100, 31, .1); }
  50% { box-shadow: 0 0 26px rgba(232, 100, 31, .48), 0 0 54px rgba(232, 100, 31, .2); }
}
.pulse-ember { animation: emberPulse 4s ease-in-out infinite; }

@keyframes glassPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(74, 168, 184, .22); }
  50% { box-shadow: 0 0 30px rgba(74, 168, 184, .42); }
}
.pulse-glass { animation: glassPulse 4.5s ease-in-out infinite; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.reveal { animation: fadeUp .5s ease both; }

/* --------------------------------------------------------------------------
   24. 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)); }
  .studio-stage, .fallback-wrap { grid-template-columns: minmax(0, 1fr); }
  .split-wide { grid-template-columns: 320px minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .search-input { width: 140px; }
  .search-input:focus { width: 180px; }
  .split-side { grid-template-columns: minmax(0, 1fr); }
  .side-sticky { position: static; }
}

@media (max-width: 900px) {
  .nav-toggle { display: grid; order: 3; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background: var(--night-950);
    border-bottom: 1px solid var(--ember-900);
    box-shadow: var(--sh-lg);
    padding: 10px 14px 18px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    z-index: 205;
  }
  .main-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-link { width: 100%; justify-content: space-between; padding: 11px 10px; font-size: .92rem; }
  .dropdown {
    position: static;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--ember-900);
    border-radius: 0;
    margin: 2px 0 8px 10px;
    min-width: 0;
    background: transparent;
  }
  .btn-studio .studio-label { display: none; }
  .btn-studio { padding: 7px 11px; }
  .header-inner { justify-content: space-between; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  ol.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-wide, .calc-layout, .split-even { grid-template-columns: minmax(0, 1fr); }
  .result-card { position: static; }
  .featured-post { grid-template-columns: minmax(0, 1fr); }
  .featured-post .fp-body { padding: 22px; }
  .footer-disclaimer { grid-template-columns: minmax(0, 1fr); }
  .thumb-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .hero { height: 460px; }
  .hero-arrow { display: none; }
  .section { padding: 44px 0; }
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: minmax(0, 1fr); }
  ol.steps { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .cta-band { padding: 28px 22px; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav .next { text-align: left; }
  .brand-tag { display: none; }
  .search-form { display: none; }
  .hero-content { max-width: 100%; }
  .hero h1, .hero .hero-title-lg { font-size: 1.95rem; }
  .studio-output { grid-template-columns: minmax(0, 1fr); }
  .canvas-wrap { min-height: 340px; }
  /* Keep the overlay on one row and drop the hint beneath it, so the two never
     collide on a narrow screen. */
  .canvas-overlay { left: 10px; right: 10px; top: 10px; gap: 6px; }
  .canvas-overlay .btn {
    white-space: nowrap;
    padding-left: 10px; padding-right: 10px;
    font-size: .72rem;
  }
  .canvas-hint { left: 10px; right: 10px; top: 52px; max-width: none; }
  .spec-table th { width: 46%; }
  .swatch-row { grid-template-columns: repeat(4, 1fr); }
  .result-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .thumb-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .header-actions { gap: 6px; }
}

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

@media print {
  .site-header, .site-footer, .to-top, .read-progress, .hero-dots, .hero-arrow { display: none; }
  body { background: #fff; color: #000; }
}
