/* ============================================================
   Automated Empire — design system
   Ops/Automation archetype: IBM Plex Sans, slate + signal orange.
   Mobile-first. Redesign layer over the original guide content.
   ============================================================ */

:root {
  /* ---- Brand: slate + one strong accent ---- */
  --brand-600: #c2410c;   /* primary actions, links — 4.9:1 on white */
  --brand-700: #9a3412;   /* hover states */
  --brand-50:  #fff7ed;   /* tinted surfaces */
  --brand-100: #ffedd5;
  --accent-500: #f59e0b;  /* sparing highlights, gradients */

  /* ---- Neutrals: cool slate ---- */
  --ink-950: #0f172a;
  --ink-900: #1e293b;
  --ink-700: #334155;
  --ink-500: #5b6b82;
  --ink-400: #7d8aa0;
  --paper:   #ffffff;
  --paper-2: #f4f6f9;
  --line:    #e2e8f0;

  /* ---- Type: IBM Plex Sans throughout ---- */
  --font-display: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-hero:    clamp(2.5rem, 1.4rem + 5vw, 4.5rem);
  --text-h1:      clamp(2rem, 1.3rem + 3.2vw, 3.25rem);
  --text-h2:      clamp(1.5rem, 1.15rem + 1.8vw, 2.25rem);
  --text-h3:      1.25rem;
  --text-lead:    clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  --text-body:    1rem;
  --text-small:   0.875rem;
  --text-caption: 0.75rem;

  --leading-tight: 1.05;
  --leading-snug:  1.25;
  --leading-body:  1.65;

  --tracking-display: -0.02em;

  /* ---- Spacing (8pt) ---- */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem;
  --s6: 1.5rem;  --s8: 2rem;   --s12: 3rem;  --s16: 4rem;
  --s24: 6rem;   --s32: 8rem;

  --section-pad: clamp(3.5rem, 2rem + 6vw, 7rem);
  --container: 72rem;
  --container-narrow: 44rem;

  /* ---- Shape & depth ---- */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 6px 24px -8px rgb(15 23 42 / 0.16);
  --shadow-lg: 0 24px 64px -24px rgb(15 23 42 / 0.24);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-600); }
a:hover { color: var(--brand-700); }
:focus-visible {
  outline: 3px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}
img, svg { max-width: 100%; height: auto; display: block; }

/* ---- Layout ---- */
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, var(--container-narrow)); margin-inline: auto; }
.section { padding-block: var(--section-pad); }
.section-alt { background: var(--paper-2); }

/* ---- Type ---- */
h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); margin: 0 0 var(--s4); }
h2 { font-size: var(--text-h2); margin: 0 0 var(--s4); }
h3 { font-size: var(--text-h3); font-weight: 600; margin: 0 0 var(--s2); line-height: var(--leading-snug); }
.hero-title { font-size: var(--text-hero); margin: 0 0 var(--s6); font-weight: 700; }
.lead { font-size: var(--text-lead); color: var(--ink-500); max-width: 42rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--text-caption); font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-700); margin-bottom: var(--s4);
}
.eyebrow::before { content: ""; width: 1.5rem; height: 2px; background: var(--brand-600); border-radius: 2px; }
.muted { color: var(--ink-500); }
.small { font-size: var(--text-small); }
.kicker {
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: var(--text-small); font-weight: 700;
  color: var(--brand-700); margin: var(--s8) 0 var(--s2);
}
.lede { font-size: var(--text-lead); color: var(--ink-500); max-width: 42rem; }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: var(--s6); }
li { margin-bottom: var(--s2); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-weight: 650; font-size: var(--text-body); line-height: 1;
  padding: 0.9rem 1.6rem; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--brand-700); color: #fff; box-shadow: var(--shadow-lg); }
.btn-secondary {
  background: var(--paper); color: var(--ink-900);
  border-color: var(--line); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--ink-400); color: var(--ink-900); }
.btn-lg { padding: 1.1rem 2.1rem; font-size: 1.0625rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s8); }

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding-block: var(--s3);
}
.brandmark { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 1.0625rem; color: var(--ink-950); text-decoration: none; }
.brandmark:hover { color: var(--ink-950); }
.brandmark-mark {
  width: 2rem; height: 2rem; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--ink-950), var(--brand-600));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.brandmark-mark svg { width: 1.15rem; height: 1.15rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s6); list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-links a { color: var(--ink-700); text-decoration: none; font-weight: 550; font-size: var(--text-small); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand-700); }
.nav-cta .btn { padding: 0.65rem 1.25rem; font-size: var(--text-small); }
@media (max-width: 40rem) {
  .nav-inner { flex-wrap: wrap; }
  .nav-cta { display: none; }
}

/* ---- Hero ---- */
.hero { padding-block: clamp(3rem, 2rem + 7vw, 6.5rem) var(--section-pad); position: relative; overflow: clip; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(42rem 26rem at 85% -5%, color-mix(in srgb, var(--brand-600) 10%, transparent), transparent 65%),
    radial-gradient(30rem 20rem at 8% 10%, color-mix(in srgb, var(--accent-500) 8%, transparent), transparent 60%);
}
.hero > .container { position: relative; }
.hero-copy { max-width: 46rem; }
.hero-proof { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); margin-top: var(--s8); padding: 0; list-style: none; }
.hero-proof li { display: flex; align-items: center; gap: var(--s2); font-size: var(--text-small); color: var(--ink-500); font-weight: 550; margin: 0; }
.hero-proof li::before { content: "✓"; color: var(--brand-600); font-weight: 800; }

