/* ============================================================
 * buildOS · base.css
 * Shared design tokens + base styles + header + footer + cookie
 * banner. Imported by every page; page-specific styles go inline
 * in each .njk template under {% block headExtras %}.
 * ============================================================ */

/* ===== Fonts (self-hosted, GDPR-safe) ===== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Design tokens ===== */
:root {
  /* Neutral surfaces */
  --ink:              oklch(24% 0.015 140);
  --ink-hover:        oklch(28% 0.015 140);
  --night:            oklch(20% 0.015 140);
  --bone:             oklch(95% 0.012 85);
  --bone-translucent: oklch(99% 0.003 95 / 0.95);
  --snow:             oklch(99% 0.003 95);
  --bone-deep:        oklch(94% 0.012 85);
  --cream:            oklch(92% 0.02 80);
  --faint:            oklch(82% 0.015 130);
  --rule:             oklch(78% 0.015 130);

  /* Text colors */
  --mute:  oklch(45% 0.015 140);
  --quiet: oklch(60% 0.012 130);

  /* Footer ramp */
  --footer-tagline:    oklch(70% 0.012 130);
  --footer-col-title:  oklch(60% 0.012 130);
  --footer-link:       oklch(80% 0.012 130);
  --footer-link-hover: var(--bone);
  --footer-rule:       oklch(30% 0.015 140);
  --footer-bottom:     oklch(50% 0.012 130);

  /* Shadow tints */
  --shadow-color-1: oklch(20% 0.015 140 / 0.08);
  --shadow-color-2: oklch(20% 0.015 140 / 0.04);
  --shadow-pill:    0 4px 16px -4px var(--shadow-color-1), 0 2px 4px var(--shadow-color-2);
  --shadow-section: 0 -16px 36px -16px var(--shadow-color-1),
                    0 16px 36px -16px var(--shadow-color-1),
                    0 -3px 8px -4px var(--shadow-color-2),
                    0 3px 8px -4px var(--shadow-color-2);

  /* Accent */
  --ember:      #E27712;
  --ember-soft: oklch(96% 0.05 70);
  --ember-glow: 226 119 18;

  /* Form states */
  --error:      oklch(55% 0.18 25);
  --focus-ring: var(--ember);

  /* Typography */
  --sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-hero:    clamp(44px, 6vw, 80px);
  --text-display: clamp(36px, 5.5vw, 72px);
  --text-h2:      clamp(28px, 4vw, 56px);
  --text-h3:      clamp(22px, 2.6vw, 32px);
  --text-lead:    19px;
  --text-body:    17px;
  --text-small:   15px;
  --text-mono:    12px;
  --text-tiny:    11px;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-28: 112px;
  --space-32: 128px;

  /* Radius */
  --radius:    16px;
  --radius-sm: 8px;

  /* Motion */
  --dur-fast:    100ms;
  --dur-short:   150ms;
  --dur-medium:  240ms;
  --dur-long:    360ms;
  --dur-slow:    600ms;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-pulse:  cubic-bezier(0.4, 0, 0.6, 1);

  /* Per-page overrideable background */
  --page-bg: var(--cream);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--page-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ===== Utilities ===== */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-14); }
@media (max-width: 1024px) { .wrap { padding: 0 var(--space-8); } }
@media (max-width: 640px)  { .wrap { padding: 0 var(--space-5); } }

.mono {
  font-family: var(--mono);
  font-size: var(--text-tiny);
  letter-spacing: 0.18em;
  color: var(--mute);
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--bone);
  font-family: var(--mono);
  font-size: var(--text-mono);
  letter-spacing: 0.12em;
  border-radius: var(--radius);
  z-index: 200;
  transition: top var(--dur-short) var(--ease-out);
}
.skip-link:focus-visible {
  top: var(--space-3);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ===== Sticky pill nav ===== */
.nav-container {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-14) 0;
  pointer-events: none;
}
@media (max-width: 1024px) { .nav-container { padding: var(--space-3) var(--space-8) 0; } }
@media (max-width: 640px)  { .nav-container { padding: var(--space-3) var(--space-5) 0; } }
.nav-pill {
  pointer-events: auto;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: 10px 18px;
  background: var(--bone-translucent);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pill);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}
