/* ==================================================================
   Clay & Kiln — design system
   Light kiln-ash theme · clay-orange primary · glaze-blue accent
   ================================================================== */

/* ---------------------------------------------------------------- 1. Tokens */
:root {
  /* Neutral — kiln ash */
  --kiln-50: #f4f0ea;
  --kiln-100: #efe9e1;
  --white: #ffffff;

  /* Clay scale */
  --clay-900: #6b3220;
  --clay-800: #8a4228;
  --clay-700: #a04e30;
  --clay-600: #b85c3a;
  --clay-500: #d07e5c;
  --clay-300: #e8a88c;
  --clay-200: #f5d6c4;
  --clay-100: #faeae0;

  /* Glaze scale */
  --glaze-900: #243a4e;
  --glaze-800: #2e4a62;
  --glaze-700: #3a5a78;
  --glaze-500: #5a7a98;
  --glaze-300: #8aa4bc;
  --glaze-200: #c4d4e0;
  --glaze-100: #e4edf3;

  /* Kiln gold scale */
  --gold-900: #8a6610;
  --gold-700: #a87a18;
  --gold-600: #c89b3c;
  --gold-500: #ddb45c;
  --gold-300: #efd08c;
  --gold-200: #f7e8c4;
  --gold-100: #fbf4e0;

  /* Greys — charcoal clay */
  --ink: #2a2522;
  --ink-700: #4a423c;
  --ink-600: #6b615a;
  --ink-500: #8c827a;
  --ink-400: #b4aaa2;
  --ink-300: #d4ccc4;
  --ink-200: #e8e2da;

  /* Semantic */
  --danger: #a84a32;
  --danger-text: #8a3a28;
  --success: #4a6b4a;
  --info: #3a5a78;
  --gold-text: #6b4e08;

  /* Borders */
  --border: #e0d8ce;
  --border-strong: #d0c6ba;

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

  /* Shadows — warm */
  --shadow-xs: 0 1px 2px rgba(42, 37, 34, 0.05);
  --shadow-sm: 0 2px 6px rgba(42, 37, 34, 0.07);
  --shadow-md: 0 6px 18px rgba(42, 37, 34, 0.08);
  --shadow-lg: 0 16px 40px rgba(42, 37, 34, 0.1);

  /* Type */
  --font-display: "Fraunces", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: Consolas, Menlo, "Courier New", monospace;

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

  /* Motion */
  --t-fast: 0.18s ease;
  --t-med: 0.3s ease;
}

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

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

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

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

img {
  height: auto;
}

a {
  color: var(--glaze-700);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--clay-700);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.35em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 34px 0;
}

:focus-visible {
  outline: 3px solid var(--gold-600);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection {
  background: var(--gold-300);
  color: var(--ink);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 500;
  background: var(--ink);
  color: var(--kiln-50);
  padding: 10px 18px;
  border-radius: 0 0 var(--r-xs) var(--r-xs);
  font-weight: 700;
  font-size: 0.88rem;
  transition: top var(--t-fast);
}

.skip-link:focus {
  top: 0;
  color: var(--kiln-50);
}

/* ---------------------------------------------------------------- 3. Type */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 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;
}
h6 {
  font-size: 0.94rem;
}

p {
  margin: 0 0 1.15em;
}

.lede {
  font-size: 1.09rem;
  color: var(--ink-600);
  line-height: 1.78;
}

.small {
  font-size: 0.86rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Eyebrow */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin: 0 0 10px;
}

.eyebrow.on-dark {
  color: var(--gold-300);
}

/* Parameter marker — temperatures, dimensions, ratios */
.param {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--kiln-50);
  border: 1px solid var(--clay-200);
  border-radius: var(--r-xs);
  padding: 1px 7px;
  color: var(--clay-800);
  white-space: nowrap;
}

/* Prose link underline */
.prose a,
.prose-block a,
.post-body a {
  text-decoration: underline;
  text-decoration-color: var(--gold-300);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- 4. Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.container-wide {
  max-width: var(--container-wide);
}

.section {
  padding: 60px 0;
}

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

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0 0 4px;
}

.section-head p {
  margin: 0;
  color: var(--ink-600);
  max-width: 62ch;
}

.section-head .link-more {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  color: var(--clay-700);
}

.section-head .link-more:hover {
  color: var(--clay-800);
}

.grid {
  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));
}
.grid-auto-sm {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.divider-clay {
  border-top: 1px solid var(--border-strong);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--ink-500);
  margin: 0 0 14px;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--ink-400);
}

.breadcrumbs a {
  color: var(--ink-600);
}

.breadcrumbs a:hover {
  color: var(--clay-700);
}

/* ---------------------------------------------------------------- 5. Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--kiln-50);
  border-bottom: 1px solid var(--border-strong);
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  height: var(--header-h);
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--clay-600);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-700);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-700);
  padding: 6px 10px;
  border-radius: var(--r-xs);
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}

.nav-link:hover {
  background: rgba(184, 92, 58, 0.08);
  color: var(--clay-700);
}

.nav-link[aria-current="page"] {
  color: var(--clay-600);
  box-shadow: inset 0 -2px 0 var(--clay-600);
}

.nav-caret {
  width: 9px;
  height: 9px;
  opacity: 0.6;
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 300px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
}

.nav-item.open > .dropdown,
.nav-item:hover > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dd-group {
  padding: 4px 0;
}

.dd-group + .dd-group {
  border-top: 1px solid var(--border);
}

.dd-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 7px 10px 3px;
}

.dd-link {
  display: block;
  padding: 7px 10px;
  border-radius: var(--r-xs);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-700);
}

.dd-link:hover {
  background: var(--clay-100);
  color: var(--clay-700);
}

.dd-desc {
  display: block;
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--ink-500);
  line-height: 1.45;
  margin-top: 1px;
}

/* 3D Studio entry button */
.studio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--clay-700);
  border: 1px solid var(--clay-300);
  background: var(--clay-100);
  border-radius: var(--r-pill);
  padding: 6px 13px;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.studio-btn:hover {
  background: var(--clay-600);
  border-color: var(--clay-600);
  color: #fff;
}

.studio-btn svg {
  width: 13px;
  height: 13px;
}

/* Header search */
.header-search {
  position: relative;
  flex: 0 0 auto;
}

.header-search input {
  width: 180px;
  padding: 7px 32px 7px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--white);
  font-size: 0.82rem;
  transition: width var(--t-med), border-color var(--t-fast);
}

.header-search input:focus {
  width: 240px;
  border-color: var(--clay-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.28);
}

.header-search .search-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-500);
  pointer-events: none;
}

/* Search suggestions */
.search-suggest {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 330px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 7px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 210;
}

.search-suggest.show {
  display: block;
}

.search-suggest .sg-item {
  display: block;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  font-size: 0.85rem;
  color: var(--ink-700);
}

.search-suggest .sg-item:hover,
.search-suggest .sg-item.active {
  background: var(--clay-100);
  color: var(--clay-700);
}

.search-suggest .sg-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-500);
}

.search-suggest .sg-empty {
  padding: 12px;
  font-size: 0.84rem;
  color: var(--ink-500);
  text-align: center;
}

/* Hamburger */
.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  background: var(--white);
  border-radius: var(--r-xs);
  cursor: pointer;
  padding: 0;
  place-items: center;
  flex: 0 0 auto;
}

.nav-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 17px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.nav-toggle span::before {
  top: -5px;
}
.nav-toggle span::after {
  top: 5px;
}

/* ---------------------------------------------------------------- 6. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast),
    transform var(--t-fast), box-shadow var(--t-fast);
}

.btn:hover {
  transform: translateY(1px);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--clay-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--clay-700);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-glaze {
  background: var(--glaze-700);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-glaze:hover {
  background: var(--glaze-800);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-outline {
  background: var(--white);
  border-color: var(--border-strong);
  color: var(--ink-700);
}

.btn-outline:hover {
  border-color: var(--clay-500);
  color: var(--clay-700);
  background: var(--clay-100);
}

.btn-ghost-light {
  background: rgba(244, 240, 234, 0.12);
  border-color: rgba(244, 240, 234, 0.4);
  color: var(--kiln-50);
}

.btn-ghost-light:hover {
  background: rgba(244, 240, 234, 0.22);
  color: #fff;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.83rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------------------------------------------------------------- 7. Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t-med), transform var(--t-med), border-color var(--t-med);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--clay-300);
}

.card-media {
  aspect-ratio: 16 / 10;
  background: var(--kiln-100);
  overflow: hidden;
  position: relative;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-med);
}

.card:hover .card-media img {
  transform: scale(1.04);
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  margin: 0 0 7px;
  line-height: 1.3;
}

.card-title a {
  color: var(--ink);
}

.card-title a:hover {
  color: var(--clay-700);
}

.card-text {
  font-size: 0.88rem;
  color: var(--ink-600);
  margin: 0 0 14px;
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--ink-500);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}

/* Category card — no image */
.cat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--clay-100);
  display: grid;
  place-items: center;
  color: var(--clay-700);
}

.cat-icon svg {
  width: 24px;
  height: 24px;
}

.cat-count {
  font-size: 0.78rem;
  color: var(--ink-500);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cat-arrow {
  margin-left: auto;
  color: var(--gold-700);
  font-weight: 700;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Tool card — line art on kiln ash */
.tool-card .card-media {
  background: var(--kiln-100);
  aspect-ratio: 4 / 3;
  padding: 14px;
}

.tool-card .card-media img {
  object-fit: contain;
}

/* Blog card */
.blog-card .card-media {
  aspect-ratio: 16 / 9;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--ink-500);
  margin-bottom: 8px;
}

.blog-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-400);
}

/* Calculator card */
.calc-card {
  padding: 20px;
}

.mini-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.mini-field label {
  font-size: 0.78rem;
  color: var(--ink-600);
  font-weight: 600;
  min-width: 62px;
}

.mini-field input,
.mini-field select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xs);
  background: var(--kiln-50);
  font-size: 0.84rem;
}

/* Studio card — dark charcoal */
.studio-card {
  background: var(--ink);
  border-color: var(--ink-700);
  color: var(--kiln-50);
  overflow: hidden;
}

.studio-card:hover {
  border-color: var(--gold-600);
}

.studio-card .card-body {
  color: var(--kiln-50);
}

.studio-card .card-title {
  color: #fff;
}

