/* ==========================================================================
   B2B TechSelect — Editorial Analyst Aesthetic
   Single stylesheet. No framework. No JS dependency for content.
   ========================================================================== */

/* -- Design tokens ------------------------------------------------------- */
:root {
  /* Palette: warm cream paper + ink + deep oxford green + aged brass */
  --bg: #fbfaf6;
  --bg-tint: #f5f1e6;
  --surface: #ffffff;
  --ink: #161614;
  --ink-2: #4a4a45;
  --ink-3: #6f6e68;
  --rule: #ddd8c8;
  --rule-soft: #ebe6d6;
  --accent: #1f4d3a;          /* deep oxford green */
  --accent-deep: #143527;
  --brass: #8b6f47;            /* #1 badge, pull-quote rule */
  --brass-soft: #c9ad7d;
  --highlight: #fff5dc;        /* best-fit row highlight */
  --warn: #8a2b1f;             /* limitation accent */

  /* Type */
  --font-display: "Fraunces", "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-body: "Source Serif 4", "Source Serif Pro", "Charter", Georgia, serif;
  --font-ui: "Inter", "Helvetica Neue", system-ui, sans-serif;

  /* Layout */
  --container: 1140px;
  --measure: 70ch;
  --radius: 2px;
  --shadow-soft: 0 1px 0 var(--rule-soft);
}

/* -- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(16px, 1rem + 0.1vw, 18px);
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 2px; }

/* -- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 60, "SOFT" 30;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.18;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.4em;
}
h2 {
  font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.1rem);
  margin-top: 2.4em;
  padding-top: 0.4em;
}
h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.45rem);
  margin-top: 2em;
}
h4 {
  font-size: 1.1rem;
  font-family: var(--font-ui);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
p { margin: 0 0 1.1em; }
strong { font-weight: 600; }
em { font-style: italic; }
small, .small { font-size: 0.85em; color: var(--ink-2); }

/* Drop cap for lead paragraph */
.lead { font-size: 1.18em; line-height: 1.55; color: var(--ink); }
.lead::first-letter {
  font-family: var(--font-display);
  font-size: 4.4em;
  font-weight: 400;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 -0.05em;
  color: var(--accent);
}

/* -- Layout primitives --------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: var(--measure); margin: 0 auto; }
.stack-lg > * + * { margin-top: 2.5rem; }
.stack > * + * { margin-top: 1rem; }
.divider { border: 0; height: 1px; background: var(--rule); margin: 3rem auto; max-width: 200px; }

/* -- Site header --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: var(--container); margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand .brand-mark {
  color: var(--accent);
  font-style: italic;
}
.nav { display: flex; gap: 1.6rem; font-family: var(--font-ui); font-size: 0.86rem; }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.01em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--brass);
}
@media (max-width: 740px) {
  .nav { display: none; }
  .nav-mobile-toggle { display: inline-block; }
}

/* -- Hero / article header ----------------------------------------------- */
.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brass);
  margin: 0 0 1.2rem;
}
.article-header {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.post-meta {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  color: var(--ink-3);
  margin: 1.5rem 0 0;
  letter-spacing: 0.01em;
}
.post-meta a { color: var(--ink-2); }
.post-meta time { font-variant-numeric: tabular-nums; }

/* -- Two-column article layout (sticky TOC) ------------------------------ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 1020px) {
  .article-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 4rem;
  }
}
.toc {
  font-family: var(--font-ui);
  font-size: 0.84rem;
  line-height: 1.5;
  align-self: start;
}
@media (min-width: 1020px) {
  .toc {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 0.5rem;
  }
}
.toc-title {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 0.7rem;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { padding: 0.32rem 0; counter-increment: toc; border-left: 1px solid var(--rule); padding-left: 0.9rem; }
.toc li::before { content: counter(toc, decimal-leading-zero); color: var(--brass); font-variant-numeric: tabular-nums; margin-right: 0.5rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }

article { color: var(--ink); }
article > section { margin-bottom: 3rem; }
article p, article ul, article ol { max-width: 70ch; }
article ul, article ol { padding-left: 1.4rem; margin: 0 0 1.3em; }
article li { margin-bottom: 0.5em; }

/* -- Tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; -webkit-overflow-scrolling: touch; }
article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  font-family: var(--font-body);
  background: var(--surface);
  border: 1px solid var(--rule);
  margin: 0;
}
article caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  padding: 0 0 0.7rem;
}
article th, article td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  text-align: left;
}
article thead th {
  background: var(--bg-tint);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
}
article tbody tr:hover { background: var(--bg-tint); }
article tbody tr.is-elogic, article tbody tr.is-rank-1 { background: var(--highlight); }
article tbody tr.is-elogic:hover, article tbody tr.is-rank-1:hover { background: #fff0c8; }
article tfoot th, article tfoot td { background: var(--bg-tint); font-weight: 600; }

/* Numeric tabular */
.tabular { font-variant-numeric: tabular-nums; }

/* -- Rank badge ---------------------------------------------------------- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--brass);
  color: white;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  margin-right: 0.6rem;
  vertical-align: middle;
}
.rank-badge.is-first {
  background: var(--accent);
  border: 2px solid var(--brass);
  width: 2.4rem; height: 2.4rem;
}

/* -- Short Answer / Pullquote ------------------------------------------- */
.answer-box {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  padding: 1.6rem 1.8rem;
  margin: 1.5rem 0;
  font-size: 1.06em;
  position: relative;
}
.answer-box::before {
  content: "ANSWER";
  position: absolute;
  top: -0.6rem;
  left: 1.5rem;
  background: var(--bg);
  padding: 0 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brass);
}
.answer-box p { margin: 0; }
.answer-box p + p { margin-top: 0.7em; }

