/* ==========================================================================
   CrystalWell Analytics — Design Tokens
   Palette: deep ink-blue field, cut-glass facet blues, warm paper, brass trim.
   Type: Source Serif 4 (display/editorial), Inter (body/UI), IBM Plex Mono (data).
   Signature: faceted "crystal" geometry — angular, cut-gem shapes replace soft
   gradients throughout (hero mark, section dividers, card corners).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* core palette */
  --navy-950: #080f1d;
  --navy-900: #0d1b32;
  --navy-800: #132a4a;
  --blue-700: #1c4a86;
  --blue-600: #245fa8;
  --blue-500: #3577c9;
  --blue-400: #6ba0e0;
  --blue-100: #e5eefa;
  --paper: #f6f3ea;
  --paper-dim: #ede8db;
  --ink: #161b26;
  --ink-soft: #4c5568;
  --ink-faint: #646c85;
  --brass: #b58a3f;
  --brass-soft: #e4d3ab;
  --up: #2e7d5b;
  --down: #b3423b;
  --line: rgba(13, 27, 50, 0.12);
  --line-dark: rgba(230, 236, 248, 0.14);

  /* type */
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* layout */
  --max: 1180px;
  --radius: 2px;
  --shadow-1: 0 1px 2px rgba(8, 15, 29, 0.06), 0 8px 24px rgba(8, 15, 29, 0.06);
  --shadow-2: 0 4px 12px rgba(8, 15, 29, 0.10), 0 16px 40px rgba(8, 15, 29, 0.12);
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: var(--ink);
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 300;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--blue-600);
  font-weight: 500;
}
.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--brass);
}
.on-dark .eyebrow { color: var(--blue-400); }
.on-dark .eyebrow::before { background: var(--brass-soft); }

/* ---------- faceted signature mark ---------- */
.facet-mark { display: inline-flex; flex-shrink: 0; }
.facet-mark svg { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue-600);
  color: #fff;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 100%, 9px 100%);
  padding-left: 26px;
}
.btn-primary:hover { background: var(--blue-500); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.on-dark .btn-ghost { border-color: var(--line-dark); color: #fff; }
.btn-ghost:hover { border-color: var(--blue-400); color: var(--blue-600); }
.on-dark .btn-ghost:hover { color: var(--blue-400); }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 15, 29, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-dark);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  color: var(--blue-100);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.82;
  transition: opacity 0.15s ease;
  position: relative;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--brass);
}
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  width: 36px; height: 36px;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 880px) {
  .nav-links { position: fixed; top: 68px; left: 0; right: 0; background: var(--navy-950);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 28px 20px;
    border-bottom: 1px solid var(--line-dark); transform: translateY(-8px); opacity: 0;
    pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line-dark); }
  .nav-links a.active::after { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-cta .btn-primary { display: none; }
}

/* ---------- section rhythm ---------- */
.section { padding: 108px 0; position: relative; }
.section-tight { padding: 84px 0; }
.section.on-dark { background: var(--navy-950); color: #fff; }
.section.paper-dim { background: var(--paper-dim); }

.section-head { margin-bottom: 56px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin-top: 14px; line-height: 1.15; max-width: 900px; }
.section-head p { margin-top: 16px; color: var(--ink-soft); font-size: 16.5px; max-width: 760px; }
.on-dark .section-head p { color: rgba(229, 238, 250, 0.72); }

/* angled divider between sections, cut-facet style */
.facet-divider {
  height: 64px;
  width: 100%;
  background: inherit;
}
.divider-to-dark {
  background: var(--navy-950);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  margin-top: -1px;
}
.divider-from-dark {
  background: var(--paper);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  margin-bottom: -1px;
}

/* ---------- hero ---------- */
.hero {
  background: var(--navy-950);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 96px 0 128px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 620px) 1fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 1.06;
  margin-top: 20px;
  color: #fff;
}
.hero h1 em {
  font-style: italic;
  color: var(--blue-400);
}
.hero p.lede {
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(229, 238, 250, 0.8);
  max-width: 52ch;
}
.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust {
  margin-top: 56px;
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--blue-100);
  opacity: 0.7;
}
.hero-trust span { display: flex; align-items: center; gap: 8px; }
.hero-trust span::before { content: "◆"; color: var(--brass); font-size: 8px; }

.hero-facets { position: relative; height: 420px; }
.hero-facets svg { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-facets { height: 240px; order: -1; opacity: 0.5; }
}

