/* ==========================================================================
   Knot & Rigging — Maritime Toolkit
   Deep navy ground · rope-tan primary · brass accent · nautical chart texture
   ========================================================================== */

/* ------------------------------------------------------------- tokens */
:root {
  /* core three */
  --navy-900: #0A1A2A;
  --rope-500: #C4A57A;
  --brass-500: #B8935A;

  /* navy ramp */
  --navy-1000: #050D16;
  --navy-800: #0F2438;
  --navy-700: #152F48;
  --navy-600: #1E3D5C;
  --navy-500: #2A4F72;
  --navy-400: #3A6488;

  /* rope ramp */
  --rope-900: #5C4A30;
  --rope-800: #8A7050;
  --rope-700: #B08E68;
  --rope-400: #D4B896;
  --rope-300: #E4CEB0;
  --rope-200: #F0E0C8;

  /* brass ramp */
  --brass-900: #6B5020;
  --brass-800: #8A6A2A;
  --brass-400: #D0AC70;
  --brass-300: #E0C490;
  --brass-200: #F0DCB8;

  /* sea-green ramp */
  --sea-900: #1E4A42;
  --sea-800: #2E6A5E;
  --sea-700: #4A8A7A;
  --sea-500: #6EA898;
  --sea-300: #A0C8BC;
  --sea-100: #D0E4DC;

  /* signal red ramp */
  --red-900: #5C1E18;
  --red-800: #8B3A2E;
  --red-700: #C44A3A;
  --red-600: #D86858;
  --red-300: #E8A090;
  --red-100: #F5D0C8;

  /* neutrals */
  --ink: #F0E8D8;
  --ink-2: #C4B090;
  --ink-3: #8A7860;
  --line: #1E3D5C;
  --line-2: #2A4F72;

  /* semantic */
  --ok: #4A8A7A;
  --warn: #D0AC70;
  --danger: #C44A3A;
  --info: #3A6488;

  /* surfaces */
  --surface: #0A1A2A;
  --surface-2: #0F2438;
  --surface-3: #152F48;
  --surface-deep: #050D16;

  /* texture */
  --chart-fine: rgba(196, 165, 122, .06);
  --chart-coarse: rgba(196, 165, 122, .1);
  --rope-weave: rgba(196, 165, 122, .08);

  /* radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* shadows */
  --sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --sh-sm: 0 2px 8px rgba(0, 0, 0, .4);
  --sh-md: 0 8px 22px rgba(0, 0, 0, .45);
  --sh-lg: 0 18px 48px rgba(0, 0, 0, .55);
  --glow-rope: 0 0 18px rgba(196, 165, 122, .25);
  --glow-brass: 0 0 18px rgba(184, 147, 90, .3);

  /* motion */
  --t-fast: .16s ease;
  --t-mid: .3s ease;
  --t-knot: .45s cubic-bezier(.34, 1.2, .64, 1);

  /* type */
  --font-display: "Alegreya", "Crimson Text", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Menlo, monospace;

  --container: 1200px;
  --container-narrow: 820px;
  --container-wide: 1360px;
  --gutter: 22px;
  --header-h: 96px;
}

/* -------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--navy-900);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--rope-400); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brass-300); }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 7px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible {
  outline: 3px solid var(--brass-500);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(184, 147, 90, .35);
  border-radius: var(--r-xs);
}
::selection { background: rgba(196, 165, 122, .3); color: #fff; }

/* -------------------------------------------------------- typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.005em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.18rem, 2vw, 1.4rem); }
h4 { font-size: 1.08rem; }
h5 { font-size: 1rem; }
p { margin: 0 0 18px; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 68ch; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass-500);
  margin: 0 0 10px;
}
.eyebrow::before { content: "\221E"; font-size: 1rem; line-height: 1; }
.section-head { margin-bottom: 26px; }
.section-head h2 { margin-bottom: 6px; }
.section-head p { color: var(--ink-2); margin: 0; max-width: 70ch; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: .86rem; }
.center { text-align: center; }
.prose a { color: var(--brass-300); text-decoration: underline; text-decoration-color: var(--brass-900); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brass-500); }

/* ----------------------------------------------------------- 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); }
main { padding-top: var(--header-h); }
section { margin-bottom: 60px; }
.section-sm { margin-bottom: 38px; }
.section-tight { margin-bottom: 60px; margin-top: 42px; }

.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.split { display: grid; gap: 34px; grid-template-columns: 1fr 1fr; }
.split-wide { display: grid; gap: 34px; grid-template-columns: 380px 1fr; align-items: start; }
.split-side { display: grid; gap: 40px; grid-template-columns: 1fr 310px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 500;
  background: var(--brass-500); color: var(--navy-1000); font-weight: 700;
  padding: 10px 18px; border-radius: var(--r-pill); transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; }

/* chart-grid texture on content surfaces */
.chart-bg {
  background-color: var(--navy-900);
  background-image:
    repeating-linear-gradient(0deg, var(--chart-fine) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(90deg, var(--chart-fine) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(0deg, var(--chart-coarse) 0 1px, transparent 1px 100px),
    repeating-linear-gradient(90deg, var(--chart-coarse) 0 1px, transparent 1px 100px);
}

/* =====================================================================
   HEADER — nautical chart tab navigation (site-wide signature)
   ===================================================================== */
.edge-bar {
  position: sticky; top: 0; z-index: 200;
  height: 40px;
  background: var(--navy-1000);
  border-bottom: 1px solid var(--brass-900);
  background-image:
    repeating-linear-gradient(0deg, rgba(196,165,122,.05) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(90deg, rgba(196,165,122,.05) 0 1px, transparent 1px 20px);
  transition: height var(--t-mid);
}
.edge-inner {
  max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--gutter);
  height: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: nowrap;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: var(--rope-500); color: var(--navy-1000);
  display: grid; place-items: center;
}
.brand-mark svg { width: 18px; height: 18px; stroke: currentColor; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--rope-200); white-space: nowrap; transition: font-size var(--t-mid);
}
.brand-tag {
  font-size: .55rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: var(--brass-500);
}
.edge-right { display: flex; align-items: center; gap: 10px; flex: none; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: var(--navy-800); color: var(--rope-400);
  display: grid; place-items: center; cursor: pointer; transition: all var(--t-fast);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--navy-700); color: var(--brass-300); border-color: var(--brass-900); }