/* ---- Cards / guide index ---- */
.grid-3 { display: grid; gap: var(--s6); grid-template-columns: 1fr; margin-top: var(--s8); }
.grid-2 { display: grid; gap: var(--s6); grid-template-columns: 1fr; margin-top: var(--s8); }
@media (min-width: 56rem) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--s8);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md);
  background: var(--brand-50); color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; margin-bottom: var(--s4);
}
.card-icon svg { width: 1.4rem; height: 1.4rem; }
.card p { color: var(--ink-500); margin: var(--s2) 0 0; font-size: var(--text-small); }
.card h3 a { color: var(--ink-950); text-decoration: none; }
.card h3 a:hover { color: var(--brand-700); }
.card-link { display: inline-flex; align-items: center; gap: var(--s1); margin-top: var(--s4); font-weight: 650; font-size: var(--text-small); }

/* ---- Steps ---- */
.steps { display: grid; gap: var(--s6); margin-top: var(--s8); counter-reset: step; grid-template-columns: 1fr; }
@media (min-width: 56rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding-top: var(--s8); border-top: 2px solid var(--line); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: calc(-1 * var(--s2)); left: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; color: var(--brand-100);
  background: var(--paper); padding-right: var(--s3); line-height: 1;
}
.step p { color: var(--ink-500); font-size: var(--text-small); margin: var(--s2) 0 0; }

/* ---- CTA band ---- */
.cta-band {
  background: linear-gradient(135deg, var(--ink-950), var(--ink-900));
  color: #fff; border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 2rem + 4vw, 4.5rem);
  text-align: center; position: relative; overflow: clip;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(36rem 18rem at 50% -20%, color-mix(in srgb, var(--brand-600) 35%, transparent), transparent 70%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; margin: 0 0 var(--s4); font-size: var(--text-h2); }
.cta-band p { color: rgb(255 255 255 / 0.72); max-width: 36rem; margin: 0 auto var(--s6); }
.cta-band .btn-row { justify-content: center; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--line); padding-block: var(--s12) var(--s8); margin-top: var(--section-pad); }
.footer-grid { display: grid; gap: var(--s8); grid-template-columns: 1fr; }
@media (min-width: 56rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer h2 { font-size: var(--text-caption); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-500); margin: 0 0 var(--s3); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.footer li { margin: 0; }
.footer a { color: var(--ink-500); text-decoration: none; font-size: var(--text-small); }
.footer a:hover { color: var(--brand-700); }
.footer-base {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); justify-content: space-between;
  margin-top: var(--s12); padding-top: var(--s6); border-top: 1px solid var(--line);
  font-size: var(--text-caption); color: var(--ink-500);
}

/* ---- Article ---- */
.breadcrumbs { font-size: var(--text-small); color: var(--ink-500); margin: var(--s6) 0 0; }
.breadcrumbs a { color: var(--brand-700); text-decoration: underline; }
.breadcrumbs a:hover { color: var(--brand-700); }
.article-head { padding-block: var(--s6) var(--s8); }
.article-head h1 { max-width: 48rem; }
.article-body { padding-bottom: var(--section-pad); }
.article-body h2 { margin-top: var(--s16); }
.formula, .example {
  background: var(--paper-2); border: 1px solid var(--line);
  border-left: 4px solid var(--brand-600);
  border-radius: var(--radius-sm); padding: var(--s4) var(--s6);
  margin: var(--s6) 0;
}
.formula code, .example code { font-family: var(--font-mono); font-size: 0.9375rem; }
.example { border-left-color: var(--accent-500); }
.example p { margin-bottom: var(--s2); }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--s6) var(--s8); margin-top: var(--s12);
  background: var(--paper);
}
.panel h2 { margin-top: 0; font-size: var(--text-h3); }
.faq h3 { margin-top: var(--s8); }
.faq h3:first-of-type { margin-top: var(--s4); }
.prepared { font-size: var(--text-small); color: var(--ink-500); margin-top: var(--s12); }
.data-table { border-collapse: collapse; width: 100%; margin: var(--s6) 0; font-size: var(--text-body); }
.data-table th, .data-table td { border: 1px solid var(--line); padding: var(--s2) var(--s3); text-align: left; }
.data-table th { background: var(--paper-2); }

/* ---- Guide prev/next ---- */
.keep-reading { margin-top: var(--s16); }
.keep-reading .grid-2 { margin-top: var(--s6); }
.next-card { display: block; text-decoration: none; color: inherit; }
.next-card .kicker { margin: 0 0 var(--s2); }
.next-card h3 { color: var(--ink-950); }
.next-card:hover h3 { color: var(--brand-700); }

/* ---- Utility ---- */
.kicker-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--line); margin: var(--s12) 0; }

/* Design review 2026-10-21: keep anchored sections clear of the sticky header (S5.4). */
section[id], h2[id] { scroll-margin-top: 96px; }
