/* ==========================================================================
   Escapement & Co. — design system
   Midnight black ground · brass gold primary · ruby accent
   1. tokens        6. header (dial-scale double rule)
   2. reset         7. home modules
   3. typography    8. cards & badges
   4. layout        9. notices
   5. buttons      10. footer
   ...
   ========================================================================== */

/* ------------------------------------------------------------ 1. tokens */
:root {
  /* midnight */
  --midnight-900: #06080C;
  --midnight-850: #0D0F14;
  --midnight-800: #141820;
  --midnight-750: #1C212C;
  --midnight-700: #252B38;
  --midnight-600: #333A48;
  --midnight-500: #454D5C;

  /* brass gold */
  --gold-700: #6B5210;
  --gold-600: #A88A20;
  --gold-500: #D4AF37;
  --gold-400: #E0C060;
  --gold-300: #EAD080;
  --gold-200: #F2E0B0;
  --gold-100: #F8F0D8;

  /* ruby */
  --ruby-700: #5C1A1A;
  --ruby-600: #8A2828;
  --ruby-500: #C94040;
  --ruby-400: #D86060;
  --ruby-300: #E89090;
  --ruby-200: #F5C0C0;
  --ruby-100: #FAE0E0;

  /* silver */
  --silver-700: #3A4050;
  --silver-600: #5C6478;
  --silver-500: #8B8FA3;
  --silver-400: #B0B4C4;
  --silver-300: #D0D4E0;
  --silver-200: #E8ECF2;
  --silver-100: #F5F7FA;

  /* movement blue */
  --blue-700: #1E3A5C;
  --blue-600: #2E5A88;
  --blue-500: #4A7AB0;
  --blue-400: #7AA0C8;
  --blue-300: #B0C8E0;

  --ok: #4A8A6A;

  /* semantic */
  --bg: var(--midnight-900);
  --bg-panel: var(--midnight-800);
  --bg-card: var(--midnight-800);
  --bg-raised: var(--midnight-750);
  --text: var(--silver-200);
  --text-2: var(--silver-400);
  --text-3: var(--silver-500);
  --border: var(--midnight-700);
  --border-strong: var(--midnight-600);
  --accent: var(--gold-500);

  /* radius */
  --r-sm: 2px;
  --r: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* shadow */
  --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-gold: 0 0 16px rgba(212, 175, 55, .3), 0 0 40px rgba(212, 175, 55, .12);
  --glow-ruby: 0 0 16px rgba(201, 64, 64, .3);

  /* transition */
  --t-fast: .14s ease;
  --t: .28s ease;
  --t-gear: .5s cubic-bezier(.4, 0, .2, 1);

  /* fonts */
  --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Menlo, monospace;

  /* header geometry — the dial-scale double rule */
  --h-top: 44px;
  --h-ruler: 40px;
  --h-ruler-min: 32px;
  --h-head: 92px;
}

/* ------------------------------------------------------------- 2. reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img, svg, video { max-width: 100%; }
img { display: block; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
li { margin: .3em 0; }
table { border-collapse: collapse; width: 100%; }
figure { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

a { color: var(--silver-300); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--gold-400); }

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(212, 175, 55, .35);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 400;
  background: var(--gold-500); color: var(--midnight-900);
  padding: 10px 18px; border-radius: var(--r-pill); font-weight: 700;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; color: var(--midnight-900); }

/* -------------------------------------------------------- 3. typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .005em;
  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 1em; }

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

.eyebrow {
  font-size: .72rem; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-500);
  margin: 0 0 .55em; display: block;
}

.lede { font-size: 1.06rem; color: var(--text-2); max-width: 62ch; }

.prose a { color: var(--silver-300); text-decoration: underline; text-decoration-color: var(--gold-700); text-underline-offset: 3px; }
.prose a:hover { color: var(--gold-400); }

/* ------------------------------------------------------------ 4. layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 22px; }
.container-narrow { max-width: 820px; }
.container-wide { max-width: 1360px; }

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

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

/* Geneva stripes — the signature ground texture of the main content. */
main {
  background-color: var(--midnight-850);
  background-image: repeating-linear-gradient(35deg,
    rgba(212, 175, 55, .04) 0 3px,
    rgba(212, 175, 55, 0) 3px 9px);
  min-height: 60vh;
}

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

.page-hero {
  position: relative;
  background: var(--midnight-850);
  border-bottom: 3px solid var(--gold-500);
  padding: 44px 0 38px;
  overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(35deg,
    rgba(212, 175, 55, .05) 0 3px, rgba(212, 175, 55, 0) 3px 10px);
}
.page-hero > .container { position: relative; }
.page-hero h1 { margin-bottom: .35em; max-width: 26ch; }

/* breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.crumbs, .crumbs a {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--silver-500);
}
.crumbs a:hover { color: var(--gold-400); }
.crumbs .sep { opacity: .5; }
.crumbs .here { color: var(--gold-500); }

/* ----------------------------------------------------------- 5. buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-pill);
  font-size: .9rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid transparent; background: transparent; color: var(--text);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--gold-500); color: var(--midnight-900); }
.btn-primary:hover { background: var(--gold-400); color: var(--midnight-900); box-shadow: var(--glow-gold); }

.btn-silver { background: var(--silver-300); color: var(--midnight-900); }
.btn-silver:hover { background: var(--silver-200); color: var(--midnight-900); }

.btn-outline { border-color: var(--gold-500); color: var(--gold-400); background: var(--midnight-850); }
.btn-outline:hover { background: rgba(212, 175, 55, .12); color: var(--gold-300); border-color: var(--gold-400); }

.btn-ghost { background: var(--midnight-750); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--midnight-700); color: var(--text); }

.btn-danger { background: var(--ruby-500); color: #fff; }
.btn-danger:hover { background: var(--ruby-400); color: #fff; }

.btn-sm { padding: 7px 14px; font-size: .78rem; }
.btn-lg { padding: 14px 28px; font-size: .96rem; }
.btn-block { display: flex; width: 100%; }

.btn-gear .ico { transition: transform var(--t-gear); }
.btn-gear:hover .ico { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .btn-gear .ico { transition: none; }
  .btn-gear:hover .ico { transform: none; }
}

.ico { width: 18px; height: 18px; flex: none; }
.ico-lg { width: 24px; height: 24px; }

/* --------------------------------------------------- 6. header / ruler */
.site-header {
  position: sticky; top: 0; z-index: 200;
  transition: box-shadow var(--t);
}
.site-header.is-stuck { box-shadow: var(--sh-md); }

.header-top {
  background: var(--midnight-900);
  border-bottom: 1px solid var(--gold-700);
  position: relative; z-index: 2;
}
.header-inner {
  height: var(--h-top);
  max-width: 1200px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--gold-500); display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--gold-700), var(--sh-sm);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  color: var(--silver-100); letter-spacing: .01em;
}
.brand-tag {
  font-size: .52rem; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-500);
}

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

.search-box { position: relative; display: flex; align-items: center; }
.search-box input {
  width: 220px; height: 36px; padding: 0 36px 0 34px;
  border-radius: var(--r-pill); border: 1px solid var(--border-strong);
  background: var(--midnight-800); color: var(--text);
  font-size: .84rem; transition: border-color var(--t-fast), background var(--t-fast), width var(--t-fast);
}
.search-box input::placeholder { color: var(--silver-600); }
.search-box input:focus { border-color: var(--gold-500); background: var(--midnight-750); outline: none; }
.search-box .search-icon {
  position: absolute; left: 11px; width: 16px; height: 16px;
  color: var(--silver-500); pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-width: 88vw;
  max-height: 60vh; overflow-y: auto;
  background: var(--midnight-800); border: 1px solid var(--border-strong);
  border-top: 2px solid var(--gold-500);
  border-radius: var(--r); box-shadow: var(--sh-lg);
  padding: 6px; display: none; z-index: 220;
}
.search-box.is-open .search-results { display: block; }
.search-results a {
  display: block; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: .88rem; color: var(--text);
}
.search-results a:hover, .search-results a.is-active { background: var(--midnight-750); color: var(--gold-300); }
.search-results .sr-kind {
  display: block; font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-600);
}
.search-results .sr-empty { padding: 12px; color: var(--silver-500); font-size: .86rem; }

.btn-studio {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--gold-500); color: var(--gold-400);
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn-studio .ico { width: 15px; height: 15px; }
.btn-studio:hover { background: rgba(212, 175, 55, .14); color: var(--gold-300); box-shadow: var(--glow-gold); }

.nav-toggle {
  display: none; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--midnight-800);
  align-items: center; justify-content: center; color: var(--text);
}

/* --- the dial ruler --- */
.header-ruler {
  position: relative; z-index: 1;
  background: var(--midnight-850);
  border-bottom: 1px solid var(--gold-700);
  overflow: visible;
}
/* fine graduation marks along the top edge, like a dial chapter ring */
.ruler-ticks {
  height: 9px; pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(212, 175, 55, .28) 0 1px, rgba(212, 175, 55, 0) 1px 4px),
    repeating-linear-gradient(90deg, rgba(212, 175, 55, .5) 0 2px, rgba(212, 175, 55, 0) 2px 20px);
  background-size: 100% 3px, 100% 8px;
  background-repeat: repeat-x;
  background-position: 0 0, 0 0;
}
.ruler-track {
  height: var(--h-ruler);
  max-width: 1200px; margin: 0 auto; padding: 0 14px;
  display: flex; align-items: center; gap: 2px;
  transition: height var(--t);
}
.ruler-item {
  position: relative; display: inline-flex; align-items: center;
  padding: 10px 18px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  font-size: .82rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--silver-400);
  transition: color var(--t-fast), background var(--t-fast);
}
.ruler-item:hover { background: rgba(212, 175, 55, .12); color: var(--gold-400); }
.ruler-item.is-active { color: var(--gold-500); }
.ruler-item.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--gold-500);
}
/* the pointer, hanging down from the graduation marks */
.ruler-item.is-active::before {
  content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid var(--gold-500);
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, .6));
}
.ruler-mobile-brand { display: none; }

