/* ============================================================
   CODENIZE.TOOLS — Design System
   Light engineering UI, deep-slate ink, terminal-emerald accent.
   Structure modeled on img.now; skeleton conventions from sudoku.by.
   ============================================================ */

:root {
  /* Color system: cool neutral base + one terminal-green accent. */
  --bg: #f4f6f8;
  --bg-2: #e9edf1;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --surface-glass-strong: rgba(255, 255, 255, 0.88);
  --text: #0f1a2a;
  --text-2: #46566b;
  --text-3: #64748b;
  --border: rgba(10, 30, 50, 0.10);
  --border-2: rgba(10, 30, 50, 0.05);

  /* Terminal emerald. */
  --accent: #0f9d76;
  --accent-text: #0a7d5e;       /* AA-compliant green for text/links */
  --accent-press: #0c8663;
  --accent-soft: rgba(15, 157, 118, 0.09);
  --accent-border: rgba(15, 157, 118, 0.30);
  --cta-bg: #23dd9f;            /* bright mint button fill */
  --cta-ink: #04291d;
  --ink: #0b1626;               /* deep navy-slate: primary buttons, code windows */
  --warning: #b45309;
  --error: #dc2626;

  /* Code window palette (dark). */
  --code-bg: #0d1524;
  --code-border: #1d2a40;
  --code-text: #dbe7ee;
  --code-muted: #64748b;
  --code-green: #6ee7b7;
  --code-blue: #7dd3fc;
  --code-orange: #fbbf8f;
  --code-purple: #c4b5fd;

  /* Gradients, used sparingly. */
  --grad-hero: radial-gradient(120% 110% at 50% -10%, rgba(35, 221, 159, 0.16) 0%, rgba(15, 157, 118, 0.06) 45%, rgba(244, 246, 248, 0) 72%);
  --grad-accent: linear-gradient(135deg, #23dd9f 0%, #10b981 55%, #0f9d76 100%);
  --grad-soft: linear-gradient(135deg, rgba(35, 221, 159, 0.18), rgba(15, 157, 118, 0.08));

  /* Typography. */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radius. */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-pill: 9999px;

  /* Depth. */
  --shadow-xs: 0 1px 2px rgba(13, 30, 50, 0.06);
  --shadow-sm: 0 1px 3px rgba(13, 30, 50, 0.09), 0 1px 2px rgba(13, 30, 50, 0.05);
  --shadow-md: 0 4px 14px rgba(13, 30, 50, 0.10);
  --shadow-lg: 0 12px 28px rgba(13, 30, 50, 0.14);

  /* Layout. */
  --maxw: 1240px;
  --maxw-narrow: 880px;
  --gutter: clamp(20px, 5vw, 44px);
  --header-h: 64px;

  /* Motion. */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.16s; --t: 0.26s;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.02rem;
  line-height: 1.7;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: inline-block; vertical-align: middle; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 0.5em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1.1em; }
li { margin-bottom: 0.35em; }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(52px, 8vw, 96px) 0; }
.section-sm { padding: clamp(36px, 5vw, 60px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 4vw, 44px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--accent-text); background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 5px 12px; border-radius: var(--r-pill); margin-bottom: 16px;
}
.lead { font-size: 1.14rem; color: var(--text-2); line-height: 1.75; }
.text-muted { color: var(--text-2); }
.text-small { font-size: 0.92rem; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Buttons ---------- */
.btn {
  --bh: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--bh); padding: 0 20px;
  border-radius: var(--r-xs);
  font-size: 0.96rem; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent; background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease),
              box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #000a18; box-shadow: var(--shadow-md); }
