/* =============================================================
   Haevek site — page-level styles built on tokens.css
   Aesthetic: editorial-technical. Light canvas, near-black ink,
   gradient deployed as a single accent per surface.
   ============================================================= */

:root {
  /* Local site overrides — warmer cream canvas, deeper ink */
  --site-bg: #FAFAF7;
  --site-bg-2: #F2F0EA;
  --site-ink: #0E0B14;
  --site-ink-2: #2A2138;
  --site-ink-3: #6C6275;
  --site-rule: #1A14201A;
  --site-rule-strong: #1A1420;
  --site-max: 1200px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--site-bg);
  color: var(--site-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection {
  background: var(--brand-purple);
  color: #fff;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 32px;
}

.container-wide {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 96px 0;
  position: relative;
}

.section-tight { padding: 64px 0; }

.section + .section {
  border-top: 1px solid var(--site-rule);
}

.section-ink {
  background: var(--ink-900);
  color: var(--fg-on-ink);
}

.section-ink + .section,
.section + .section-ink {
  border-top: none;
}

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--site-ink-3);
  margin: 0 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-ink .eyebrow {
  color: var(--fg-on-ink-2);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--site-ink);
  margin: 0;
  text-wrap: balance;
}

.section-ink h1, .section-ink h2, .section-ink h3, .section-ink h4 {
  color: var(--fg-on-ink);
}

.h-display {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.025em;
}

.h1 {
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.lead {
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.5;
  color: var(--site-ink-2);
  max-width: 64ch;
  text-wrap: pretty;
}

.section-ink .lead { color: var(--fg-on-ink-2); }

.muted { color: var(--site-ink-3); }
.section-ink .muted { color: var(--fg-on-ink-3); }

/* The signature gradient text — used at most ONCE per page */
.brand-grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono { font-family: var(--font-mono); font-feature-settings: "ss01"; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease-out-quart),
              color var(--dur-micro) var(--ease-out-quart),
              border-color var(--dur-micro) var(--ease-out-quart);
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.btn-primary {
  background: var(--site-ink);
  color: #fff;
}
.btn-primary:hover { background: #000; }

.section-ink .btn-primary {
  background: #fff;
  color: var(--site-ink);
}
.section-ink .btn-primary:hover { background: #f0ece6; }

.btn-ghost {
  background: transparent;
  color: var(--site-ink);
  border-color: var(--site-rule-strong);
}
.btn-ghost:hover {
  background: var(--site-ink);
  color: #fff;
}
.section-ink .btn-ghost {
  color: var(--fg-on-ink);
  border-color: var(--ink-500);
}
.section-ink .btn-ghost:hover {
  background: var(--fg-on-ink);
  color: var(--ink-900);
  border-color: var(--fg-on-ink);
}

.btn-link {
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding-bottom: 2px;
}

.btn .arrow {
  transition: transform var(--dur-micro) var(--ease-out-quart);
}
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--site-rule);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-brand img {
  height: 26px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 14px;
  color: var(--site-ink-2);
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  transition: color var(--dur-micro);
}
.nav-links a:hover { color: var(--site-ink); }
.nav-links a.active {
  color: var(--site-ink);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--site-ink);
}

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

.nav-cta .btn {
  padding: 10px 16px;
  font-size: 14px;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink-900);
  color: var(--fg-on-ink-2);
  padding: 80px 0 40px;
  font-size: 14px;
}
.footer h5 {
  color: var(--fg-on-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.footer-brand img {
  height: 28px;
  margin-bottom: 16px;
}
.footer-brand p {
  max-width: 30ch;
  color: var(--fg-on-ink-3);
  line-height: 1.55;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col a {
  color: var(--fg-on-ink-2);
  transition: color var(--dur-micro);
}
.footer-col a:hover { color: var(--fg-on-ink); }
.footer-bottom {
  border-top: 1px solid var(--ink-700);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fg-on-ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: span 2; }
}

/* ---------- Generic blocks ---------- */
.divider-rule {
  height: 1px;
  background: var(--site-rule);
  margin: 0;
  border: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--site-rule-strong);
  border-radius: 999px;
  color: var(--site-ink-2);
}
.section-ink .tag {
  border-color: var(--ink-500);
  color: var(--fg-on-ink-2);
}

/* Number meta line — used on pages: section number + label */
.section-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--site-ink-3);
  margin-bottom: 32px;
}
.section-meta .num {
  font-weight: 500;
  color: var(--site-ink);
}
.section-ink .section-meta .num { color: var(--fg-on-ink); }
.section-meta .bar {
  flex: 1;
  height: 1px;
  background: var(--site-rule);
}
.section-ink .section-meta .bar { background: var(--ink-500); }

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--site-rule);
  border-radius: 8px;
  padding: 28px;
}
.section-ink .card {
  background: var(--ink-800);
  border-color: var(--ink-700);
}

/* Reveal on scroll (subtle) */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease-out-quart),
              transform 600ms var(--ease-out-quart);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* Big numerals */
.numeral {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(64px, 9vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.numeral .unit {
  font-size: 0.5em;
  font-weight: 500;
  color: var(--site-ink-3);
  letter-spacing: -0.02em;
  margin-left: 4px;
}
.section-ink .numeral .unit { color: var(--fg-on-ink-3); }

/* Small grid utilities */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .container, .container-wide { padding: 0 20px; }
}

/* Marquee-style logo strip */
.logo-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  align-items: center;
}
.logo-strip > div {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--site-ink-2);
  opacity: 0.7;
  font-size: 18px;
  border-left: 1px solid var(--site-rule);
  padding-left: 16px;
}
.logo-strip > div:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 860px) {
  .logo-strip { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .logo-strip > div { border-left: 0; padding-left: 0; justify-content: flex-start; }
}

/* Hairline frame for hero-style figures */
.frame {
  border: 1px solid var(--site-rule-strong);
  background: #fff;
  position: relative;
}
.frame::before, .frame::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--site-ink);
}
.frame.with-corners::before { top: -4px; left: -4px; }
.frame.with-corners::after { bottom: -4px; right: -4px; }

/* Page hero common */
.page-hero {
  padding: 120px 0 80px;
  border-bottom: 1px solid var(--site-rule);
}
.page-hero .eyebrow { margin-bottom: 24px; }
.page-hero h1 { margin-bottom: 24px; }
.page-hero .lead { max-width: 60ch; }
