/* ==========================================================================
   The Signal HR — Design System v2 (2026 rebuild)
   Editorial-intelligence aesthetic. Zero-framework, fluid, dark-mode aware.
   ========================================================================== */

:root {
  /* Ink & paper */
  --ink: #0e1116;
  --ink-mid: #3c404b;
  --ink-soft: #6d7280;
  --ink-faint: #a3a7b3;
  --paper: #fbfaf7;
  --paper-alt: #f3f1ec;
  --card: #ffffff;

  /* Signal accents */
  --signal: #0a5bd3;
  --signal-soft: #e8effb;
  --signal-deep: #073e8f;
  --teal: #00796d;
  --teal-soft: #e0f2ef;
  --amber: #b26a00;
  --amber-soft: #fdf1de;
  --coral: #bf4630;
  --coral-soft: #fdeae6;

  --border: rgba(14, 17, 22, 0.10);
  --border-strong: rgba(14, 17, 22, 0.20);
  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 1px 3px rgba(14,17,22,.05), 0 4px 20px rgba(14,17,22,.06);
  --shadow-lg: 0 2px 6px rgba(14,17,22,.06), 0 12px 40px rgba(14,17,22,.10);

  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "DM Sans", -apple-system, "Segoe UI", sans-serif;

  /* Fluid type scale */
  --text-xs: clamp(.72rem, .7rem + .1vw, .78rem);
  --text-sm: clamp(.84rem, .8rem + .15vw, .92rem);
  --text-base: clamp(1rem, .95rem + .2vw, 1.08rem);
  --text-lg: clamp(1.15rem, 1.05rem + .4vw, 1.35rem);
  --text-xl: clamp(1.5rem, 1.3rem + .9vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.6rem + 1.8vw, 3.1rem);
  --text-hero: clamp(2.3rem, 1.7rem + 2.9vw, 4rem);

  --wrap: 1160px;
  --wrap-prose: 720px;
}

[data-theme="dark"] {
  --ink: #eceef2;
  --ink-mid: #c3c7d1;
  --ink-soft: #8f94a3;
  --ink-faint: #62677a;
  --paper: #0e1116;
  --paper-alt: #14181f;
  --card: #191e27;
  --signal: #5c96ee;
  --signal-soft: #182740;
  --signal-deep: #9dbff5;
  --teal: #3db3a5;
  --teal-soft: #10302c;
  --amber: #e0a34e;
  --amber-soft: #33260f;
  --coral: #e57a63;
  --coral-soft: #381a14;
  --border: rgba(236, 238, 242, 0.10);
  --border-strong: rgba(236, 238, 242, 0.22);
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 20px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.35), 0 12px 40px rgba(0,0,0,.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }
.prose-wrap { max-width: var(--wrap-prose); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--signal); color: #fff; padding: .6rem 1rem; z-index: 200; border-radius: 0 0 var(--radius-sm) 0; }
.skip-link:focus { left: 0; }

/* ============================= Header ============================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 60px; }
.brand { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); letter-spacing: .01em; white-space: nowrap; }
.brand em { color: var(--signal); font-style: italic; }
.brand:hover { text-decoration: none; }
.brand .hr-tag { font-family: var(--font-body); font-size: .62em; font-weight: 500; color: var(--ink-soft); letter-spacing: .18em; margin-left: .35rem; vertical-align: 2px; }

.nav-links { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.6rem); list-style: none; }
.nav-links a { color: var(--ink-mid); font-size: var(--text-sm); font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--signal); text-decoration: none; }
.nav-cta {
  background: var(--ink); color: var(--paper) !important; padding: .45rem 1rem;
  border-radius: 100px; font-weight: 500;
}
.nav-cta:hover { background: var(--signal); }

.theme-toggle, .nav-burger {
  background: none; border: 1px solid var(--border); color: var(--ink-mid);
  border-radius: 100px; cursor: pointer; font-family: var(--font-body);
  font-size: .8rem; padding: .38rem .7rem; line-height: 1;
}
.theme-toggle:hover, .nav-burger:hover { border-color: var(--border-strong); color: var(--ink); }
.nav-burger { display: none; font-size: 1.05rem; padding: .34rem .62rem; }

@media (max-width: 820px) {
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start; padding: 1rem clamp(1.1rem,4vw,2rem) 1.3rem; gap: 1rem;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-burger { display: inline-block; }
}

/* ============================= Buttons ============================= */
.btn { display: inline-block; font-weight: 500; font-size: var(--text-sm); border-radius: 100px; padding: .72rem 1.5rem; transition: all .18s ease; cursor: pointer; border: none; font-family: var(--font-body); }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-deep); box-shadow: var(--shadow); color:#fff; }
[data-theme="dark"] .btn-primary:hover { color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--ink); }

