/* X-ARC shared stylesheet — case-study layout for sub-pages
   Inherits the landing page's announcement bar, header, footer.
   Adds article-layout (sidebar TOC + content) + case-study prose. */

/* ═══════════════════════════════════════════════════════════ */
/* TOKENS                                                       */
/* ═══════════════════════════════════════════════════════════ */
:root, :root[data-theme="dark"] {
  --canvas: #0a0a0b;
  --canvas-rgb: 10, 10, 11;
  --surface: #111113;
  --card: #161618;
  --card-hover: #1c1c1f;
  --ink: #ededed;
  --ink-soft: #c4c4c4;
  --mute: #888887;
  --mute-soft: #5a5a59;
  --accent: #4ade80;
  --accent-soft: #86efac;
  --accent-text: #22c55e;
  --accent-dim: rgba(74, 222, 128, 0.18);
  --hairline: #1f1f21;
  --hairline-strong: #2c2c2f;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  --slab-top: #1e1e22;
  --slab-side-r: #0f0f12;
  --slab-side-f: #08080a;
  --slab-stroke: #444448;
  --accent-side-r: #143820;
  --accent-side-f: #0c2516;
  --logo-filter: brightness(0) invert(1) opacity(0.7);
}
:root[data-theme="light"] {
  --canvas: #fafafa;
  --canvas-rgb: 250, 250, 250;
  --surface: #f4f4f5;
  --card: #ffffff;
  --card-hover: #f4f4f5;
  --ink: #09090b;
  --ink-soft: #3f3f46;
  --mute: #71717a;
  --mute-soft: #a1a1aa;
  --accent: #16a34a;
  --accent-soft: #22c55e;
  --accent-text: #15803d;
  --accent-dim: rgba(22, 163, 74, 0.08);
  --hairline: #e4e4e7;
  --hairline-strong: #d4d4d8;
  --slab-top: #ffffff;
  --slab-side-r: #e8e8eb;
  --slab-side-f: #d4d4d8;
  --slab-stroke: #9ca0a8;
  --accent-side-r: #bbe3c8;
  --accent-side-f: #86c994;
  --logo-filter: brightness(0) opacity(0.65);
}

/* ═══════════════════════════════════════════════════════════ */
/* RESET                                                        */
/* ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11', 'cv02';
  line-height: 1.45;
}
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; display: block; }
html { scroll-behavior: smooth; transition: background-color 0.18s, color 0.18s; }
::selection { background: var(--accent-dim); color: var(--ink); }

.container { max-width: 1280px; margin: 0 auto; width: 100%; padding: 0 56px; }

/* ═══════════════════════════════════════════════════════════ */
/* ANNOUNCEMENT BAR (matches landing page)                      */
/* ═══════════════════════════════════════════════════════════ */
.announcement-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--accent);
  padding: 13px 56px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--canvas);
  text-align: center;
  font-weight: 500;
}
.announcement-bar .sep { opacity: 0.45; padding: 0 4px; }
.announcement-cta {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--canvas);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding-bottom: 1px;
  transition: border-color 0.18s;
}
.announcement-cta:hover { border-bottom-color: var(--canvas); }
.announcement-cta .arrow { transition: transform 0.18s; }
.announcement-cta:hover .arrow { transform: translateX(2px); }

/* ═══════════════════════════════════════════════════════════ */
/* HEADER (sticky, identical to landing)                        */
/* ═══════════════════════════════════════════════════════════ */
header.top {
  padding: 22px 0;
  position: sticky; top: 0;
  background: rgba(var(--canvas-rgb), 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}
header.top .row { display: flex; justify-content: space-between; align-items: center; }
.wordmark {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  color: var(--ink);
}
.wordmark .mark { width: 7px; height: 7px; background: var(--accent); display: inline-block; }
.nav-right { display: flex; align-items: center; gap: 28px; }
.nav-links {
  display: flex; gap: 30px;
  font-family: var(--mono); font-size: 12px;
  color: var(--mute); text-transform: lowercase; letter-spacing: 0.04em;
}
.nav-links a { transition: color 0.18s; }
.nav-links a:hover { color: var(--ink); }
.theme-toggle {
  background: transparent; border: none; color: var(--mute);
  cursor: pointer; padding: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.18s;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .glyph {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid currentColor; background: transparent;
  display: inline-block;
}
:root[data-theme="light"] .theme-toggle .glyph { background: currentColor; }

/* ═══════════════════════════════════════════════════════════ */
/* ARTICLE LAYOUT (sidebar TOC + content)                       */
/* ═══════════════════════════════════════════════════════════ */
.article-layout {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 192px 1fr;
  gap: 56px;
  align-items: start;
}

.article-sidebar {
  position: sticky;
  top: 88px;
  padding-top: 96px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}
.article-sidebar::-webkit-scrollbar { display: none; }

.toc {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 0;
}
.toc li a {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--mute-soft);
  padding: 8px 0 8px 14px;
  border-left: 1px solid var(--hairline);
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.toc li a:hover { color: var(--ink-soft); }
.toc li a.active {
  color: var(--accent-text);
  border-left-color: var(--accent);
}

.article-content {
  min-width: 0;
  max-width: 680px;
}

/* ═══════════════════════════════════════════════════════════ */
/* ARTICLE HEADER (label + logo + title + meta)                 */
/* ═══════════════════════════════════════════════════════════ */
.article-header {
  padding-top: 100px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--hairline);
}

.article-header-logo {
  width: auto;
  object-fit: contain;
  filter: var(--logo-filter);
  margin-bottom: 28px;
  transition: filter 0.18s;
  /* Per-client visual balancing — different PNGs at different heights so they
     read at the same visual weight across the four deployment pages. */
}
.article-header-logo.titan   { height: 46px; }
.article-header-logo.aspire  { height: 48px; }
.article-header-logo.threed  { height: 64px; }
.article-header-logo.harris  { height: 52px; }
.article-header-logo.anthropic { height: 50px; }
/* Default for any other logo (no class) */
.article-header-logo:not([class*=" "]):not(.titan):not(.aspire):not(.threed):not(.harris):not(.anthropic) {
  height: 52px;
}

.article-header-mark {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 28px;
  display: inline-block;
}

.article-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: block;
  margin-bottom: 20px;
}

.article-header h1 {
  font-family: var(--sans);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.024em;
  color: var(--ink);
  margin-bottom: 22px;
  max-width: 22ch;
}

.article-meta {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.article-meta-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.article-meta-text {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.08em;
}
.article-meta-link {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--mute);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.18s;
}
.article-meta-link:hover { color: var(--ink); }
.article-meta-link .arrow {
  color: var(--mute-soft);
  transition: transform 0.18s, color 0.18s;
}
.article-meta-link:hover .arrow { color: var(--ink-soft); transform: translateX(2px); }

/* ═══════════════════════════════════════════════════════════ */
/* PROSE (case-study sections)                                  */
/* ═══════════════════════════════════════════════════════════ */
.prose {
  padding: 56px 0;
}
.prose + .prose {
  border-top: 1px solid var(--hairline);
}

.prose h2 {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-bottom: 22px;
}
.prose h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
}

.prose p {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.72;
  margin-bottom: 18px;
}
.prose p:last-child { margin-bottom: 0; }

.prose strong { color: var(--ink); font-weight: 500; }
.prose em { font-style: italic; color: var(--ink-soft); }

.prose a {
  color: var(--accent-text);
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.18s, opacity 0.18s;
}
.prose a:hover { border-bottom-color: var(--accent); opacity: 0.85; }
/* Buttons inside prose must keep their own styling, not inherit link styles */
.prose a.btn,
.prose a.btn:hover {
  border-bottom: 0;
  text-decoration: none;
  opacity: 1;
}
.prose a.btn-primary { color: var(--canvas); }
.prose a.btn-ghost { color: var(--ink-soft); }
.prose a.btn-primary:hover { color: var(--canvas); }
.prose a.btn-ghost:hover { color: var(--ink); }

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin-bottom: 18px;
}
.prose ul li, .prose ol li {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 8px;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--ink);
}

.prose pre {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 18px 22px;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 24px 0;
}
.prose pre code { background: transparent; padding: 0; }

/* Grove inline graph figure */
.grove-graph-figure {
  margin: 32px 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.grove-graph-figure svg {
  max-width: 480px; width: 100%; height: auto;
}
.grove-graph-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--hairline);
}
/* In dark mode the source image has a cream background; invert it to read
   against the canvas without crushing the node colours. */
:root[data-theme="dark"] .grove-graph-image {
  filter: invert(0.92) hue-rotate(180deg) saturate(1.2);
  mix-blend-mode: screen;
}
.grove-graph-figure figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--mute);
  text-align: center;
  max-width: 56ch;
  line-height: 1.5;
}