.pill-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--brass-500); color: var(--brass-300);
  font-size: .78rem; font-weight: 700; white-space: nowrap; transition: all var(--t-fast);
}
.pill-link svg { width: 15px; height: 15px; }
.pill-link:hover { background: var(--brass-500); color: var(--navy-1000); border-color: var(--brass-500); }
.burger {
  width: 38px; height: 38px; flex: none; display: none; place-items: center;
  border: 1px solid var(--line); background: var(--navy-800); color: var(--rope-400);
  border-radius: var(--r-sm); cursor: pointer;
}
.burger svg { width: 20px; height: 20px; }

/* tab strip */
.tab-strip {
  position: sticky; top: 40px; z-index: 190;
  background: var(--navy-900);
  border-bottom: 1px solid var(--brass-900);
  transition: height var(--t-mid);
}
.tab-scroll {
  max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: flex-end; gap: 3px;
  overflow-x: auto; scrollbar-width: none; position: relative;
  height: 40px;
}
.tab-scroll::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 20px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--navy-800); color: var(--ink-2);
  font-size: .84rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line); border-bottom: 1px solid var(--brass-900);
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
}
.tab svg { width: 16px; height: 16px; flex: none; }
.tab:hover { background: var(--navy-700); color: var(--rope-400); }
.tab.is-active {
  background: var(--navy-900);
  color: var(--ink);
  border: 1px solid var(--brass-900);
  border-top: 2px solid var(--brass-500);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  z-index: 2;
  box-shadow: var(--glow-rope);
}
.tab.is-active svg { color: var(--brass-400); }
.tab-fade {
  position: absolute; right: 0; top: 0; bottom: 0; width: 40px;
  background: linear-gradient(90deg, transparent, var(--navy-900));
  pointer-events: none; opacity: 0; transition: opacity var(--t-fast);
}
.tab-fade.on { opacity: 1; }

/* dropdown */
.tab-dd-wrap { position: relative; flex: none; }
.tab-dd {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 210;
  min-width: 330px; padding: 12px;
  background: var(--navy-1000); border: 1px solid var(--line-2);
  border-radius: var(--r-md); box-shadow: var(--sh-lg);
  display: none;
}
.tab-dd.open { display: block; }
.tab-dd-group { margin-bottom: 8px; }
.tab-dd-group:last-child { margin-bottom: 0; }
.tab-dd-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brass-500);
  padding: 6px 10px 4px;
}
.dd-item {
  display: block; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink); font-size: .88rem; transition: background var(--t-fast);
}
.dd-item:hover { background: var(--navy-800); color: var(--brass-300); }
.dd-desc { display: block; font-size: .74rem; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }
.dd-all {
  display: block; margin-top: 8px; padding: 9px 10px;
  border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm);
  color: var(--brass-300); font-weight: 700; font-size: .85rem;
}
.dd-all:hover { color: var(--brass-200); }

/* condensed on scroll */
body.scrolled .edge-bar { height: 36px; }
body.scrolled .brand-name { font-size: .95rem; }
body.scrolled .tab-strip { top: 36px; }
body.scrolled .tab-scroll { height: 36px; }
body.scrolled .tab { height: 36px; padding: 0 16px; }

/* mobile drawer */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(3, 8, 14, .72);
  z-index: 300; opacity: 0; pointer-events: none; transition: opacity var(--t-mid);
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw);
  z-index: 310; background: var(--navy-1000); border-left: 1px solid var(--line-2);
  padding: 20px 18px 40px; overflow-y: auto;
  transform: translateX(100%); transition: transform var(--t-mid);
  box-shadow: var(--sh-lg);
}
.drawer.open { transform: none; }
.drawer-close {
  width: 38px; height: 38px; margin-left: auto; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--navy-800); color: var(--rope-400);
  border-radius: var(--r-sm); cursor: pointer; margin-bottom: 14px;
}
.drawer-close svg { width: 20px; height: 20px; }
.dw-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brass-500); margin: 18px 0 8px;
}
.dw-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--navy-800); color: var(--ink-2); font-size: .9rem; font-weight: 600;
  margin-bottom: 3px; border: 1px solid var(--line);
  transition: all var(--t-fast);
}
.dw-link svg { width: 17px; height: 17px; flex: none; }
.dw-link:hover { background: var(--navy-700); color: var(--rope-400); }
.dw-link.is-active { background: var(--navy-900); color: var(--ink); border-top: 2px solid var(--brass-500); }

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-pill);
  font-size: .93rem; font-weight: 700; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: all var(--t-fast); text-align: center;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--rope-500); color: var(--navy-1000); }
