/* alngsd-ds.css — Alongside design system foundation
   Source of truth for all website builds going forward */

/* ──────────────────────────────────────────────────────────────
   Reset
────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; }

/* ──────────────────────────────────────────────────────────────
   Design Tokens
────────────────────────────────────────────────────────────── */
:root {
  /* — Color: surfaces — */
  --bg:               #0E0F14;
  --surface-cool:     #161925;
  --surface-elevated: #1F2435;
  --surface-warm:     #1C1008;

  /* Aliases (v2 HTML naming) */
  --surface-1: var(--surface-cool);
  --surface-2: var(--surface-elevated);

  /* — Color: borders — */
  --border-cool: #252A3A;
  --border-warm: #2E2018;

  /* — Color: accent (elemental gold) — */
  --accent:       #C2993E;
  --accent-hover: #D4AB52;
  --accent-muted: #7A5E22;

  /* — Color: text — */
  --text-primary:   #E8E4D8;
  --text-body:      #9A9688;
  --text-muted:     #5A5650;
  --text-warm-body: #7A6858;
  --text-on-accent: #0E0A04;

  /* — Gold ramp (7-step, for gradients and accent contexts) — */
  --gold-1: #0E0A04;
  --gold-2: #3A2A0E;
  --gold-3: #7A5E22;
  --gold-4: #C2993E;
  --gold-5: #D4AB52;
  --gold-6: #E8C87A;
  --gold-7: #F0DCA8;

  /* — Geometry — */
  --radius-6:  6px;
  --radius-8:  8px;
  --radius-10: 10px;
  --radius-12: 12px;
  --radius-14: 14px;
  --radius-16: 16px;
  --hairline:  0.5px;
  --bar-h:     2px;

  /* — Font stacks — */
  --font-serif: "New York", Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "SF Pro Text",
                "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono:  "SF Mono", Menlo, Monaco, "Courier New", monospace;

  /* — Type scale (fluid: mobile → desktop via clamp) — */
  --size-display:  clamp(36px, 6vw, 56px);
  --size-h1:       clamp(24px, 4vw, 32px);
  --size-h2:       clamp(20px, 3vw, 24px);
  --size-h3:       clamp(18px, 2.5vw, 22px);
  --size-headline: 17px;
  --size-body:     17px;
  --size-callout:  15px;
  --size-subhead:  13px;
  --size-caption:  12px;
  --size-label:    12px;
  --size-mono:     13px;

  /* — Tracking (letter-spacing) — */
  --track-display:  -0.03em;
  --track-h1:       -0.02em;
  --track-h2:       -0.015em;
  --track-h3:       -0.012em;
  --track-headline: -0.025em;
  --track-body:     -0.02em;
  --track-callout:  -0.015em;
  --track-subhead:  -0.012em;
  --track-caption:  -0.008em;
  --track-label:     0.08em;
  --track-mono:      0;

  /* — Line heights — */
  --lh-display:  1.02;
  --lh-h1:       1.1;
  --lh-h2:       1.2;
  --lh-h3:       1.25;
  --lh-headline: 1.3;
  --lh-body:     1.7;
  --lh-callout:  1.65;
  --lh-subhead:  1.6;
  --lh-caption:  1.55;
  --lh-label:    1.4;
  --lh-mono:     1.5;

  /* — Spacing (base-8) — */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* — Content widths — */
  --prose-xs: 360px;
  --prose-sm: 480px;
  --prose-md: 520px;
  --prose-lg: 640px;

  /* — Layout primitive defaults — */
  --stack-gap:   var(--space-md);
  --cluster-gap: var(--space-md);
  --grid-cols:   1fr;
  --grid-gap:    var(--space-md);
}

