/* ==========================================================================
   Bespoke & Thread — stylesheet.

   Dark tailoring theme: a deep tailor-grey ground, chalk white as the primary
   colour, brass as the accent, and thread red reserved for warnings. The
   tailor's chalk speckle and the brass sheen are used as 4-6% overlays rather
   than as decoration.

   Sections:
     01 tokens            07 cards and tags      13 studio tools
     02 reset and base    08 page templates      14 calculators
     03 typography        09 notices             15 blog
     04 layout            10 buttons             16 database
     05 stitch header     11 footer              17 utilities
     06 home modules      12 filters and tables
   ========================================================================== */

/* =============================================================== 01 tokens */
:root {
  /* tailor greys */
  --tailor-950: #0E0E12;
  --tailor-900: #1E1E22;
  --tailor-800: #2E2E34;
  --tailor-700: #3E3E46;
  --tailor-600: #52525C;
  --tailor-500: #6E6E7A;
  --tailor-400: #8E8E9A;

  /* chalk whites */
  --chalk-50: #F5F2EC;
  --chalk-100: #F0EDE8;
  --chalk-200: #E0DCD4;
  --chalk-300: #C8C4BC;
  --chalk-400: #A8A49C;
  --chalk-500: #8A867E;
  --chalk-600: #6E6A62;

  /* brass */
  --brass-900: #5C4818;
  --brass-700: #8A6E28;
  --brass-500: #B8935A;
  --brass-400: #D0AC70;
  --brass-300: #E0C490;
  --brass-200: #F0DCB8;
  --brass-100: #FAF0DC;

  /* tailor blue */
  --blue-900: #2E4A6A;
  --blue-700: #4A6A8A;
  --blue-500: #6A8AAA;
  --blue-300: #9AB0C8;
  --blue-100: #E4EEF6;

  /* thread red */
  --red-900: #7A2A2A;
  --red-700: #A83A3A;
  --red-500: #C85050;
  --red-300: #E89898;
  --red-100: #F5C0C0;

  /* semantic */
  --red: #C85050;
  --red-bg: #2E1414;
  --red-line: #8A2A2A;
  --red-ink: #E89898;
  --green: #5A8A5A;
  --green-bg: #14260F;
  --green-line: #3A5A2A;
  --green-ink: #A8C89A;
  --yellow: #D0AC70;
  --yellow-bg: #2E2410;
  --yellow-line: #5C4818;
  --yellow-ink: #E0C490;
  --blue: #6A8AAA;
  --blue-bg: #152030;
  --blue-line: #2E4A6A;
  --blue-ink: #9AB0C8;

  --line: #3E3E46;
  --line-strong: #52525C;
  --surface: #2E2E34;
  --surface-2: #26262C;
  --bg: #1E1E22;

  /* shape */
  --r-xs: 0px;
  --r-sm: 2px;
  --r: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* shadow — dark ground, black stacking with a brass hint */
  --sh-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-sm: 0 2px 8px rgba(0, 0, 0, .45);
  --sh-md: 0 8px 22px rgba(0, 0, 0, .5);
  --sh-lg: 0 18px 48px rgba(0, 0, 0, .6);
  --glow-brass: 0 0 16px rgba(184, 147, 90, .3);
  --glow-chalk: 0 0 12px rgba(240, 237, 232, .2);

  /* motion */
  --t-fast: .14s ease;
  --t: .28s ease;
  --t-stitch: .4s cubic-bezier(.34, 1.2, .64, 1);

  /* type */
  --font-head: "Playfair Display", "Cormorant Garamond", "Georgia", serif;
  --font-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Menlo, monospace;

  /* texture */
  --chalk-dust: radial-gradient(rgba(240, 237, 232, .05) 1px, transparent 1px);
  --brass-sheen: repeating-linear-gradient(135deg, rgba(184, 147, 90, .06) 0 1px, transparent 1px 5px);

  --header-h: 88px;
}

/* ============================================================ 02 reset/base */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--chalk-100);
  background: var(--tailor-900);
  background-image: var(--chalk-dust);
  background-size: 5px 5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; }
img { display: block; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* An inline icon must never be allowed to fill its container. Without an
   explicit box, a sizeless <svg> inside a flex row expands to all remaining
   space and the page looks broken on exactly one page. */
.ico {
  width: 18px;
  height: 18px;
  flex: none;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 24px; height: 24px; }
.ico-xl { width: 26px; height: 26px; }

[hidden] { display: none !important; }

::selection { background: var(--brass-500); color: var(--tailor-950); }

:focus-visible {
  outline: 2px solid var(--brass-500);
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(184, 147, 90, .35);
  border-radius: var(--r-sm);
}

.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: 999;
  background: var(--brass-500);
  color: var(--tailor-950);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 8px; }

/* ========================================================== 03 typography */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: .005em;
  color: var(--chalk-100);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: clamp(1.18rem, 2vw, 1.4rem); }
h4 { font-size: 1.08rem; }
p { margin: 0 0 1.05em; }

