/* ==========================================================================
   AutoBlogForge LLC — Core stylesheet
   Design system: tokens -> base -> layout -> components -> sections -> utils
   Palette concept: "cold steel + molten brass" on warm bone paper.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand colours */
  --pine-900: #0d1a15;
  --pine-800: #12281f;
  --pine-700: #17402f;
  --pine-600: #1c6244;
  --pine-500: #1f7d55;
  --pine-400: #2ea36f;
  --pine-300: #6fc79b;
  --pine-100: #dcf0e5;

  --brass-600: #9a6415;
  --brass-500: #c98a2b;
  --brass-400: #e0a749;
  --brass-100: #f8ecd6;

  --bone-000: #ffffff;
  --bone-050: #faf8f3;
  --bone-100: #f3f0e8;
  --bone-200: #e7e2d6;
  --bone-300: #d6d0c0;

  --ink-900: #10201a;
  --ink-700: #2c3c35;
  --ink-500: #5a6a63;
  --ink-400: #7d8b84;

  --danger: #b4342b;
  --warning: #a9741a;
  --ok: #1f7d55;

  /* Semantic tokens (light theme is the default) */
  --bg: var(--bone-050);
  --bg-alt: var(--bone-100);
  --surface: var(--bone-000);
  --surface-2: var(--bone-050);
  --line: var(--bone-200);
  --line-strong: var(--bone-300);
  --text: var(--ink-900);
  --text-soft: var(--ink-500);
  --text-invert: #f4f7f5;
  --brand: var(--pine-600);
  --brand-hover: var(--pine-700);
  --brand-soft: var(--pine-100);
  --accent: var(--brass-500);
  --accent-soft: var(--brass-100);
  --dark-panel: var(--pine-900);

  /* Typography */
  --font-display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --fs-xs: 0.78rem;
  --fs-sm: 0.88rem;
  --fs-base: 1rem;
  --fs-md: 1.09rem;
  --fs-lg: 1.35rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.2rem;
  --fs-3xl: 2.9rem;
  --fs-4xl: 3.6rem;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 32, 26, 0.06);
  --shadow-md: 0 6px 20px rgba(16, 32, 26, 0.08);
  --shadow-lg: 0 22px 50px rgba(16, 32, 26, 0.14);

  --wrap: 1180px;
  --header-h: 68px;
  --speed: 200ms;
}

/* Dark theme overrides — toggled by data-theme on <html> */
[data-theme="dark"] {
  --bg: #0b1512;
  --bg-alt: #0f1e19;
  --surface: #12241d;
  --surface-2: #162b23;
  --line: #22392f;
  --line-strong: #2d4b3e;
  --text: #e8f0eb;
  --text-soft: #9fb2a8;
  --text-invert: #0b1512;
  --brand: var(--pine-400);
  --brand-hover: var(--pine-300);
  --brand-soft: #16352a;
  --accent: var(--brass-400);
  --accent-soft: #34291a;
  --dark-panel: #0a120f;
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.5);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-4);
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5.2vw, var(--fs-4xl)); }
h2 { font-size: clamp(1.8rem, 3.6vw, var(--fs-3xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--speed) ease;
}
a:hover { color: var(--brand-hover); text-decoration: underline; }

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

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.15rem; }
li { margin-bottom: var(--sp-2); }

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

code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }

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

::selection { background: var(--accent); color: #1b1205; }

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 18px;
  z-index: 999;
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; }

.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;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.wrap-narrow { max-width: 800px; }

.band { padding-block: var(--sp-9); }
.band-sm { padding-block: var(--sp-8); }
.band-alt { background: var(--bg-alt); }
.band-dark {
  background: var(--dark-panel);
  color: var(--text-invert);
}
.band-dark h2, .band-dark h3 { color: #fff; }
.band-dark p { color: #c2d3cb; }

.grid { display: grid; gap: var(--sp-5); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--sp-8);
  align-items: center;
}

.stack-4 > * + * { margin-top: var(--sp-4); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* Section head */
.head { max-width: 680px; margin-bottom: var(--sp-7); }
.head.center { margin-inline: auto; }
.head p { color: var(--text-soft); font-size: var(--fs-md); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-600);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--sp-3);
}
[data-theme="dark"] .eyebrow { color: var(--brass-400); }
.eyebrow::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--accent);
  transform: rotate(45deg);
  display: inline-block;
}