/* ============================= Kicker / tags ============================= */
.kicker { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--text-xs); font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); }
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--signal); }
.tag { display: inline-block; font-size: var(--text-xs); font-weight: 500; letter-spacing: .06em; padding: .18rem .6rem; border-radius: 100px; }
.tag-signal { background: var(--signal-soft); color: var(--signal); }
.tag-teal { background: var(--teal-soft); color: var(--teal); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-coral { background: var(--coral-soft); color: var(--coral); }

/* ============================= Hero ============================= */
.hero { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-family: var(--font-display); font-size: var(--text-hero); line-height: 1.08; font-weight: 400; margin: 1.1rem 0 1.2rem; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--signal); }
.hero .sub { font-size: var(--text-lg); color: var(--ink-mid); line-height: 1.55; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; align-items: center; }
.hero-trust { margin-top: 1.4rem; font-size: var(--text-sm); color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.hero-trust span::before { content: "✓"; color: var(--teal); margin-right: .4rem; font-weight: 700; }

/* Subscribe card (above the fold) */
.sub-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem 1.5rem; box-shadow: var(--shadow-lg); }
.sub-card h2, .sub-card .sub-card-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; margin-bottom: .35rem; }
.sub-card p { font-size: var(--text-sm); color: var(--ink-soft); margin-bottom: 1rem; }
.sub-card iframe { width: 100%; border: none; border-radius: var(--radius-sm); background: transparent; height: 110px; }
.sub-card .micro { font-size: var(--text-xs); color: var(--ink-faint); margin: .6rem 0 0; }

/* ============================= Sections ============================= */
.section { padding: clamp(2.8rem, 7vw, 4.8rem) 0; }
.section-alt { background: var(--paper-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: clamp(1.6rem, 4vw, 2.4rem); flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400; line-height: 1.15; margin-top: .6rem; }
.section-head h2 em { font-style: italic; color: var(--signal); }
.section-head .more { font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }

/* ============================= Cards & grids ============================= */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.4rem; display: flex; flex-direction: column; gap: .55rem;
  color: var(--ink); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); line-height: 1.25; }
.card p { font-size: var(--text-sm); color: var(--ink-soft); }
.card .card-meta { font-size: var(--text-xs); color: var(--ink-faint); letter-spacing: .08em; text-transform: uppercase; margin-top: auto; padding-top: .5rem; }
.card .arrow { color: var(--signal); font-weight: 500; font-size: var(--text-sm); }

/* Feature card (comparison hub front door) */
.feature-card {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: clamp(1.5rem,4vw,3rem);
  background: var(--ink); color: var(--paper); border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.8rem, 4.5vw, 3rem); overflow: hidden; position: relative;
}
[data-theme="dark"] .feature-card { background: var(--card); border: 1px solid var(--border-strong); color: var(--ink); }
.feature-card h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); line-height: 1.2; margin: .8rem 0 .7rem; }
.feature-card p { opacity: .82; font-size: var(--text-sm); line-height: 1.6; }
.feature-card .kicker { color: inherit; opacity: .7; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: .65rem; font-size: var(--text-sm); }
.feature-list li { padding-left: 1.4rem; position: relative; opacity: .92; }
.feature-list li::before { content: "→"; position: absolute; left: 0; color: var(--amber); }
@media (max-width: 760px) { .feature-card { grid-template-columns: 1fr; } }

/* ============================= Briefing list ============================= */
.brief-item { border-bottom: 1px solid var(--border); padding: 1.35rem 0; display: grid; grid-template-columns: 110px 1fr; gap: 1.2rem; }
.brief-item:last-child { border-bottom: none; }
@media (max-width: 640px) { .brief-item { grid-template-columns: 1fr; gap: .3rem; } }
.brief-item .b-tag { align-self: start; }
.brief-item h3 { font-size: var(--text-base); font-weight: 500; line-height: 1.4; margin-bottom: .3rem; }
.brief-item p { font-size: var(--text-sm); color: var(--ink-soft); }
.brief-item .src { font-size: var(--text-xs); color: var(--ink-faint); margin-top: .35rem; }
.brief-item .src a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }

.so-what { background: var(--signal-soft); border-left: 3px solid var(--signal); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .8rem 1rem; font-size: var(--text-sm); color: var(--ink-mid); margin-top: .6rem; }
.so-what strong { color: var(--signal); letter-spacing: .05em; font-size: var(--text-xs); text-transform: uppercase; }

/* ============================= Article / prose ============================= */
.article-header { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem); }
.article-header h1 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400; line-height: 1.12; margin: 1rem 0 .9rem; letter-spacing: -.01em; }
.article-header .standfirst { font-size: var(--text-lg); color: var(--ink-mid); line-height: 1.5; }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: var(--text-sm); color: var(--ink-soft); margin-top: 1.1rem; align-items: center; }

.prose { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); line-height: 1.2; margin-top: 2em; }
.prose h3 { font-size: var(--text-base); font-weight: 700; margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-mid); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose blockquote { border-left: 3px solid var(--signal); padding: .2em 0 .2em 1.2em; font-family: var(--font-display); font-size: var(--text-lg); font-style: italic; color: var(--ink); }
.prose .note { background: var(--amber-soft); border-left: 3px solid var(--amber); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .9rem 1.1rem; font-size: var(--text-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.prose th, .prose td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.prose .sources { font-size: var(--text-sm); color: var(--ink-soft); border-top: 1px solid var(--border); padding-top: 1.2rem; margin-top: 2.2rem; }
.prose .sources li { color: var(--ink-soft); }

/* ============================= Comparison matrix ============================= */
.matrix-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.matrix { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 880px; }
.matrix th { position: sticky; top: 0; background: var(--paper-alt); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); text-align: left; padding: .8rem .9rem; border-bottom: 1px solid var(--border-strong); }
.matrix td { padding: .85rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--ink-mid); }
.matrix tr:last-child td { border-bottom: none; }
.matrix td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.matrix tr:hover td { background: var(--paper-alt); }

/* ============================= Trust bar ============================= */
.trust-bar { display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: center; padding: 1.1rem 0; font-size: var(--text-sm); color: var(--ink-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-bar strong { color: var(--ink); font-weight: 500; }

/* ============================= Newsletter band ============================= */
.news-band { background: var(--ink); color: var(--paper); border-radius: calc(var(--radius) + 4px); padding: clamp(2rem, 5vw, 3.2rem); text-align: center; }
[data-theme="dark"] .news-band { background: var(--card); border: 1px solid var(--border-strong); color: var(--ink); }
.news-band h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); margin-bottom: .6rem; }
.news-band h2 em { font-style: italic; color: var(--amber); }
.news-band p { opacity: .8; font-size: var(--text-sm); max-width: 42em; margin: 0 auto 1.4rem; }
.news-band iframe { width: 100%; max-width: 440px; border: none; height: 110px; margin: 0 auto; border-radius: var(--radius-sm); }
.news-band .micro { font-size: var(--text-xs); opacity: .55; margin-top: .8rem; }

/* ============================= Breadcrumb ============================= */
.crumbs { font-size: var(--text-xs); color: var(--ink-faint); padding-top: 1.4rem; }
.crumbs a { color: var(--ink-soft); }
.crumbs span { margin: 0 .45rem; }

/* ============================= Footer ============================= */
.site-footer { border-top: 1px solid var(--border); margin-top: clamp(2rem, 6vw, 4rem); padding: clamp(2rem, 5vw, 3rem) 0 2.2rem; background: var(--paper-alt); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .15em; color: var(--ink-faint); margin-bottom: .8rem; font-weight: 500; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-grid a { color: var(--ink-soft); font-size: var(--text-sm); }
.footer-grid a:hover { color: var(--signal); }
.footer-brand p { font-size: var(--text-sm); color: var(--ink-soft); max-width: 30em; margin-top: .6rem; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; font-size: var(--text-xs); color: var(--ink-faint); }

/* ============================= Utilities ============================= */
.center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, a.card:hover { transform: none; }
  * { transition: none !important; }
}