/* dropdown under Tools */
.ruler-drop { position: relative; }
.dd-panel {
  position: absolute; top: 100%; left: 0; min-width: 300px;
  background: var(--midnight-800); border: 1px solid var(--border-strong);
  border-top: 2px solid var(--gold-500);
  border-radius: 0 0 var(--r) var(--r); box-shadow: var(--sh-lg);
  padding: 8px; display: none; z-index: 210;
}
.ruler-drop:hover > .dd-panel,
.ruler-drop:focus-within > .dd-panel,
.ruler-drop.is-open > .dd-panel { display: block; }
.dd-panel a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm); font-size: .88rem; color: var(--text);
}
.dd-panel a:hover { background: var(--midnight-750); color: var(--gold-300); }
.dd-ico {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--midnight-750); border: 1px solid var(--border);
  color: var(--gold-500);
}
.dd-ico .ico { width: 12px; height: 12px; }
.dd-desc {
  display: block; font-size: .74rem; color: var(--silver-500); font-weight: 400;
  letter-spacing: 0; text-transform: none;
}
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* shrunk state */
.site-header.is-compact .header-inner { height: 38px; }
.site-header.is-compact .brand-tag { display: none; }
.site-header.is-compact .brand-name { font-size: .95rem; }
.site-header.is-compact .ruler-track { height: var(--h-ruler-min); }
.site-header.is-compact .ruler-item { padding: 7px 16px; font-size: .78rem; }

/* --- mobile drawer --- */
.nav-drawer {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--midnight-900); border-bottom: 1px solid var(--gold-700);
  box-shadow: var(--sh-lg); display: none; z-index: 205;
  max-height: calc(100vh - var(--h-top)); overflow-y: auto;
}
.nav-drawer.is-open { display: block; }
.nd-perf {
  height: 7px;
  background-image: repeating-linear-gradient(90deg, rgba(212, 175, 55, .35) 0 1px, rgba(212, 175, 55, 0) 1px 6px);
}
.nd-section { padding: 10px 18px; border-bottom: 1px solid var(--border); }
.nd-section:last-child { border-bottom: 0; }
.nd-label {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-600); margin-bottom: 6px;
}
.nd-section a {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 8px 4px; font-size: .92rem; color: var(--text); border-radius: var(--r-sm);
}
.nd-section a:hover, .nd-section a.is-active { color: var(--gold-400); background: var(--midnight-800); }
.nd-section a .ico { width: 17px; height: 17px; color: var(--gold-600); flex: none; }

/* ------------------------------------------------------------ 7. home */
.hero {
  position: relative; height: 460px; overflow: hidden;
  background: var(--midnight-900);
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .7s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, #06080C 0%, rgba(13, 15, 20, .9) 46%, rgba(212, 175, 55, .15) 100%);
}
.hero-body {
  position: relative; z-index: 2; height: 100%;
  max-width: 1200px; margin: 0 auto; padding: 0 22px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 6px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--gold-600); background: rgba(212, 175, 55, .1);
  font-size: .7rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-300); margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.95rem, 4.2vw, 2.9rem);
  max-width: 20ch; margin-bottom: .3em; color: var(--silver-100);
}
.hero p { max-width: 54ch; color: var(--silver-400); font-size: 1.02rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-dots {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: 22px;
  display: flex; align-items: center; gap: 8px;
}
.hero-dot {
  width: 28px; height: 5px; border-radius: var(--r-pill); border: 0; padding: 0;
  background: var(--midnight-600); transition: width var(--t), background var(--t-fast);
}
.hero-dot.is-active { width: 44px; background: var(--gold-500); box-shadow: var(--glow-gold); }
.hero-arrow {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(6, 8, 12, .7); border: 1px solid var(--border-strong); color: var(--silver-300);
}
.hero-arrow:hover { color: var(--gold-400); border-color: var(--gold-600); }
.hero-arrow.prev { left: 18px; }
.hero-arrow.next { right: 18px; }

/* trust strip */
.trust { display: grid; gap: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-ico {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: rgba(212, 175, 55, .1); border: 1px solid var(--gold-700); color: var(--gold-500);
}
.trust-ico .ico { width: 17px; height: 17px; }
.trust-item h4 { margin: 0 0 2px; font-size: .98rem; }
.trust-item p { margin: 0; font-size: .84rem; color: var(--text-3); }

/* section head */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 0; color: var(--text-3); font-size: .92rem; max-width: 60ch; }

/* four-step process */
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
ol.steps li { position: relative; margin: 0; }
ol.steps .step-media {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: var(--midnight-800); border: 1px solid var(--border); aspect-ratio: 16 / 10;
}
ol.steps .step-media img { width: 100%; height: 100%; object-fit: cover; }
.step-num {
  position: absolute; left: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--midnight-900); color: var(--gold-500);
  border: 1px solid var(--gold-600); font-family: var(--font-mono); font-size: .82rem; font-weight: 700;
}
.step-label {
  position: absolute; left: 10px; bottom: 10px;
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-500); background: rgba(6, 8, 12, .78); padding: 3px 8px; border-radius: var(--r-sm);
}
ol.steps h3 { font-size: 1.1rem; margin: 12px 0 4px; }
ol.steps p { margin: 0; font-size: .88rem; color: var(--text-3); }