.btn-accent { background: var(--cta-bg); color: var(--cta-ink); }
.btn-accent:hover { background: #1ecb91; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--surface-2); border-color: var(--border); }
.btn-lg { --bh: 52px; padding: 0 28px; font-size: 1.02rem; }
.btn-sm { --bh: 36px; padding: 0 14px; font-size: 0.88rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent-border); }
.card h3 { font-size: 1.1rem; margin: 14px 0 6px; }
.card p { color: var(--text-2); font-size: 0.94rem; line-height: 1.55; margin: 0; }
.card-arrow {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  color: var(--accent-text); font-size: 0.9rem; font-weight: 600;
  opacity: 0; transform: translateX(-4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
a.card:hover .card-arrow { opacity: 1; transform: translateX(0); }

.icon-tile {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-text);
  box-shadow: var(--shadow-xs); flex-shrink: 0;
}
.icon-tile.grad { background: var(--grad-soft); border-color: transparent; }
.icon-tile.dark { background: var(--ink); color: var(--code-green); border-color: transparent; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.badge-accent { color: var(--accent-text); border-color: var(--accent-border); background: var(--accent-soft); }
.badge-aws { color: #92510a; border-color: rgba(217, 119, 6, 0.3); background: rgba(217, 119, 6, 0.07); }
.badge-warn { color: var(--warning); border-color: rgba(180, 83, 9, 0.3); background: rgba(180, 83, 9, 0.06); }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 0.9rem; font-weight: 500; box-shadow: var(--shadow-xs); text-decoration: none;
  transition: transform var(--t-fast) var(--ease), border-color var(--t) var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent-border); text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.site-header.scrolled {
  background: var(--surface-glass-strong);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: var(--shadow-xs);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.04em;
  color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--ink); color: var(--code-green);
}
.brand .dot { color: var(--accent); }

.nav-primary { display: flex; align-items: center; gap: 2px; margin: 0 auto; }
.nav-primary > li { list-style: none; position: relative; }
.nav-primary a.nav-link, .nav-primary .nav-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 13px; border-radius: var(--r-sm);
  font-size: 0.95rem; font-weight: 520; color: var(--text-2);
  background: none; border: 0; cursor: pointer; font-family: inherit; text-decoration: none;
}
.nav-primary a.nav-link:hover, .nav-primary .nav-trigger:hover,
.nav-primary a.nav-link.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-primary a.nav-link.active { font-weight: 620; }

.nav-item-menu .nav-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(6px);
  padding: 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; pointer-events: none;
  max-width: calc(100vw - 32px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility var(--t);
  transition-delay: 0.18s; /* grace period: don't hide on a brief mouse-out */
  z-index: 110;
}
/* Invisible strip bridging the gap between trigger and menu so :hover never drops. */
.nav-item-menu .nav-menu::before {
  content: ""; position: absolute; top: -14px; left: -12px; right: -12px; height: 14px;
}
.nav-item-menu:hover .nav-menu, .nav-item-menu:focus-within .nav-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}
.nav-trigger .icon { transition: transform var(--t) var(--ease); }
.nav-item-menu:hover .nav-trigger .icon, .nav-item-menu:focus-within .nav-trigger .icon { transform: rotate(180deg); }
.nav-menu-grid { display: grid; grid-auto-flow: column; gap: 0 30px; }
.nav-menu-heading {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3); margin: 0 0 6px; padding: 0 10px;
}
.nav-cols-2 { columns: 2; column-gap: 16px; }
.nav-cols-2 a { break-inside: avoid; }
.nav-menu a {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-xs);
  color: var(--text-2); font-size: 0.92rem; text-decoration: none; white-space: nowrap;
}
.nav-menu a:hover { background: var(--surface-2); color: var(--text); }
.nav-menu a .icon { width: 16px; height: 16px; color: var(--accent-text); flex-shrink: 0; }
.nav-menu-sub { margin-left: auto; padding-left: 14px; color: var(--text-3); font-size: 0.78rem; }
.nav-menu-footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-2); }
.nav-menu-footer a { font-weight: 600; color: var(--accent-text); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-xs);
  background: none; border: 1px solid var(--border); color: var(--text); cursor: pointer;
}