/* ──────────────────────────────────────────────────────────────
   Base
────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: var(--space-2xl) var(--space-md) var(--space-3xl);
}

.wrap { margin: 0 auto; max-width: 720px; }

::selection { background: var(--accent); color: var(--text-on-accent); }

/* ──────────────────────────────────────────────────────────────
   Typography classes
────────────────────────────────────────────────────────────── */
.t-display {
  font-family: var(--font-serif);
  font-size: var(--size-display);
  font-weight: 400;
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
  color: var(--text-primary);
}
.t-h1 {
  font-family: var(--font-serif);
  font-size: var(--size-h1);
  font-weight: 400;
  letter-spacing: var(--track-h1);
  line-height: var(--lh-h1);
  color: var(--text-primary);
}
.t-h2 {
  font-family: var(--font-serif);
  font-size: var(--size-h2);
  font-weight: 400;
  letter-spacing: var(--track-h2);
  line-height: var(--lh-h2);
  color: var(--text-primary);
}
.t-h3 {
  font-family: var(--font-serif);
  font-size: var(--size-h3);
  font-weight: 400;
  letter-spacing: var(--track-h3);
  line-height: var(--lh-h3);
  color: var(--text-primary);
}
.t-headline {
  font-family: var(--font-sans);
  font-size: var(--size-headline);
  font-weight: 600;
  letter-spacing: var(--track-headline);
  line-height: var(--lh-headline);
  color: var(--text-primary);
}
.t-body {
  font-family: var(--font-sans);
  font-size: var(--size-body);
  font-weight: 400;
  letter-spacing: var(--track-body);
  line-height: var(--lh-body);
  color: var(--text-body);
}
.t-callout {
  font-family: var(--font-sans);
  font-size: var(--size-callout);
  font-weight: 400;
  letter-spacing: var(--track-callout);
  line-height: var(--lh-callout);
  color: var(--text-body);
}
.t-subhead {
  font-family: var(--font-sans);
  font-size: var(--size-subhead);
  font-weight: 500;
  letter-spacing: var(--track-subhead);
  line-height: var(--lh-subhead);
  color: var(--text-body);
}
.t-caption {
  font-family: var(--font-sans);
  font-size: var(--size-caption);
  font-weight: 400;
  letter-spacing: var(--track-caption);
  line-height: var(--lh-caption);
  color: var(--text-muted);
}
.t-label {
  font-family: var(--font-sans);
  font-size: var(--size-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  line-height: var(--lh-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.t-mono {
  font-family: var(--font-mono);
  font-size: var(--size-mono);
  font-weight: 400;
  letter-spacing: var(--track-mono);
  line-height: var(--lh-mono);
  color: var(--text-body);
}

/* ──────────────────────────────────────────────────────────────
   Layout primitives
────────────────────────────────────────────────────────────── */
.stack   { display: flex; flex-direction: column; gap: var(--stack-gap); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap); }
.grid    { display: grid; grid-template-columns: var(--grid-cols); gap: var(--grid-gap); }

.surface {
  background: var(--surface-cool);
  border: var(--hairline) solid var(--border-cool);
  border-radius: var(--radius-12);
}
.surface[data-tone="warm"] { background: var(--surface-warm); border-color: var(--border-warm); }
.surface[data-elev="2"]    { background: var(--surface-elevated); }

/* ──────────────────────────────────────────────────────────────
   Buttons
────────────────────────────────────────────────────────────── */
:where(.btn) {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--size-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-8);
  background: var(--accent);
  color: var(--text-on-accent);
  text-decoration: none;
  cursor: default;
}
:where(.btn-outline) {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--size-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-8);
  border: var(--hairline) solid var(--accent);
  color: var(--accent);
  background: transparent;
  text-decoration: none;
  cursor: default;
}
a:where(.btn, .btn-outline) { cursor: pointer; }
a:where(.btn, .btn-outline):hover  { background: var(--accent-hover); color: var(--text-on-accent); }
a:where(.btn, .btn-outline):active { transform: translateY(0.5px); }

/* ──────────────────────────────────────────────────────────────
   Color utilities
────────────────────────────────────────────────────────────── */
.text-accent     { color: var(--accent) !important; }
.text-muted      { color: var(--text-muted) !important; }
.text-primary    { color: var(--text-primary) !important; }
.text-warm-body  { color: var(--text-warm-body) !important; }

/* ──────────────────────────────────────────────────────────────
   Spacing utilities
────────────────────────────────────────────────────────────── */
.mb-0   { margin-bottom: 0; }
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mr-md  { margin-right: var(--space-md); }
.pt-xl  { padding-top: var(--space-xl); }

/* ──────────────────────────────────────────────────────────────
   Responsive overrides
────────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  body {
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
    --stack-gap:   var(--space-sm);
    --cluster-gap: var(--space-sm);
    --grid-gap:    var(--space-sm);
    --size-headline: 16px;
    --size-subhead:  12px;
    --size-mono:     12px;
  }
  .wrap { padding-inline: var(--space-md); }
}