a { color: var(--chalk-200); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brass-400); }
.prose a, .tip-box a, .notice a, .legal-note a, .post-body a {
  color: var(--brass-400);
  border-bottom: 1px solid var(--brass-900);
}
.prose a:hover { border-bottom-color: var(--brass-400); }

strong { color: var(--chalk-50); font-weight: 700; }
em { color: var(--chalk-200); }

.eyebrow {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brass-500);
  margin: 0 0 .55em;
}
.eyebrow::before { content: "\2702\00a0"; color: var(--brass-500); }

.lead {
  font-size: 1.08rem;
  color: var(--chalk-300);
  max-width: 68ch;
  line-height: 1.68;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--chalk-400); }

/* ============================================================== 04 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; }
.section-alt {
  background: var(--tailor-950);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.section-head { max-width: 62ch; margin-bottom: 28px; }
.section-head p { color: var(--chalk-300); }

.split-wide { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 34px; }
.split-side { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 40px; }
.split-side > .side { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }

.mt-1 { margin-top: 14px; }
.mt-2 { margin-top: 28px; }
.mt-3 { margin-top: 44px; }
.mb-0 { margin-bottom: 0; }

/* ======================================================= 05 stitch header
   The site's signature. A brand strip sits above a running stitch trail;
   the navigation items are stitch tabs sitting on the trail, and the active
   one has "dropped its needle" — pressed down, lit, and shadowed. */

.brandbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 36px;
  background: var(--tailor-950);
  border-bottom: 1px solid var(--brass-900);
  transition: transform var(--t);
}
.brandbar.is-hidden { transform: translateY(-100%); }
.brandbar-inner {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 24px; height: 24px;
  flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--brass-500);
  color: var(--tailor-950);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--chalk-100);
  white-space: nowrap;
}
.brand-tag {
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass-500);
  white-space: nowrap;
}
.brand-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-btn {
  width: 32px; height: 32px;
  flex: none;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--chalk-300);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--tailor-800); color: var(--brass-400); border-color: var(--line); }

.pill-3d {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border: 1px solid var(--brass-500);
  border-radius: var(--r-pill);
  color: var(--brass-400);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.pill-3d:hover { background: var(--brass-500); color: var(--tailor-950); box-shadow: var(--glow-brass); }

.hamburger { display: none; }

/* the trail itself */
.chainnav {
  position: fixed;
  top: 36px; left: 0; right: 0;
  z-index: 190;
  height: 52px;
  background: var(--tailor-900);
  border-bottom: 1px solid var(--brass-900);
  transition: top var(--t), height var(--t);
}
.chainnav.is-compact { top: 0; height: 46px; }
.chainnav-inner { position: relative; height: 100%; display: flex; align-items: center; }

.chain {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  position: relative;
}
/* the dashed stitch trail running behind the tabs */
.chain::before {
  content: "";
  position: absolute;
  left: -50vw; right: -50vw;
  top: 50%;
  border-top: 1px dashed var(--brass-700);
  opacity: .55;
  pointer-events: none;
}
.chain-item { position: relative; }

.chain-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 16px;
  background: var(--tailor-800);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--chalk-300);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast),
    transform var(--t-stitch), box-shadow var(--t-fast);
}
/* the落针 point below each tab */
.chain-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  border-radius: var(--r-pill);
  background: var(--brass-900);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.chain-link:hover {
  background: var(--tailor-700);
  color: var(--chalk-100);
  border-color: var(--line-strong);
}
.chain-link:hover::after { background: var(--brass-500); }

.chain-link.is-active {
  background: var(--brass-500);
  color: var(--tailor-950);
  border-color: var(--brass-400);
  transform: translateY(2px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4);
}
.chain-link.is-active::after {
  background: var(--chalk-100);
  box-shadow: var(--glow-brass);
  transform: scale(1.3);
}

/* tools dropdown */
.dd-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 320px;
  padding: 10px;
  background: var(--tailor-800);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brass-500);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  z-index: 30;
}
.chain-item:hover .dd-panel,
.chain-item:focus-within .dd-panel,
.dd-panel.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.dd-panel a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--chalk-200);
  font-size: .92rem;
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast);
}
.dd-panel a:hover { background: var(--tailor-700); color: var(--brass-400); }
.dd-desc { display: block; margin-top: 2px; font-size: .78rem; font-weight: 400; color: var(--chalk-400); line-height: 1.45; }
.dd-sep { height: 1px; margin: 8px 6px; background: var(--line); }

/* drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(14, 14, 18, .7);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
.drawer.is-open { opacity: 1; visibility: visible; }
.drawer-inner {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  background: var(--tailor-900);
  border-left: 1px solid var(--line);
  padding: 18px 20px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t);
}
.drawer.is-open .drawer-inner { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-head strong { font-family: var(--font-head); font-size: 1.2rem; }
.drawer-list, .drawer-sub { list-style: none; margin: 0; padding: 0; }
.drawer-list > li { border-bottom: 1px dashed var(--line); }
.drawer-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 6px;
  color: var(--chalk-200);
  font-weight: 600;
}
.drawer-list a:hover, .drawer-list a.is-active { color: var(--brass-400); }
.drawer-sub { padding-left: 30px; }
.drawer-sub a { padding: 9px 6px; font-weight: 400; font-size: .92rem; color: var(--chalk-400); }

/* search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(14, 14, 18, .82);
  display: grid;
  place-items: start center;
  padding: 90px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-box {
  width: min(620px, 100%);
  background: var(--tailor-800);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  overflow: hidden;
}
.search-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-row input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--chalk-100);
  font-size: 1.05rem;
  outline: none;
}
.search-row input::placeholder { color: var(--chalk-500); }
.search-results { max-height: 52vh; overflow-y: auto; }
.search-result {
  display: block;
  padding: 13px 18px;
  border-bottom: 1px dashed var(--line);
  transition: background var(--t-fast);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--tailor-700); }
.search-result .sr-title { font-weight: 700; color: var(--chalk-100); }
.search-result .sr-kind { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brass-500); }
.search-result .sr-desc { font-size: .88rem; color: var(--chalk-400); }
.search-empty { padding: 22px 18px; color: var(--chalk-400); margin: 0; font-size: .92rem; }

/* ======================================================= 06 home modules */
.hero {
  position: relative;
  height: 460px;
  overflow: hidden;
  background: var(--tailor-950);
  border-bottom: 1px solid var(--line);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s ease, visibility .7s ease;
}
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-slide > img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .85;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #0E0E12 0%, rgba(30, 30, 34, .9) 46%, rgba(184, 147, 90, .12) 100%);
}
.hero-inner { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--brass-500);
  border-radius: var(--r-pill);
  background: rgba(14, 14, 18, .5);
  color: var(--brass-400);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1, .hero h2 {
  font-size: clamp(1.95rem, 4.2vw, 2.9rem);
  max-width: 20ch;
  margin-bottom: .35em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .6);
}
.hero p { max-width: 56ch; color: var(--chalk-200); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.hero-nav { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(14, 14, 18, .6);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--chalk-100);
  cursor: pointer;
  pointer-events: auto;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.hero-arrow:hover { background: var(--brass-500); color: var(--tailor-950); border-color: var(--brass-400); }
.hero-arrow.prev { left: 18px; }
.hero-arrow.next { right: 18px; }
.hero-arrow.prev .ico { transform: rotate(180deg); }

.hero-dots {
  position: absolute;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex; gap: 10px; align-items: center;
}
.hero-dot {
  width: 10px; height: 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--brass-500);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: width var(--t), background var(--t-fast), box-shadow var(--t-fast);
}
.hero-dot.is-active { width: 28px; background: var(--brass-500); box-shadow: var(--glow-brass); }

.trust-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-icon {
  width: 40px; height: 40px;
  flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--brass-900);
  border-radius: var(--r-sm);
  color: var(--brass-500);
  background: var(--tailor-800);
}
.trust-item h3 { font-size: 1rem; margin-bottom: .2em; }
.trust-item p { font-size: .88rem; color: var(--chalk-400); margin: 0; }

/* community quote cards */
.quote-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brass-500);
  border-radius: var(--r);
  position: relative;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t-fast);
}
.quote-card::before {
  content: "\201C";
  position: absolute;
  top: 6px; right: 18px;
  font-family: var(--font-head);
  font-size: 3.4rem;
  line-height: 1;
  color: var(--brass-900);
  opacity: .7;
}
.quote-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--brass-500); }
.quote-card blockquote { margin: 0; }
.quote-card p { font-size: .95rem; color: var(--chalk-200); margin: 0 0 14px; }
.quote-card footer { margin-top: auto; }
.quote-card cite {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-style: normal;
  letter-spacing: .04em;
  color: var(--brass-500);
}

/* community Q&A cards */
.qa-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brass-500);
  border-radius: var(--r);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t-fast);
}
.qa-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--brass-500); }
.qa-q {
  font-style: italic;
  color: var(--chalk-100);
  font-size: 1rem;
  margin: 12px 0 10px;
}
.qa-src { font-family: var(--font-mono); font-size: .72rem; color: var(--brass-500); letter-spacing: .04em; }
.qa-answer { font-size: .9rem; color: var(--chalk-300); margin: 0; }
.qa-answer::before { content: "\2705\00a0"; }
.qa-foot { display: flex; justify-content: flex-end; margin-top: 14px; color: var(--brass-500); }

/* steps */
ol.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.step-media { position: relative; aspect-ratio: 16 / 10; background: var(--tailor-800); }
.step-media img { width: 100%; height: 100%; object-fit: contain; }
.step-num {
  position: absolute;
  top: 10px; left: 10px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--brass-500);
  color: var(--tailor-950);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .9rem;
}
.step-body { padding: 16px 18px 20px; }
.step-label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-500); }
.step-body h3 { font-size: 1.08rem; margin: 4px 0 .3em; }
.step-body p { font-size: .88rem; color: var(--chalk-400); margin: 0; }

/* studio preview block */
.studio-preview {
  position: relative;
  background: var(--tailor-950);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}