/* Pullquote */
.pullquote {
  border-left: 2px solid var(--accent);
  padding: 6px 0 6px 22px;
  margin: 28px 0;
}
.pullquote p {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* METRICS GRID (used inside prose)                             */
/* ═══════════════════════════════════════════════════════════ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  margin: 28px 0;
}
.metric-card {
  background: var(--card);
  padding: 22px 20px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.metric-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-text);
  display: block;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.metric-label {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* On narrow viewports labels can wrap freely */
@media (max-width: 1100px) {
  .metric-label { white-space: normal; }
}

/* ═══════════════════════════════════════════════════════════ */
/* PIPELINE LIST (numbered steps inside prose)                  */
/* All items share the same height regardless of line count.    */
/* ═══════════════════════════════════════════════════════════ */
.pipeline-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  margin: 28px 0;
}
.pipeline-item {
  background: var(--card);
  padding: 18px 22px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  min-height: 92px;
}
.pipeline-num {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  min-width: 1.6rem;
  padding-top: 2px;
  letter-spacing: 0.05em;
}
.pipeline-item h4 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}
.pipeline-item p {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* PROOF VIDEO + COMMENTS (used in 3ED deployment)              */
/* ═══════════════════════════════════════════════════════════ */
.proof-video {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 18px;
  margin: 28px 0 20px;
  transition: border-color 0.18s, background 0.18s;
  text-decoration: none;
}
.proof-video:hover { border-color: var(--hairline-strong); background: var(--card-hover); }
.prose a.proof-video,
.prose a.proof-video:hover { border-bottom: 0; opacity: 1; }
.proof-video-thumb {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}
.proof-video-body { display: flex; flex-direction: column; gap: 10px; }
.proof-video-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}
.proof-video-stats {
  display: flex; flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.proof-video-stats strong { color: var(--ink); font-weight: 500; }

.proof-comments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 28px;
}
.proof-comment {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.proof-comment-text {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
}
.proof-comment-author {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--mute);
}

@media (max-width: 700px) {
  .proof-video { grid-template-columns: 1fr; }
  .proof-comments { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════ */
/* SPEC GRID (key/value labels in 2 columns inside prose)       */
/* ═══════════════════════════════════════════════════════════ */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  margin: 28px 0;
}
.spec-item {
  background: var(--card);
  padding: 16px 22px;
}
.spec-item h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}
.spec-item p {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* CTA CLOSE (closing CTA before footer — matches landing)      */
/* ═══════════════════════════════════════════════════════════ */
.cta-close {
  text-align: center;
  padding: 90px 24px;
  border-top: 1px solid var(--hairline);
  margin-top: 32px;
}
.cta-close .label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: block;
  margin-bottom: 18px;
}
.cta-close h2 {
  font-family: var(--sans);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin-bottom: 14px;
  max-width: 24ch;
  margin-left: auto; margin-right: auto;
}
.cta-close p {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.65;
  max-width: 460px;
  margin: 0 auto 32px;
}
.cta-group {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 13px 22px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  border: 1px solid var(--hairline-strong);
}
.btn .arrow { transition: transform 0.18s; }
.btn:hover .arrow { transform: translateX(2px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--canvas);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-text); border-color: var(--accent-text); }
.btn-ghost {
  color: var(--ink-soft);
  background: transparent;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--mute); }

/* ═══════════════════════════════════════════════════════════ */
/* FOOTER (matches landing)                                     */
/* ═══════════════════════════════════════════════════════════ */
footer.bottom { padding: 40px 0 48px; border-top: 1px solid var(--hairline); }
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 24px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute);
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-row .wm {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink); letter-spacing: 0.18em;
}
.footer-row .wm .mark {
  width: 7px; height: 7px; background: var(--accent); display: inline-block;
}
.footer-slogan {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--mute-soft);
}
.footer-row .links { display: flex; align-items: center; gap: 26px; }
.footer-row a { transition: color 0.18s; }
.footer-row a:hover { color: var(--accent-text); }

/* ═══════════════════════════════════════════════════════════ */
/* SCROLL REVEAL                                                */
/* ═══════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* RESPONSIVE                                                   */
/* ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
    padding: 0 28px;
    gap: 24px;
  }
  .article-sidebar {
    position: static;
    padding-top: 28px;
    max-height: none;
    overflow: visible;
  }
  .toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .toc li a {
    border-left: 0;
    border-bottom: 1px solid var(--hairline);
    padding: 8px 12px;
    font-size: 10.5px;
  }
  .toc li a.active {
    border-bottom-color: var(--accent);
  }
  .article-header { padding-top: 32px; }
  .article-header h1 { font-size: clamp(22px, 6vw, 30px); }
  .nav-links { display: none; }
  .container { padding: 0 28px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
}
