/* =====================================================================
   Charted — marketing & legal site
   A single stylesheet, editorial discipline, hairlines + parchment + ink.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,300..700,0..100&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---------- tokens ---------- */
:root {
  --canvas:        #FAF7F2;
  --canvas-raised: #F2ECE0;
  --ink:           #1B2A41;
  --ink-soft:      #2E3D54;
  --muted:         #6B6357;
  --terracotta:    #C8623C;
  --terracotta-dim:#9C4232;
  --hairline:        rgba(27, 42, 65, 0.12);
  --hairline-strong: rgba(27, 42, 65, 0.22);
  --selection-bg:  rgba(200, 98, 60, 0.18);

  --shell-max:   980px;
  --legal-max:   720px;
  --gutter:      24px;
  --gutter-mob:  20px;

  --serif: 'Fraunces', ui-serif, 'New York', Georgia, 'Times New Roman', serif;
  --sans:  'IBM Plex Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas:        #1F1A15;
    --canvas-raised: #2A231C;
    --ink:           #FAF7F2;
    --ink-soft:      #E5DDD0;
    --muted:         rgba(250, 247, 242, 0.65);
    --terracotta:    #D87554;
    --terracotta-dim:#C8623C;
    --hairline:        rgba(250, 247, 242, 0.12);
    --hairline-strong: rgba(250, 247, 242, 0.22);
    --selection-bg:  rgba(216, 117, 84, 0.28);
  }
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--selection-bg); color: var(--ink); }
img, svg { display: block; max-width: 100%; }

a { color: var(--terracotta); text-decoration: none; transition: color .15s ease; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* ---------- type utilities (mirror iOS Type enum) ---------- */
.display {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 350;
  line-height: 1.02;
  letter-spacing: -0.018em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.title {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 96;
}
.subtitle {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
}
.section-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.body  { font-size: 16px; line-height: 1.6; }
.caption { font-size: 13px; line-height: 1.5; color: var(--muted); }

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-block;
}

.muted   { color: var(--muted); }
.accent  { color: var(--terracotta); }
.serif   { font-family: var(--serif); }
.mono    { font-family: var(--mono); }
.center  { text-align: center; }

/* ---------- layout shells ---------- */
.shell        { max-width: var(--shell-max);  margin: 0 auto; padding: 0 var(--gutter); }
.legal-shell  { max-width: var(--legal-max);  margin: 0 auto; padding: 0 var(--gutter); }

@media (max-width: 640px) {
  .shell, .legal-shell { padding: 0 var(--gutter-mob); }
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--gutter);
  max-width: var(--shell-max); margin: 0 auto;
}
.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 450;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.wordmark a { color: inherit; }
.wordmark a:hover { text-decoration: none; }
.wordmark .dot { color: var(--terracotta); }

.topnav {
  display: flex; gap: 26px; align-items: center;
  font-family: var(--sans);
  font-size: 14px;
}
.topnav a { color: var(--ink); }
.topnav a:hover { color: var(--terracotta); text-decoration: none; }

@media (max-width: 480px) {
  .topbar { padding: 22px var(--gutter-mob); }
  .topnav { gap: 18px; font-size: 13px; }
}

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  font-size: 15px; font-weight: 500; font-family: var(--sans);
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease,
              border-color .2s ease, color .2s ease;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover { text-decoration: none; }
.button-primary {
  background: var(--terracotta); color: #FAF7F2;
}
.button-primary:hover {
  background: var(--terracotta-dim);
  transform: translateY(-1px);
}
.button-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.button-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.button .arrow { transition: transform .25s ease; display: inline-block; }
.button:hover .arrow { transform: translateX(3px); }

/* ---------- hero ---------- */
.hero {
  padding: 56px var(--gutter) 88px;
  max-width: var(--shell-max);
  margin: 0 auto;
  position: relative;
}
.hero-eyebrow { margin-bottom: 24px; }
.hero h1      { margin-bottom: 32px; max-width: 820px; }
.hero-lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
  margin-bottom: 44px;
  font-weight: 400;
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.compass {
  position: absolute;
  right: -36px; top: 56px;
  width: 240px; height: 240px;
  opacity: 0.92;
  pointer-events: none;
  color: var(--ink);
}
@media (max-width: 860px) { .compass { right: -60px; top: 24px; width: 180px; height: 180px; opacity: 0.6; } }
@media (max-width: 640px) { .compass { display: none; } }

@media (max-width: 640px) {
  .hero { padding: 32px var(--gutter-mob) 56px; }
  .hero-lede { font-size: 17px; margin-bottom: 32px; }
}

/* ---------- generic sections ---------- */
.section {
  padding: 80px 0;
}
.section-eyebrow { margin-bottom: 28px; display: block; }
.section h2.title { margin-bottom: 44px; max-width: 620px; }

@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .section h2.title { margin-bottom: 32px; }
}