.studio-preview .sp-media { position: relative; min-height: 340px; background: #101014; }
.studio-preview .sp-media img { width: 100%; height: 100%; object-fit: cover; }
.studio-preview .sp-body { padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.studio-preview .sp-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* troubleshooting table */
.trouble-table th, .trouble-table td { text-align: left; }
.trouble-table tbody tr:hover { background: var(--tailor-800); }
.trouble-table .src { font-family: var(--font-mono); font-size: .74rem; color: var(--brass-500); }

/* discussion chips */
.disc-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scroll-snap-type: x proximity;
}
.disc-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 240px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.disc-chip:hover { border-color: var(--brass-500); background: var(--tailor-700); transform: translateY(-2px); }
.disc-chip .dc-title { display: block; font-weight: 700; color: var(--chalk-100); font-size: .95rem; }
.disc-chip .dc-src { font-family: var(--font-mono); font-size: .72rem; color: var(--brass-500); }

/* CTA band */
.cta-band {
  position: relative;
  padding: 40px;
  border-radius: var(--r);
  background: linear-gradient(120deg, var(--brass-700), var(--brass-500));
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 8px),
    linear-gradient(120deg, var(--brass-700), var(--brass-500));
  color: var(--tailor-950);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.cta-band h2, .cta-band h3 { color: var(--tailor-950); margin-bottom: .2em; }
.cta-band p { color: rgba(14, 14, 18, .8); margin: 0; max-width: 54ch; }

/* ====================================================== 07 cards and tags */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  color: inherit;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t-fast);
}
/* a stitch seam along the top edge of every card */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background-image: repeating-linear-gradient(90deg, var(--brass-900) 0 6px, transparent 6px 12px);
  opacity: .8;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--brass-500); }
.card:active { transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--brass-500); outline-offset: 2px; box-shadow: var(--glow-brass); }

.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--tailor-800); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.06rem; margin: 0 0 .35em; }
.card-desc { font-size: .9rem; color: var(--chalk-400); margin: 0; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.card-arrow { color: var(--brass-500); display: inline-flex; transition: transform var(--t-fast); }
.card:hover .card-arrow { transform: translateX(3px); }

.cat-card .card-body { padding-top: 22px; }
.cat-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--brass-900);
  border-radius: var(--r-sm);
  color: var(--brass-500);
  background: var(--tailor-800);
  background-image: var(--brass-sheen);
}
.cat-count { font-family: var(--font-mono); font-size: .74rem; color: var(--chalk-500); letter-spacing: .04em; }

.tool-card .card-media img { object-fit: contain; padding: 6px; }
.blog-card .card-media { aspect-ratio: 16 / 9; }
.blog-meta { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-500); margin: 0 0 8px; }

.calc-card .card-media { aspect-ratio: 4 / 3; }
.calc-card .card-media img { object-fit: contain; padding: 8px; }

.studio-card {
  background: var(--tailor-950);
  border-color: var(--line-strong);
}
.studio-card:hover { box-shadow: var(--sh-lg), var(--glow-brass); }
.studio-card .card-media { aspect-ratio: 4 / 3; }
.studio-card .card-media img { object-fit: contain; padding: 8px; }

.garment-card { cursor: default; }
.garment-card:hover { transform: none; box-shadow: var(--sh-sm); border-color: var(--line); }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--brass-900);
  color: var(--brass-200);
}
.tag-chalk { background: var(--tailor-700); color: var(--chalk-200); }
.tag-blue { background: var(--blue-900); color: var(--blue-300); }
.tag-red { background: var(--red-900); color: var(--red-300); }
.tag-green { background: var(--green-bg); color: var(--green-ink); border: 1px solid var(--green-line); }
.tag-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--chalk-300); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--tailor-800);
  color: var(--chalk-300);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--brass-500); color: var(--brass-400); }
.chip.is-active { background: var(--brass-500); color: var(--tailor-950); border-color: var(--brass-400); }

.param-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--brass-900);
  border-radius: var(--r-sm);
  background: var(--tailor-800);
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--brass-300);
}
.badge-3d {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--brass-500);
  color: var(--tailor-950);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.stitch-badge, .fabric-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: .72rem;
  border: 1px solid var(--line);
}
.stitch-badge { background: var(--tailor-800); color: var(--chalk-300); }
.fabric-badge { background: var(--blue-bg); color: var(--blue-300); border-color: var(--blue-line); }

/* ====================================================== 08 page templates */
.page-hero {
  position: relative;
  padding: 40px 0 34px;
  background: var(--tailor-950);
  border-bottom: 3px solid var(--brass-500);
  background-image: var(--chalk-dust);
  background-size: 5px 5px;
}
.page-hero h1 { margin-bottom: .3em; }
.page-hero .lead { margin-bottom: 0; }

.breadcrumb {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--chalk-500);
}
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--line-strong); }
.breadcrumb a { color: var(--chalk-400); }
.breadcrumb a:hover { color: var(--brass-400); }