.studio-card .card-title a {
  color: #fff;
}

.studio-card .card-title a:hover {
  color: var(--gold-300);
}

.studio-card .card-text {
  color: var(--ink-300);
}

.studio-thumb {
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 50% 42%, #3a322c 0%, #211d1a 72%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.studio-thumb img {
  width: 62%;
  height: auto;
  opacity: 0.95;
}

/* ---------------------------------------------------------------- 8. Tags */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--clay-100);
  color: var(--clay-700);
  border: 1px solid var(--clay-200);
  white-space: nowrap;
}

.tag-glaze {
  background: var(--glaze-100);
  color: var(--glaze-700);
  border-color: var(--glaze-200);
}

.tag-gold {
  background: var(--gold-100);
  color: var(--gold-900);
  border-color: var(--gold-300);
}

.tag-green {
  background: #e8f0e8;
  color: var(--success);
  border-color: #c8dcc8;
}

.tag-red {
  background: var(--clay-100);
  color: var(--danger-text);
  border-color: var(--clay-300);
}

.tag-outline {
  background: transparent;
  color: var(--ink-600);
  border-color: var(--border-strong);
}

.chip {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--border-strong);
  color: var(--ink-700);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.chip:hover {
  border-color: var(--clay-500);
  color: var(--clay-700);
}

.chip.active,
.chip[aria-pressed="true"] {
  background: var(--clay-600);
  border-color: var(--clay-600);
  color: #fff;
}

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

/* 3D badge */
.badge-3d {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--gold-300);
  color: var(--ink);
}

.badge-3d svg {
  width: 11px;
  height: 11px;
}

/* Stage pill */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--glaze-100);
  color: var(--glaze-700);
  border: 1px solid var(--glaze-200);
}

/* ---------------------------------------------------------------- 9. Notices */
.notice {
  border-radius: var(--r-md);
  padding: 15px 18px;
  margin: 0 0 20px;
  font-size: 0.9rem;
  border-left: 4px solid transparent;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice-title {
  display: block;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.notice.safety {
  background: var(--gold-100);
  border-color: var(--gold-300);
  color: var(--gold-text);
}

.notice.info {
  background: var(--glaze-100);
  border-color: var(--glaze-300);
  color: var(--glaze-800);
}

.notice.warn {
  background: var(--clay-100);
  border-color: var(--clay-300);
  color: var(--danger-text);
}

.notice.neutral {
  background: var(--kiln-50);
  border-color: var(--border-strong);
  color: var(--ink-700);
}

.tip-box {
  border-left: 4px solid var(--gold-300);
  background: var(--gold-100);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 18px;
  margin: 0 0 20px;
  font-size: 0.9rem;
}

.tip-box.tip-warn {
  border-color: var(--clay-500);
  background: var(--clay-100);
  color: var(--danger-text);
}

.tip-box.tip-note {
  border-color: var(--glaze-300);
  background: var(--glaze-100);
  color: var(--glaze-800);
}

.tip-box.tip-ok {
  border-color: #8fae8f;
  background: #e8f0e8;
  color: #35502f;
}

.tip-box .tb-title {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
  font-size: 0.86rem;
}

.tip-box p:last-child {
  margin-bottom: 0;
}

.legal-note {
  background: var(--kiln-50);
  border-left: 4px solid var(--clay-600);
  padding: 14px 18px;
  font-size: 0.84rem;
  color: var(--ink-600);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  margin: 26px 0 0;
}

.legal-note p:last-child {
  margin-bottom: 0;
}

.empty-state {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 46px 24px;
  text-align: center;
  color: var(--ink-500);
  background: var(--white);
}

.empty-state h3 {
  margin-bottom: 6px;
  color: var(--ink-700);
}

/* Safety strip */
.safety-strip {
  background: var(--clay-100);
  border-bottom: 1px solid var(--clay-300);
  padding: 11px 0;
}

.safety-strip .container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--danger-text);
  font-weight: 600;
}

.safety-strip .ss-icons {
  display: flex;
  gap: 7px;
}

.safety-strip .ss-icons svg {
  width: 17px;
  height: 17px;
}

.safety-strip strong {
  font-weight: 800;
  letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------- 10. Page hero */
.page-hero {
  background: var(--ink);
  color: var(--kiln-50);
  border-bottom: 3px solid var(--clay-600);
  padding: 42px 0 46px;
}

.page-hero h1 {
  color: #fff;
  margin-bottom: 12px;
}

.page-hero .lede {
  color: var(--ink-300);
  max-width: 74ch;
  margin: 0;
}

.page-hero .breadcrumbs {
  color: var(--ink-400);
}

.page-hero .breadcrumbs a {
  color: var(--ink-300);
}

.page-hero .breadcrumbs a:hover {
  color: var(--gold-300);
}

.page-hero .breadcrumbs li + li::before {
  color: var(--ink-600);
}

.page-hero .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ---------------------------------------------------------------- 11. Home */
/* Hero carousel */
.hero {
  position: relative;
  height: 460px;
  overflow: hidden;
  background: var(--kiln-100);
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    #f4f0ea 0%,
    rgba(244, 240, 234, 0.9) 46%,
    rgba(184, 92, 58, 0.28) 100%
  );
}

.hero-contents {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  animation: heroFade 0.7s ease;
}