.logo-word {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.045em;
  color: var(--ink);
  line-height: 1;
  text-transform: none;
}
.nav-spacer { flex: 1; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.nav-link {
  font-family: var(--mono);
  font-size: var(--text-mono);
  letter-spacing: 0.12em;
  color: var(--ink);
  padding: 4px 0;
  text-transform: none;
  transition: opacity var(--dur-short) var(--ease-out);
}
.nav-link:hover { opacity: 0.6; }
.nav-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  opacity: 1;
}
.nav-cta {
  font-family: var(--mono);
  font-size: var(--text-mono);
  letter-spacing: 0.12em;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bone);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-transform: none;
  transition: background-color var(--dur-short) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.nav-cta:hover { background: var(--ink-hover); }
.nav-cta:active { transform: translateY(1px); }
.nav-cta:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.nav-cta .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  flex-shrink: 0;
}
/* Hide nav-links early enough that the CTA always fits in the pill. */
@media (max-width: 900px) {
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .nav-pill { padding: 8px 14px; gap: var(--space-3); }
  .nav-cta { font-size: 11px; padding: 7px 12px; }
}

/* ===== Footer ===== */
.footer {
  background: var(--night);
  color: var(--bone);
  padding: var(--space-16) 0 0;
  text-transform: none;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.footer-brand .logo-word {
  color: var(--bone);
  font-size: 30px;
}
.footer-tagline {
  font-family: var(--sans);
  font-size: var(--text-small);
  line-height: 1.6;
  color: var(--footer-tagline);
  max-width: 300px;
}
.footer-col-title {
  font-family: var(--mono);
  font-size: var(--text-tiny);
  letter-spacing: 0.18em;
  color: var(--footer-col-title);
  margin-bottom: var(--space-4);
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--footer-link);
  transition: color var(--dur-short) var(--ease-out);
}
.footer-links a:hover { color: var(--footer-link-hover); }
.footer-links a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  color: var(--footer-link-hover);
}
.footer-links .linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-bottom {
  border-top: 1px solid var(--footer-rule);
  padding: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.footer-bottom-text {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--footer-bottom);
  line-height: 1.5;
}
.footer-bottom-mark {
  font-family: var(--mono);
  font-size: var(--text-tiny);
  letter-spacing: 0.16em;
  color: var(--footer-bottom);
}
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  /* Brand spans the full width so Product + Company can sit side-by-side
     below, instead of Company falling under Brand with an empty cell. */
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .footer { padding: var(--space-12) 0 0; }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* ===== Cookie banner ===== */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  width: min(680px, calc(100vw - 32px));
  z-index: 9999;
  background: var(--snow);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow-pill);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 20px;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
  font-family: var(--sans);
  text-transform: none;
}
.cookie-banner.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.cookie-banner__text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mute);
}
.cookie-banner__text strong { color: var(--ink); font-weight: 600; }
.cookie-banner__text a {
  color: var(--ember);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--ember) 35%, transparent);
}
.cookie-banner__text a:hover { border-bottom-color: var(--ember); }
.cookie-banner__actions { display: flex; gap: 10px; align-items: center; }
.cookie-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 999px;
  padding: 9px 18px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.cookie-btn:hover { background: var(--bone-deep); }
.cookie-btn--accept {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
}
.cookie-btn--accept:hover {
  background: var(--ink-hover);
  border-color: var(--ink-hover);
}
@media (max-width: 560px) {
  .cookie-banner {
    grid-template-columns: 1fr;
    gap: 14px;
    bottom: 12px;
    padding: 18px;
  }
  .cookie-banner__actions { justify-content: stretch; }
  .cookie-btn { flex: 1; text-align: center; }
}