/* tool detail */
.exhibit {
  background: var(--tailor-800);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  position: relative;
}
.exhibit::before {
  content: "";
  position: absolute;
  top: 8px; left: 14px; right: 14px;
  height: 1px;
  background-image: repeating-linear-gradient(90deg, var(--brass-900) 0 6px, transparent 6px 12px);
}
.exhibit-main { background: var(--tailor-900); border-radius: var(--r-sm); overflow: hidden; }
.exhibit-main img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.thumb {
  background: var(--tailor-900);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.thumb:hover { border-color: var(--brass-500); }
.thumb.is-active { border-color: var(--brass-500); box-shadow: var(--glow-brass); }

.spec-table { margin-top: 18px; }
.spec-table th, .spec-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.spec-table th { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--chalk-500); font-weight: 600; width: 42%; }
.spec-table td { color: var(--chalk-100); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  margin: 0 6px 6px 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--brass-900);
  background: var(--tailor-800);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .05em;
  color: var(--brass-300);
}
.stage-pill::before { content: "\25CF"; font-size: .6em; color: var(--brass-500); }

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

.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }

/* content pages */
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}
.info-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.08rem; }
.info-card h3 .ico { color: var(--brass-500); }
.info-card ul { margin: 0; padding-left: 20px; color: var(--chalk-300); font-size: .92rem; }
.info-card li { margin-bottom: 6px; }
.info-card p { font-size: .92rem; color: var(--chalk-300); margin: 0; }

.prose-block { max-width: 72ch; }
.prose-block h2 { margin-top: 1.4em; }
.prose-block p { color: var(--chalk-200); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px;
}
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--chalk-400); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--tailor-900);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--chalk-100);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brass-500);
  box-shadow: 0 0 0 3px rgba(184, 147, 90, .18);
}
.field textarea { min-height: 140px; resize: vertical; }
.field-error { display: block; margin-top: 6px; font-size: .82rem; color: var(--red-300); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red-500); }
.form-msg { margin-top: 14px; font-size: .9rem; }
.form-msg.is-ok { color: var(--green-ink); }
.form-msg.is-bad { color: var(--red-300); }

/* =============================================================== 09 notices */
.notice {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--r-sm);
  background: var(--tailor-800);
  margin-bottom: 22px;
}
.notice .ico { margin-top: 3px; }
.notice h4 { margin: 0 0 .3em; font-size: 1rem; }
.notice p { margin: 0; font-size: .92rem; color: var(--chalk-300); }
.notice-safety { background: var(--red-bg); border-color: var(--red-line); }
.notice-safety .ico, .notice-safety h4 { color: var(--red-ink); }
.notice-info { background: var(--blue-bg); border-color: var(--blue-line); }
.notice-info .ico, .notice-info h4 { color: var(--blue-ink); }
.notice-warn { background: var(--yellow-bg); border-color: var(--yellow-line); }
.notice-warn .ico, .notice-warn h4 { color: var(--yellow-ink); }

.tip-box {
  padding: 16px 18px;
  border-left: 4px solid var(--brass-500);
  background: var(--tailor-800);
  border-radius: var(--r-sm);
  margin: 0 0 22px;
}
.tip-box.tip-warn { border-left-color: var(--red-500); background: var(--red-bg); }
.tip-box.tip-note { border-left-color: var(--blue-500); background: var(--blue-bg); }
.tip-box.tip-ok { border-left-color: var(--green); background: var(--green-bg); }
.tip-box h4 { margin: 0 0 .3em; font-size: .98rem; color: var(--brass-300); }
.tip-box.tip-warn h4 { color: var(--red-ink); }
.tip-box.tip-note h4 { color: var(--blue-ink); }
.tip-box.tip-ok h4 { color: var(--green-ink); }
.tip-box p { margin: 0; font-size: .92rem; color: var(--chalk-200); }

.legal-note {
  padding: 16px 18px;
  border-left: 4px solid var(--brass-500);
  background: var(--tailor-800);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: .84rem;
  color: var(--chalk-400);
  line-height: 1.6;
}

.empty-state {
  padding: 40px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  text-align: center;
  color: var(--chalk-400);
}

.safety-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border: 1px solid var(--red-line);
  border-left: 4px solid var(--red-500);
  border-radius: var(--r-sm);
  background: var(--red-bg);
  color: var(--red-ink);
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.tension-indicator, .stitch-length-indicator, .needle-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--tailor-800);
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--chalk-300);
}
.tension-indicator .bar { width: 60px; height: 6px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--green), var(--yellow), var(--red)); }

