/* ─────────────────────────────────────────────────────────────────
   CorpSol — global tokens + base
   ───────────────────────────────────────────────────────────────── */

:root {
  /* Palette: default — navy + bright blue */
  --c-bg: #ffffff;
  --c-bg-soft: #f5f6f8;
  --c-bg-muted: #eceef2;
  --c-line: rgba(10, 31, 68, 0.08);
  --c-line-strong: rgba(10, 31, 68, 0.14);
  --c-ink: #0A1F44;
  --c-ink-2: #1a2a4e;
  --c-mute: rgba(10, 31, 68, 0.58);
  --c-mute-2: rgba(10, 31, 68, 0.72);
  --c-faint: rgba(10, 31, 68, 0.36);
  --c-accent: #2563EB;
  --c-accent-2: #1d4ed8;
  --c-accent-soft: rgba(37, 99, 235, 0.10);
  --c-on-accent: #ffffff;
  --c-success: #16a34a;
  --c-warn: #ea580c;
  --c-quanta: #2563EB;
  --c-insight: #06B6D4;

  /* Type */
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --tracking-tight: -0.02em;
  --tracking-display: -0.035em;
  --tracking-eyebrow: 0.12em;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing scale */
  --pad-section: 120px;
  --pad-block: 28px;
  --pad-card: 28px;
  --gap-grid: 16px;

  /* Layout */
  --max-w: 1280px;
  --max-w-wide: 1440px;
  --side-pad: 32px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.04), 0 0 0 1px rgba(10, 31, 68, 0.04);
  --shadow-md: 0 4px 24px rgba(10, 31, 68, 0.06), 0 0 0 1px rgba(10, 31, 68, 0.05);
  --shadow-lg: 0 18px 48px -16px rgba(10, 31, 68, 0.18), 0 0 0 1px rgba(10, 31, 68, 0.05);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ── Dark theme overrides ── */
[data-theme="dark"] {
  --c-bg: #0a0e1a;
  --c-bg-soft: #10162a;
  --c-bg-muted: #161d36;
  --c-line: rgba(255, 255, 255, 0.07);
  --c-line-strong: rgba(255, 255, 255, 0.14);
  --c-ink: #f5f7ff;
  --c-ink-2: #d9dff0;
  --c-mute: rgba(245, 247, 255, 0.62);
  --c-mute-2: rgba(245, 247, 255, 0.78);
  --c-faint: rgba(245, 247, 255, 0.32);
  --c-accent-soft: rgba(79, 140, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 18px 48px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-y: scroll; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  text-wrap: pretty;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: var(--tracking-display); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

/* ── Layout primitives ── */
.cs-container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--side-pad);
  padding-right: var(--side-pad);
}
.cs-container--wide { max-width: var(--max-w-wide); }
.cs-section { padding-top: var(--pad-section); padding-bottom: var(--pad-section); }

@media (max-width: 900px) {
  :root { --pad-section: 80px; --side-pad: 20px; --pad-card: 22px; }
  body { font-size: 16px; }
}
@media (max-width: 600px) {
  :root { --pad-section: 64px; --side-pad: 16px; }
}

/* ── Type helpers ── */
.cs-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--c-mute);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cs-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent);
  display: inline-block;
}
.cs-h1 {
  font-size: clamp(40px, 6.4vw, 88px);
  line-height: 0.98;
  letter-spacing: var(--tracking-display);
  font-weight: 600;
}
.cs-h2 {
  font-size: clamp(32px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: var(--tracking-display);
  font-weight: 600;
}
.cs-h3 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.cs-lead {
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.5;
  color: var(--c-mute-2);
  max-width: 64ch;
  font-weight: 400;
}

/* ── Buttons ── */
.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-ink);
  color: var(--c-bg);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  white-space: nowrap;
}
.cs-btn:hover { background: var(--c-ink-2); transform: translateY(-1px); }
.cs-btn:active { transform: translateY(0); }
.cs-btn--primary { background: var(--c-accent); color: var(--c-on-accent); }
.cs-btn--primary:hover { background: var(--c-accent-2); }
.cs-btn--ghost {
  background: transparent;
  color: var(--c-ink);
  box-shadow: inset 0 0 0 1px var(--c-line-strong);
}
.cs-btn--ghost:hover { background: var(--c-bg-soft); box-shadow: inset 0 0 0 1px var(--c-ink); }
.cs-btn--sm { height: 40px; padding: 0 16px; font-size: 14px; }
.cs-btn--lg { height: 58px; padding: 0 28px; font-size: 16px; }
.cs-btn--block { width: 100%; }