/* --------------------------------------------------------------------------
   4. Buttons & pills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1;
  padding: 14px 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--speed) ease, background var(--speed) ease,
    border-color var(--speed) ease, color var(--speed) ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }

.btn-brass { background: var(--accent); color: #23180a; }
.btn-brass:hover { background: var(--brass-400); color: #23180a; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-quiet {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-quiet:hover { border-color: var(--line-strong); color: var(--text); }

.btn-light { background: #fff; color: var(--pine-800); }
.btn-light:hover { background: var(--bone-100); color: var(--pine-900); }

.btn-sm { padding: 9px 14px; font-size: var(--fs-xs); }
.btn-lg { padding: 17px 30px; font-size: var(--fs-base); }
.btn-block { width: 100%; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--pine-700);
  border: 1px solid transparent;
}
[data-theme="dark"] .pill { color: var(--pine-300); }
.pill-brass { background: var(--accent-soft); color: var(--brass-600); }
[data-theme="dark"] .pill-brass { color: var(--brass-400); }
.pill-line { background: transparent; border-color: var(--line-strong); color: var(--text-soft); }

/* --------------------------------------------------------------------------
   5. Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--speed) ease, transform var(--speed) ease,
    box-shadow var(--speed) ease;
}
.card-hover:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card h3 { margin-bottom: var(--sp-2); }
.card p { color: var(--text-soft); font-size: var(--fs-sm); }

.card-dark {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-invert);
  box-shadow: none;
}
.card-dark p { color: #b9cbc2; }

/* Icon tile drawn with CSS only (no external icon fonts) */
.tile {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--pine-600);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
  border: 1px solid rgba(31, 125, 85, 0.18);
}
[data-theme="dark"] .tile { color: var(--pine-300); }
.tile-brass {
  background: var(--accent-soft);
  color: var(--brass-600);
  border-color: rgba(201, 138, 43, 0.25);
}
[data-theme="dark"] .tile-brass { color: var(--brass-400); }

/* --------------------------------------------------------------------------
   6. Announcement bar + header
   -------------------------------------------------------------------------- */
.announce {
  background: var(--pine-800);
  color: #dbeae2;
  font-size: var(--fs-xs);
  text-align: center;
  padding: 9px var(--sp-5);
  position: relative;
}
.announce a { color: var(--brass-400); font-weight: 600; }
.announce .close-announce {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #9db4a9;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.announce .close-announce:hover { color: #fff; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

/* Logo: pure CSS/SVG wordmark */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: -0.03em;
  color: var(--text);
}
.logo:hover { text-decoration: none; color: var(--text); }
.logo .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--pine-600), var(--pine-800) 70%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex: none;
}
.logo .mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 45%, rgba(224, 167, 73, 0.9) 50%, transparent 56%);
}
.logo .mark span {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.logo em { font-style: normal; color: var(--brand); }
[data-theme="dark"] .logo em { color: var(--pine-300); }

/* Primary nav */
.nav { display: flex; align-items: center; gap: var(--sp-2); }
.nav a.nav-link,
.nav button.nav-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav a.nav-link:hover,
.nav button.nav-link:hover { background: var(--bg-alt); color: var(--brand); text-decoration: none; }
.nav a.nav-link[aria-current="page"] { color: var(--brand); font-weight: 600; }

.has-dropdown { position: relative; }
.caret {
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--speed) ease;
}
.has-dropdown.open .caret { transform: rotate(-135deg) translateY(-2px); }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 290px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3);
  display: none;
}
.has-dropdown.open .dropdown { display: block; }
.dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-sm);
}
.dropdown a:hover { background: var(--bg-alt); text-decoration: none; color: var(--brand); }
.dropdown a small { display: block; color: var(--text-soft); font-size: var(--fs-xs); font-weight: 400; }
.dropdown a strong { font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: var(--sp-2); }