.hero-content[hidden] {
  display: none;
}

@keyframes heroFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-inner {
  max-width: 620px;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-700);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--clay-200);
  border-radius: var(--r-pill);
  padding: 6px 15px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(1.95rem, 4.2vw, 2.9rem);
  margin-bottom: 14px;
}

.hero p {
  font-size: 1.03rem;
  color: var(--ink-700);
  margin-bottom: 24px;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-controls {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  z-index: 4;
}

.hero-controls .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 30px;
  height: 5px;
  border-radius: var(--r-pill);
  background: rgba(42, 37, 34, 0.22);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width var(--t-med), background var(--t-med);
}

.hero-dot.active {
  width: 46px;
  background: var(--clay-600);
}

.hero-arrows {
  display: flex;
  gap: 8px;
}

.hero-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink-700);
  transition: background var(--t-fast), color var(--t-fast);
}

.hero-arrow:hover {
  background: var(--clay-600);
  color: #fff;
  border-color: var(--clay-600);
}

.hero-arrow svg {
  width: 15px;
  height: 15px;
}

/* Trust bar */
.trust-bar {
  background: var(--ink);
  color: var(--kiln-50);
  padding: 38px 0;
}

.trust-bar .grid {
  gap: 26px;
}

.trust-item {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.trust-icon {
  flex: 0 0 auto;
  color: var(--gold-300);
}

.trust-icon svg {
  width: 22px;
  height: 22px;
}

.trust-item h3 {
  color: #fff;
  font-size: 0.97rem;
  margin: 0 0 5px;
}

.trust-item p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink-300);
  line-height: 1.6;
}

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  counter-reset: step;
}

.steps li {
  margin: 0;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: 100%;
  transition: box-shadow var(--t-med), transform var(--t-med);
}

.step-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.step-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--kiln-100);
}

.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(--clay-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.94rem;
  box-shadow: var(--shadow-sm);
}

.step-body {
  padding: 16px;
}

.step-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-600);
  margin-bottom: 5px;
}

.step-body h3 {
  font-size: 1.02rem;
  margin: 0 0 6px;
}

.step-body p {
  font-size: 0.84rem;
  color: var(--ink-600);
  margin: 0;
}

/* Studio preview band — dark immersive */
.studio-band {
  background: var(--ink);
  color: var(--kiln-50);
  padding: 56px 0;
  position: relative;
  overflow: hidden;
}

.studio-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 22% 50%, rgba(184, 92, 58, 0.22) 0%, transparent 58%);
  pointer-events: none;
}

.studio-band .container {
  position: relative;
  z-index: 2;
}

.studio-band-head {
  margin-bottom: 30px;
}

.studio-band-head h2 {
  color: #fff;
  margin-bottom: 8px;
}

.studio-band-head p {
  color: var(--ink-300);
  max-width: 66ch;
  margin: 0;
}

.studio-band-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 30px;
  align-items: center;
}

.studio-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #3a322c 0%, #1c1917 76%);
  border: 1px solid var(--ink-700);
}

.studio-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.studio-preview .preview-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 0.72rem;
  color: var(--ink-300);
  background: rgba(20, 18, 16, 0.7);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  border: 1px solid var(--ink-700);
}

.studio-preview .preview-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  text-align: center;
  color: var(--ink-300);
  font-size: 0.85rem;
}

.studio-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.studio-quick a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px;
  border-radius: var(--r-md);
  background: rgba(244, 240, 234, 0.06);
  border: 1px solid var(--ink-700);
  color: var(--kiln-50);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.studio-quick a:hover {
  background: rgba(244, 240, 234, 0.12);
  border-color: var(--gold-600);
  transform: translateY(-2px);
  color: #fff;
}

.studio-quick .sq-icon {
  color: var(--gold-300);
}

.studio-quick .sq-icon svg {
  width: 20px;
  height: 20px;
}

.studio-quick strong {
  font-size: 0.9rem;
  font-family: var(--font-display);
}

.studio-quick span {
  font-size: 0.75rem;
  color: var(--ink-300);
  line-height: 1.5;
}

/* CTA band */
.cta-band {
  background: var(--clay-600);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 44px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.cta-band h2 {
  color: #fff;
  margin: 0 0 8px;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  max-width: 56ch;
  font-size: 0.95rem;
}

.cta-band .btn {
  background: #fff;
  color: var(--clay-700);
  flex: 0 0 auto;
}

.cta-band .btn:hover {
  background: var(--kiln-50);
  color: var(--clay-800);
}

/* ---------------------------------------------------------------- 12. Tool detail */
.split-wide {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
}

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

.split-half {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  align-items: start;
}

.exhibit {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.exhibit-main {
  aspect-ratio: 4 / 3;
  background: var(--kiln-100);
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}

.exhibit-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exhibit-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.exhibit-thumb {
  aspect-ratio: 1;
  background: var(--kiln-50);
  border: 0;
  padding: 9px;
  cursor: pointer;
  transition: background var(--t-fast);
}

.exhibit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exhibit-thumb:hover {
  background: var(--clay-100);
}

.exhibit-thumb.active {
  background: var(--clay-200);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0 0;
  font-size: 0.86rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.spec-table caption {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 0 0 8px;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

.spec-table th {
  font-weight: 600;
  color: var(--ink-600);
  width: 44%;
  background: var(--kiln-50);
  font-size: 0.83rem;
}

.spec-table td {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
}

.panel > h3 {
  font-size: 1.12rem;
  margin: 0 0 12px;
}

.panel > h4 {
  font-size: 0.98rem;
  margin: 18px 0 8px;
}

.panel ul {
  margin-bottom: 0;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.89rem;
  color: var(--ink-700);
  margin-bottom: 9px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--clay-500);
  transform: rotate(45deg);
}

.check-list.safety-list li::before {
  background: var(--danger);
}

/* Related tools */
.related-strip {
  border-top: 1px solid var(--border);
  margin-top: 46px;
  padding-top: 38px;
}

/* ---------------------------------------------------------------- 13. Listing */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-xs);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 150px;
  min-width: 140px;
}

.field label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xs);
  background: var(--kiln-50);
  font-size: 0.87rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--clay-500);
  outline: none;
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.22);
}