.btn-primary:hover { background: var(--brass-400); color: var(--navy-1000); box-shadow: var(--glow-brass); }
.btn-brass { background: var(--brass-500); color: var(--navy-1000); }
.btn-brass:hover { background: var(--brass-400); box-shadow: var(--glow-brass); }
.btn-outline { background: var(--navy-800); color: var(--rope-400); border-color: var(--rope-800); }
.btn-outline:hover { border-color: var(--brass-500); color: var(--brass-300); background: var(--navy-700); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--navy-800); color: var(--ink); }
.btn-danger { background: var(--red-800); color: var(--red-100); border-color: var(--red-700); }
.btn-danger:hover { background: var(--red-700); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .84rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-knot .knot-ico { transition: transform var(--t-knot); }
.btn-knot:hover .knot-ico { transform: scale(.86) rotate(-8deg); }

/* =====================================================================
   CARDS — whole-card clickable (design §0.1)
   ===================================================================== */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  transition: transform var(--t-mid), box-shadow var(--t-mid), border-color var(--t-mid);
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg), var(--glow-rope);
  border-color: var(--rope-800);
  color: inherit;
}
.card:active { transform: translateY(-1px); }
.card-media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--navy-1000); border-bottom: 1px solid var(--line);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-mid); }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px; flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; }
.card-title { font-family: var(--font-display); font-size: 1.06rem; font-weight: 700; margin: 0; line-height: 1.3; }
.card-desc { margin: 0; font-size: .88rem; color: var(--ink-2); line-height: 1.6; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line);
  background: rgba(5, 13, 22, .4);
}
.card-arrow { color: var(--brass-500); font-size: 1rem; transition: transform var(--t-mid); }
.card:hover .card-arrow { transform: translateX(4px); }

/* category card */
.cat-card .cat-ico {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--navy-700); border: 1px solid var(--rope-800); color: var(--rope-500);
  display: grid; place-items: center; margin-bottom: 4px;
}
.cat-card .cat-ico svg { width: 24px; height: 24px; }
.cat-count { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-3); }

/* tool card */
.tool-card .card-media { background: var(--navy-1000); }
.tool-card .card-media img { object-fit: contain; padding: 6px; }

/* knot card */
.knot-card .knot-thumb {
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  background: var(--navy-1000); border: 1px solid var(--rope-800);
  display: grid; place-items: center; overflow: hidden; margin-bottom: 6px;
}
.knot-card .knot-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* calculator card */
.calc-card .calc-mini {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--navy-1000); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .78rem; color: var(--ink-3);
  margin-bottom: 10px;
}
.calc-card .calc-mini b { color: var(--brass-300); font-size: .92rem; }

/* studio card */
.studio-card {
  background: var(--navy-1000); border-color: var(--brass-900);
  box-shadow: var(--sh-md), 0 0 0 1px rgba(184,147,90,.12);
}
.studio-card:hover { box-shadow: var(--sh-lg), var(--glow-brass); border-color: var(--brass-500); }
.studio-card .card-media { aspect-ratio: 16 / 9; }
.badge-3d {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--brass-500); color: var(--navy-1000);
  font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.badge-3d svg { width: 12px; height: 12px; }

/* blog card */
.blog-card .card-media { aspect-ratio: 16 / 9; }
.blog-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: .74rem; color: var(--ink-3); font-family: var(--font-mono);
}

/* =====================================================================
   TAGS · CHIPS · BADGES
   ===================================================================== */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  background: var(--navy-700); color: var(--rope-400); border: 1px solid var(--line-2);
  white-space: nowrap;
}
.tag-brass { background: rgba(184,147,90,.16); color: var(--brass-300); border-color: var(--brass-900); }
.tag-sea { background: rgba(74,138,122,.16); color: var(--sea-300); border-color: var(--sea-900); }
.tag-red { background: rgba(196,74,58,.16); color: var(--red-300); border-color: var(--red-900); }
.tag-outline { background: transparent; color: var(--ink-2); border-color: var(--line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--navy-800); color: var(--ink-2); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 600; cursor: pointer; transition: all var(--t-fast);
}
.chip:hover { border-color: var(--rope-800); color: var(--rope-400); }
.chip.is-active { background: var(--rope-500); color: var(--navy-1000); border-color: var(--rope-500); font-weight: 700; }

.param-badge {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--font-mono); font-size: .78rem;
  padding: 4px 10px; border-radius: var(--r-xs);
  background: var(--navy-1000); border: 1px solid var(--rope-800); color: var(--rope-400);
}
.param-badge b { color: var(--brass-300); }

.stage-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--navy-700); border: 1px solid var(--line-2); color: var(--rope-400);
}

.strength-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-pill);
}
.s-100 { background: rgba(74,138,122,.2); color: var(--sea-300); border: 1px solid var(--sea-900); }
.s-75 { background: rgba(110,168,152,.18); color: var(--sea-500); border: 1px solid var(--sea-800); }
.s-60 { background: rgba(208,172,112,.18); color: var(--brass-300); border: 1px solid var(--brass-900); }
.s-45 { background: rgba(196,74,58,.18); color: var(--red-300); border: 1px solid var(--red-900); }

.rope-badge {
  font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-xs); letter-spacing: .04em;
}
.rb-nylon { background: rgba(58,100,136,.22); color: #A8C4D9; border: 1px solid var(--navy-400); }
.rb-poly { background: rgba(74,138,122,.22); color: var(--sea-300); border: 1px solid var(--sea-800); }
.rb-manila { background: rgba(138,112,80,.24); color: var(--rope-300); border: 1px solid var(--rope-800); }
.rb-hmpe { background: rgba(184,147,90,.2); color: var(--brass-300); border: 1px solid var(--brass-900); }

/* =====================================================================
   PAGE HERO
   ===================================================================== */
.page-hero {
  position: relative; padding: 40px 0 34px;
  background: var(--navy-900);
  border-bottom: 3px solid var(--rope-500);
  background-image:
    repeating-linear-gradient(0deg, var(--chart-fine) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(90deg, var(--chart-fine) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(0deg, var(--chart-coarse) 0 1px, transparent 1px 100px),
    repeating-linear-gradient(90deg, var(--chart-coarse) 0 1px, transparent 1px 100px);
}
.page-hero h1 { margin-bottom: 10px; max-width: 26ch; }
.page-hero .lead { margin-bottom: 0; }

.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px;
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brass-300); }
.crumbs .sep { color: var(--rope-900); }
.crumbs .here { color: var(--rope-400); }

/* =====================================================================
   HERO CAROUSEL (home)
   ===================================================================== */
.hero {
  position: relative; height: 480px; overflow: hidden;
  background: var(--navy-1000); border-bottom: 3px solid var(--rope-500);
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease;
  background-size: cover; background-position: center;
}
.hero-slide.on { opacity: 1; }
.hero-slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, #050D16 0%, rgba(10,26,42,.88) 46%, rgba(196,165,122,.18) 100%);
}
.hero-inner {
  position: relative; z-index: 3; height: 100%;
  max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; flex-direction: column; justify-content: center;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 5px 15px; border-radius: var(--r-pill);
  background: rgba(196,165,122,.14); border: 1px solid var(--rope-800);
  color: var(--rope-300); font-size: .72rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(1.95rem, 4.2vw, 2.9rem); max-width: 20ch; margin-bottom: 14px; }
