/* ═══════════════════════════════════════════════════════════════
   maahaa.dev — Cosmic Engineering tokens & shared chrome
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400;500;700&family=Outfit:wght@200;300;400;500;700&display=swap');

:root {
  /* palette */
  --ink: #0a0612;
  --ink-2: #15102a;
  --ink-3: #1c1635;
  --paper: #f5ede0;
  --paper-2: #d6cdba;
  --muted: #8a7f99;
  --gold: #f4a93b;
  --gold-2: #d97a1f;
  --terra: #c54a2c;
  --violet: #7a5ec7;

  --rule: rgba(245, 237, 224, 0.08);
  --rule-2: rgba(245, 237, 224, 0.18);
  --rule-3: rgba(245, 237, 224, 0.32);

  --bg-btn: var(--gold);
  --fg-btn: #0a0612;

  --fg: var(--paper);
  --fg-2: var(--paper-2);
  --fg-muted: var(--muted);
  --bg: var(--ink);
  --bg-card: var(--ink-2);
  --bg-card-2: var(--ink-3);

  /* type */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* scale */
  --display: clamp(2.4rem, 6.4vw, 7rem);
  --h1: clamp(2rem, 5vw, 4.5rem);
  --h2: clamp(1.6rem, 3.4vw, 2.6rem);
  --h3: clamp(1.2rem, 2vw, 1.6rem);
  --h4: clamp(1rem, 1.5vw, 1.2rem);
  --body: clamp(1.06rem, 1.3vw, 1.24rem);
  --small: clamp(0.92rem, 1.05vw, 1.06rem);
  --micro: clamp(0.76rem, 0.88vw, 0.88rem);

  /* spacing */
  --pad-page: clamp(1.6rem, 4vw, 4.5rem);

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
}

/* light ground */
.light,
html.light {
  --ink: #faf6ec;
  --ink-2: #f0e7d3;
  --ink-3: #e6dcc4;
  --paper: #0f0d18;
  --paper-2: #2e2a3d;
  --muted: #57506b;
  --gold: #b05a00;
  --gold-2: #8c4700;
  --terra: #a13d22;
  --violet: #5a429a;
  --rule: rgba(15, 13, 24, 0.12);
  --rule-2: rgba(15, 13, 24, 0.24);
  --rule-3: rgba(15, 13, 24, 0.40);

  --fg-btn: var(--ink);
}

/* Fraunces thin strokes look jagged dark-on-light — bump weight */
html.light h1,
html.light h2,
html.light h3,
html.light h4 {
  font-weight: 400;
}

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

html,
body {
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--body);
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* atmosphere — every full page gets this */
body.surface::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 75% 12%, rgba(122, 94, 199, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 12% 88%, rgba(244, 169, 59, 0.06) 0%, transparent 55%);
}

.light body.surface::before,
html.light body.surface::before {
  background:
    radial-gradient(ellipse 80% 50% at 75% 12%, rgba(122, 94, 199, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 12% 88%, rgba(194, 102, 13, 0.07) 0%, transparent 55%);
}

body.surface::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.93 0 0 0 0 0.88 0 0 0 0.04 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

html.light body.surface::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.10 0 0 0 0 0.08 0 0 0 0 0.20 0 0 0 0.03 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

/* type */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--fg);
  text-wrap: balance;
}

h1 em,
h2 em,
h3 em,
.display em,
.ital {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

p {
  max-width: 64ch;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

/* eyebrow */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--micro);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
  display: inline-flex;
  gap: 0.6em;
  align-items: center;
}

.eyebrow .num {
  color: var(--paper-2);
}

/* mono utility */
.mono {
  font-family: var(--font-mono);
}

/* nav chrome */
.page {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px var(--pad-page) 96px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 36px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--fg);
}

.brand svg {
  color: currentColor;
}

.wm {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.2rem, 1.4vw, 1.45rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.wm .d {
  margin-left: 6px;
  font-style: italic;
  font-variation-settings: 'ital' 1;
  font-weight: 400;
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-2);
  transition: color .18s var(--ease-std);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-links a.active::before {
  content: '• ';
  color: var(--gold);
  margin-right: 4px;
}

/* footer */
.foot {
  margin-top: 96px;
  padding: 36px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot .l {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.foot .l.r {
  text-align: right;
  align-items: flex-end;
}

.foot .l .em {
  color: var(--gold);
}

.foot a:hover {
  color: var(--gold);
}

@media (max-width: 720px) {
  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .foot .l.r {
    text-align: left;
    align-items: flex-start;
  }
}

/* buttons */
.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 13px 22px;
  border-radius: 2px;
  cursor: pointer;
  border: 0;
  background: var(--bg-btn);
  color: var(--fg-btn) !important;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background .18s var(--ease-std);
  white-space: nowrap;
}

.btn:hover {
  background: var(--gold-2);
  color: var(--fg-btn) !important;
}

.btn .a {
  opacity: 0.7;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--rule-2);
  color: var(--fg) !important;
  padding: 12px 21px;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold) !important;
  background: transparent;
}

/* card */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(20px, 2.4vw, 36px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 1px;
  background: var(--gold);
}

/* impact pill */
.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  background: rgba(244, 169, 59, 0.06);
  padding: 6px 12px;
  border-radius: 2px;
}

/* focus */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* skip link */
.skip {
  position: absolute;
  left: 8px;
  top: 8px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform .18s;
  z-index: 100;
  border-radius: 2px;
}

.skip:focus {
  transform: translateY(0);
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-1 {
  transition-delay: 0.05s;
}

.reveal-2 {
  transition-delay: 0.18s;
}

.reveal-3 {
  transition-delay: 0.32s;
}

.reveal-4 {
  transition-delay: 0.46s;
}

.reveal-5 {
  transition-delay: 0.60s;
}

.reveal-6 {
  transition-delay: 0.72s;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.2s !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* mobile nav */
.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--rule-2);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 2px;
  cursor: pointer;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--rule-2);
  color: var(--fg);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .18s, color .18s;
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

html.light .theme-toggle .sun-icon {
  display: none;
}

html.light .theme-toggle .moon-icon {
  display: block;
}

@media (max-width: 720px) {
  .menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    right: var(--pad-page);
    flex-direction: column;
    gap: 18px;
    background: var(--bg-card);
    border: 1px solid var(--rule);
    padding: 22px 26px;
    border-radius: 4px;
    z-index: 50;
  }

  .nav-links.open {
    display: flex;
  }

  .nav {
    position: relative;
  }

  .nav-right {
    gap: 12px;
  }
}

/* section eyebrow row */
.section-head {
  margin-bottom: clamp(28px, 4vw, 56px);
}

.section-head .eyebrow {
  margin-bottom: 14px;
}