.field-search {
  flex: 1 1 240px;
}

.filter-count {
  font-size: 0.84rem;
  color: var(--ink-600);
  padding: 9px 0;
  white-space: nowrap;
}

.filter-count strong {
  color: var(--clay-700);
}

.result-note {
  font-size: 0.86rem;
  color: var(--ink-600);
  margin: 0 0 18px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  background: var(--white);
  border-radius: var(--r-xs);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.page-btn:hover:not([disabled]) {
  border-color: var(--clay-500);
  color: var(--clay-700);
  background: var(--clay-100);
}

.page-btn.active {
  background: var(--clay-600);
  border-color: var(--clay-600);
  color: #fff;
}

.page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------- 14. Calculator */
.calc-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  align-items: start;
}

.calc-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.calc-form h2 {
  font-size: 1.25rem;
  margin: 0 0 4px;
}

.calc-form .cf-sub {
  font-size: 0.85rem;
  color: var(--ink-600);
  margin: 0 0 20px;
}

.calc-form .field + .field {
  margin-top: 15px;
}

.unit-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-bottom: 18px;
}

.unit-toggle button {
  border: 0;
  background: var(--white);
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-600);
  cursor: pointer;
}

.unit-toggle button.active {
  background: var(--clay-600);
  color: #fff;
}

.result-card {
  background: var(--ink);
  color: var(--kiln-50);
  border-radius: var(--r-md);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.result-card .rc-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin: 0 0 4px;
}

.result-hero {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--gold-300);
  margin: 0 0 4px;
  word-break: break-word;
}

.result-hero .unit {
  font-size: 0.42em;
  color: var(--ink-300);
  margin-left: 5px;
}

.result-sub {
  font-size: 0.84rem;
  color: var(--ink-300);
  margin: 0 0 22px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink-700);
  border: 1px solid var(--ink-700);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.result-cell {
  background: var(--ink);
  padding: 14px 16px;
}

.result-cell dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin: 0 0 3px;
}

.result-cell dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.02rem;
  color: #fff;
}

.gauge {
  margin-top: 22px;
}

.gauge-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--ink-300);
  margin-bottom: 6px;
}

.gauge-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--ink-700);
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--gold-600), var(--gold-300));
  transition: width var(--t-med);
}

.formula {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-700);
  font-size: 0.79rem;
  color: var(--ink-400);
}

.formula code {
  font-family: var(--font-mono);
  color: var(--gold-300);
  font-size: 0.94em;
}

/* ---------------------------------------------------------------- 15. Blog */
.featured-post {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 30px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 38px;
}

.featured-post .fp-media {
  aspect-ratio: 16 / 10;
  background: var(--kiln-100);
  height: 100%;
}

.featured-post .fp-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-post .fp-body {
  padding: 34px 34px 34px 4px;
}

.featured-post h2 {
  margin-bottom: 10px;
}

.post-hero {
  background: var(--ink);
  color: var(--kiln-50);
  padding: 40px 0 0;
  border-bottom: 3px solid var(--clay-600);
}

.post-hero h1 {
  color: #fff;
  max-width: 22ch;
}

.post-hero .lede {
  color: var(--ink-300);
  max-width: 70ch;
}

.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--ink-300);
  margin: 18px 0 0;
}

.post-byline .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--clay-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}

.post-hero-img {
  margin-top: 30px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  overflow: hidden;
  border: 1px solid var(--ink-700);
  border-bottom: 0;
  aspect-ratio: 21 / 9;
  background: var(--kiln-100);
}

.post-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body {
  font-size: 1.01rem;
}

.post-body h2 {
  margin: 44px 0 14px;
  padding-top: 4px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.post-body h3 {
  margin: 30px 0 10px;
  font-size: 1.18rem;
}

.post-body > section:first-child h2 {
  margin-top: 6px;
}

.post-body figure {
  margin: 26px 0;
}

.post-body figure img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--kiln-100);
}

.post-body figcaption {
  font-size: 0.8rem;
  color: var(--ink-500);
  margin-top: 8px;
  text-align: center;
}

.post-body .data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.87rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.post-body .data-table th,
.post-body .data-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.post-body .data-table thead th {
  background: var(--kiln-100);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-600);
}

.post-body .data-table tbody tr:last-child td {
  border-bottom: 0;
}