.hero p { max-width: 56ch; color: var(--ink-2); font-size: 1.04rem; margin-bottom: 26px; }
.hero-dots {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 4; display: flex; gap: 10px;
}
.hero-dot {
  width: 28px; height: 5px; border-radius: var(--r-pill); border: 0; padding: 0;
  background: var(--rope-900); cursor: pointer; transition: all var(--t-mid);
}
.hero-dot.on { width: 44px; background: var(--rope-500); box-shadow: var(--glow-rope); }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(5,13,22,.7); color: var(--rope-400);
  display: grid; place-items: center; cursor: pointer; transition: all var(--t-fast);
}
.hero-arrow:hover { background: var(--rope-500); color: var(--navy-1000); border-color: var(--rope-500); }
.hero-arrow svg { width: 18px; height: 18px; }
.hero-arrow.prev { left: 18px; }
.hero-arrow.next { right: 18px; }

/* =====================================================================
   TRUST STRIP · STEPS · CTA
   ===================================================================== */
.trust-strip { background: var(--navy-1000); border-block: 1px solid var(--line); padding: 30px 0; }
.trust-item { display: flex; gap: 12px; align-items: flex-start; }
.trust-ico {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--navy-800); border: 1px solid var(--brass-900); color: var(--brass-400);
  display: grid; place-items: center;
}
.trust-ico svg { width: 19px; height: 19px; }
.trust-item h3 { font-family: var(--font-body); font-size: .95rem; font-weight: 700; margin: 0 0 3px; }
.trust-item p { margin: 0; font-size: .84rem; color: var(--ink-2); line-height: 1.6; }

ol.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gutter); }
ol.steps > li { position: relative; margin: 0; }
.step-media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--navy-1000);
}
.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(--rope-500); color: var(--navy-1000);
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: .88rem;
  z-index: 2;
}
.step-label {
  display: inline-block; margin: 14px 0 6px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .16em; color: var(--brass-500);
}
.step-body h3 { font-size: 1.12rem; margin-bottom: 6px; }
.step-body p { font-size: .88rem; color: var(--ink-2); margin: 0; }

.cta-band {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--rope-500), var(--brass-500) 60%, var(--rope-700));
  border-radius: var(--r-lg); padding: 44px 40px; color: var(--navy-1000);
  border: 1px dashed rgba(10,26,42,.32);
}
.cta-band h2 { color: var(--navy-1000); margin-bottom: 8px; }
.cta-band p { color: rgba(5,13,22,.8); max-width: 60ch; margin-bottom: 22px; }
.cta-band .btn-primary { background: var(--navy-1000); color: var(--rope-200); }
.cta-band .btn-primary:hover { background: var(--navy-900); color: var(--brass-300); }
.cta-band .btn-outline { background: transparent; color: var(--navy-1000); border-color: rgba(5,13,22,.4); }
.cta-band .btn-outline:hover { background: rgba(5,13,22,.12); color: var(--navy-1000); }

/* =====================================================================
   TOOL DETAIL
   ===================================================================== */
.exhibit {
  border: 1px dashed rgba(196,165,122,.24);
  border-radius: var(--r-md); padding: 14px; background: var(--navy-1000);
}
.exhibit-main {
  aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden;
  background: var(--navy-1000); border: 1px solid var(--line);
}
.exhibit-main img { width: 100%; height: 100%; object-fit: contain; }
.thumb-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.thumb {
  aspect-ratio: 4 / 3; border-radius: var(--r-xs); overflow: hidden;
  border: 1px solid var(--line); background: var(--navy-1000); cursor: pointer;
  padding: 0; transition: border-color var(--t-fast);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover, .thumb.on { border-color: var(--brass-500); }

.spec-table { width: 100%; font-size: .85rem; }
.spec-table th, .spec-table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table th {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  width: 42%; background: rgba(5,13,22,.4);
}
.spec-table td { font-family: var(--font-mono); color: var(--rope-400); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-wrap {
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-2); margin-bottom: 18px;
}
.spec-wrap h3 {
  font-family: var(--font-body); font-size: .8rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brass-500);
  margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: rgba(5,13,22,.5);
}

.legal-note {
  background: var(--navy-800); border-left: 4px solid var(--rope-500);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 18px; font-family: var(--font-mono);
  font-size: .84rem; color: var(--ink-2); line-height: 1.7;
}

/* =====================================================================
   FILTER BAR · PAGINATION · EMPTY
   ===================================================================== */
.filter-bar {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr auto auto; gap: 10px;
  align-items: center; padding: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); margin-bottom: 26px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--r-xs);
  background: var(--navy-1000); border: 1px solid var(--line);
  color: var(--ink); font-size: .9rem; transition: border-color var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brass-500); outline: none; }
.input::placeholder { color: var(--ink-3); }
.select { appearance: none; padding-right: 32px; background-image: none; cursor: pointer; }
.select option { background: var(--navy-1000); color: var(--ink); }
.result-count {
  font-family: var(--font-mono); font-size: .78rem; color: var(--ink-3);
  white-space: nowrap; text-align: center;
}

.pagination { display: flex; gap: 7px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.pagination button {
  min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: var(--r-xs); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
  font-family: var(--font-mono); font-size: .84rem; cursor: pointer;
  transition: all var(--t-fast);
}
.pagination button:hover:not(:disabled) { border-color: var(--rope-800); color: var(--rope-400); }
.pagination button.on { background: var(--rope-500); color: var(--navy-1000); border-color: var(--rope-500); font-weight: 700; }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }

.empty-state {
  border: 1px dashed var(--rope-800); border-radius: var(--r-md);
  padding: 46px 24px; text-align: center; color: var(--ink-2);
  background: rgba(15,36,56,.4);
}
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { margin: 0 0 16px; }

/* =====================================================================
   CALCULATOR
   ===================================================================== */
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
.calc-form {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 22px;
}
.calc-form .field { margin-bottom: 16px; }
.calc-form .field:last-of-type { margin-bottom: 22px; }
.range-row { display: grid; grid-template-columns: 1fr 84px; gap: 10px; align-items: center; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  border-radius: var(--r-pill); background: var(--navy-600); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--rope-500); border: 2px solid var(--navy-1000); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--navy-1000);
  background: var(--rope-500); cursor: pointer;
}
.calc-out {
  background: var(--navy-800); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 26px; position: sticky; top: 110px;
}
.calc-big {
  font-family: var(--font-mono); font-weight: 700; color: var(--brass-300);
  font-size: clamp(2.4rem, 6vw, 3.2rem); line-height: 1.05; letter-spacing: -.02em;
}
.calc-big-label {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px;
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.calc-cell {
  background: var(--navy-1000); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px;
}
.calc-cell .k {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 3px;
}
.calc-cell .v { font-family: var(--font-mono); font-size: 1.06rem; font-weight: 700; color: var(--rope-300); }
.gauge { height: 8px; border-radius: var(--r-pill); background: var(--navy-600); overflow: hidden; margin-top: 18px; }
.gauge-fill { height: 100%; border-radius: var(--r-pill); transition: width var(--t-mid), background var(--t-mid); }
.formula {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .78rem; color: var(--ink-3); line-height: 1.8;
}
.formula code { color: var(--rope-400); }

/* =====================================================================
   NOTICES · TIP BOXES · INDICATORS
   ===================================================================== */
.notice {
  border-radius: var(--r-sm); padding: 14px 18px; margin-bottom: 18px;
  font-size: .89rem; border: 1px solid var(--line); background: var(--surface-2);
}
.notice h4 { font-family: var(--font-body); font-size: .92rem; margin: 0 0 5px; display: flex; align-items: center; gap: 8px; }
.notice svg { width: 17px; height: 17px; flex: none; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice-safety { background: #2E1410; border-color: var(--red-800); color: var(--red-300); }
.notice-safety h4 { color: var(--red-300); }
.notice-info { background: var(--navy-700); border-color: var(--navy-400); color: #A8C4D9; }
.notice-info h4 { color: #A8C4D9; }
.notice-warn { background: #2E2410; border-color: var(--brass-800); color: var(--brass-300); }
.notice-warn h4 { color: var(--brass-300); }
.notice-neutral { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }

.tip-box {
  border-left: 4px solid var(--brass-500); background: var(--surface-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 14px 18px; margin: 22px 0;
  font-size: .89rem; color: var(--ink-2);
}
.tip-box h4 { font-family: var(--font-body); font-size: .92rem; margin: 0 0 5px; color: var(--ink); }
.tip-box p:last-child { margin-bottom: 0; }
.tip-box.tip { border-left-color: var(--brass-500); }
.tip-box.warn { border-left-color: var(--red-700); }
.tip-box.note { border-left-color: var(--navy-400); }
.tip-box.ok { border-left-color: var(--sea-700); }

.safety-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #2E1410; border: 1px solid var(--red-800); border-radius: var(--r-md);
  padding: 14px 18px; margin-bottom: 26px;
}
.safety-strip svg { width: 20px; height: 20px; color: var(--red-300); flex: none; }
.safety-strip span {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 700;
  letter-spacing: .06em; color: var(--red-300);
}
.safety-strip p { margin: 0; font-size: .84rem; color: var(--red-100); flex: 1 1 240px; }

.load-indicator, .wear-indicator, .webgl-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .76rem; font-weight: 700;
  padding: 5px 12px; border-radius: var(--r-pill); letter-spacing: .06em;
}
.load-indicator::before, .wear-indicator::before, .webgl-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.li-ok, .wi-new, .ws-ready { background: rgba(74,138,122,.16); color: var(--sea-300); border: 1px solid var(--sea-800); }
.li-caution, .wi-good, .ws-loading { background: rgba(208,172,112,.16); color: var(--brass-300); border: 1px solid var(--brass-900); }
.li-high, .wi-worn, .ws-fallback { background: rgba(184,147,90,.16); color: var(--brass-400); border: 1px solid var(--brass-900); }
.li-over, .wi-replace, .ws-error { background: rgba(196,74,58,.18); color: var(--red-300); border: 1px solid var(--red-800); }

/* =====================================================================
   3D STUDIO
   ===================================================================== */
.studio-shell {
  display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start;
}
.studio-stage {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line-2); background: var(--navy-1000);
  min-height: 460px;
}
.studio-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.studio-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(5,13,22,.7);
}
.studio-toolbar .spacer { flex: 1 1 auto; }
.studio-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--navy-1000); z-index: 6; transition: opacity var(--t-mid);
}
.studio-loading.done { opacity: 0; pointer-events: none; }
.sl-inner { text-align: center; width: min(280px, 70%); }
.sl-bar { height: 6px; border-radius: var(--r-pill); background: var(--navy-700); overflow: hidden; margin-top: 14px; }
.sl-bar i { display: block; height: 100%; width: 30%; background: var(--rope-500); animation: sl 1.1s ease-in-out infinite; }
@keyframes sl { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.studio-fallback {
  display: none; position: absolute; inset: 0; z-index: 5;
  background: var(--navy-1000); padding: 22px; overflow-y: auto;
}
.studio-fallback.show { display: block; }
.studio-fallback > div { max-width: 520px; margin: 0 auto; text-align: center; }
.studio-fallback img { margin: 0 auto 16px; max-width: 320px; }
.studio-fallback h3 { margin-bottom: 8px; }
.studio-fallback p { color: var(--ink-2); font-size: .88rem; }
.sc-overlay {
  position: absolute; left: 12px; bottom: 12px; z-index: 4;
  display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none;
}
.sc-overlay > * { pointer-events: auto; }
.studio-panel {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px;
}
.studio-panel h3 {
  font-family: var(--font-body); font-size: .78rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brass-500);
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.studio-panel .field { margin-bottom: 14px; }
.studio-readout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px;
}
.readout-cell {
  background: var(--navy-1000); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px;
}
.readout-cell .k {
  display: block; font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px;
}
.readout-cell .v { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; color: var(--brass-300); }
.readout-cell.wide { grid-column: 1 / -1; }
.readout-cell.wide .v { font-size: .86rem; color: var(--rope-300); }
.studio-hint {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .8rem; color: var(--ink-3); margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.studio-hint svg { width: 16px; height: 16px; flex: none; color: var(--brass-500); margin-top: 2px; }
.studio-steps { list-style: none; padding: 0; margin: 0; }
.studio-steps li {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
  font-size: .85rem; color: var(--ink-2); border-bottom: 1px solid var(--line);
}
.studio-steps li:last-child { border-bottom: 0; }
.studio-steps .sn {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--navy-700); border: 1px solid var(--line-2); color: var(--brass-400);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
}
.studio-steps li.on { color: var(--ink); }
.studio-steps li.on .sn { background: var(--rope-500); color: var(--navy-1000); border-color: var(--rope-500); }

/* homepage preview block */
.studio-preview {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--brass-900); background: var(--navy-1000);
  box-shadow: var(--sh-md);
}
.studio-preview .sp-grid { display: grid; grid-template-columns: 1.4fr 1fr; }
.sp-canvas { position: relative; min-height: 360px; }
.sp-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.sp-side { padding: 26px; border-left: 1px solid var(--line); }
.sp-side h2 { font-size: 1.5rem; margin-bottom: 8px; }
.sp-side p { color: var(--ink-2); font-size: .9rem; }
.sp-links { display: grid; gap: 9px; margin-top: 18px; }
.sp-link {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: .88rem; font-weight: 600;
  transition: all var(--t-fast);
}
.sp-link svg { width: 17px; height: 17px; color: var(--brass-500); flex: none; }
.sp-link:hover { border-color: var(--brass-500); background: var(--navy-700); color: var(--brass-300); transform: translateX(3px); }
.sp-link .arrow { margin-left: auto; color: var(--brass-500); }