/* Mobile menu */
.mobile-menu {
  display: none; position: fixed; inset: var(--header-h) 0 0 0; z-index: 95;
  background: var(--surface); overflow-y: auto; padding: 18px var(--gutter) 48px;
}
.mobile-menu.open { display: block; }
.mobile-menu .mm-link {
  display: block; padding: 13px 4px; font-size: 1.05rem; font-weight: 560;
  color: var(--text); border-bottom: 1px solid var(--border-2); text-decoration: none;
}
.mobile-menu details { border-bottom: 1px solid var(--border-2); }
.mobile-menu summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 4px; font-size: 1.05rem; font-weight: 560; cursor: pointer; list-style: none;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu details[open] summary .icon { transform: rotate(180deg); }
.mobile-menu .mm-sub { padding: 0 4px 14px; }
.mobile-menu .mm-sub a {
  display: block; padding: 8px 10px; color: var(--text-2); font-size: 0.96rem;
  border-radius: var(--r-xs); text-decoration: none;
}
.mobile-menu .mm-sub a:hover { background: var(--surface-2); }
.mobile-menu .mm-sub-heading {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3); margin: 12px 0 4px; padding: 0 10px;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  font-size: 0.86rem; color: var(--text-3); padding: 18px 0 0;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text-2); font-weight: 550; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(44px, 7vw, 88px) 0 clamp(32px, 5vw, 64px); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -10% -12% 30%; background: var(--grad-hero); z-index: -1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero .lead { margin-bottom: 26px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; list-style: none; }
.hero-points li { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 0.92rem; margin: 0; }
.hero-points .icon { color: var(--accent-text); width: 16px; height: 16px; }

/* ---------- Code window ---------- */
.code-window {
  background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); overflow: hidden; font-size: 0.88rem;
}
.code-window-bar {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-bottom: 1px solid var(--code-border); background: rgba(255, 255, 255, 0.02);
}
.code-window-bar .dots { display: flex; gap: 6px; }
.code-window-bar .dots span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-window-bar .dots span:nth-child(1) { background: #f6635a; }
.code-window-bar .dots span:nth-child(2) { background: #f8bd44; }
.code-window-bar .dots span:nth-child(3) { background: #3bc75b; }
.code-window-bar .filename {
  margin-left: 8px; font-family: var(--mono); font-size: 0.78rem; color: var(--code-muted);
}
.code-window pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  color: var(--code-text); line-height: 1.65; tab-size: 2;
}
.code-window code { font-size: 0.85rem; }
.tok-k { color: var(--code-blue); }      /* keywords: do, end, hosted_zone */
.tok-s { color: var(--code-green); }     /* strings */
.tok-n { color: var(--code-orange); }    /* numbers */
.tok-c { color: var(--code-muted); font-style: italic; }  /* comments */
.tok-m { color: var(--code-purple); }    /* methods */

/* Terminal-style command block (light chrome) */
.cmd-block {
  position: relative; display: block;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--code-border); border-radius: var(--r-sm);
  padding: 13px 48px 13px 16px; font-family: var(--mono); font-size: 0.86rem;
  overflow-x: auto; white-space: pre; line-height: 1.6;
}
.cmd-block .prompt { color: var(--code-green); user-select: none; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 7px; border: 1px solid var(--code-border);
  background: rgba(255, 255, 255, 0.04); color: var(--code-muted); cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.copy-btn:hover { color: var(--code-text); border-color: var(--code-muted); }
.copy-btn.copied { color: var(--code-green); border-color: var(--code-green); }
.copy-btn .icon { width: 15px; height: 15px; }

/* ---------- Steps (workflow) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-xs); }
.step-num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--ink); color: var(--code-green); font-family: var(--mono); font-weight: 700;
  font-size: 1rem; margin-bottom: 14px;
}
.step h3 { font-size: 1.06rem; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 0.94rem; margin: 0 0 12px; }
.step .cmd-block { font-size: 0.78rem; padding: 10px 40px 10px 13px; }

/* ---------- Feature rows ---------- */
.feature-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px);
  align-items: center; padding: clamp(28px, 4vw, 48px) 0;
}
.feature-row .feature-visual img { border-radius: var(--r-md); box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.feature-row.flip .feature-visual { order: -1; }
.feature-checks { list-style: none; padding: 0; margin: 18px 0 0; }
.feature-checks li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; color: var(--text-2); font-size: 0.97rem; }
.feature-checks .icon { color: var(--accent-text); flex-shrink: 0; margin-top: 4px; width: 17px; height: 17px; }