/* 3D studio preview band */
.studio-band {
  position: relative; overflow: hidden;
  background: var(--midnight-900);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.studio-band-inner { display: grid; gap: 30px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
.studio-stage {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-lg);
  background: var(--midnight-850); border: 1px solid var(--border-strong); overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .6);
}
.studio-stage canvas { display: block; width: 100% !important; height: 100% !important; }
.studio-stage .stage-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center;
}
.studio-stage .stage-fallback img { width: 100%; max-height: 100%; object-fit: contain; }
.studio-links { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 34px;
  background: var(--gold-500); color: var(--midnight-900);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .25;
  background-image: repeating-linear-gradient(35deg, rgba(0, 0, 0, .12) 0 3px, rgba(0, 0, 0, 0) 3px 9px);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: var(--midnight-900); margin: 0 0 4px; }
.cta-band p { margin: 0; color: rgba(6, 8, 12, .8); max-width: 52ch; }
.cta-band .btn { background: var(--midnight-900); color: var(--gold-300); }
.cta-band .btn:hover { background: var(--midnight-800); color: var(--gold-200); box-shadow: none; }

/* ----------------------------------------------------- 8. cards/badges */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--midnight-800); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-sm); overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t-fast);
  min-width: 0;
}
/* metal chamfer: 1px gold hairline top, 1px dark hairline bottom */
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0), rgba(212, 175, 55, .45), rgba(212, 175, 55, 0));
  pointer-events: none;
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: rgba(0, 0, 0, .5); pointer-events: none;
}
a.card { cursor: pointer; color: inherit; text-decoration: none; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--gold-600); }
a.card:hover .card-title { color: var(--gold-300); }
a.card:active { transform: translateY(-1px); }
a.card:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; }

.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--midnight-850); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
a.card:hover .card-media img { transform: scale(1.04); }
.card-media.is-contain { background: var(--midnight-850); }
.card-media.is-contain img { object-fit: contain; padding: 8px; }

.card-body { padding: 18px; flex: 1 1 auto; min-width: 0; }
.card-title { font-size: 1.06rem; font-weight: 600; margin: 0 0 6px; color: var(--text); transition: color var(--t-fast); }
.card-desc { margin: 0; font-size: .87rem; color: var(--text-3); }

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--border); font-size: .78rem;
}
.card-arrow { color: var(--gold-600); font-size: 1rem; transition: transform var(--t-fast), color var(--t-fast); }
a.card:hover .card-arrow { color: var(--gold-400); transform: translateX(3px); }

/* category card */
.cat-card { padding: 20px; }
.cat-ico {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--gold-300), var(--gold-600) 70%);
  color: var(--midnight-900); margin-bottom: 14px; flex: none;
  box-shadow: 0 0 0 1px var(--gold-700), var(--sh-sm);
}
.cat-ico .ico { width: 24px; height: 24px; }
.cat-count { font-family: var(--font-mono); font-size: .74rem; color: var(--gold-600); letter-spacing: .08em; }

/* studio card */
.studio-card { background: var(--midnight-900); border-color: var(--border-strong); }
.studio-card .card-media { background: var(--midnight-900); }
.badge-3d {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--gold-500); color: var(--midnight-900);
  font-family: var(--font-mono); font-size: .62rem; font-weight: 700; letter-spacing: .12em;
}
.badge-3d .ico { width: 11px; height: 11px; }
.studio-card:hover { border-color: var(--gold-600); box-shadow: var(--sh-lg), var(--glow-gold); }

/* blog card */
.blog-card .card-media { aspect-ratio: 16 / 9; }
.blog-meta {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--silver-500);
}

/* calc card with mini input preview */
.calc-card .mini-input {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-top: 12px;
  background: var(--midnight-850); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: .78rem; color: var(--text-2);
}
.calc-card .mini-input b { color: var(--gold-400); }

/* caliber card */
.caliber-card { padding: 18px; }
.cal-thumb {
  width: 68px; height: 68px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--midnight-850); border: 1px solid var(--border-strong); overflow: hidden;
  margin-bottom: 12px;
}
.cal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cal-rows { display: grid; gap: 4px; margin-top: 10px; }
.cal-row { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; border-bottom: 1px dotted var(--border); padding-bottom: 3px; }
.cal-row span { color: var(--text-3); }
.cal-row b { font-family: var(--font-mono); color: var(--gold-400); font-weight: 600; }

/* tags & chips */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--midnight-750); color: var(--silver-400); border: 1px solid var(--border);
  white-space: nowrap;
}
.tag-gold { background: rgba(212, 175, 55, .14); color: var(--gold-300); border-color: var(--gold-700); }
.tag-ruby { background: rgba(201, 64, 64, .16); color: var(--ruby-300); border-color: var(--ruby-700); }
.tag-blue { background: rgba(74, 122, 176, .16); color: var(--blue-300); border-color: var(--blue-700); }
.tag-ok { background: rgba(74, 138, 106, .16); color: #8FBF9F; border-color: #2E5A44; }
.tag-outline { background: transparent; border-color: var(--border-strong); color: var(--text-3); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-pill);
  font-size: .82rem; font-weight: 600; border: 1px solid var(--border-strong);
  background: var(--midnight-800); color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--gold-600); color: var(--gold-300); }
.chip.is-active { background: var(--gold-500); color: var(--midnight-900); border-color: var(--gold-500); }