/* Theme toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--speed) ease;
}
.theme-toggle:hover { border-color: var(--brand); }

/* Mobile menu */
.burger {
  display: none;
  width: 40px; height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  position: relative;
}
.burger span {
  position: absolute;
  left: 10px;
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: transform var(--speed) ease, opacity var(--speed) ease;
}
.burger span:nth-child(1) { top: 13px; }
.burger span:nth-child(2) { top: 18px; }
.burger span:nth-child(3) { top: 23px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: var(--sp-4) var(--sp-5) var(--sp-6);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
}
.mobile-nav a:hover { color: var(--brand); text-decoration: none; }
.mobile-nav .mobile-cta { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); }

/* --------------------------------------------------------------------------
   7. Hero + the forge line (signature element)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--sp-8) var(--sp-9);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 60% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 60% 0%, #000 20%, transparent 75%);
  opacity: 0.55;
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero h1 { margin-bottom: var(--sp-5); }
.hero h1 mark {
  background: linear-gradient(transparent 62%, var(--accent-soft) 62%);
  color: inherit;
  padding: 0 2px;
}
.hero-lede { font-size: var(--fs-md); color: var(--text-soft); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  font-family: var(--font-mono);
}
.hero-notes span::before { content: "✓ "; color: var(--brand); font-weight: 700; }

/* The forge line panel */
.forge {
  background: var(--dark-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  color: #e6efe9;
  box-shadow: var(--shadow-lg);
}
.forge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--sp-4);
}
.forge-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fae9f;
}
.dot-row { display: flex; gap: 6px; }
.dot-row i {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: block;
}
.dot-row i:first-child { background: var(--brass-400); }

.forge-note {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: #8fae9f;
  margin-top: 14px;
  line-height: 1.5;
}