/* ---------- Tool hero ---------- */
.tool-hero { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(26px, 4vw, 56px); align-items: start; padding: clamp(28px, 4vw, 52px) 0; }
.tool-hero-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.tool-hero h1 { margin: 0; font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.tool-hero .lead { margin-bottom: 20px; }
.tool-specs {
  display: grid; grid-template-columns: auto 1fr; gap: 7px 18px;
  margin: 0 0 22px; font-size: 0.93rem;
}
.tool-specs dt { color: var(--text-3); font-weight: 550; }
.tool-specs dd { margin: 0; color: var(--text); font-family: var(--mono); font-size: 0.88rem; }
.tool-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.status-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(180, 83, 9, 0.06); border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: var(--r-sm); padding: 13px 16px; margin: 18px 0;
  font-size: 0.93rem; color: #7c4a10;
}
.status-note .icon { flex-shrink: 0; margin-top: 3px; width: 17px; height: 17px; }

/* ---------- Prose (article/guide bodies) ---------- */
.prose { max-width: 720px; }
.prose h2 { margin-top: 2em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { margin-top: 1.5em; }
.prose p, .prose li { color: #26364a; }
.prose a { text-decoration: underline; text-decoration-color: rgba(15, 157, 118, 0.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent-text); }
.prose pre {
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--code-border); border-radius: var(--r-sm);
  padding: 16px 18px; overflow-x: auto; font-size: 0.85rem; line-height: 1.65; margin: 0 0 1.2em;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose code {
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 5px;
  padding: 0.1em 0.4em; font-size: 0.85em; color: var(--text);
}
.prose blockquote {
  margin: 0 0 1.2em; padding: 12px 20px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--r-xs) var(--r-xs) 0; color: var(--text-2);
}
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose table thead th {
  text-align: left; background: var(--surface-2); border-bottom: 2px solid var(--border);
  padding: 10px 14px; font-weight: 650; white-space: nowrap;
}
.prose table td { padding: 10px 14px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.prose img { border-radius: var(--r-md); border: 1px solid var(--border); }

/* ---------- Guide layout with TOC ---------- */
.article-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; padding: 8px 0 clamp(40px, 6vw, 72px); }
.article-toc { position: sticky; top: calc(var(--header-h) + 24px); }
.article-toc .toc-title {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 10px;
}
.article-toc nav a {
  display: block; padding: 6px 10px; border-left: 2px solid var(--border);
  color: var(--text-2); font-size: 0.88rem; line-height: 1.4; text-decoration: none;
}
.article-toc nav a:hover { color: var(--accent-text); border-left-color: var(--accent); }
.article-hero-img { border-radius: var(--r-md); border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 28px; width: 100%; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--text-3); font-size: 0.88rem; margin-bottom: 22px; }

