/* ===================================================================
   SB140Explained.com — Editorial stylesheet
   Aesthetic: serious editorial publication with Texas regional gravity
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..900,0..100,0..1&family=Source+Serif+4:opsz,wght@8..60,300..700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Editorial palette — warm parchment, deep navy, Texas earth accent */
  --bg-paper: #f6f1e6;
  --bg-card: #fcf9f2;
  --bg-deep: #1a1d2e;
  --bg-deep-alt: #14172b;

  --ink-primary: #1a1d2e;
  --ink-body: #2a2e3f;
  --ink-secondary: #5a5e6f;
  --ink-muted: #8a8a93;
  --ink-inverse: #f6f1e6;

  --accent: #b85c2c;
  --accent-deep: #8b3d1a;
  --accent-soft: #f0d7c0;

  --rule: #d4cbb8;
  --rule-strong: #a89c80;
  --highlight: #faebc8;
  --warn-bg: #f5dcd2;
  --warn-ink: #6b1e10;
  --consumer: #a93226;
  --business: #1f4e5f;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --col-narrow: 38rem;
  --col-medium: 52rem;
  --col-wide: 72rem;
  --col-max: 88rem;

  --radius-s: 2px;
  --radius-m: 4px;
  --radius-l: 8px;

  --shadow-soft: 0 1px 2px rgba(26, 29, 46, 0.04), 0 2px 8px rgba(26, 29, 46, 0.04);
  --shadow-card: 0 1px 0 rgba(26, 29, 46, 0.06), 0 4px 16px rgba(26, 29, 46, 0.06);
  --shadow-lift: 0 2px 4px rgba(26, 29, 46, 0.08), 0 12px 32px rgba(26, 29, 46, 0.10);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-paper);
  background-image:
    radial-gradient(at 0% 0%, rgba(184, 92, 44, 0.02) 0%, transparent 50%),
    radial-gradient(at 100% 100%, rgba(26, 29, 46, 0.02) 0%, transparent 50%);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: 'kern', 'liga', 'onum';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent); text-decoration-thickness: 2px; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 5vw + 0.5rem, 3.75rem);
  font-weight: 500;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 144;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.625rem, 2.5vw + 0.75rem, 2.25rem);
  font-variation-settings: 'opsz' 72;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
  font-variation-settings: 'opsz' 24;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}

p { margin: 0 0 1.25rem 0; }

.lede {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1.5vw + 0.5rem, 1.375rem);
  font-variation-settings: 'opsz' 48, 'SOFT' 50;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink-body);
  margin-bottom: 2rem;
  letter-spacing: -0.005em;
}

.byline {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
}
.byline strong { color: var(--ink-primary); font-weight: 600; }
.byline .sep { color: var(--rule-strong); }

blockquote, .pullquote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-variation-settings: 'opsz' 72, 'SOFT' 50;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink-primary);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  letter-spacing: -0.01em;
}

code, .stat-label {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(26, 29, 46, 0.06);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-s);
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */

.wrap {
  max-width: var(--col-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article {
  max-width: var(--col-medium);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article-wide {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-loose { padding: 6rem 0; }

/* ============================================================
   MASTHEAD / HEADER
   ============================================================ */

.masthead {
  background: var(--bg-paper);
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(246, 241, 230, 0.92);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  text-decoration: none;
  color: var(--ink-primary);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand-mark {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 1;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}
.brand-mark .accent { color: var(--accent); }

.brand-sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 1px solid var(--rule-strong);
  padding-left: 0.5rem;
}

.nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.nav a {
  color: var(--ink-body);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-m);
  letter-spacing: -0.005em;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: rgba(26, 29, 46, 0.06); color: var(--ink-primary); }
.nav a.current {
  color: var(--ink-primary);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-m);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink-primary);
}

@media (max-width: 720px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0.25rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0.5rem; border-radius: 0; border-bottom: 1px solid var(--rule); }
  .nav-toggle { display: block; }
  .brand-sub { display: none; }
}

/* ============================================================
   HERO / TOP BANNER
   ============================================================ */

.hero {
  padding: 4rem 0 2rem;
  position: relative;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero h1 {
  margin-bottom: 1.5rem;
  max-width: 28ch;
}

.hero .lede {
  max-width: 42ch;
}

.last-updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================================================
   FACT BOX (the key-stats summary)
   ============================================================ */

.factbox {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1.75rem 2rem;
  margin: 2rem 0 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem 2rem;
  box-shadow: var(--shadow-soft);
}

.factbox h2 {
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-secondary);
  margin: 0 0 0.5rem;
  grid-column: 1 / -1;
}

.fact .stat-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  padding: 0;
  display: block;
  margin-bottom: 0.25rem;
}
.fact .stat-value {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 60, 'SOFT' 30;
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--ink-primary);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.fact .stat-detail {
  font-size: 0.8125rem;
  color: var(--ink-secondary);
  line-height: 1.4;
  margin-top: 0.25rem;
}

/* ============================================================
   TWO-PATH ROUTER (the consumer / business CTA split)
   ============================================================ */

.router {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 4rem 0;
}

@media (max-width: 720px) {
  .router { grid-template-columns: 1fr; }
}

.path-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 2.25rem 2rem 2rem;
  text-decoration: none;
  color: var(--ink-body);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.path-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 4px;
  background: currentColor;
  opacity: 0.85;
}
.path-card.consumer { color: var(--consumer); }
.path-card.business { color: var(--business); }

.path-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: currentColor;
}

.path-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: currentColor;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.path-card h3 {
  font-size: 1.5rem;
  font-variation-settings: 'opsz' 48;
  color: var(--ink-primary);
  margin: 0 0 0.75rem 0;
}

.path-card p {
  color: var(--ink-body);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.path-arrow {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: currentColor;
  letter-spacing: 0.04em;
  margin-top: auto;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.path-arrow::after { content: '→'; transition: transform 0.2s ease; }
.path-card:hover .path-arrow::after { transform: translateX(4px); }

/* ============================================================
   ARTICLE PROSE
   ============================================================ */

.prose { font-size: 1.0625rem; line-height: 1.7; }
.prose p { margin: 0 0 1.5rem; }
.prose p:first-child { margin-top: 0; }

.prose h2 + p, .prose h3 + p { margin-top: 0; }

.prose ul, .prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}
.prose li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}
.prose li::marker { color: var(--accent); }

.prose strong { color: var(--ink-primary); font-weight: 600; }

.prose hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 3rem auto;
  width: 30%;
}

/* ============================================================
   CALLOUTS & WARNINGS
   ============================================================ */

.callout {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.callout h4 {
  font-size: 0.75rem;
  color: var(--accent-deep);
  margin: 0 0 0.5rem;
}
.callout p:last-child { margin-bottom: 0; }

.callout.warn {
  background: var(--warn-bg);
  border-left-color: var(--warn-ink);
}
.callout.warn h4 { color: var(--warn-ink); }

.callout.update {
  background: var(--highlight);
  border-left-color: var(--accent);
}

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline {
  margin: 2.5rem 0;
  border-left: 2px solid var(--rule);
  padding-left: 1.75rem;
  position: relative;
}
.timeline-item {
  position: relative;
  padding-bottom: 1.75rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.95rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  background: var(--bg-paper);
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}
.timeline-text {
  color: var(--ink-body);
  margin: 0;
}
.timeline-text strong { color: var(--ink-primary); }

/* ============================================================
   FAQ
   ============================================================ */

.faq-list { margin: 2rem 0; }
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 36;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink-primary);
  list-style: none;
  position: relative;
  padding-right: 2rem;
  letter-spacing: -0.005em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 400;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item-body { padding-top: 0.75rem; color: var(--ink-body); }
.faq-item-body p:last-child { margin-bottom: 0; }

/* ============================================================
   FORMS
   ============================================================ */

.intake-form {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 2rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-card);
}

@media (min-width: 720px) {
  .intake-form { padding: 2.5rem 3rem; }
}

.intake-form h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.intake-form .form-lede {
  color: var(--ink-secondary);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
}

.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 600px) {
  .field-group { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1.25rem; }
.field-group .field { margin-bottom: 0; }

.field label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.field label .req { color: var(--accent); margin-left: 0.25rem; }

.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-primary);
  background: var(--bg-paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-m);
  padding: 0.75rem 0.875rem;
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(184, 92, 44, 0.15);
}
.field textarea { min-height: 110px; resize: vertical; font-family: var(--font-body); }

.field-checkbox {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  margin: 1.25rem 0;
}
.field-checkbox input { margin-top: 0.25rem; }
.field-checkbox label {
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-body);
  font-weight: 400;
  line-height: 1.5;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  border: 1px solid var(--ink-primary);
  border-radius: var(--radius-m);
  padding: 0.875rem 1.75rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--bg-deep-alt); color: var(--ink-inverse); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink-primary);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { background: var(--ink-primary); color: var(--ink-inverse); }

.form-disclaimer {
  font-size: 0.8125rem;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-top: 1.25rem;
}

/* ============================================================
   SOURCES / CITATIONS
   ============================================================ */

.sources {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 1.5rem 2rem;
  margin: 3rem 0;
  font-size: 0.875rem;
}
.sources h4 {
  margin: 0 0 0.75rem;
  color: var(--ink-secondary);
}
.sources ol { margin: 0; padding-left: 1.5rem; }
.sources li { margin-bottom: 0.5rem; color: var(--ink-secondary); }
.sources li a { color: var(--ink-body); }

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: var(--bg-deep);
  color: var(--ink-inverse);
  padding: 4rem 0 2rem;
  margin-top: 6rem;
}
.footer a { color: var(--accent-soft); }
.footer a:hover { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-brand .brand-mark { color: var(--ink-inverse); }
.footer-brand .brand-mark .accent { color: var(--accent); }
.footer-brand p {
  font-size: 0.875rem;
  color: rgba(246, 241, 230, 0.7);
  max-width: 35ch;
  margin-top: 0.75rem;
}

.footer h5 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(246, 241, 230, 0.6);
  margin: 0 0 1rem;
  font-weight: 700;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 0.5rem; }
.footer li a { font-size: 0.9375rem; text-decoration: none; color: rgba(246, 241, 230, 0.85); }
.footer li a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid rgba(246, 241, 230, 0.1);
  padding-top: 2rem;
  font-size: 0.75rem;
  color: rgba(246, 241, 230, 0.5);
  line-height: 1.6;
}
.footer-bottom p { margin: 0 0 0.75rem; max-width: 70ch; }

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .masthead, .footer, .nav, .router, .intake-form { display: none; }
  body { background: white; font-size: 11pt; }
  .article, .article-wide { max-width: 100%; }
}