.param-badge {
  display: inline-block; padding: 3px 8px; border-radius: var(--r-sm);
  background: var(--midnight-850); border: 1px solid var(--gold-700);
  font-family: var(--font-mono); font-size: .78rem; color: var(--gold-300);
}
.jewel-badge, .beat-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .04em;
}
.jewel-badge { background: rgba(201, 64, 64, .14); border: 1px solid var(--ruby-700); color: var(--ruby-300); }
.beat-badge { background: rgba(74, 122, 176, .14); border: 1px solid var(--blue-700); color: var(--blue-300); }

.stage-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: rgba(212, 175, 55, .12); border: 1px solid var(--gold-700);
  color: var(--gold-300); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.stage-pill .ico { width: 14px; height: 14px; }

/* -------------------------------------------------------- 9. notices */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--border);
  font-size: .88rem; margin: 0 0 18px;
}
.notice .ico { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.notice strong { display: block; margin-bottom: 2px; }
.notice-safety { background: #2E1414; border-color: var(--ruby-600); color: var(--ruby-300); }
.notice-safety .ico { color: var(--ruby-400); }
.notice-warn { background: #2E2410; border-color: var(--gold-700); color: var(--gold-200); }
.notice-warn .ico { color: var(--gold-500); }
.notice-info { background: #152530; border-color: var(--blue-600); color: var(--blue-300); }
.notice-info .ico { color: var(--blue-400); }
.notice-neutral { background: var(--midnight-800); color: var(--text-2); }

.tip-box {
  border-left: 4px solid var(--gold-500); background: rgba(212, 175, 55, .07);
  padding: 14px 16px; border-radius: 0 var(--r) var(--r) 0; margin: 0 0 18px; font-size: .9rem;
}
.tip-box.warn { border-left-color: var(--ruby-500); background: rgba(201, 64, 64, .08); }
.tip-box.note { border-left-color: var(--blue-500); background: rgba(74, 122, 176, .08); }
.tip-box.ok { border-left-color: var(--ok); background: rgba(74, 138, 106, .08); }
.tip-label {
  display: block; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold-500); margin-bottom: 3px;
}
.tip-box.warn .tip-label { color: var(--ruby-300); }
.tip-box.note .tip-label { color: var(--blue-300); }
.tip-box.ok .tip-label { color: #8FBF9F; }

.legal-note {
  border-left: 4px solid var(--gold-500); background: var(--midnight-850);
  padding: 14px 16px; border-radius: 0 var(--r) var(--r) 0;
  font-family: var(--font-mono); font-size: .84rem; color: var(--text-3); line-height: 1.6;
}

.empty-state {
  border: 1px dashed var(--border-strong); border-radius: var(--r);
  padding: 34px 20px; text-align: center; color: var(--text-3); background: var(--midnight-850);
}
.empty-state .ico { width: 30px; height: 30px; color: var(--gold-600); margin-bottom: 8px; }

.safety-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding: 10px 16px; border: 1px solid var(--ruby-600); border-radius: var(--r);
  background: #2E1414; color: var(--ruby-200); margin: 0 0 24px;
}
.safety-strip .ico { width: 17px; height: 17px; color: var(--ruby-300); flex: none; }
.safety-strip span { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }

.amplitude-indicator, .rate-indicator, .magnetism-warning {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em;
  border: 1px solid var(--border-strong); background: var(--midnight-800);
}
.amplitude-bar, .rate-bar {
  width: 74px; height: 6px; border-radius: var(--r-pill); overflow: hidden; background: var(--midnight-700);
}
.amplitude-bar i, .rate-bar i { display: block; height: 100%; border-radius: var(--r-pill); }
.magnetism-warning { border-color: var(--ruby-600); color: var(--ruby-200); background: #2E1414; }
.magnetism-warning .ico { width: 14px; height: 14px; }

.webgl-status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--border-strong); background: var(--midnight-800); color: var(--silver-500);
}
.webgl-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--silver-600); flex: none; }
.webgl-status.is-ready { color: #8FBF9F; border-color: #2E5A44; }
.webgl-status.is-ready .dot { background: var(--ok); box-shadow: 0 0 8px rgba(74, 138, 106, .8); }
.webgl-status.is-fallback { color: var(--gold-300); border-color: var(--gold-700); }
.webgl-status.is-fallback .dot { background: var(--gold-500); }
.webgl-status.is-error { color: var(--ruby-200); border-color: var(--ruby-600); }
.webgl-status.is-error .dot { background: var(--ruby-500); }

/* --------------------------------------------- 10. filters / paginate */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 24px;
  background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--sh-sm);
}
.filter-bar .fb-search { position: relative; flex: 1 1 220px; min-width: 0; }
.filter-bar input[type="search"], .filter-bar select, .form-field input, .form-field select, .form-field textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--midnight-850); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  color: var(--text); font-size: .88rem;
}
.filter-bar input[type="search"] { padding-left: 34px; }
.filter-bar .fb-search .ico { position: absolute; left: 11px; top: 12px; width: 15px; height: 15px; color: var(--silver-500); }
.filter-bar select { min-width: 150px; flex: 0 1 auto; width: auto; }
.filter-count { font-family: var(--font-mono); font-size: .78rem; color: var(--text-3); margin-left: auto; }
.filter-count b { color: var(--gold-400); }