/* =============================================================== 10 buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brass-500); color: var(--tailor-950); border-color: var(--brass-400); }
.btn-primary:hover { background: var(--brass-400); color: var(--tailor-950); box-shadow: var(--glow-brass); }
.btn-chalk { background: var(--chalk-100); color: var(--tailor-950); }
.btn-chalk:hover { background: #fff; color: var(--tailor-950); }
.btn-outline { background: var(--tailor-800); color: var(--brass-400); border-color: var(--brass-500); }
.btn-outline:hover { background: var(--brass-500); color: var(--tailor-950); }
.btn-ghost { background: transparent; color: var(--chalk-300); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--tailor-800); color: var(--chalk-100); border-color: var(--brass-500); }
.btn-danger { background: var(--red-700); color: #fff; }
.btn-danger:hover { background: var(--red-500); }
.btn-sm { padding: 7px 14px; font-size: .78rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-stitch { position: relative; }
.btn-stitch .ico { transition: transform var(--t-stitch); }
.btn-stitch:hover .ico { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ================================================================ 11 footer */
.site-footer {
  margin-top: 60px;
  padding: 52px 0 30px;
  background: var(--tailor-950);
  border-top: 3px solid var(--brass-500);
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 34px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: .86rem; color: var(--chalk-400); max-width: 42ch; }
.footer-social { display: flex; gap: 10px; margin: 16px 0; }
.footer-social a {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--chalk-300);
}
.footer-social a:hover { border-color: var(--brass-500); color: var(--brass-400); }
.footer-col h3 { font-family: var(--font-body); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-500); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: .88rem; color: var(--chalk-300); }
.footer-col a:hover { color: var(--brass-400); }

.subscribe { display: flex; gap: 8px; margin-top: 12px; }
.subscribe input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: var(--tailor-900);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--chalk-100);
  font-size: .86rem;
}
.subscribe input:focus { outline: none; border-color: var(--brass-500); }
.subscribe-msg { margin: 8px 0 0; font-size: .8rem; color: var(--green-ink); min-height: 1.1em; }

.footer-disclaimer {
  margin-top: 40px;
  padding: 22px 24px;
  border: 1px solid var(--brass-900);
  border-left: 4px solid var(--brass-500);
  border-radius: var(--r-sm);
  background: var(--tailor-900);
}
.footer-disclaimer h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; color: var(--brass-300); margin-bottom: .6em; }
.footer-disclaimer ul { margin: 0; padding-left: 20px; }
.footer-disclaimer li { font-size: .86rem; color: var(--chalk-400); margin-bottom: 7px; }
.footer-disclaimer strong { color: var(--chalk-200); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--chalk-500);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-bottom a { color: var(--chalk-400); }
.footer-bottom a:hover { color: var(--brass-400); }
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--brass-500);
  border-radius: var(--r-pill);
  color: var(--brass-400);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
}

.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 150;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--brass-500);
  color: var(--tailor-950);
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  box-shadow: var(--sh-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top .ico { transform: rotate(-90deg); }

.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 400;
  background: var(--brass-500);
  box-shadow: var(--glow-brass);
}

/* ================================================== 12 filters and tables */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 18px;
  margin-bottom: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field label { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--chalk-500); }
.filter-field input, .filter-field select {
  padding: 9px 12px;
  background: var(--tailor-900);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--chalk-100);
  font-size: .88rem;
  min-width: 160px;
}
.filter-field input:focus, .filter-field select:focus { outline: none; border-color: var(--brass-500); }
.filter-count { margin-left: auto; font-family: var(--font-mono); font-size: .8rem; color: var(--chalk-400); align-self: center; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 34px; }
.page-btn {
  min-width: 40px; height: 40px;
  display: grid; place-items: center;
  padding: 0 10px;
  background: var(--tailor-800);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--chalk-300);
  font-family: var(--font-mono);
  font-size: .86rem;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.page-btn:hover { border-color: var(--brass-500); color: var(--brass-400); }
.page-btn.is-active { background: var(--brass-500); color: var(--tailor-950); border-color: var(--brass-400); }
.page-btn[disabled] { opacity: .4; cursor: not-allowed; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: .88rem; }
table.data thead th {
  background: var(--tailor-800);
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brass-400);
  position: sticky;
  top: 0;
  cursor: pointer;
  white-space: nowrap;
}
table.data thead th[data-sort]:hover { color: var(--brass-200); }
table.data tbody tr:hover { background: var(--tailor-800); }
table.data td { color: var(--chalk-200); }
table.data .num { font-family: var(--font-mono); }
.table-note { font-size: .84rem; color: var(--chalk-400); margin-top: 12px; }

/* ========================================================== 13 studio tools */
.studio-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.studio-stage {
  background: var(--tailor-950);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  overflow: hidden;
}
.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--tailor-900);
}
.studio-toolbar h2 { font-size: 1.05rem; margin: 0; }
.canvas-wrap { position: relative; aspect-ratio: 4 / 3; min-height: 320px; background: #101014; }
.canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.webgl-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--chalk-400);
}
.webgl-status::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--chalk-500); }
.webgl-status.is-loading::before { background: var(--brass-500); }
.webgl-status.is-ready { border-color: var(--green-line); color: var(--green-ink); }
.webgl-status.is-ready::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.webgl-status.is-fallback { border-color: var(--yellow-line); color: var(--yellow-ink); }
.webgl-status.is-fallback::before { background: var(--yellow); }
.webgl-status.is-error { border-color: var(--red-line); color: var(--red-ink); }
.webgl-status.is-error::before { background: var(--red); }