/* ---------- FAQ ---------- */
.faq { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--border-2); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px; cursor: pointer; font-weight: 620; font-size: 1rem; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { flex-shrink: 0; color: var(--text-3); transition: transform var(--t) var(--ease); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .faq-body { padding: 0 22px 18px; color: var(--text-2); font-size: 0.96rem; line-height: 1.7; }

/* ---------- Bands & CTA ---------- */
.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cta-banner {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--ink); color: #fff; padding: clamp(36px, 6vw, 64px);
  text-align: center;
}
.cta-banner::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 120% at 50% 120%, rgba(35, 221, 159, 0.25), transparent 60%);
}
.cta-banner > * { position: relative; }
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255, 255, 255, 0.75); max-width: 560px; margin: 0 auto 24px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); padding: 56px 0 32px; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 28px; }
.footer-desc { color: var(--text-2); font-size: 0.93rem; max-width: 300px; }
.footer-col h2, .footer-col .footer-h {
  font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3); font-weight: 700; margin-bottom: 10px;
}
.footer-col a { display: block; color: var(--text-2); font-size: 0.91rem; padding: 4px 0; text-decoration: none; }
.footer-col a:hover { color: var(--accent-text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 0.87rem;
}

/* ---------- Misc ---------- */
.tool-list-section { margin-bottom: clamp(28px, 4vw, 44px); }
.page-hero { padding: clamp(36px, 6vw, 64px) 0 clamp(20px, 3vw, 36px); position: relative; }
.page-hero::before { content: ""; position: absolute; inset: -10% -12% 20%; background: var(--grad-hero); z-index: -1; }
.related-strip { margin-top: clamp(36px, 5vw, 56px); }
.img-frame { border-radius: var(--r-md); border: 1px solid var(--border); box-shadow: var(--shadow-md); overflow: hidden; }
.img-frame img { display: block; width: 100%; }

.error-page { text-align: center; padding: clamp(64px, 12vw, 140px) 0; }
.error-page .code { font-family: var(--mono); font-size: clamp(4rem, 12vw, 7rem); font-weight: 700; color: var(--accent); line-height: 1; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Rich content: callouts, key points, tables ---------- */
.callout {
  display: flex; gap: 13px; align-items: flex-start;
  border-radius: var(--r-md); padding: 16px 18px; margin: 0 0 22px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.callout .callout-ic { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.callout .callout-ic .icon { width: 18px; height: 18px; }
.callout-body { min-width: 0; }
.callout-label {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; margin-bottom: 3px; display: block;
}
.callout p { margin: 0; font-size: 0.98rem; line-height: 1.65; color: var(--text); }
.callout p + p { margin-top: 8px; }

.callout-tldr { background: var(--accent-soft); border-color: var(--accent-border); }
.callout-tldr .callout-ic { background: var(--ink); color: var(--code-green); }
.callout-tldr .callout-label { color: var(--accent-text); }

.callout-tip { background: rgba(217, 119, 6, 0.06); border-color: rgba(217, 119, 6, 0.28); }
.callout-tip .callout-ic { background: #b45309; color: #fff; }
.callout-tip .callout-label { color: #92510a; }

.keypoints {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px 24px; margin: 0 0 24px; box-shadow: var(--shadow-xs);
}
.keypoints .kp-title {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--text-3); margin-bottom: 12px;
}
.keypoints ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.keypoints li { display: flex; gap: 11px; align-items: flex-start; color: var(--text); font-size: 0.97rem; line-height: 1.55; margin: 0; }
.keypoints li .icon { flex-shrink: 0; color: var(--accent-text); width: 18px; height: 18px; margin-top: 2px; }

.info-table-wrap { margin: 8px 0 26px; }
.info-table-title { font-size: 1.06rem; font-weight: 650; margin-bottom: 4px; }
.info-table-caption { color: var(--text-2); font-size: 0.92rem; margin-bottom: 14px; }
.info-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.info-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; background: var(--surface); }
.info-table thead th {
  text-align: left; background: var(--surface-2); border-bottom: 2px solid var(--border);
  padding: 11px 16px; font-weight: 650; white-space: nowrap;
}
.info-table td { padding: 11px 16px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.info-table tbody tr:last-child td { border-bottom: 0; }
.info-table tbody tr:hover { background: var(--surface-2); }
.info-table td:first-child { font-weight: 550; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { display: none; }
}
@media (max-width: 900px) {
  .nav-primary { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions .btn-ghost { display: none; }
  .hero-grid, .tool-hero, .feature-row { grid-template-columns: 1fr; }
  .feature-row.flip .feature-visual { order: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tool-specs { grid-template-columns: 1fr; gap: 2px; }
  .tool-specs dt { margin-top: 8px; }
  body { font-size: 0.98rem; }
}