.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 28px; }
.pagination button {
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: var(--r-sm);
  background: var(--midnight-800); border: 1px solid var(--border); color: var(--text-2);
  font-family: var(--font-mono); font-size: .84rem;
}
.pagination button:hover { border-color: var(--gold-600); color: var(--gold-300); }
.pagination button[aria-current="true"] { background: var(--gold-500); color: var(--midnight-900); border-color: var(--gold-500); font-weight: 700; }
.pagination button[disabled] { opacity: .4; cursor: default; }

.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

/* --------------------------------------------- 11. tool detail pieces */
.exhibit {
  background: var(--midnight-850); border: 1px solid var(--border-strong); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--sh-sm);
}
.exhibit-main { position: relative; aspect-ratio: 4 / 3; background: var(--midnight-900); }
.exhibit-main img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.exhibit-thumbs { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 10px; }
.exhibit-thumbs button {
  min-width: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--midnight-900); overflow: hidden; aspect-ratio: 4 / 3;
  transition: border-color var(--t-fast);
}
.exhibit-thumbs button:hover, .exhibit-thumbs button.is-active { border-color: var(--gold-500); }
.exhibit-thumbs img { width: 100%; height: 100%; object-fit: cover; max-width: 100%; }
.exhibit-3d { width: 100%; height: 100%; }

.spec-table { width: 100%; font-size: .86rem; }
.spec-table th, .spec-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.spec-table th { color: var(--text-3); font-weight: 500; width: 44%; }
.spec-table td { font-family: var(--font-mono); color: var(--gold-200); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.panel {
  background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; margin-bottom: 22px;
}
.panel > h3:first-child, .panel > h4:first-child { margin-top: 0; }
.panel-title {
  display: flex; align-items: center; gap: 9px; margin: 0 0 14px;
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text);
}
.panel-title .ico { color: var(--gold-500); }

.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: .9rem; border-bottom: 1px dotted var(--border); }
.feature-list li:last-child { border-bottom: 0; }
.feature-list .ico { width: 16px; height: 16px; color: var(--gold-500); flex: none; margin-top: 5px; }

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

.stage-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* -------------------------------------------------- 12. calculators */
.calc-form { display: grid; gap: 16px; }
.form-field label {
  display: block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}
.form-field .unit { color: var(--gold-600); }
.form-field textarea { height: 120px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.result-card {
  background: var(--midnight-850); border: 1px solid var(--gold-700); border-radius: var(--r);
  padding: 24px; box-shadow: var(--sh-md); position: sticky; top: calc(var(--h-head) + 20px);
}
.result-hero { text-align: center; padding: 6px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.result-label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-600); }
.result-big {
  font-family: var(--font-mono); font-size: clamp(2.4rem, 6vw, 3.2rem); font-weight: 700;
  color: var(--gold-400); line-height: 1.1; text-shadow: 0 0 24px rgba(212, 175, 55, .35);
}
.result-unit { font-family: var(--font-mono); font-size: .9rem; color: var(--text-3); }
.result-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.result-cell {
  background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px;
}
.result-cell span { display: block; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.result-cell b { font-family: var(--font-mono); font-size: 1.06rem; color: var(--gold-300); font-weight: 600; }
.gauge { height: 8px; border-radius: var(--r-pill); background: var(--midnight-700); overflow: hidden; margin-bottom: 6px; }
.gauge i { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); transition: width var(--t); }
.gauge-note { font-family: var(--font-mono); font-size: .7rem; color: var(--text-3); }
.calc-note { font-size: .84rem; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.calc-note ul { margin: 0; padding-left: 1.2em; }

/* ------------------------------------------------ 13. studio tool page */
.studio-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.studio-main { min-width: 0; }
.studio-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r);
}
.studio-toolbar .spacer { flex: 1 1 auto; }
.stage-wrap {
  position: relative; aspect-ratio: 16 / 10; min-height: 320px;
  background: var(--midnight-900); border: 1px solid var(--border-strong);
  border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 60px rgba(0, 0, 0, .55);
}
.stage-wrap canvas { display: block; width: 100% !important; height: 100% !important; }
.stage-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: var(--midnight-900); text-align: center;
}
.stage-overlay .spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--midnight-700); border-top-color: var(--gold-500);
  animation: ecspin 1s linear infinite; margin: 0 auto 12px;
}
@keyframes ecspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .stage-overlay .spinner { animation-duration: 3s; } }
.stage-overlay .so-progress { width: 220px; height: 4px; border-radius: var(--r-pill); background: var(--midnight-700); overflow: hidden; margin: 0 auto; }
.stage-overlay .so-progress i { display: block; height: 100%; background: var(--gold-500); width: 30%; }
.stage-overlay p { font-family: var(--font-mono); font-size: .78rem; color: var(--text-3); margin: 0 0 10px; }
.stage-error { max-width: 420px; }
.stage-error .ico { width: 34px; height: 34px; color: var(--ruby-400); margin-bottom: 8px; }
.fallback-2d { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; background: var(--midnight-900); }
.fallback-2d img { width: 100%; height: 100%; object-fit: contain; }