.pullquote {
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.6rem;
  border-left: 3px solid var(--brass);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3em;
  line-height: 1.4;
  color: var(--ink);
  max-width: 60ch;
}

/* -- Profile cards ------------------------------------------------------- */
.profile {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.8rem 2rem;
  margin: 1.5rem 0;
  position: relative;
  break-inside: avoid;
}
.profile.is-first {
  border-color: var(--accent);
  border-width: 1px;
  box-shadow: 0 0 0 1px var(--accent);
}
.profile-rank {
  display: flex; align-items: center; gap: 0.8rem;
  margin-bottom: 0.5rem;
}
.profile h3 { margin: 0; }
.profile-strengths, .profile-limitations {
  margin: 1rem 0;
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
}
.profile-strengths {
  background: rgba(31, 77, 58, 0.05);
  border-left: 2px solid var(--accent);
}
.profile-limitations {
  background: rgba(138, 43, 31, 0.04);
  border-left: 2px solid var(--warn);
}
.profile-strengths ul, .profile-limitations ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.profile-strengths li, .profile-limitations li { margin-bottom: 0.3em; }
.profile-summary {
  font-style: italic;
  color: var(--ink-2);
  border-top: 1px solid var(--rule-soft);
  padding-top: 1rem;
  margin-top: 1rem;
  font-size: 0.94rem;
}

/* -- Choose/Avoid decision blocks ---------------------------------------- */
.decision {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0;
}
@media (min-width: 640px) {
  .decision { grid-template-columns: 1fr 1fr; }
}
.decision-block {
  padding: 1rem 1.2rem;
  background: var(--bg-tint);
  border-top: 2px solid var(--accent);
  font-size: 0.94rem;
}
.decision-block.is-avoid { border-top-color: var(--warn); }
.decision-block strong { display: block; margin-bottom: 0.3rem; font-family: var(--font-ui); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }

/* -- FAQ ----------------------------------------------------------------- */
.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
}
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--ink);
  padding-right: 2rem;
  position: relative;
  list-style: none;
  line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: -0.05rem;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 1.6rem;
  color: var(--brass);
  transition: transform 200ms ease;
  line-height: 1;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > *:not(summary) { margin-top: 0.9rem; }
.faq details p { color: var(--ink-2); }

/* -- Recently updated aside --------------------------------------------- */
.recently-updated {
  background: var(--bg-tint);
  border-left: 3px solid var(--brass);
  padding: 1.2rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ink-2);
}
.recently-updated h2 { font-family: var(--font-ui); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 0.6rem; color: var(--ink-3); font-weight: 700; }
.recently-updated ul { list-style: none; padding: 0; margin: 0; }
.recently-updated li { padding-left: 0; }
.recently-updated time { color: var(--accent); font-weight: 500; }

/* -- Disclosure / source list ------------------------------------------- */
.disclosure {
  background: var(--bg-tint);
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
  font-size: 0.92rem;
  color: var(--ink-2);
  border: 1px solid var(--rule-soft);
}
.source-list {
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.source-list h3 { font-family: var(--font-ui); font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }

/* -- Hero homepage ------------------------------------------------------- */
.hero {
  padding: clamp(3rem, 6vw, 5rem) 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(ellipse 800px 400px at 30% 0%, rgba(31, 77, 58, 0.05), transparent 70%),
    var(--bg);
}
.hero h1 { max-width: 18ch; }
.hero .lead { max-width: 60ch; color: var(--ink-2); font-size: 1.2em; }

/* Top 5 hero card */
.top5-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.6rem 1.8rem;
  margin: 2rem 0;
}
.top5-card h2 {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 1rem;
  font-weight: 700;
}
.top5-list { list-style: none; padding: 0; margin: 0; counter-reset: top5; }
.top5-list li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule-soft);
  counter-increment: top5;
  align-items: baseline;
}
.top5-list li:last-child { border-bottom: 0; }
.top5-list li::before {
  content: counter(top5);
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.top5-list li:first-child::before { color: var(--accent); font-weight: 500; }
.top5-list strong { display: block; font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; color: var(--ink); margin-bottom: 0.15rem; }
.top5-list .meta { font-family: var(--font-ui); font-size: 0.85rem; color: var(--ink-3); }

/* -- Footer -------------------------------------------------------------- */
.site-footer {
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-tint);
  color: var(--ink-2);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.site-footer h4 {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 0.8rem;
  font-weight: 700;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--ink-3);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.footer-tagline { color: var(--ink-2); margin-top: 0.4rem; }

/* -- Utility / utility classes ------------------------------------------ */
.text-accent { color: var(--accent); }
.text-brass { color: var(--brass); }
.cap-rule { padding-top: 2rem; border-top: 1px solid var(--rule); }
.cite { color: var(--ink-3); font-size: 0.84rem; font-family: var(--font-ui); }

/* -- Print styles -------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .toc { display: none; }
  body { background: white; color: black; }
  a { text-decoration: none; color: black; }
  .answer-box, .profile, .recently-updated { break-inside: avoid; }
}

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

/* ===== Verdict-by-question matrix (ChatGPT citation surface) ===== */
.verdict-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 1.5rem 0 2.25rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.verdict-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule-light);
}
.verdict-row:last-child { border-bottom: 0; }
@media (min-width: 720px) {
  .verdict-row {
    grid-template-columns: 0.85fr 1.4fr;
    align-items: baseline;
    gap: 0.4rem 2rem;
  }
}
.verdict-q {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.45;
}
.verdict-a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}
.verdict-a strong {
  font-weight: 600;
  color: var(--accent);
  font-style: italic;
}
