/* ============================================================
   2M Data Analytics — shared shell
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Palette */
  --bg: #FAFAF7;
  --paper: #F0EDE3;
  --ink: #0B0B0F;
  --ink-2: #1F2937;
  --ink-3: #4A5568;
  --ink-4: #8A8F98;
  --line: #E5E2D6;
  --line-2: #D8D4C5;
  --accent: #2563EB;
  --accent-ink: #1D4ED8;
  --accent-tint: #DBEAFE;

  /* Type */
  --sans: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Spacing / shape */
  --rad: 16px;
  --rad-sm: 10px;
  --rad-lg: 22px;
  --container: 1280px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(72px, 9vw, 128px);

  /* Density (tweakable) */
  --density: 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

/* ============================================================
   Layout primitives
   ============================================================ */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section-tight { padding-top: calc(var(--section-y) * 0.6); padding-bottom: calc(var(--section-y) * 0.6); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.h-display {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(44px, 6.5vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.h-display em {
  font-style: normal;
  font-family: var(--sans);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-3);
}

.h-1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

.h-2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.h-3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0;
}

.lede {
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 60ch;
  margin: 0;
  text-wrap: pretty;
}

.body { color: var(--ink-3); line-height: 1.65; }

.mono { font-family: var(--mono); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform 0.15s ease, background 0.18s, color 0.18s, border-color 0.18s;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--bg); }

.btn-accent { background: var(--accent); color: var(--bg); }
.btn-accent:hover { background: var(--ink); color: var(--bg); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 4px 0;
  transition: color 0.18s, border-color 0.18s, gap 0.18s;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); gap: 12px; }

.btn .arrow { width: 14px; height: 14px; transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(2px); }

/* ============================================================
   Top nav
   ============================================================ */

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px; height: 28px;
  background: var(--ink);
  border-radius: 8px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
}
.brand-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent) 0%, transparent 55%);
  opacity: 0.85;
}
.brand-mark span { position: relative; z-index: 1; color: var(--bg); }

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--ink-3);
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper); }
.nav-links a.active { color: var(--ink); background: var(--paper); }

.topbar-cta { display: flex; align-items: center; gap: 12px; }

/* mobile */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .topbar-cta .btn-ghost { display: none; }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(60px, 8vw, 96px) 0 32px;
  margin-top: clamp(80px, 10vw, 120px);
  position: relative;
  overflow: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

.footer-brand-large {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(36px, 4vw, 52px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 16px;
}
.footer-brand-large .accent { color: var(--accent); }

.footer h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--ink-4);
  margin: 0 0 18px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer li a { font-size: 14px; color: rgba(250, 250, 247, 0.78); transition: color 0.15s; }
.footer li a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid rgba(250, 250, 247, 0.12);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; gap: 14px; align-items: flex-start; }
}

/* ============================================================
   Cards / surfaces
   ============================================================ */

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: calc(28px * var(--density));
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--ink-2);
}

.card-paper { background: var(--paper); border-color: var(--line-2); }
.card-ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.card-ink .body { color: rgba(250,250,247,0.7); }

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tag-accent { background: var(--accent-tint); border-color: transparent; color: var(--accent-ink); }
.tag-ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ============================================================
   Page hero (smaller, for non-home pages)
   ============================================================ */

.page-hero {
  padding-top: clamp(72px, 10vw, 140px);
  padding-bottom: clamp(48px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { margin-bottom: 24px; }
.page-hero .lede { margin-top: 24px; max-width: 64ch; }

/* ============================================================
   Misc utilities
   ============================================================ */

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 32px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2vw, 24px); }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.flex-col { display: flex; flex-direction: column; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; } .gap-48 { gap: 48px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; } .mb-48 { margin-bottom: 48px; }

/* number badge */
.numbox {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-2);
}

/* fade-in on load */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s ease forwards;
}
.fade-up.delay-1 { animation-delay: 0.08s; }
.fade-up.delay-2 { animation-delay: 0.16s; }
.fade-up.delay-3 { animation-delay: 0.24s; }
.fade-up.delay-4 { animation-delay: 0.32s; }

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* tickerline ribbon */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  overflow: hidden;
  white-space: nowrap;
  background: var(--paper);
}
.ticker-track {
  display: inline-flex;
  animation: ticker 38s linear infinite;
  gap: 40px;
}
.ticker-track > span { display: inline-flex; align-items: center; gap: 40px; }
.ticker-track .dot { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; display: inline-block; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
