/* =====================================================================
   AbteeX Design System — Lumynax / Te Mārama / (Weftline)
   Balanced OpenAI × Apple • Warm ivory + obsidian + amber
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ——— Color ——— */
  --ivory-50:  #FFFFFF;   /* page — pure white */
  --ivory-100: #FAF7F1;   /* surface — warm */
  --ivory-200: #EEE8DA;   /* line */
  --ivory-300: #DDD3BE;
  --obsidian-900: #0A0A0B;
  --obsidian-700: #1F1E1C;
  --obsidian-500: #4A4742;
  --obsidian-300: #8A857B;
  --obsidian-200: #B3AEA3;
  --amber-500: #C9761F;   /* dawn accent */
  --amber-400: #E08A2C;
  --amber-100: #F4E4CC;

  --bg:        var(--ivory-50);
  --surface:   var(--ivory-100);
  --line:      var(--ivory-200);
  --line-strong: var(--ivory-300);
  --ink:       var(--obsidian-900);
  --ink-2:     var(--obsidian-700);
  --muted:     var(--obsidian-500);
  --muted-2:   var(--obsidian-300);
  --accent:    var(--amber-500);

  /* ——— Type ——— */
  --font-display: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Scale (fluid, 1920 design reference) */
  --t-micro: 11px;
  --t-small: 13px;
  --t-body:  16px;
  --t-lead:  19px;
  --t-h4:    24px;
  --t-h3:    34px;
  --t-h2:    clamp(40px, 4.2vw, 64px);
  --t-h1:    clamp(56px, 8vw, 128px);
  --t-mega:  clamp(80px, 13vw, 200px);

  /* ——— Space ——— */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px; --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 192px;

  /* ——— Radius ——— */
  --r-1: 2px; --r-2: 6px; --r-3: 10px; --r-4: 14px; --r-full: 999px;

  /* ——— Motion ——— */
  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --t-fast: 160ms;
  --t-med:  320ms;
  --t-slow: 640ms;
}

[data-theme="dark"] {
  --bg:        #0B0B0C;
  --surface:   #131311;
  --line:      #23221F;
  --line-strong: #2E2C28;
  --ink:       #F5F0E6;
  --ink-2:     #EDE6D6;
  --muted:     #A39E94;
  --muted-2:   #6F6A60;
  --accent:    #E8A04B;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

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

/* ——— Type utilities ——— */
.display, h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.02; margin: 0; }
h1 { font-size: var(--t-h1); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: var(--t-h2); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; }
h3 { font-size: var(--t-h3); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h4 { font-size: var(--t-h4); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
p  { margin: 0; }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--ink-2); font-weight: 400; letter-spacing: -0.005em; }
.mono { font-family: var(--font-mono); font-size: var(--t-small); letter-spacing: 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.caps {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: var(--t-small);
}

/* ——— Layout ——— */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--s-7); }
@media (max-width: 800px) { .wrap { padding: 0 var(--s-5); } }

.hairline { height: 1px; background: var(--line); width: 100%; }
.hairline-strong { height: 1px; background: var(--line-strong); width: 100%; }

/* ——— Nav ——— */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 96px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 15px;
  display: flex; align-items: baseline; gap: 10px;
}
.nav-logo .small { font-weight: 300; font-size: 11px; letter-spacing: 0.22em; color: var(--muted); }
.nav-links { display: flex; gap: var(--s-6); }
.nav-links a {
  font-size: 13px; color: var(--muted);
  transition: color var(--t-fast) var(--ease-out);
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  font-size: 13px; padding: 8px 14px;
  border: 1px solid var(--ink); border-radius: var(--r-full);
  transition: all var(--t-fast) var(--ease-out);
}
.nav-cta:hover { background: var(--ink); color: var(--bg); }

/* ——— Buttons ——— */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--r-full);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-med) var(--ease-out);
}
.btn .arrow { transition: transform var(--t-med) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-accent {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-accent:hover { box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 60%, transparent); }

/* ——— Cards ——— */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  padding: var(--s-6);
  transition: border-color var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.card:hover { border-color: var(--line-strong); }

/* ——— Accent bits ——— */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  font-family: var(--font-mono); font-size: var(--t-micro); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}

/* ——— Reveal on scroll ——— */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 80ms; }
.reveal.d2 { transition-delay: 160ms; }
.reveal.d3 { transition-delay: 240ms; }
.reveal.d4 { transition-delay: 320ms; }

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

/* ——— Footer ——— */
.footer {
  border-top: 1px solid var(--line);
  padding: var(--s-9) 0 var(--s-7);
  margin-top: var(--s-10);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-7);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-family: var(--font-mono); font-size: var(--t-micro); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-4); font-weight: 500; }
.footer a { display: block; padding: 4px 0; color: var(--ink-2); font-size: 14px; }
.footer a:hover { color: var(--accent); }

/* ——— Tweaks panel ——— */
.tweaks {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  padding: 14px 16px;
  display: none; flex-direction: column; gap: 10px;
  z-index: 100; min-width: 220px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,0.12);
}
.tweaks.on { display: flex; }
.tweaks h6 { margin: 0 0 4px; font-family: var(--font-mono); font-size: var(--t-micro); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.tweak-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; }
.tweak-row select, .tweak-row button {
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink); padding: 6px 10px; border-radius: var(--r-2);
  font-family: var(--font-mono); font-size: 12px; cursor: pointer;
}

/* ——— Mono keyline dividers ——— */
.keyline-top { border-top: 1px solid var(--line); }
.keyline-bottom { border-bottom: 1px solid var(--line); }

/* Selection */
::selection { background: var(--amber-100); color: var(--ink); }
[data-theme="dark"] ::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }
