/* coordiNATE — design tokens, reset, type, layout primitives, shared components. */

:root {
  /* Surfaces */
  --paper: #eceef2;      /* page background, cool venue-concrete grey */
  --paper-2: #f8f9fb;    /* raised surfaces */
  --line: #d5d9e2;       /* hairlines on paper */
  --night: #0c1238;      /* "show night" navy, dark sections */
  --night-2: #151c4a;    /* raised surfaces on night */
  --night-line: #2a3268; /* hairlines on night */

  /* Text */
  --ink: #0c1238;
  --ink-2: #4a5175;      /* secondary text on paper */
  --mist: #c9cdea;       /* body text on night */
  --mist-2: #8d93c0;     /* secondary text on night */

  /* Meaningful colour: each one means one thing everywhere */
  --cue: #2f45ff;        /* brand + actions + "you" */
  --cue-soft: #dfe3ff;
  --signal: #ff5b2e;     /* a problem / incident */
  --amber: #ffb020;      /* delayed / at risk */
  --go: #10b981;         /* done / resolved / approved */
  --ai-1: #7c5cff;       /* AI: iridescent violet → pink → cyan */
  --ai-2: #ff79d6;
  --ai-3: #4fd1ff;
  --ai: linear-gradient(120deg, var(--ai-1), var(--ai-2) 55%, var(--ai-3));

  /* Type */
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Scale (fluid). Display is condensed caps; text is regular width.
     Headlines also respect viewport height so short laptop screens aren't all headline. */
  --t-hero: clamp(3.2rem, min(1.2rem + 10.4vw, 15svh), 11.5rem);
  --t-h2: clamp(2.4rem, min(1.3rem + 5.6vw, 10.5svh), 6.6rem);
  --t-h3: clamp(1.6rem, 1.15rem + 1.6vw, 2.4rem);
  --t-lead: clamp(1.12rem, 1rem + 0.45vw, 1.38rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-micro: 0.75rem;

  /* Space & shape */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --section: clamp(72px, min(12vw, 17svh), 176px);
  --r-xl: 28px;   /* product windows, big panels */
  --r-lg: 18px;   /* cards */
  --r-md: 12px;   /* small UI pieces */
  --r-pill: 999px;

  --shadow-window: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 80px -30px rgba(12, 18, 56, 0.45),
    0 12px 24px -12px rgba(12, 18, 56, 0.25);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--cue); color: #fff; }

:focus-visible {
  outline: 3px solid var(--cue);
  outline-offset: 3px;
  border-radius: 6px;
}
.on-night :focus-visible { outline-color: var(--ai-3); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Language ----------
   Both languages sit side by side in the HTML; only the active one shows.
   (`lang=""` opts an element out, e.g. the language switch buttons.) */
:root[lang="de"] [lang="en"],
:root[lang="en"] [lang="de"] { display: none !important; }
:root[lang="de"] .display, :root[lang="de"] .h3 { hyphens: auto; overflow-wrap: break-word; }

/* Brand wordmark: "coordi" in brand blue, "NATE" in the text colour, never uppercased */
.brand { text-transform: none; white-space: nowrap; }
.brand-pre { color: var(--cue); }
.on-night .brand-pre { color: #7d8bff; }

/* ---------- Type ---------- */
.display {
  font-family: var(--font);
  font-variation-settings: "wdth" 62;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.005em;
}
.h2 { font-size: var(--t-h2); }
.h3 {
  font-size: var(--t-h3);
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--ink-2); max-width: 38em; }
.on-night .lead { color: var(--mist); }
.muted { color: var(--ink-2); }
.on-night .muted { color: var(--mist-2); }
.mono { font-family: var(--mono); font-size: 0.82em; letter-spacing: 0; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); position: relative; }
.on-night { background: var(--night); color: #fff; }
.section-head { display: grid; gap: 24px; margin-bottom: clamp(48px, 6vw, 88px); }
.section-head.center { justify-items: center; text-align: center; }
.section-head.center .lead { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--cue);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--fg);
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s;
  box-shadow: 0 10px 30px -12px rgba(47, 69, 255, 0.7);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(47, 69, 255, 0.8); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-ghost {
  --bg: transparent;
  --fg: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.on-night .btn-ghost { --fg: #fff; box-shadow: inset 0 0 0 1.5px var(--night-line); }
.on-night .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 0.94rem; }
.btn-lg { min-height: 60px; padding: 0 30px; font-size: 1.08rem; }

/* Status dot used across UI: colour carries the meaning */
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot.live { background: var(--go); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Product window chrome (shared by graphics modules) */
.window {
  background: var(--paper-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.window-bar {
  display: flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 18px;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-small); color: var(--ink-2);
}
.window-bar .lights { display: flex; gap: 6px; }
.window-bar .lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }

/* AI gradient text/border helpers */
.ai-text { background: var(--ai); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-border { position: relative; }
.ai-border::before {
  content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit;
  background: var(--ai);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