.sc-overlay { position: absolute; inset: 0; pointer-events: none; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.sc-readout {
  align-self: flex-start;
  padding: 8px 12px;
  background: rgba(14, 14, 18, .72);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--brass-300);
  line-height: 1.5;
}
.sc-hint {
  align-self: center;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .12em;
  color: var(--chalk-500);
}
.sc-warn {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 7px 14px;
  background: var(--red-bg);
  border: 1px solid var(--red-line);
  border-radius: var(--r-pill);
  color: var(--red-ink);
  font-size: .78rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  z-index: 5;
}
.sc-warn.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.studio-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--tailor-950);
  z-index: 4;
  transition: opacity var(--t), visibility var(--t);
}
.studio-loading.hide { opacity: 0; visibility: hidden; }
.studio-loading p { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--chalk-400); margin: 0; }
.sl-track { width: min(260px, 70%); height: 4px; border-radius: var(--r-pill); background: var(--tailor-700); overflow: hidden; }
.sl-bar { height: 100%; width: 0; background: var(--brass-500); transition: width var(--t); }

.studio-fallback {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow-y: auto;
  padding: 24px;
  background: var(--tailor-950);
  display: none;
}
.studio-fallback.show { display: block; }
.studio-fallback h3 { font-size: 1.1rem; color: var(--brass-300); }
.studio-fallback p { font-size: .9rem; color: var(--chalk-300); }
.fb-table { margin: 16px 0; }
.fb-table th, .fb-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: .86rem; }
.fb-table th { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; color: var(--chalk-500); }
.fb-table td:last-child { font-family: var(--font-mono); color: var(--brass-300); }
.fb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.studio-panel { display: flex; flex-direction: column; gap: 18px; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.panel-card h3 { font-family: var(--font-body); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-500); margin: 0 0 14px; }

.slider-row { margin-bottom: 16px; }
.slider-row:last-child { margin-bottom: 0; }
.sl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.sl-top label { font-size: .84rem; color: var(--chalk-300); }
.sl-top output { font-family: var(--font-mono); font-size: .82rem; color: var(--brass-300); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--tailor-700);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: var(--r-pill);
  background: var(--brass-500);
  border: 2px solid var(--tailor-950);
  cursor: pointer;
  box-shadow: var(--glow-brass);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: var(--r-pill);
  background: var(--brass-500);
  border: 2px solid var(--tailor-950);
  cursor: pointer;
}

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-row button {
  padding: 7px 12px;
  background: var(--tailor-800);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--chalk-300);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.preset-row button:hover { border-color: var(--brass-500); color: var(--brass-400); }
.preset-row button.is-active { background: var(--brass-500); color: var(--tailor-950); border-color: var(--brass-400); }

.out-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.out-cell { padding: 10px 12px; background: var(--tailor-900); border: 1px solid var(--line); border-radius: var(--r-sm); }
.out-cell.wide { grid-column: 1 / -1; }
.out-cell dt { font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--chalk-500); }
.out-cell dd { margin: 4px 0 0; font-family: var(--font-mono); font-size: .92rem; color: var(--brass-300); }

.step-list { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.step-list li { position: relative; padding: 8px 0 8px 30px; font-size: .86rem; color: var(--chalk-500); counter-increment: st; border-bottom: 1px dashed var(--line); }
.step-list li:last-child { border-bottom: 0; }
.step-list li::before {
  content: counter(st);
  position: absolute;
  left: 0; top: 8px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--chalk-500);
}
.step-list li.is-done { color: var(--chalk-300); }
.step-list li.is-done::before { background: var(--green); border-color: var(--green); color: var(--tailor-950); }
.step-list li.is-current { color: var(--brass-300); font-weight: 600; }
.step-list li.is-current::before { background: var(--brass-500); border-color: var(--brass-400); color: var(--tailor-950); }

.calc-note { font-size: .78rem; color: var(--chalk-500); }

/* ========================================================= 14 calculators */
.calc-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; align-items: start; }
.calc-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.calc-form .field label { font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--chalk-400); }
.calc-result {
  background: var(--tailor-950);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 30px;
  background-image: var(--brass-sheen);
}
.calc-hero-value {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 700;
  color: var(--brass-400);
  line-height: 1.05;
  text-shadow: 0 0 22px rgba(184, 147, 90, .25);
}
.calc-hero-label { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--chalk-500); margin-bottom: 4px; }
.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.calc-cell { padding: 14px; background: var(--tailor-900); border: 1px solid var(--line); border-radius: var(--r-sm); }
.calc-cell dt { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--chalk-500); }
.calc-cell dd { margin: 5px 0 0; font-family: var(--font-mono); font-size: 1.05rem; color: var(--chalk-100); }
.calc-gauge { margin-top: 22px; }
.gauge-track { height: 8px; border-radius: var(--r-pill); background: var(--tailor-700); overflow: hidden; }
.gauge-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brass-700), var(--brass-400)); transition: width var(--t); }
.calc-formula { margin-top: 20px; font-family: var(--font-mono); font-size: .8rem; color: var(--chalk-400); line-height: 1.6; }