.forge-input { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.forge-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
}
.forge-input input::placeholder { color: #7d9689; }

.queue { display: grid; gap: 10px; }
.job {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.03);
}
.job-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
}
.job-title { font-weight: 600; color: #fff; }
.job-stage {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  color: #a9c2b4;
  white-space: nowrap;
}
.job-stage[data-stage="published"] { background: rgba(46, 163, 111, 0.22); color: #8fe0b6; }
.job-stage[data-stage="drafting"] { background: rgba(224, 167, 73, 0.2); color: var(--brass-400); }
.job-meta { font-size: var(--fs-xs); color: #8ea79a; margin-top: 4px; font-family: var(--font-mono); }
.rail {
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  margin-top: 10px;
  overflow: hidden;
}
.rail > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pine-500), var(--brass-400));
  transition: width 420ms ease;
}
.forge-foot {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: #8fae9f;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   8. Trust band, stats, marquee
   -------------------------------------------------------------------------- */
.trust {
  border-block: 1px solid var(--line);
  background: var(--bg-alt);
  padding-block: var(--sp-6);
}
.trust-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: var(--sp-5);
}
.logo-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-6);
  align-items: center;
}
.fake-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-soft);
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.fake-logo::before {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(12deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
  margin-top: var(--sp-7);
}
.stat { text-align: center; }
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  letter-spacing: -0.03em;
  color: var(--text);
}
.stat span { font-size: var(--fs-xs); color: var(--text-soft); font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   9. Spec sheet (features), steps, tables
   -------------------------------------------------------------------------- */
.spec {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
.spec-item {
  padding: var(--sp-6) var(--sp-5);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.spec-item:nth-child(3n) { border-right: 0; }
.spec-item:nth-last-child(-n + 3) { border-bottom: 0; }
.spec-item h3 { font-size: var(--fs-lg); }
.spec-item p { color: var(--text-soft); font-size: var(--fs-sm); margin: 0; }
.spec-num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--brass-600);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: var(--sp-3);
}
[data-theme="dark"] .spec-num { color: var(--brass-400); }

/* Four-stage production line */
.line {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
.line::before {
  content: "";
  position: absolute;
  top: 26px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 16px);
}
.stage { text-align: center; padding: 0 var(--sp-3); position: relative; }
.stage-dot {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin: 0 auto var(--sp-4);
  font-family: var(--font-mono);
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.stage:last-child .stage-dot { border-color: var(--accent); color: var(--brass-600); }
[data-theme="dark"] .stage:last-child .stage-dot { color: var(--brass-400); }
.stage h3 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.stage p { font-size: var(--fs-sm); color: var(--text-soft); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: var(--fs-sm);
}
table.data th, table.data td {
  padding: 14px var(--sp-5);
  text-align: left;
  border-bottom: 1px solid var(--line);
}
table.data thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--bg-alt);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.yes { color: var(--ok); font-weight: 600; }
table.data td.no { color: var(--text-soft); }
.col-brand { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }

/* --------------------------------------------------------------------------
   10. Content type chips, use cases, workflow
   -------------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 9px 16px;
  font-size: var(--fs-sm);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color var(--speed) ease, color var(--speed) ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip b { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--brass-600); }
[data-theme="dark"] .chip b { color: var(--brass-400); }

.ledger { border-top: 1px solid var(--line); }
.ledger-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--sp-6);
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.ledger-row .key {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding-top: 5px;
}
.ledger-row h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.ledger-row p { color: var(--text-soft); }

/* Dashboard mockup drawn in CSS */
.mock {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); display: block; }
.mock-bar span {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-soft);
}
.mock-body { display: grid; grid-template-columns: 168px 1fr; min-height: 320px; }
.mock-side { border-right: 1px solid var(--line); padding: var(--sp-4); background: var(--surface-2); }
.mock-side u {
  display: block;
  height: 9px;
  border-radius: 4px;
  background: var(--line);
  margin-bottom: 13px;
  text-decoration: none;
}
.mock-side u.on { background: var(--brand); width: 72%; }
.mock-main { padding: var(--sp-5); }
.mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.mock-cards div {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-3);
}
.mock-cards b { display: block; font-family: var(--font-display); font-size: var(--fs-lg); }
.mock-cards small { color: var(--text-soft); font-size: var(--fs-xs); }
.mock-list { display: grid; gap: 9px; }
.mock-list i {
  display: block;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--bg-alt) 0 38%, transparent 38%);
}

/* --------------------------------------------------------------------------
   11. Testimonials carousel
   -------------------------------------------------------------------------- */
.carousel { position: relative; }
.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 1fr);
  gap: var(--sp-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: var(--sp-4);
  scrollbar-width: thin;
}
.carousel-track > * { scroll-snap-align: start; }
.quote { display: flex; flex-direction: column; gap: var(--sp-4); height: 100%; }
.quote blockquote { margin: 0; font-size: var(--fs-md); line-height: 1.6; }
.quote .who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--pine-700);
  font-weight: 700;
  font-family: var(--font-display);
  flex: none;
}
[data-theme="dark"] .avatar { color: var(--pine-300); }
.who b { display: block; font-size: var(--fs-sm); }
.who span { font-size: var(--fs-xs); color: var(--text-soft); }
.stars { color: var(--brass-500); letter-spacing: 2px; font-size: var(--fs-sm); }
.carousel-nav { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-3); }
.carousel-nav button {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
}
.carousel-nav button:hover { border-color: var(--brand); color: var(--brand); }