/* =====================================================================
   DATABASE TABLE
   ===================================================================== */
.db-table-wrap {
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: auto; background: var(--surface-2);
}
.db-table { width: 100%; min-width: 780px; font-size: .86rem; }
.db-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--navy-1000); color: var(--brass-500);
  font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.db-table thead th button {
  background: none; border: 0; color: inherit; font: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 0;
}
.db-table thead th button:hover { color: var(--brass-300); }
.db-table tbody tr { border-bottom: 1px solid var(--line); transition: background var(--t-fast); }
.db-table tbody tr:hover { background: var(--navy-800); }
.db-table tbody td { padding: 11px 14px; vertical-align: middle; }
.db-table .num { font-family: var(--font-mono); color: var(--rope-400); }
.db-table .row-toggle {
  background: none; border: 1px solid var(--line); color: var(--rope-400);
  border-radius: var(--r-xs); width: 26px; height: 26px; cursor: pointer;
  display: grid; place-items: center; font-family: var(--font-mono); font-size: .9rem;
}
.db-table .row-toggle:hover { border-color: var(--brass-500); color: var(--brass-300); }
.db-detail-row td { background: var(--navy-1000); padding: 0; }
.db-detail {
  padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; font-size: .84rem; color: var(--ink-2);
}
.db-detail b {
  display: block; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px;
}
.db-compare {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--navy-1000);
  border-top: 1px solid var(--line-2);
}
.db-compare .lbl {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.compare-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 20px; }
.compare-card {
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 16px;
}
.compare-card h4 { font-size: 1rem; margin-bottom: 10px; }
.compare-card dl { margin: 0; font-size: .82rem; }
.compare-card dt {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 8px;
}
.compare-card dd { margin: 2px 0 0; font-family: var(--font-mono); color: var(--rope-300); }

/* =====================================================================
   BLOG
   ===================================================================== */
.featured-post {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-2); margin-bottom: 40px;
  transition: transform var(--t-mid), box-shadow var(--t-mid), border-color var(--t-mid);
  cursor: pointer;
}
.featured-post:hover, .featured-post:focus-visible {
  transform: translateY(-4px); box-shadow: var(--sh-lg), var(--glow-rope);
  border-color: var(--rope-800); color: inherit;
}
.featured-post .fp-media { aspect-ratio: auto; min-height: 300px; overflow: hidden; background: var(--navy-1000); }
.featured-post .fp-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-post .fp-body { padding: 30px; display: flex; flex-direction: column; justify-content: center; }