.param-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--white);
}

.param-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  margin: 0;
  font-size: 0.88rem;
}

.param-list li:last-child {
  border-bottom: 0;
}

.param-list .pl-key {
  color: var(--ink-600);
  font-weight: 600;
}

.param-list .pl-val {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--clay-800);
  text-align: right;
}

.step-block {
  display: flex;
  gap: 16px;
  margin: 22px 0;
  align-items: flex-start;
}

.step-block .sb-num {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--clay-100);
  border: 1px solid var(--clay-200);
  color: var(--clay-700);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.step-block h4 {
  margin: 6px 0 4px;
  font-size: 1.04rem;
}

.step-block p {
  margin: 0;
  font-size: 0.91rem;
  color: var(--ink-600);
}

/* Sidebar */
.side-sticky {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 22px;
}

.toc h2 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-family: var(--font-body);
  margin: 0 0 12px;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 7px 10px 7px 30px;
  border-radius: var(--r-xs);
  font-size: 0.85rem;
  color: var(--ink-600);
  position: relative;
  line-height: 1.45;
  border-left: 2px solid transparent;
}

.toc a::before {
  counter-increment: toc;
  content: counter(toc);
  position: absolute;
  left: 9px;
  top: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink-400);
  font-family: var(--font-mono);
}

.toc a:hover {
  background: var(--clay-100);
  color: var(--clay-700);
}

.toc a.active {
  background: var(--clay-100);
  color: var(--clay-700);
  border-left-color: var(--clay-600);
}

.author-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.author-box .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clay-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  flex: 0 0 auto;
}

.author-box h3 {
  font-size: 0.95rem;
  margin: 0 0 2px;
}

.author-box p {
  font-size: 0.8rem;
  color: var(--ink-600);
  margin: 0;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}

.post-nav a {
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.post-nav a:hover {
  border-color: var(--clay-300);
  transform: translateY(-2px);
}

.post-nav .pn-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 5px;
}

.post-nav strong {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
  display: block;
}

.post-nav .pn-next {
  text-align: right;
}

/* Reading progress + to top */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--clay-600);
  z-index: 300;
  transition: width 0.1s linear;
}

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--ink-700);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--t-med), transform var(--t-med), visibility var(--t-med);
  z-index: 150;
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--clay-600);
  color: #fff;
  border-color: var(--clay-600);
}

.to-top svg {
  width: 17px;
  height: 17px;
}

/* ---------------------------------------------------------------- 16. Content pages */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}

.info-card h3 {
  font-size: 1.04rem;
  margin: 0 0 8px;
}

.info-card p {
  font-size: 0.88rem;
  color: var(--ink-600);
  margin: 0;
}

.prose-block {
  max-width: 76ch;
}

.prose-block h2 {
  margin-top: 40px;
}

.prose-block h2:first-child {
  margin-top: 0;
}

.prose-block ul,
.prose-block ol {
  margin-bottom: 1.2em;
}

.prose-block li {
  margin-bottom: 0.4em;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.form-card .field + .field {
  margin-top: 16px;
}

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

.form-row + .field,
.field + .form-row {
  margin-top: 16px;
}

.form-status {
  margin-top: 16px;
  font-size: 0.87rem;
  padding: 12px 15px;
  border-radius: var(--r-xs);
  display: none;
}

.form-status.show {
  display: block;
}

.form-status.ok {
  background: #e8f0e8;
  color: #35502f;
  border: 1px solid #c8dcc8;
}

.form-status.err {
  background: var(--clay-100);
  color: var(--danger-text);
  border: 1px solid var(--clay-300);
}

.field .field-err {
  font-size: 0.76rem;
  color: var(--danger-text);
  display: none;
}

.field.invalid input,
.field.invalid textarea {
  border-color: var(--danger);
  background: #fdf3ef;
}

.field.invalid .field-err {
  display: block;
}

/* ---------------------------------------------------------------- 17. Studio (3D) */
.studio-toolbar {
  background: var(--ink);
  border-bottom: 1px solid var(--ink-700);
  color: var(--kiln-50);
  padding: 12px 0;
}

.studio-toolbar .container {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.studio-toolbar .st-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  margin: 0;
}

.studio-toolbar .st-sep {
  width: 1px;
  height: 22px;
  background: var(--ink-700);
}

.tb-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-700);
  background: rgba(244, 240, 234, 0.06);
  color: var(--kiln-50);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.tb-btn:hover {
  background: rgba(244, 240, 234, 0.14);
  border-color: var(--gold-600);
  color: #fff;
}

.tb-btn.active {
  background: var(--clay-600);
  border-color: var(--clay-600);
  color: #fff;
}

.tb-btn svg {
  width: 13px;
  height: 13px;
}

.tb-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.studio-stage {
  background: #17140f;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  align-items: stretch;
}

.studio-canvas-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 44%, #3a322c 0%, #17140f 74%);
  height: clamp(420px, 68vh, 760px);
  min-height: 0;
  overflow: hidden;
}

.studio-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.studio-canvas-wrap canvas:active {
  cursor: grabbing;
}

.studio-overlay {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 5;
}

.overlay-stat {
  background: rgba(20, 18, 16, 0.78);
  border: 1px solid var(--ink-700);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  color: var(--kiln-50);
  min-width: 96px;
}