.studio-panel { background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.studio-panel h3 { font-size: 1.05rem; margin: 0 0 12px; }
.param-row { margin-bottom: 14px; }
.param-row label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}
.param-row label b { color: var(--gold-400); font-size: .84rem; text-transform: none; letter-spacing: 0; }
.param-row input[type="range"] { width: 100%; height: 24px; background: transparent; -webkit-appearance: none; appearance: none; }
.param-row input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: var(--r-pill); background: var(--midnight-700); }
.param-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; margin-top: -6px;
  background: var(--gold-500); border: 2px solid var(--midnight-900); box-shadow: var(--sh-sm);
}
.param-row input[type="range"]::-moz-range-track { height: 4px; border-radius: var(--r-pill); background: var(--midnight-700); }
.param-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: 2px solid var(--midnight-900); border-radius: 50%;
  background: var(--gold-500);
}
.param-row select { width: 100%; height: 38px; padding: 0 10px; background: var(--midnight-850); border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text); font-size: .86rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  flex: 1 1 auto; min-width: 62px; height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  background: var(--midnight-850); border: 1px solid var(--border-strong); color: var(--text-2);
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em;
}
.seg button.is-active { background: var(--gold-500); border-color: var(--gold-500); color: var(--midnight-900); font-weight: 700; }
.readout { display: grid; gap: 8px; }
.readout-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px dotted var(--border); font-size: .82rem; }
.readout-row span { color: var(--text-3); }
.readout-row b { font-family: var(--font-mono); color: var(--gold-300); }
.hint-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: .8rem; color: var(--text-3); }
.hint-list li { display: flex; gap: 8px; padding: 3px 0; }
.hint-list .ico { width: 14px; height: 14px; color: var(--gold-600); flex: none; margin-top: 4px; }

/* ------------------------------------------------ 14. caliber database */
.db-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--midnight-800); }
.db-table { min-width: 760px; font-size: .86rem; }
.db-table th {
  text-align: left; padding: 11px 12px; background: var(--midnight-850);
  border-bottom: 1px solid var(--border-strong); color: var(--text-3); font-weight: 600;
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.db-table th button { background: none; border: 0; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: 5px; padding: 0; }
.db-table th button:hover { color: var(--gold-400); }
.db-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.db-table tbody tr { cursor: pointer; transition: background var(--t-fast); }
.db-table tbody tr:hover { background: var(--midnight-750); }
.db-table tbody tr.is-open { background: var(--midnight-750); }
.db-detail td { background: var(--midnight-850); font-size: .82rem; color: var(--text-2); }
.sorts { display: inline-flex; align-items: center; gap: 4px; }
.compare-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compare-slot { border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 14px; min-height: 160px; background: var(--midnight-850); }

/* ------------------------------------------------------- 15. blog/post */
.featured-post {
  display: grid; gap: 0; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--midnight-800); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm);
}
.featured-post .fp-media { aspect-ratio: 16 / 11; overflow: hidden; background: var(--midnight-850); }
.featured-post .fp-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-post .fp-body { padding: 26px; display: flex; flex-direction: column; justify-content: center; }
.featured-post h2 { font-size: clamp(1.5rem, 2.4vw, 2.05rem); margin: 8px 0 10px; }
a.featured-post { color: inherit; text-decoration: none; transition: border-color var(--t-fast), box-shadow var(--t); }
a.featured-post:hover { border-color: var(--gold-600); box-shadow: var(--sh-lg); }
a.featured-post:hover h2 { color: var(--gold-300); }

.post-hero { position: relative; background: var(--midnight-850); border-bottom: 3px solid var(--gold-500); padding: 40px 0 34px; overflow: hidden; }
.post-hero::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(35deg, rgba(212, 175, 55, .05) 0 3px, rgba(212, 175, 55, 0) 3px 10px); }
.post-hero > .container { position: relative; }
.post-hero h1 { max-width: 28ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--silver-500); }

.post-body { font-size: 1.02rem; }
.post-body h2 { margin-top: 1.6em; }
.post-body h3 { margin-top: 1.3em; }
.post-body ul li, .post-body ol li { margin: .4em 0; }
.post-body table { margin: 0 0 1.4em; font-size: .88rem; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.post-body th, .post-body td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.post-body th { background: var(--midnight-800); color: var(--gold-300); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.post-body blockquote {
  margin: 1.4em 0; padding: 14px 20px; border-left: 3px solid var(--gold-500);
  background: rgba(212, 175, 55, .06); border-radius: 0 var(--r) var(--r) 0;
  font-family: var(--font-display); font-size: 1.16rem; color: var(--gold-100);
}
.post-figure { margin: 0 0 1.6em; }
.post-figure img { width: 100%; border-radius: var(--r); border: 1px solid var(--border); background: var(--midnight-850); }
.post-figure figcaption { font-family: var(--font-mono); font-size: .74rem; color: var(--text-3); padding: 8px 2px 0; }

.step-block { display: flex; gap: 16px; margin: 0 0 1.4em; }
.sb-num {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--midnight-800); border: 1px solid var(--gold-600); color: var(--gold-500);
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
}
.sb-body { min-width: 0; }
.sb-body h3 { margin: 0 0 4px; font-size: 1.14rem; }

.toc { position: sticky; top: calc(var(--h-head) + 20px); background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; margin-bottom: 20px; }
.toc h4 { margin: 0 0 10px; font-size: .74rem; font-family: var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-600); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a { display: block; padding: 5px 0 5px 22px; position: relative; font-size: .84rem; color: var(--text-2); border-bottom: 1px dotted var(--border); }
.toc a::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 0; font-family: var(--font-mono); font-size: .7rem; color: var(--gold-700); }
.toc a:hover { color: var(--gold-300); }
.toc li:last-child a { border-bottom: 0; }