/* --------------------------------------------------------------------------
   12. Pricing
   -------------------------------------------------------------------------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
  flex-wrap: wrap;
}
.switch {
  position: relative;
  width: 56px; height: 30px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  transition: transform var(--speed) ease;
}
.switch[aria-checked="true"]::after { transform: translateX(26px); }
.toggle-row label,
.billing-label { font-size: var(--fs-sm); font-weight: 600; cursor: pointer; color: var(--text-soft); }
.billing-label.active { color: var(--text); }
.toggle-row .save {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--brass-600);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
[data-theme="dark"] .toggle-row .save { color: var(--brass-400); }

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); align-items: start; }
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.plan.featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-md);
}
.plan .badge {
  position: absolute;
  top: -12px;
  left: var(--sp-5);
  background: var(--brand);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.plan h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-1); }
.plan .tagline { font-size: var(--fs-xs); color: var(--text-soft); min-height: 34px; margin-bottom: var(--sp-4); }
.price { display: flex; align-items: baseline; gap: 5px; margin-bottom: var(--sp-1); }
.price b { font-family: var(--font-display); font-size: 2.5rem; letter-spacing: -0.04em; }
.price span { color: var(--text-soft); font-size: var(--fs-sm); }
.price-note { font-size: var(--fs-xs); color: var(--text-soft); font-family: var(--font-mono); margin-bottom: var(--sp-5); min-height: 20px; }
.plan ul { list-style: none; padding: 0; margin: var(--sp-5) 0 var(--sp-5); font-size: var(--fs-sm); }
.plan ul li { padding-left: 24px; position: relative; color: var(--text-soft); }
.plan ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 8px;
  width: 11px; height: 6px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}
.plan ul li.off::before {
  border: 0;
  content: "—";
  color: var(--text-soft);
  top: 0; left: 0;
  width: auto; height: auto;
  transform: none;
}
.plan .btn { margin-top: auto; }

/* --------------------------------------------------------------------------
   13. FAQ accordion
   -------------------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text);
  padding: var(--sp-5) 42px var(--sp-5) 0;
  cursor: pointer;
  position: relative;
  line-height: 1.35;
}
.faq-q::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--brand);
  font-family: var(--font-mono);
  line-height: 1;
}
.faq-q[aria-expanded="true"]::after { content: "–"; }
.faq-a {
  display: none;
  padding: 0 var(--sp-7) var(--sp-5) 0;
  color: var(--text-soft);
  font-size: var(--fs-sm);
}
.faq-a.open { display: block; }

/* --------------------------------------------------------------------------
   14. Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint { font-weight: 400; color: var(--text-soft); font-size: var(--fs-xs); display: block; }
.input, select.input, textarea.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--text);
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}
.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
textarea.input { min-height: 130px; resize: vertical; line-height: 1.6; }
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) 51%, calc(100% - 13px) 51%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}
.input.invalid { border-color: var(--danger); }
.err {
  display: none;
  color: var(--danger);
  font-size: var(--fs-xs);
  margin-top: 5px;
}
.err.show { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  height: 26px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--fs-sm);
  color: var(--text-soft);
}
.check input { margin-top: 4px; accent-color: var(--brand); }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--text-soft);
  padding: 6px 8px;
  border-radius: var(--r-sm);
}
.pw-toggle:hover { color: var(--brand); }

.form-note { font-size: var(--fs-xs); color: var(--text-soft); }
.success-box {
  display: none;
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  color: var(--pine-700);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}
[data-theme="dark"] .success-box { color: var(--pine-300); }
.success-box.show { display: block; }

/* Auth pages */
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--header-h));
}
.auth-form { display: grid; place-items: center; padding: var(--sp-8) var(--sp-5); }
.auth-form .inner { width: 100%; max-width: 400px; }
.auth-aside {
  background: var(--dark-panel);
  color: var(--text-invert);
  padding: var(--sp-8) var(--sp-7);
  display: grid;
  align-content: center;
  gap: var(--sp-5);
}
.auth-aside h2 { color: #fff; }
.auth-aside p, .auth-aside li { color: #b9cbc2; }
.auth-aside ul { list-style: none; padding: 0; }
.auth-aside li { padding-left: 24px; position: relative; margin-bottom: 12px; }
.auth-aside li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 11px; height: 6px;
  border-left: 2px solid var(--brass-400);
  border-bottom: 2px solid var(--brass-400);
  transform: rotate(-45deg);
}

/* --------------------------------------------------------------------------
   15. Generator tool
   -------------------------------------------------------------------------- */
.tool { display: grid; grid-template-columns: 380px 1fr; gap: var(--sp-5); align-items: start; }
.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.tool-out {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.tool-out-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tool-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.counts {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  display: flex;
  gap: var(--sp-4);
}
.output {
  padding: var(--sp-6);
  flex: 1;
  overflow-y: auto;
  max-height: 70vh;
}
.output h1, .output h2, .output h3 { font-family: var(--font-display); }
.output h1 { font-size: var(--fs-2xl); }
.output h2 { font-size: var(--fs-xl); margin-top: var(--sp-6); }
.output h3 { font-size: var(--fs-md); margin-top: var(--sp-5); }
.output p, .output li { font-size: 0.98rem; }
.output .kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-3);
}

.empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-5);
  color: var(--text-soft);
  height: 100%;
}
.empty .glyph {
  width: 58px; height: 58px;
  border-radius: var(--r-md);
  border: 2px dashed var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  color: var(--text-soft);
}

/* Loading skeleton */
.skeleton { display: grid; gap: 12px; padding: var(--sp-6); }
.skeleton i {
  display: block;
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--line) 37%, var(--bg-alt) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skeleton i.tall { height: 26px; width: 60%; }
.skeleton i.short { width: 82%; }
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.history-list { display: grid; gap: var(--sp-2); }
.history-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: var(--fs-sm);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  align-items: center;
  background: var(--surface-2);
}
.history-item button {
  background: transparent;
  border: 0;
  color: var(--brand);
  cursor: pointer;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   16. Blog
   -------------------------------------------------------------------------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.post-card { display: flex; flex-direction: column; height: 100%; }
.post-thumb {
  height: 150px;
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, var(--pine-700), var(--pine-500) 60%, var(--brass-500));
  position: relative;
  overflow: hidden;
}
.post-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 28px 28px;
}
.post-thumb.b { background: linear-gradient(135deg, var(--pine-800), var(--brass-600)); }
.post-thumb.c { background: linear-gradient(135deg, var(--brass-500), var(--pine-600)); }
.post-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  margin-bottom: var(--sp-2);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.post-card h3 { font-size: var(--fs-md); }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--brand); text-decoration: none; }
.post-card .btn { margin-top: auto; }

.article { max-width: 720px; }
.article h2 { font-size: var(--fs-xl); margin-top: var(--sp-7); }
.article h3 { font-size: var(--fs-lg); margin-top: var(--sp-6); }
.article p, .article li { font-size: var(--fs-md); color: var(--text); }
.article blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-5);
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--fs-md);
}
.article figure { margin: var(--sp-6) 0; }
.article figcaption { font-size: var(--fs-xs); color: var(--text-soft); margin-top: var(--sp-2); }
.author-box {
  display: flex;
  gap: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-top: var(--sp-7);
  background: var(--surface);
}
.author-box .avatar { width: 56px; height: 56px; font-size: var(--fs-md); }