.post-hero {
  padding: 38px 0 30px; background: var(--navy-900);
  border-bottom: 3px solid var(--rope-500);
  background-image:
    repeating-linear-gradient(0deg, var(--chart-fine) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(90deg, var(--chart-fine) 0 1px, transparent 1px 20px);
}
.post-hero h1 { max-width: 30ch; margin-bottom: 14px; }
.post-meta {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  font-family: var(--font-mono); font-size: .76rem; color: var(--ink-3);
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--rope-900); }
.post-hero-img {
  margin-top: 26px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 8 / 3; background: var(--navy-1000);
}
.post-hero-img img { width: 100%; height: 100%; object-fit: cover; }

.post-body { font-size: 1rem; }
.post-body > h2 { margin-top: 40px; padding-top: 4px; }
.post-body > h2:first-child { margin-top: 0; }
.post-body h3 { margin-top: 28px; }
.post-body ul, .post-body ol { padding-left: 24px; }
.post-body li { margin-bottom: 9px; }

.step-block { display: grid; gap: 14px; margin: 26px 0; }
.step-block .sb {
  display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start;
}
.step-block .sb-num {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--navy-700); border: 1px solid var(--rope-800); color: var(--brass-300);
  display: grid; place-items: center; font-family: var(--font-mono);
  font-size: 1.05rem; font-weight: 700;
}
.step-block .sb h4 { margin: 0 0 4px; font-size: 1.02rem; }
.step-block .sb p { margin: 0; font-size: .92rem; color: var(--ink-2); }

.side-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px; margin-bottom: 18px;
}
.side-card h3 {
  font-family: var(--font-body); font-size: .76rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brass-500);
  margin: 0 0 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.side-sticky { position: sticky; top: 110px; }
.toc { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 6px 0 6px 12px; font-size: .86rem; color: var(--ink-2);
  border-left: 2px solid var(--line); transition: all var(--t-fast);
}
.toc a:hover, .toc a.on { color: var(--brass-300); border-left-color: var(--brass-500); }
.toc a.lvl3 { padding-left: 24px; font-size: .82rem; }

.author-box {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); margin: 40px 0;
}
.author-avatar {
  width: 54px; height: 54px; flex: none; border-radius: 50%;
  background: var(--navy-700); border: 1px solid var(--rope-800); color: var(--brass-300);
  display: grid; place-items: center; font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700;
}
.author-box h4 { margin: 0 0 2px; }
.author-box .role {
  font-family: var(--font-mono); font-size: .72rem; color: var(--brass-500);
  letter-spacing: .06em; text-transform: uppercase;
}
.author-box p { margin: 8px 0 0; font-size: .88rem; color: var(--ink-2); }

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 40px 0;
}
.post-nav a {
  display: block; padding: 16px 18px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface-2); transition: all var(--t-fast);
}
.post-nav a:hover { border-color: var(--rope-800); transform: translateY(-2px); }
.post-nav .pn-lbl {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 5px;
}
.post-nav .pn-title { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: .96rem; }
.post-nav .next { text-align: right; }

.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 250;
  background: transparent; pointer-events: none;
}
.read-progress-fill { height: 100%; width: 0; background: var(--brass-500); transition: width .1s linear; }
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--navy-800); color: var(--rope-400);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; pointer-events: none; transition: all var(--t-mid); box-shadow: var(--sh-md);
}
.to-top.on { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--rope-500); color: var(--navy-1000); }
.to-top svg { width: 20px; height: 20px; transform: rotate(90deg); }

/* =====================================================================
   CONTENT PAGES · FORMS
   ===================================================================== */
.info-grid { display: grid; gap: var(--gutter); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.info-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 22px;
}
.info-card .ic-ico {
  width: 42px; height: 42px; border-radius: 50%; margin-bottom: 12px;
  background: var(--navy-700); border: 1px solid var(--rope-800); color: var(--rope-500);
  display: grid; place-items: center;
}
.info-card .ic-ico svg { width: 21px; height: 21px; }
.info-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.info-card p { margin: 0; font-size: .88rem; color: var(--ink-2); }

.prose-block { max-width: 74ch; }
.prose-block h2 { margin-top: 38px; }
.prose-block h2:first-child { margin-top: 0; }

.form-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 24px;
}
.form-card .field { margin-bottom: 16px; }
.form-note { font-size: .8rem; color: var(--ink-3); margin: 10px 0 0; }
.form-status {
  margin-top: 14px; padding: 11px 14px; border-radius: var(--r-sm);
  font-size: .86rem; display: none;
}
.form-status.show { display: block; }
.form-status.ok { background: rgba(74,138,122,.16); border: 1px solid var(--sea-800); color: var(--sea-300); }
.form-status.err { background: rgba(196,74,58,.16); border: 1px solid var(--red-800); color: var(--red-300); }
.field-error { font-size: .78rem; color: var(--red-300); margin-top: 4px; display: none; }
.field.invalid .input, .field.invalid .textarea { border-color: var(--red-700); }
.field.invalid .field-error { display: block; }

/* =====================================================================
   SEARCH
   ===================================================================== */
.search-box {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 8px 14px; margin-bottom: 26px;
}
.search-box svg { width: 19px; height: 19px; color: var(--ink-3); flex: none; }
.search-box input {
  flex: 1; background: none; border: 0; outline: none;
  font-size: 1rem; color: var(--ink); padding: 8px 0;
}
.search-box input::placeholder { color: var(--ink-3); }
.search-hint {
  font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3);
  letter-spacing: .08em; text-transform: uppercase; flex: none;
}