.author-box { display: flex; gap: 14px; align-items: center; background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; margin: 24px 0; }
.author-av {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--gold-500); color: var(--midnight-900); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
}
.author-box h4 { margin: 0; font-size: 1rem; }
.author-box p { margin: 0; font-size: .82rem; color: var(--text-3); }

.post-nav { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 34px; }
.post-nav a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--midnight-800); }
.post-nav a:hover { border-color: var(--gold-600); }
.post-nav .pn-dir { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-600); }
.post-nav .pn-title { font-family: var(--font-display); font-size: 1rem; color: var(--text); }

.read-progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: var(--gold-500); z-index: 300; box-shadow: 0 0 10px rgba(212, 175, 55, .7); }
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 260;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-500); color: var(--midnight-900); border: 0; box-shadow: var(--sh-md);
  opacity: 0; pointer-events: none; transition: opacity var(--t-fast);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------------------------------------------------------- 16. forms */
.form-card { background: var(--midnight-800); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; }
.form-card .form-field { margin-bottom: 16px; }
.field-error { display: block; color: var(--ruby-300); font-size: .78rem; margin-top: 5px; min-height: 1em; }
.form-ok { display: none; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: rgba(74, 138, 106, .14); border: 1px solid #2E5A44; color: #8FBF9F; font-size: .86rem; }
.form-ok.is-visible { display: block; }

.info-grid { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prose-block h3 { margin-top: 1.4em; }
.prose-block h3:first-child { margin-top: 0; }

/* --------------------------------------------------------- 17. footer */
.site-footer { background: var(--midnight-900); border-top: 1px solid var(--gold-700); padding: 44px 0 0; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; }
.footer-grid h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-600); margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 0 0 7px; }
.footer-grid a { font-size: .88rem; color: var(--text-2); }
.footer-grid a:hover { color: var(--gold-400); }
.footer-brand p { font-size: .84rem; color: var(--text-3); max-width: 42ch; }
.footer-social { display: flex; gap: 8px; margin: 14px 0; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-strong); color: var(--text-2);
}
.footer-social a:hover { border-color: var(--gold-600); color: var(--gold-400); }
.footer-version { font-family: var(--font-mono); font-size: .68rem; color: var(--silver-600); letter-spacing: .1em; }
.subscribe { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.subscribe input { flex: 1 1 140px; min-width: 0; height: 40px; padding: 0 12px; background: var(--midnight-850); border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text); font-size: .86rem; }
.subscribe button { flex: none; }

.disclaimer { border: 1px solid var(--gold-700); border-radius: var(--r); padding: 18px; margin: 34px 0 24px; background: rgba(212, 175, 55, .05); }
.disclaimer h4 { display: flex; align-items: center; gap: 8px; color: var(--gold-300); margin: 0 0 8px; font-family: var(--font-display); font-size: 1.02rem; }
.disclaimer h4 .ico { color: var(--gold-500); }
.disclaimer p { font-size: .82rem; color: var(--text-3); margin: 0 0 8px; }
.disclaimer p:last-child { margin-bottom: 0; }

.footer-bottom {
  border-top: 1px solid var(--border); padding: 16px 0 24px;
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
  font-size: .8rem; color: var(--text-3);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-bottom a { color: var(--text-3); }
.footer-bottom a:hover { color: var(--gold-400); }
.magnetism-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--gold-700); color: var(--gold-400);
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
}

/* ---------------------------------------------------- 18. breakpoints */
@media (max-width: 1080px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  ol.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1000px) {
  .search-box input { width: 150px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .ruler-track { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; }
  .split-wide { grid-template-columns: minmax(0, 1fr); }
  .split-side { grid-template-columns: minmax(0, 1fr); }
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .studio-band-inner { grid-template-columns: minmax(0, 1fr); }
  .featured-post { grid-template-columns: minmax(0, 1fr); }
  .result-card { position: static; }
  .toc { position: static; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-auto { grid-template-columns: minmax(0, 1fr); }
  .trust, ol.steps { grid-template-columns: minmax(0, 1fr); }
  .compare-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { height: 460px; }
  .hero-arrow { display: none; }
  .section { padding: 42px 0; }
  .split-wide, .split-side, .calc-layout { gap: 24px; }
  .exhibit-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .search-box input { width: 130px; }
  .btn-studio span { display: none; }
  .btn-studio { padding: 0 11px; }
  .step-block { gap: 12px; }
  .sb-num { width: 42px; height: 42px; font-size: .95rem; }
  .cta-band { padding: 24px; }
  /* 3D tools degrade to the 2D fallback by default on small screens */
  .stage-wrap { aspect-ratio: 4 / 3; min-height: 260px; }
}

/* ------------------------------------------------- 19. reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hero-slide { transition: none; }
}
