/* ============================================================
   OrgSense — Design System
   Brand DNA: node-network mark · deep teal ink #102A33 · coral signal #D9633A
   Type: Space Grotesk (display) · Hanken Grotesk (body) · Space Mono (data labels)
   ============================================================ */

/* ---- Tokens ------------------------------------------------ */
:root {
  /* brand constants */
  --ink: #102A33;
  --coral: #D9633A;

  /* accent (tweakable) */
  --accent: #D9633A;
  --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
  --accent-ink: #7a2f12;

  /* fonts */
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* rhythm */
  --section: clamp(80px, 11vw, 168px);
  --container: 1280px;
  --pad: clamp(20px, 5vw, 64px);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---- Light theme (default) --------------------------------- */
:root, [data-theme="light"] {
  --bg: #F6F3EC;
  --bg-2: #EFEBE1;
  --surface: #FFFFFF;
  --surface-2: #FBF9F4;
  --text: #14262C;
  --text-soft: #4A5A60;
  --text-mute: #7E8A8E;
  --line: #E2DCCF;
  --line-strong: #CFC8B8;
  --on-ink: #F4F1E9;
  --grid-line: rgba(16, 42, 51, .055);
  --node: #102A33;
  --node-dim: rgba(16, 42, 51, .28);
  --link-rgb: 16, 42, 51;
  --shadow-card: 0 1px 2px rgba(16,42,51,.04), 0 18px 50px -28px rgba(16,42,51,.22);
  --shadow-float: 0 24px 70px -30px rgba(16,42,51,.4);
  --hero-fade: #F6F3EC;
  color-scheme: light;
}

/* ---- Dark theme -------------------------------------------- */
[data-theme="dark"] {
  /* dark-mode accent: amber (light mode keeps coral #D9633A) */
  --accent: #E0A13D;
  --accent-ink: #4a3414;
  --bg: #07171C;
  --bg-2: #0B2027;
  --surface: #0E252D;
  --surface-2: #103039;
  --text: #EDF1F0;
  --text-soft: #A8BCC0;
  --text-mute: #6E8488;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --on-ink: #EDF1F0;
  --grid-line: rgba(255,255,255,.045);
  --node: #5FE0C0;
  --node-dim: rgba(120, 210, 190, .3);
  --link-rgb: 150, 230, 210;
  --shadow-card: 0 1px 0 rgba(255,255,255,.04) inset, 0 30px 70px -34px rgba(0,0,0,.7);
  --shadow-float: 0 34px 90px -34px rgba(0,0,0,.85);
  --hero-fade: #07171C;
  color-scheme: dark;
}

/* ---- Reset ------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .6s var(--ease);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

/* ---- Layout primitives ------------------------------------- */
.wrap { max-width: var(--container); margin: 0 auto; padding-inline: var(--pad); }
.wrap-narrow { max-width: 920px; margin: 0 auto; padding-inline: var(--pad); }
.section { padding-block: var(--section); position: relative; }

/* ---- Typography -------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h1.display { font-size: clamp(42px, 5.6vw, 82px); }
h2.display { font-size: clamp(34px, 5vw, 68px); font-weight: 500; }
h3.display { font-size: clamp(24px, 2.6vw, 36px); font-weight: 500; letter-spacing: -0.02em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
}
.eyebrow.center::before { display: none; }

.lead {
  font-size: clamp(18px, 1.5vw, 21px);
  color: var(--text-soft);
  line-height: 1.65;
  max-width: 56ch;
  text-wrap: pretty;
}

.accent-text { color: var(--accent); }
.serifless em { font-style: normal; color: var(--accent); }

/* ---- Buttons ----------------------------------------------- */
.btn {
  --bw: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  padding: 15px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .4s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .4s var(--ease);
  will-change: transform;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 0 14px 30px -16px rgba(16,42,51,.6);
}
[data-theme="dark"] .btn-primary { background: var(--accent); color: #1a0d07; box-shadow: 0 18px 40px -18px var(--accent); }
.btn-primary:hover { box-shadow: 0 20px 44px -16px rgba(16,42,51,.8); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 16px 36px -16px var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); background: color-mix(in oklch, var(--text) 5%, transparent); }
.btn-lg { padding: 18px 32px; font-size: 17px; }
.btn .arrow { transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Pills / tags ------------------------------------------ */
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---- Cards ------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---- Reveal animation primitives --------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal="in"] { opacity: 1; transform: none; }
[data-reveal-scale] { opacity: 0; transform: scale(.96) translateY(20px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal-scale="in"] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-scale] { opacity: 1 !important; transform: none !important; }
}
[data-motion="off"] [data-reveal],
[data-motion="off"] [data-reveal-scale] { opacity: 1 !important; transform: none !important; transition: none !important; }

/* word-by-word headline reveal */
.line-mask { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.04em; }
.line-mask > span { display: block; white-space: nowrap; transform: translateY(120%); transition: transform 1.05s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal-lines="in"] .line-mask > span { transform: none; }
@media (prefers-reduced-motion: reduce) { .line-mask > span { transform: none !important; } }