.toc {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  margin-bottom: var(--sp-6);
}
.toc strong {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: block;
  margin-bottom: var(--sp-2);
}
.toc ol { margin: 0; font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--pine-900);
  color: #b9cbc2;
  padding-block: var(--sp-8) var(--sp-5);
  margin-top: var(--sp-9);
}
.site-footer a { color: #b9cbc2; font-size: var(--fs-sm); }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: var(--sp-6);
  padding-bottom: var(--sp-7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand .logo { color: #fff; margin-bottom: var(--sp-4); }
.footer-brand p { font-size: var(--fs-sm); max-width: 34ch; }
.footer-col h4 {
  color: #fff;
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-top: var(--sp-5);
  font-size: var(--fs-xs);
}
.social { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.social a {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0;
}
.social a:hover { border-color: var(--brass-400); color: var(--brass-400); }

/* --------------------------------------------------------------------------
   18. Overlays: modal, toast, cookie bar, back to top
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 14, 0.62);
  display: none;
  place-items: center;
  padding: var(--sp-5);
  z-index: 120;
}
.modal-backdrop.open { display: grid; }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  max-width: 520px;
  width: 100%;
  padding: var(--sp-6);
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
}
.modal-close:hover { border-color: var(--brand); color: var(--brand); }
.modal h3 { margin-bottom: var(--sp-2); }
.modal .summary {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  background: var(--bg-alt);
  font-size: var(--fs-sm);
  margin: var(--sp-4) 0;
}
.modal .summary div { display: flex; justify-content: space-between; gap: var(--sp-3); margin-bottom: 8px; }
.modal .summary div:last-child { margin-bottom: 0; font-weight: 700; }

#toast-area {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  display: grid;
  gap: 10px;
  z-index: 130;
  max-width: 330px;
}
.toast {
  background: var(--pine-900);
  color: #eaf3ee;
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--brand);
  animation: toast-in 260ms ease;
}
.toast.warn { border-left-color: var(--brass-400); }
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.cookie-bar {
  position: fixed;
  left: var(--sp-5);
  bottom: var(--sp-5);
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-lg);
  z-index: 110;
  display: none;
}
.cookie-bar.show { display: block; }
.cookie-bar p { font-size: var(--fs-sm); color: var(--text-soft); }
.cookie-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }

.to-top {
  position: fixed;
  right: var(--sp-5);
  bottom: 84px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: none;
  place-items: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
  font-size: 1rem;
}
.to-top.show { display: grid; }
.to-top:hover { border-color: var(--brand); color: var(--brand); }

/* --------------------------------------------------------------------------
   19. Page header (inner pages) + misc
   -------------------------------------------------------------------------- */
.page-head {
  padding-block: var(--sp-8) var(--sp-7);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.page-head h1 { margin-bottom: var(--sp-3); }
.page-head p { color: var(--text-soft); font-size: var(--fs-md); max-width: 62ch; }
.crumbs {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  margin-bottom: var(--sp-4);
}
.crumbs a { color: var(--text-soft); }

.legal h2 { font-size: var(--fs-xl); margin-top: var(--sp-7); }
.legal h3 { font-size: var(--fs-md); margin-top: var(--sp-5); }
.legal p, .legal li { color: var(--text-soft); font-size: var(--fs-sm); }
.legal .updated {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: inline-block;
  margin-bottom: var(--sp-5);
}

.cta-band {
  background: linear-gradient(135deg, var(--pine-800), var(--pine-600));
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  color: #fff;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--sp-6);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 167, 73, 0.34), transparent 65%);
}
.cta-band h2 { color: #fff; margin-bottom: var(--sp-3); }
.cta-band p { color: #cfe0d7; }
.cta-band .actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; position: relative; z-index: 1; }

.err-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--brand);
  margin-bottom: var(--sp-4);
}

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .split { grid-template-columns: 1fr; gap: var(--sp-7); }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .spec { grid-template-columns: repeat(2, 1fr); }
  .spec-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .spec-item:nth-child(2n) { border-right: 0; }
  .spec-item:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .spec-item:nth-last-child(-n + 2) { border-bottom: 0; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .tool { grid-template-columns: 1fr; }
  .tool-panel { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

@media (max-width: 860px) {
  .nav, .header-actions .btn { display: none; }
  .burger { display: block; }
  .line { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .line::before { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cta-band { grid-template-columns: 1fr; padding: var(--sp-6); }
  .ledger-row { grid-template-columns: 1fr; gap: var(--sp-2); }
}

@media (max-width: 640px) {
  :root { --sp-9: 64px; --sp-8: 48px; }
  .g-2, .g-3, .g-4, .spec, .post-grid, .plans, .mock-cards, .field-row {
    grid-template-columns: 1fr;
  }
  .spec-item { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .spec-item:last-child { border-bottom: 0 !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mock-body { grid-template-columns: 1fr; }
  .mock-side { display: none; }
  .line { grid-template-columns: 1fr; }
  .cookie-bar { left: var(--sp-3); right: var(--sp-3); max-width: none; bottom: var(--sp-3); }
  #toast-area { left: var(--sp-3); right: var(--sp-3); max-width: none; }
  .output { padding: var(--sp-4); }
  .carousel-track { grid-auto-columns: 86%; }
}

/* --------------------------------------------------------------------------
   21. Motion + print preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-footer, .announce, .cookie-bar, .to-top, #toast-area,
  .tool-panel, .hero-cta { display: none !important; }
  body { background: #fff; color: #000; }
}