/* shape tweaks via [data-radius] */
[data-radius="sharp"] .cs-btn { border-radius: 4px; }
[data-radius="rounded"] .cs-btn { border-radius: var(--r-md); }
[data-radius="pill"] .cs-btn { border-radius: var(--r-pill); }

/* ── Cards ── */
.cs-card {
  background: var(--c-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--pad-card);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.cs-card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
@media (hover: none) { .cs-card--hover:hover { transform: none; box-shadow: var(--shadow-sm); } }
.cs-card--inset { background: var(--c-bg-soft); box-shadow: none; }
.cs-card--ink { background: var(--c-ink); color: var(--c-bg); box-shadow: none; }
.cs-card--ink .cs-mute { color: rgba(255,255,255,0.72); }

[data-radius="sharp"] .cs-card { border-radius: 4px; }
[data-radius="rounded"] .cs-card { border-radius: var(--r-md); }
[data-radius="pill"] .cs-card { border-radius: var(--r-xl); }

.cs-mute { color: var(--c-mute-2); }
.cs-faint { color: var(--c-faint); }

/* ── Pill / chip ── */
.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--c-bg-soft);
  color: var(--c-mute-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* ── Density modes ── */
[data-density="compact"] { --pad-section: 84px; --pad-card: 20px; --gap-grid: 12px; }
[data-density="cozy"]    { --pad-section: 160px; --pad-card: 36px; --gap-grid: 24px; }

/* ── Utility ── */
.cs-stack-sm > * + * { margin-top: 8px; }
.cs-stack    > * + * { margin-top: 16px; }
.cs-stack-lg > * + * { margin-top: 24px; }
.cs-stack-xl > * + * { margin-top: 40px; }

.cs-grid { display: grid; gap: var(--gap-grid); }
.cs-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cs-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cs-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .cs-grid--3, .cs-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cs-grid--2, .cs-grid--3, .cs-grid--4 { grid-template-columns: 1fr; }
}

/* Divider */
.cs-hr { height: 1px; background: var(--c-line); border: 0; margin: 0; }

/* Subtle dotted grid background — feels SaaS */
.cs-dots {
  background-image: radial-gradient(circle at 1px 1px, var(--c-line-strong) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Scroll-reveal — disabled. The .cs-reveal class is kept in JSX for future hooks
   but has no visual effect: content is always visible. Anim was unreliable. */
.cs-reveal, .cs-reveal.is-in { /* intentionally empty */ }

/* Section header */
.cs-sec-head { display: grid; gap: 16px; max-width: 920px; margin-bottom: 48px; }
.cs-sec-head .cs-h2 { max-width: 18ch; }

/* Forms */
.cs-input, .cs-textarea, .cs-select {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c-ink);
  font: inherit;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.cs-textarea { height: auto; min-height: 120px; padding: 14px 18px; resize: vertical; line-height: 1.5; }
.cs-input:focus, .cs-textarea:focus, .cs-select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px var(--c-accent-soft);
}
.cs-input--error { border-color: var(--c-warn) !important; }
.cs-label { display: block; font-size: 13px; font-weight: 500; color: var(--c-mute-2); margin-bottom: 8px; }
.cs-help-error { font-size: 12px; color: var(--c-warn); margin-top: 6px; }

/* Modal */
.cs-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 14, 26, 0.5);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: cs-fade 0.25s var(--ease);
}
.cs-modal {
  background: var(--c-bg);
  color: var(--c-ink);
  border-radius: var(--r-xl);
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.4);
  animation: cs-pop 0.3s var(--ease);
}
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-pop  { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Marquee */
.cs-marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.cs-marquee-track {
  display: flex; gap: 12px;
  width: max-content;
  animation: cs-marquee-scroll 38s linear infinite;
  will-change: transform;
}
.cs-marquee:hover .cs-marquee-track { animation-play-state: paused; }
@keyframes cs-marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .cs-marquee-track { animation: none; }
}

/* Quanta / Insight accent helpers */
.cs-card-quanta {
  background: linear-gradient(160deg, #0A1F44 0%, #1d3a82 60%, #2563EB 130%);
  color: #fff;
}
.cs-card-insight {
  background: linear-gradient(160deg, #052e3a 0%, #0a5566 60%, #06B6D4 130%);
  color: #fff;
}