/* ---------- feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.feature {
  padding: 36px 32px 40px;
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
.feature:nth-child(2n) { border-right: none; }
.feature:nth-last-child(-n+2) { border-bottom: none; }
.feature .label { color: var(--terracotta); margin-bottom: 14px; }
.feature h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 10px;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.feature p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature { border-right: none !important; padding: 28px 4px 32px; }
}

/* ---------- charts list ---------- */
.charts-list { display: grid; grid-template-columns: 1fr; }
.chart-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  column-gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}
.chart-row:last-child { border-bottom: none; }
.chart-row .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.chart-row .name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
}
.chart-row .count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.premium-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  border: 1px solid var(--terracotta);
  border-radius: 999px;
  padding: 3px 8px 2px;
  margin-left: 10px;
  vertical-align: 3px;
  text-transform: uppercase;
}

/* ---------- pull quote ---------- */
.quote-section {
  padding: 96px 0 56px;
}
.quote {
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 400;
  line-height: 1.35;
  max-width: 720px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.quote::before {
  content: '';
  display: block;
  width: 44px;
  height: 1px;
  background: var(--terracotta);
  margin-bottom: 28px;
}
.quote-attrib { margin-top: 22px; }

@media (max-width: 640px) {
  .quote-section { padding: 64px 0 32px; }
}

/* ---------- CTA block ---------- */
.cta-block {
  padding: 88px 0 104px;
  text-align: center;
  border-top: 1px solid var(--hairline);
  margin-top: 24px;
}
.cta-block .label { margin-bottom: 22px; }
.cta-block h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 350;
  line-height: 1.1;
  margin: 0 auto 20px;
  max-width: 640px;
  letter-spacing: -0.015em;
}
.cta-block p {
  color: var(--muted);
  margin: 0 auto 36px;
  max-width: 500px;
  font-size: 16px;
}
@media (max-width: 640px) {
  .cta-block { padding: 64px 0 80px; }
}

/* ---------- footer ---------- */
.site-footer {
  padding: 36px var(--gutter) 56px;
  max-width: var(--shell-max);
  margin: 0 auto;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--sans);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--terracotta); }
.site-footer .links { display: flex; gap: 24px; }
.site-footer .coord {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
@media (max-width: 480px) {
  .site-footer { padding: 28px var(--gutter-mob) 40px; gap: 12px; }
  .site-footer .links { gap: 18px; }
  .site-footer .coord { display: none; }
}

/* ---------- legal pages ---------- */
.legal-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--hairline);
}
.legal-hero .label { display: inline-block; margin-bottom: 18px; }
.legal-hero h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5.2vw, 56px);
  font-weight: 350;
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin-bottom: 14px;
}
.legal-hero .meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal-content { padding: 48px 0 96px; }
.legal-content h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin: 56px 0 16px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.legal-content h2 .roman {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 500;
  min-width: 36px;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 12px;
  font-weight: 500;
}
.legal-content p {
  margin: 0 0 16px;
  line-height: 1.7;
  font-size: 16px;
  color: var(--ink-soft);
}
.legal-content p:last-child { margin-bottom: 0; }
.legal-content ul {
  margin: 0 0 20px 0;
  padding-left: 22px;
  list-style: none;
}
.legal-content li {
  margin-bottom: 10px;
  line-height: 1.65;
  color: var(--ink-soft);
  position: relative;
  padding-left: 0;
}
.legal-content li::before {
  content: '—';
  position: absolute;
  left: -22px;
  color: var(--terracotta);
  opacity: 0.7;
}
.legal-content strong { color: var(--ink); font-weight: 600; }
.legal-content em { font-family: var(--serif); font-style: italic; }

.legal-content a {
  border-bottom: 1px solid var(--terracotta);
  padding-bottom: 1px;
}
.legal-content a:hover { text-decoration: none; background: var(--selection-bg); }

@media (max-width: 640px) {
  .legal-hero { padding: 40px 0 32px; }
  .legal-content { padding: 40px 0 72px; }
  .legal-content h2 .roman { display: block; margin-bottom: 4px; }
  .legal-content h2 { display: block; }
}

/* ---------- entrance animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { opacity: 0; animation: rise 0.85s cubic-bezier(.2,.7,.2,1) forwards; }
.rise-1 { animation-delay:  .05s; }
.rise-2 { animation-delay:  .18s; }
.rise-3 { animation-delay:  .34s; }
.rise-4 { animation-delay:  .52s; }
.rise-5 { animation-delay:  .70s; }

/* Compass draws in, then a slow gentle rotation */
@keyframes draw {
  from { stroke-dashoffset: 720; }
  to   { stroke-dashoffset: 0;   }
}
@keyframes spin-slow {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}
.compass-ring { stroke-dasharray: 720; animation: draw 1.6s ease-out .4s forwards; opacity: 0; animation-fill-mode: forwards; }
.compass-ring { animation: draw 1.6s ease-out .4s forwards, fade-in .6s ease .4s forwards; }
@keyframes fade-in { to { opacity: 1; } }

.compass-rose { transform-origin: 120px 120px; animation: rose-in 1.2s cubic-bezier(.2,.7,.2,1) .8s both; }
@keyframes rose-in {
  from { opacity: 0; transform: rotate(-12deg) scale(0.92); }
  to   { opacity: 1; transform: rotate(0)      scale(1);    }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .compass-ring, .compass-rose {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