/* instant search overlay */
.insta {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 220;
  width: min(430px, 88vw); max-height: 62vh; overflow-y: auto;
  background: var(--navy-1000); border: 1px solid var(--line-2);
  border-radius: var(--r-md); box-shadow: var(--sh-lg); padding: 8px; display: none;
}
.insta.open { display: block; }
.insta-search-wrap { position: relative; }
.insta-item {
  display: block; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--ink); transition: background var(--t-fast);
}
.insta-item:hover, .insta-item.on { background: var(--navy-800); color: var(--brass-300); }
.insta-item .ii-t { font-size: .88rem; font-weight: 600; display: block; }
.insta-item .ii-d { font-size: .74rem; color: var(--ink-3); display: block; margin-top: 2px; }
.insta-empty { padding: 18px; text-align: center; color: var(--ink-3); font-size: .86rem; }

/* site-wide search overlay (opened by the header search button) */
.search-overlay { position: fixed; inset: 0; z-index: 300; }
.search-overlay[hidden] { display: none; }
.so-scrim {
  position: absolute; inset: 0; background: rgba(4, 10, 18, .74);
  backdrop-filter: blur(3px); animation: soFade var(--t-fast) both;
}
.so-panel {
  position: relative; width: min(680px, 92vw); margin: 12vh auto 0;
  background: var(--navy-900); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  padding: 18px 18px 14px; animation: soRise var(--t-mid) both;
}
.so-panel .search-box { margin-bottom: 0; position: relative; }
.so-panel .insta { left: 0; right: 0; width: auto; }
.so-close { position: absolute; top: 10px; right: 10px; }
.so-foot { margin: 14px 4px 0; }
@keyframes soFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes soRise { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .so-scrim, .so-panel { animation: none; }
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
  background: var(--navy-1000); border-top: 1px solid var(--brass-900);
  padding: 52px 0 26px; margin-top: 40px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 34px; padding-bottom: 34px; border-bottom: 1px solid var(--line);
}
.fb-name { font-family: var(--font-display); font-size: 1.24rem; font-weight: 700; color: var(--rope-200); display: block; margin-bottom: 10px; }
.footer-brand p { font-size: .86rem; color: var(--ink-2); max-width: 40ch; }
.footer-social { display: flex; gap: 9px; margin: 16px 0 12px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--navy-800); color: var(--rope-400);
  display: grid; place-items: center; transition: all var(--t-fast);
}
.footer-social a:hover { background: var(--rope-500); color: var(--navy-1000); border-color: var(--rope-500); }
.footer-social svg { width: 17px; height: 17px; }
.fb-version { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); }
.footer-col h4 {
  font-family: var(--font-body); font-size: .76rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brass-500);
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0 0 16px; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: .86rem; color: var(--ink-2); }
.footer-col a:hover { color: var(--brass-300); }
.subscribe-row { display: flex; gap: 8px; }
.subscribe-row input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: var(--r-pill);
  background: var(--navy-900); border: 1px solid var(--line); color: var(--ink); font-size: .84rem;
}
.subscribe-row input:focus { border-color: var(--brass-500); outline: none; }

.disclaimer {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 28px;
  padding: 30px 0; border-bottom: 1px solid var(--line);
}
.disclaimer-box {
  background: var(--navy-900); border: 1px solid var(--rope-800);
  border-radius: var(--r-md); padding: 20px;
}
.disclaimer-box h4 {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-size: .92rem; margin: 0 0 12px; color: var(--rope-300);
}
.disclaimer-box svg { width: 18px; height: 18px; color: var(--brass-500); flex: none; }
.disclaimer-box ul { margin: 0; padding-left: 20px; }
.disclaimer-box li { font-size: .84rem; color: var(--ink-2); margin-bottom: 8px; line-height: 1.6; }
.disclaimer-text p { font-size: .84rem; color: var(--ink-2); line-height: 1.7; }
.disclaimer-text strong { color: var(--rope-300); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding-top: 22px;
  font-size: .82rem; color: var(--ink-3);
}
.footer-bottom nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom a { color: var(--ink-3); }
.footer-bottom a:hover { color: var(--brass-300); }
.inspect-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--rope-800); color: var(--rope-400);
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .12em;
}
.inspect-badge svg { width: 14px; height: 14px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .studio-shell { grid-template-columns: 1fr; }
  .studio-panel { position: static; }
  .studio-preview .sp-grid { grid-template-columns: 1fr; }
  .sp-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 1000px) {
  .tab { padding: 0 15px; font-size: .8rem; }
  .tab svg { display: none; }
}
@media (max-width: 900px) {
  :root { --header-h: 92px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split, .split-wide, .calc-layout, .split-side { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .fp-media { min-height: 210px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .disclaimer { grid-template-columns: 1fr; }
  .calc-out { position: static; }
  .side-sticky { position: static; }
  .burger { display: grid; }
  .tab-scroll { display: none; }
  .edge-bar { height: 52px; }
  body.scrolled .edge-bar { height: 48px; }
  .tab-strip { display: none; }
  .pill-link span { display: none; }
  .pill-link { width: 30px; padding: 0; justify-content: center; }
  .pill-link svg { width: 16px; height: 16px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 92px; }
  body { font-size: 15.5px; }
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: 1fr; }
  .hero { height: 460px; }
  .hero-arrow { display: none; }
  section { margin-bottom: 46px; }
  .page-hero { padding: 30px 0 26px; }
  .cta-band { padding: 30px 22px; }
  .filter-bar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .calc-grid, .studio-readout { grid-template-columns: 1fr; }
  .db-compare { position: static; }
  .studio-stage { min-height: 340px; }
  .sp-canvas { min-height: 300px; }
  .author-box { flex-direction: column; }
}

/* =====================================================================
   MOTION PREFERENCES
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover, .featured-post:hover { transform: none; }
  .hero-slide { transition: none; }
  .sl-bar i { animation: none; width: 100%; }
}

@media print {
  .edge-bar, .tab-strip, .site-footer, .to-top, .read-progress, .hero-arrow, .hero-dots { display: none; }
  body { background: #fff; color: #111; }
  main { padding-top: 0; }
}