/* ================================================================ 15 blog */
.featured-post {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  color: inherit;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t-fast);
}
.featured-post:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--brass-500); }
.featured-post .fp-media { position: relative; min-height: 300px; background: var(--tailor-800); }
.featured-post .fp-media img { width: 100%; height: 100%; object-fit: cover; }
.featured-post .fp-body { padding: 34px; display: flex; flex-direction: column; justify-content: center; }

.post-hero { padding: 40px 0 30px; background: var(--tailor-950); border-bottom: 3px solid var(--brass-500); }
.post-hero h1 { max-width: 24ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-500); }
.post-meta .author { color: var(--chalk-300); }

.post-body { font-size: 1.02rem; color: var(--chalk-200); }
.post-body h2 { margin-top: 1.7em; padding-top: .3em; }
.post-body h3 { margin-top: 1.4em; }
.post-body ul, .post-body ol { margin: 0 0 1.2em; padding-left: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote { margin: 0 0 1.2em; padding: 14px 20px; border-left: 4px solid var(--brass-500); background: var(--tailor-800); border-radius: var(--r-sm); font-style: italic; color: var(--chalk-200); }
.post-body blockquote footer { margin-top: 8px; font-style: normal; font-family: var(--font-mono); font-size: .76rem; color: var(--brass-500); }

.step-block { display: flex; gap: 16px; margin: 0 0 18px; }
.step-block .sb-num {
  width: 52px; height: 52px;
  flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--tailor-800);
  border: 1px solid var(--brass-500);
  color: var(--brass-400);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}
.step-block h4 { margin: 6px 0 .3em; font-size: 1.05rem; }
.step-block p { margin: 0; font-size: .94rem; color: var(--chalk-300); }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 22px; }
.toc h3 { font-family: var(--font-body); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brass-500); margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 7px; font-size: .88rem; }

.author-box { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-top: 34px; }
.author-box .ab-avatar { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--brass-900); color: var(--brass-300); font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; }
.author-box h4 { margin: 0 0 .2em; }
.author-box p { margin: 0; font-size: .86rem; color: var(--chalk-400); }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 34px; }
.post-nav a { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color var(--t-fast), transform var(--t-fast); }
.post-nav a:hover { border-color: var(--brass-500); transform: translateY(-2px); }
.post-nav .pn-label { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brass-500); }
.post-nav .pn-title { display: block; margin-top: 5px; font-weight: 700; color: var(--chalk-100); }

/* ============================================================ 16 database */
.db-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 20px; }
.compare-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--brass-900);
  border-left: 4px solid var(--brass-500);
  border-radius: var(--r);
}
.compare-bar .cb-slot { font-family: var(--font-mono); font-size: .8rem; color: var(--chalk-300); padding: 4px 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-pill); }
.compare-table td, .compare-table th { text-align: left; }
.compare-table th:first-child { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; color: var(--chalk-500); }
.db-row-toggle { background: none; border: 0; color: var(--brass-400); cursor: pointer; font-family: var(--font-mono); font-size: .76rem; padding: 2px 0; }
.db-detail td { background: var(--tailor-900); }
.db-detail .dd-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.db-detail h4 { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brass-500); margin: 0 0 6px; }
.db-detail p, .db-detail ul { margin: 0; font-size: .86rem; color: var(--chalk-300); }
.db-detail ul { padding-left: 18px; }

/* ============================================================= 17 utilities */
.cluster { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack > * + * { margin-top: 14px; }
.divider { height: 1px; background: var(--line); margin: 34px 0; border: 0; }
.text-center { text-align: center; }
.center-block { margin-left: auto; margin-right: auto; }
.nowrap { white-space: nowrap; }

/* ============================================================= responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .chain-link { padding: 0 12px; font-size: .74rem; letter-spacing: .06em; }
  .studio-wrap { grid-template-columns: minmax(0, 1fr); }
  .split-side { grid-template-columns: minmax(0, 1fr); }
  .split-side > .side { position: static; }
  .split-wide { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .chainnav { display: none; }
  .hamburger { display: grid; }
  :root { --header-h: 52px; }
  .brandbar { height: 52px; }
  .brandbar-inner { height: 52px; }
  .grid-3, .grid-4, .grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  ol.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
  .featured-post { grid-template-columns: minmax(0, 1fr); }
  .studio-preview { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: minmax(0, 1fr); }
  ol.steps { grid-template-columns: minmax(0, 1fr); }
  .trust-bar { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { height: 460px; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
  .out-grid { grid-template-columns: minmax(0, 1fr); }
  .db-detail .dd-inner { grid-template-columns: minmax(0, 1fr); }
  .filter-field input, .filter-field select { min-width: 0; width: 100%; }
  .filter-field { flex: 1 1 100%; }
  .section { padding: 44px 0; }
}

/* ================================================== reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-slide { transition: none; }
  .card:hover, .featured-post:hover, .quote-card:hover, .qa-card:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
}

/* ============================================================== print */
@media print {
  .brandbar, .chainnav, .drawer, .search-overlay, .to-top, .site-footer, .read-progress { display: none !important; }
  body { padding-top: 0; background: #fff; color: #000; }
}
