/* ============================================================
   Armillary Labs — main.css
   Global reset, CSS variables, typography, shared utilities
   ============================================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

img, video, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Color — Base */
  --ink:          #0A0A0F;
  --ink-80:       rgba(10, 10, 15, 0.8);
  --ink-60:       rgba(10, 10, 15, 0.6);
  --ink-30:       rgba(10, 10, 15, 0.3);
  --ink-10:       rgba(10, 10, 15, 0.1);

  --surface:      #F5F3EE;
  --surface-90:   rgba(245, 243, 238, 0.9);
  --surface-60:   rgba(245, 243, 238, 0.6);
  --surface-40:   rgba(245, 243, 238, 0.4);
  --surface-20:   rgba(245, 243, 238, 0.2);
  --surface-10:   rgba(245, 243, 238, 0.1);
  --surface-06:   rgba(245, 243, 238, 0.06);
  --surface-03:   rgba(245, 243, 238, 0.03);

  /* Color — Accent */
  --gold:         #C4873A;
  --gold-light:   #E8B96A;
  --gold-60:      rgba(196, 135, 58, 0.6);
  --gold-40:      rgba(196, 135, 58, 0.4);
  --gold-30:      rgba(196, 135, 58, 0.3);
  --gold-25:      rgba(196, 135, 58, 0.25);
  --gold-20:      rgba(196, 135, 58, 0.2);
  --gold-18:      rgba(196, 135, 58, 0.18);
  --gold-15:      rgba(196, 135, 58, 0.15);
  --gold-10:      rgba(196, 135, 58, 0.1);
  --gold-08:      rgba(196, 135, 58, 0.08);

  /* Color — Background */
  --bg:           #0A0A0F;
  --bg-card:      rgba(245, 243, 238, 0.02);
  --bg-card-hover:rgba(196, 135, 58, 0.04);

  /* Nav */
  --nav-bg:       rgba(10, 10, 15, 0.75);

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-body:    'Outfit', system-ui, sans-serif;

  /* Type scale */
  --text-xs:      10px;
  --text-sm:      13px;
  --text-base:    15px;
  --text-md:      16px;
  --text-lg:      20px;
  --text-xl:      28px;
  --text-2xl:     36px;
  --text-3xl:     44px;
  --text-4xl:     62px;

  /* 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-16:     64px;
  --space-20:     80px;
  --space-24:     96px;
  --space-32:     128px;

  /* Layout */
  --max-width:    1000px;
  --nav-height:   64px;

  /* Border */
  --border:       0.5px solid var(--surface-10);
  --border-gold:  0.5px solid var(--gold-40);

  /* Radius */
  --radius-sm:    2px;
  --radius-md:    4px;
  --radius-lg:    8px;

  /* Transition */
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
  --duration:     0.2s;
  --duration-slow:0.4s;
}

/* ── Light theme overrides ──────────────────────────────────── */
[data-theme="light"] {
  --ink:           #F0EDE5;
  --ink-80:        rgba(240, 237, 229, 0.8);
  --ink-60:        rgba(240, 237, 229, 0.6);
  --ink-30:        rgba(240, 237, 229, 0.3);
  --ink-10:        rgba(240, 237, 229, 0.1);

  --surface:       #0A0A0F;
  --surface-90:    rgba(10, 10, 15, 0.9);
  --surface-60:    rgba(10, 10, 15, 0.6);
  --surface-40:    rgba(10, 10, 15, 0.4);
  --surface-20:    rgba(10, 10, 15, 0.2);
  --surface-10:    rgba(10, 10, 15, 0.1);
  --surface-06:    rgba(10, 10, 15, 0.06);
  --surface-03:    rgba(10, 10, 15, 0.03);

  --bg:            #F0EDE5;
  --bg-card:       rgba(10, 10, 15, 0.03);
  --bg-card-hover: rgba(196, 135, 58, 0.05);

  --gold-light:    #A8681E;

  --nav-bg:        rgba(240, 237, 229, 0.8);
}

/* ── Body ───────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.7;
  background: var(--bg);
  color: var(--surface);
  min-height: 100vh;
  transition: background-color var(--duration-slow) var(--ease),
              color var(--duration-slow) var(--ease);
}

/* ── Typography ─────────────────────────────────────────────── */
.font-display  { font-family: var(--font-display); }
.font-mono     { font-family: var(--font-mono); }
.font-body     { font-family: var(--font-body); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
}

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-10);
}

.section {
  padding: var(--space-24) var(--space-10);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-divider {
  border: none;
  border-top: var(--border);
  margin: 0 var(--space-10);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* ── Section Label ──────────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: var(--space-12);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.section-label::after {
  content: '';
  display: block;
  width: 48px;
  height: 0.5px;
  background: var(--gold-25);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.05em;
  padding: 11px var(--space-8);
  border-radius: var(--radius-sm);
  transition: background var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              color var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
  border: 0.5px solid var(--gold);
}

.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--surface-60);
  border: 0.5px solid var(--surface-20);
}

.btn-ghost:hover {
  border-color: var(--surface-40);
  color: var(--surface);
}

/* ── Error (404) ────────────────────────────────────────────── */
.error-main {
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.error-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-20) var(--space-10);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.error-hero .eyebrow { margin-bottom: var(--space-5); }

.error-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--space-6);
}

.error-lede {
  font-size: var(--text-md);
  font-weight: 300;
  line-height: 1.8;
  color: var(--surface-60);
  margin-bottom: var(--space-10);
  max-width: 40ch;
}

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