.overlay-stat .os-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.overlay-stat .os-value {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  color: var(--gold-300);
}

.studio-hint {
  position: absolute;
  left: 16px;
  top: 16px;
  background: rgba(20, 18, 16, 0.78);
  border: 1px solid var(--ink-700);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 0.74rem;
  color: var(--ink-300);
  z-index: 5;
}

.studio-panel {
  background: #211d19;
  border-left: 1px solid var(--ink-700);
  padding: 20px;
  overflow-y: auto;
  max-height: clamp(420px, 68vh, 760px);
  color: var(--kiln-50);
}

.studio-panel::-webkit-scrollbar {
  width: 8px;
}

.studio-panel::-webkit-scrollbar-thumb {
  background: var(--ink-700);
  border-radius: 4px;
}

.sp-section + .sp-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--ink-700);
}

.sp-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin: 0 0 14px;
}

.sp-slider {
  margin-bottom: 16px;
}

.sp-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.sp-slider-head label {
  font-size: 0.82rem;
  color: var(--kiln-50);
  font-weight: 600;
}

.sp-slider-head output {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold-300);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--ink-700);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--clay-500);
  border: 2px solid var(--kiln-50);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--clay-500);
  border: 2px solid var(--kiln-50);
  cursor: pointer;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.preset-btn {
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-700);
  background: rgba(244, 240, 234, 0.06);
  color: var(--kiln-50);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.preset-btn:hover {
  background: rgba(244, 240, 234, 0.14);
  border-color: var(--gold-600);
}

.preset-btn.active {
  background: var(--clay-600);
  border-color: var(--clay-600);
  color: #fff;
}

/* Swatch grid for glaze painter */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.swatch {
  aspect-ratio: 1;
  border-radius: var(--r-xs);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform var(--t-fast), border-color var(--t-fast);
}

.swatch:hover {
  transform: scale(1.06);
}

.swatch.active {
  border-color: var(--kiln-50);
  box-shadow: 0 0 0 2px var(--gold-600);
}

.studio-footer-hint {
  background: var(--ink);
  color: var(--ink-300);
  font-size: 0.8rem;
  padding: 14px 0;
  border-top: 1px solid var(--ink-700);
}

.studio-footer-hint .container {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
}

.studio-footer-hint kbd {
  background: var(--ink-700);
  border-radius: 4px;
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--kiln-50);
  border: 1px solid #4a423c;
}

/* WebGL fallback */
.gl-fallback[hidden] {
  display: none;
}

.gl-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 34px;
  text-align: center;
  background: #211d19;
  color: var(--kiln-50);
  z-index: 6;
}

.gl-fallback-inner {
  max-width: 420px;
}

.gl-fallback h3 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.gl-fallback p {
  font-size: 0.85rem;
  color: var(--ink-300);
  margin-bottom: 16px;
}

.gl-fallback svg {
  margin: 0 auto 14px;
  width: 90px;
  height: 90px;
}

/* Kiln curve chart */
.chart-wrap {
  background: #211d19;
  border-radius: var(--r-sm);
  padding: 16px;
  border: 1px solid var(--ink-700);
}

.chart-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

.curve-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--ink-300);
  margin-top: 12px;
}

.curve-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.curve-legend i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

/* Segment table */
.seg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 14px;
}

.seg-table th,
.seg-table td {
  text-align: left;
  padding: 7px 9px;
  border-bottom: 1px solid var(--ink-700);
  color: var(--kiln-50);
}

.seg-table th {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.seg-table td {
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.kiln-visual {
  display: grid;
  place-items: center;
  padding: 14px 0;
}

.kiln-visual svg {
  width: 120px;
  height: 120px;
}

/* ---------------------------------------------------------------- 18. Search page */
.search-hero-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 640px;
}

.search-hero-form input {
  flex: 1 1 300px;
  padding: 13px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--white);
  font-size: 0.96rem;
}

.search-hero-form input:focus {
  border-color: var(--clay-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 155, 60, 0.24);
}

.search-hit {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.search-hit:hover {
  border-color: var(--clay-300);
  transform: translateX(3px);
}

.search-hit .sh-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--clay-100);
  display: grid;
  place-items: center;
  color: var(--clay-700);
  flex: 0 0 auto;
}

.search-hit .sh-icon svg {
  width: 20px;
  height: 20px;
}

.search-hit h3 {
  font-size: 1.02rem;
  margin: 0 0 4px;
}

.search-hit h3 a {
  color: var(--ink);
}

.search-hit h3 a:hover {
  color: var(--clay-700);
}

.search-hit p {
  font-size: 0.85rem;
  color: var(--ink-600);
  margin: 0 0 7px;
}

.search-hit mark {
  background: var(--gold-300);
  color: var(--ink);
  border-radius: 2px;
  padding: 0 2px;
}

.search-group-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 30px 0 14px;
  font-family: var(--font-body);
}

/* ---------------------------------------------------------------- 19. Footer */
.site-footer {
  background: var(--ink);
  color: var(--kiln-50);
  margin-top: 60px;
  padding-top: 52px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding-bottom: 40px;
}

.footer-brand .brand {
  color: #fff;
  margin-bottom: 14px;
}