/* ---------- lens (numbered facets) ---------- */
.lens-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-dark);
  border-left: 1px solid var(--line-dark);
}
.lens-cell {
  border-right: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  padding: 34px 28px;
  transition: background 0.2s ease;
}
.lens-cell:hover { background: rgba(53, 119, 201, 0.08); }
.lens-num {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--brass-soft);
  letter-spacing: 0.08em;
}
.lens-cell h3 {
  color: #fff;
  font-size: 19px;
  margin-top: 14px;
}
.lens-cell p {
  margin-top: 10px;
  color: rgba(229, 238, 250, 0.68);
  font-size: 14.5px;
  line-height: 1.55;
}
@media (max-width: 780px) {
  .lens-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .lens-strip { grid-template-columns: 1fr; }
}

/* ---------- philosophy grid ---------- */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.philosophy-card {
  background: var(--paper);
  padding: 32px 28px;
}
.philosophy-glyph {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-600);
  font-family: var(--font-display);
  font-size: 20px;
  border: 1px solid var(--line);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.philosophy-card h3 { font-size: 18px; margin-top: 18px; }
.philosophy-card p { margin-top: 10px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

@media (max-width: 900px) { .philosophy-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .philosophy-grid { grid-template-columns: 1fr; } }

/* ---------- process timeline ---------- */
.timeline { position: relative; padding-left: 8px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 68px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(var(--blue-600), var(--line));
}
.timeline-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-row:last-child { border-bottom: none; }
.timeline-step {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue-600);
  padding-top: 4px;
  position: relative;
}
.timeline-step::before {
  content: "";
  position: absolute;
  left: 60px; top: 6px;
  width: 9px; height: 9px;
  background: var(--paper);
  border: 2px solid var(--blue-600);
  border-radius: 50%;
}
.timeline-row h3 { font-size: 19px; }
.timeline-row p { margin-top: 8px; color: var(--ink-soft); font-size: 15px; max-width: 62ch; }

@media (max-width: 640px) {
  .timeline::before { left: 30px; }
  .timeline-row { grid-template-columns: 30px 1fr; gap: 16px; }
  .timeline-step { font-size: 0; }
  .timeline-step::before { left: 22px; }
}

/* ---------- research cards ---------- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.research-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.article-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 26px 24px 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.article-card:hover {
  border-color: var(--blue-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-1);
}
.article-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.article-card h3 { font-size: 20px; margin-top: 14px; line-height: 1.3; }
.article-card p.deck { margin-top: 10px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; flex: 1; }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--blue-700);
  background: var(--blue-100);
}
.article-read {
  margin-top: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue-600);
  display: inline-flex; align-items: center; gap: 6px;
}
.article-read svg { width: 13px; height: 13px; transition: transform 0.15s ease; }
.article-card:hover .article-read svg { transform: translateX(3px); }

@media (max-width: 900px) { .research-grid, .research-grid.two-col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .research-grid, .research-grid.two-col { grid-template-columns: 1fr; } }

.research-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 40px; }
.filter-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.filter-chip.active, .filter-chip:hover { border-color: var(--blue-600); color: var(--blue-700); background: var(--blue-100); }

/* ---------- article page ---------- */
.article-header { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.article-header .back-link {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--blue-600);
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 28px;
}
.article-header h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; }
.article-header .article-meta { margin-top: 20px; }
.article-body {
  max-width: 760px;
  padding: 56px 0 100px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
}
.article-body h2 { font-size: 25px; margin-top: 48px; margin-bottom: 4px; }
.article-body h3 { font-size: 20px; margin-top: 34px; }
.article-body p { margin-top: 18px; }
.article-body ul { margin-top: 18px; padding-left: 22px; list-style: disc; }
.article-body li { margin-top: 8px; }
.article-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--brass);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: var(--ink-soft);
}
.article-body strong { color: var(--ink); }
.article-footer {
  max-width: 760px; padding: 0 0 90px;
  border-top: 1px solid var(--line); padding-top: 32px;
}
.article-disclaimer {
  font-size: 13px; color: var(--ink-faint); line-height: 1.6;
}

/* ---------- newsletter / contact ---------- */
.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line-dark);
}
.panel { padding: 48px 40px; }
.panel-blue { background: var(--navy-900); color: #fff; }
.panel-paper { background: var(--paper); border-left: 1px solid var(--line-dark); }
.panel h3 { font-size: 24px; }
.panel-blue h3 { color: #fff; }
.panel p.desc { margin-top: 14px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.panel-blue p.desc { color: rgba(229, 238, 250, 0.75); }
.field-row { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.text-input {
  flex: 1; min-width: 180px;
  padding: 13px 14px;
  border: 1px solid var(--line-dark);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14.5px;
}
.text-input::placeholder { color: rgba(229,238,250,0.45); }
.panel-paper .text-input { background: #fff; border-color: var(--line); color: var(--ink); }
.panel-paper .text-input::placeholder { color: var(--ink-faint); }
textarea.text-input { width: 100%; min-height: 100px; resize: vertical; font-family: var(--font-body); }
.fine-print { margin-top: 14px; font-size: 12.5px; color: rgba(229,238,250,0.5); }
.panel-paper .fine-print { color: var(--ink-faint); }
.form-note { margin-top: 14px; font-size: 13.5px; color: var(--brass-soft); display: none; }
.form-note.visible { display: block; }
.panel-paper .form-note { color: var(--up); }

@media (max-width: 820px) {
  .split-panel { grid-template-columns: 1fr; }
  .panel-paper { border-left: none; border-top: 1px solid var(--line-dark); }
}

/* ---------- dashboard preview ---------- */
.dashboard-preview { background: var(--navy-950); }
.dashboard-preview-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.dashboard-preview-title { color: #fff; margin-top: 14px; font-size: clamp(24px, 3vw, 34px); }
.dashboard-preview-desc { margin-top: 16px; color: rgba(229, 238, 250, 0.72); font-size: 15.5px; line-height: 1.65; max-width: 52ch; }
.dashboard-preview-cta { margin-top: 26px; }
.snapshot-card { border: 1px solid var(--line-dark); background: rgba(255, 255, 255, 0.03); padding: 22px; }
.snapshot-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--blue-400); margin-bottom: 14px;
}
.snapshot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-dark); }
.snapshot-cell { background: var(--navy-900); padding: 16px; }
.snapshot-value { font-family: var(--font-mono); font-size: 22px; color: #fff; }
.snapshot-value-blue { color: var(--blue-400); }
.snapshot-value-brass { color: var(--brass-soft); }
.snapshot-sub { font-size: 11px; color: rgba(229, 238, 250, 0.55); margin-top: 4px; }
@media (max-width: 780px) { .dashboard-preview-grid { grid-template-columns: 1fr; } }

/* ---------- pull quote ---------- */
.pull-quote {
  padding: 90px 0;
  background: var(--paper-dim);
  text-align: center;
}
.pull-quote blockquote {
  max-width: 780px;
  margin: 0 auto;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.4;
  color: var(--navy-900);
}
.pull-quote cite {
  display: block;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-600);
}

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 60px; align-items: start; }
.about-grid p { margin-top: 18px; color: var(--ink-soft); font-size: 16px; line-height: 1.75; }
.about-grid p a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; }
.about-grid p a:hover { color: var(--blue-700); }
.about-stat-list { display: grid; gap: 22px; }
.about-stat { padding: 20px 0; border-bottom: 1px solid var(--line); }
.about-stat .num { font-family: var(--font-mono); font-size: 26px; color: var(--blue-600); }
.about-stat .label { margin-top: 4px; font-size: 13.5px; color: var(--ink-faint); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- info / disclosure ---------- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.info-block { padding: 28px; border: 1px solid var(--line); background: var(--paper); }
.info-block h3 { font-size: 16px; }
.info-block p { margin-top: 12px; font-size: 14px; color: var(--ink-soft); line-height: 1.7; }
.info-block p a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; }
.info-block p a:hover { color: var(--blue-700); }
@media (max-width: 780px) { .info-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-950); color: rgba(229,238,250,0.75); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-size: 19px; }
.footer-desc { margin-top: 16px; font-size: 14px; max-width: 34ch; color: rgba(229,238,250,0.6); }
.footer-col h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-400); font-weight: 500; }
.footer-col ul { margin-top: 16px; display: grid; gap: 10px; }
.footer-col a { font-size: 14px; opacity: 0.82; }
.footer-col a:hover { opacity: 1; color: var(--blue-400); }
.footer-bottom {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-dark);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: rgba(229,238,250,0.45);
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- misc utility ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.tag-strip { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 30px; }
.tag-strip span { font-size: 13.5px; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; }
.tag-strip span::before { content: ""; width: 6px; height: 6px; background: var(--blue-500); clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }

.center-cta { text-align: center; margin-top: 52px; }