.footer-brand .brand-name {
  color: #fff;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--ink-300);
  max-width: 40ch;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--ink-700);
  display: grid;
  place-items: center;
  color: var(--ink-300);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.footer-social a:hover {
  background: var(--clay-600);
  border-color: var(--clay-600);
  color: #fff;
}

.footer-social svg {
  width: 15px;
  height: 15px;
}

.footer-col h3 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin: 0 0 14px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 9px;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--ink-300);
}

.footer-col a:hover {
  color: var(--gold-300);
}

.footer-sub {
  margin-top: 18px;
}

.footer-sub label {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-400);
  margin-bottom: 7px;
}

.footer-sub .fs-row {
  display: flex;
  gap: 8px;
}

.footer-sub input {
  flex: 1;
  min-width: 0;
  padding: 9px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-700);
  background: rgba(244, 240, 234, 0.07);
  color: var(--kiln-50);
  font-size: 0.83rem;
}

.footer-sub input::placeholder {
  color: var(--ink-500);
}

.footer-sub input:focus {
  outline: none;
  border-color: var(--gold-600);
}

.footer-sub button {
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--clay-600);
  color: #fff;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.footer-sub button:hover {
  background: var(--clay-700);
}

.footer-sub .fs-msg {
  font-size: 0.76rem;
  margin-top: 8px;
  color: var(--gold-300);
  min-height: 1em;
}

/* Footer disclaimer zone */
.footer-disclaimer {
  border-top: 1px solid var(--ink-700);
  padding: 26px 0;
}

.disclaimer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 30px;
}

.disclaimer-card {
  background: rgba(244, 240, 234, 0.05);
  border: 1px solid var(--gold-600);
  border-radius: var(--r-md);
  padding: 20px;
}

.disclaimer-card .dc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.disclaimer-card .dc-head svg {
  width: 20px;
  height: 20px;
  color: var(--gold-300);
  flex: 0 0 auto;
}

.disclaimer-card h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin: 0;
}

.disclaimer-card p,
.disclaimer-card li {
  font-size: 0.81rem;
  color: var(--ink-300);
  margin: 0 0 7px;
}

.disclaimer-card ul {
  padding-left: 18px;
  margin: 0;
}

.disclaimer-card ul li:last-child {
  margin-bottom: 0;
}

.footer-bottom {
  border-top: 1px solid var(--ink-700);
  padding: 20px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.79rem;
  color: var(--ink-400);
}

.footer-bottom nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom a {
  color: var(--ink-400);
}

.footer-bottom a:hover {
  color: var(--gold-300);
}

.age-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-700);
  color: var(--ink-300);
}

/* ---------------------------------------------------------------- 20. Utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: 14px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 38px; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-600); }
.nowrap { white-space: nowrap; }
.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;
}

.stack-sm > * + * { margin-top: 10px; }
.stack > * + * { margin-top: 18px; }
.stack-lg > * + * { margin-top: 30px; }

/* Grain texture (optional, very subtle) */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- 21. Responsive */
@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .studio-band-grid {
    grid-template-columns: 1fr;
  }
  .studio-stage {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
}

@media (max-width: 1000px) {
  .header-search input {
    width: 140px;
  }
  .header-search input:focus {
    width: 180px;
  }
  .split-wide {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 30px;
  }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: grid;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--r-md) var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: 10px;
    margin: 0;
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    z-index: 205;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 11px 12px;
    font-size: 0.92rem;
  }

  .dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 8px 12px;
    min-width: 0;
    display: none;
  }

  .nav-item.open > .dropdown {
    display: block;
  }

  .nav-item:hover > .dropdown {
    transform: none;
  }

  .studio-btn {
    margin-left: auto;
  }

  .header-search {
    display: none;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-wide,
  .split-side,
  .split-half,
  .calc-layout,
  .featured-post,
  .disclaimer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .featured-post .fp-body {
    padding: 0 24px 28px;
  }

  .result-card,
  .side-sticky {
    position: static;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-panel {
    border-left: 0;
    border-top: 1px solid var(--ink-700);
    max-height: none;
  }

  .studio-canvas-wrap {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .section {
    padding: 44px 0;
  }

  .section-sm {
    padding: 30px 0;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-auto,
  .grid-auto-sm,
  .steps,
  .form-row,
  .post-nav,
  .footer-grid,
  .studio-quick,
  .swatch-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .swatch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero {
    height: 460px;
  }

  .hero-inner {
    max-width: 100%;
  }

  .hero-controls .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .trust-bar .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .cta-band {
    padding: 30px 22px;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-grid {
    gap: 26px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-hero {
    font-size: 2.4rem;
  }

  .studio-canvas-wrap {
    min-height: 340px;
  }

  .studio-stage {
    min-height: 0;
  }

  .studio-toolbar .st-sep {
    display: none;
  }

  .post-body h2 {
    margin-top: 34px;
  }

  .step-block .sb-num {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }

  .search-hit {
    flex-direction: column;
    gap: 10px;
  }
}

/* ---------------------------------------------------------------- 22. Motion prefs */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover,
  .step-card:hover,
  .btn:hover {
    transform: none;
  }
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .hero-controls,
  .to-top,
  .read-progress,
  .filter-bar {
    display: none !important;
  }
  body {
    background: #fff;
  }
}
