/* ==========================================================================
   wayneatkinson.com — "DIGITAL ALCHEMY" design system
   The one theme carried through every page. Raw ideas in, gold out.
   ========================================================================== */

:root {
  /* --- The Void (backgrounds, darkest → lightest) --- */
  --void-0: #06040f;
  --void-1: #0a0718;
  --void-2: #100b24;
  --void-3: #171033;
  --void-glass: rgba(23, 16, 51, 0.55);

  /* --- Starlight (text) --- */
  --star-1: #f2eefc;         /* headings */
  --star-2: #c9c2e2;         /* body */
  --star-3: #8f87b3;         /* muted */
  --star-4: #7d76a6;         /* faint (≥4.5:1 on void-0) */

  /* --- The Elements (accents) --- */
  --gold:   #f2c14e;  --gold-hot:   #ffdd87;  --gold-dim:   rgba(242, 193, 78, 0.14);
  --violet: #8b5cf6;  --violet-hot: #b79cff;  --violet-dim: rgba(139, 92, 246, 0.14);
  --aqua:   #34d3c8;  --aqua-hot:   #7ef2e9;  --aqua-dim:   rgba(52, 211, 200, 0.14);
  --ember:  #f0774a;  --ember-hot:  #ffa07f;  --ember-dim:  rgba(240, 119, 74, 0.14);
  --jade:   #4ade80;  --jade-hot:   #90f0b2;  --jade-dim:   rgba(74, 222, 128, 0.14);
  --rose:   #ef6ba8;  --rose-hot:   #ff9fce;  --rose-dim:   rgba(239, 107, 168, 0.14);

  /* --- Aurora gradient (the signature) --- */
  --aurora: linear-gradient(115deg, var(--gold) 0%, var(--ember) 28%, var(--rose) 52%, var(--violet) 76%, var(--aqua) 100%);
  --aurora-soft: linear-gradient(115deg, rgba(242,193,78,.85), rgba(239,107,168,.85), rgba(139,92,246,.85));

  /* --- Type --- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Outfit', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  --font-arcane: 'Cinzel Decorative', 'Fraunces', Georgia, serif;

  /* --- Rhythm --- */
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --page-max: 1200px;
  --nav-h: 76px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  /* --- Elevation / glow --- */
  --line: rgba(143, 135, 179, 0.16);
  --line-bright: rgba(242, 193, 78, 0.35);
  --shadow-deep: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  --glow-gold: 0 0 40px -6px rgba(242, 193, 78, 0.45);
  --glow-violet: 0 0 40px -6px rgba(139, 92, 246, 0.45);

  /* --- Shared component contracts --- */
  --focus-ring: 2px solid var(--gold);
  --radius-card: 12px;
  --glass-2: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  --hero-pad-top: calc(var(--nav-h) + clamp(3rem, 8vw, 4.5rem));
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--void-0);
  color: var(--star-2);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 350;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--violet); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--star-1);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: var(--gold); text-decoration: none; transition: color 0.25s; }
a:hover { color: var(--gold-hot); }

img { max-width: 100%; display: block; }

code, pre { font-family: var(--font-mono); font-size: 0.9em; }

/* ==========================================================================
   The magic canvas — fixed constellation backdrop drawn by js/magic.js
   ========================================================================== */
#magic-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.site-content { position: relative; z-index: 1; }

/* Aurora nebulae — enormous soft blobs that drift behind everything */
.nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
  animation: nebula-drift 26s var(--ease-spring) infinite alternate;
}
.nebula--gold   { width: 44vw; height: 44vw; background: var(--gold);   top: -12vw; right: -10vw; }
.nebula--violet { width: 52vw; height: 52vw; background: var(--violet); bottom: -18vw; left: -14vw; animation-delay: -9s; }
.nebula--aqua   { width: 30vw; height: 30vw; background: var(--aqua);   top: 40vh; right: 20vw; opacity: 0.08; animation-delay: -17s; }

@keyframes nebula-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, -3vw, 0) scale(1.15); }
}

/* ==========================================================================
   Shared components
   ========================================================================== */

/* -- Aurora text: the signature gradient headline treatment -- */
.aurora-text {
  background: var(--aurora);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: aurora-shift 9s ease-in-out infinite alternate;
}
@keyframes aurora-shift {
  from { background-position: 0% 40%; }
  to   { background-position: 100% 60%; }
}

/* -- Arcane caps: Cinzel Decorative ornament type for numerals & seals -- */
.arcane {
  font-family: var(--font-arcane);
  font-weight: 400;
  letter-spacing: 0.14em;
}

/* -- Chip: shared mono uppercase pill (categories, tags, statuses) -- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--star-3);
  background: rgba(255, 255, 255, 0.03);
}

/* -- Skip link (a11y) -- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.8rem 1.2rem;
  background: var(--void-1);
  color: var(--star-1);
  border: 1px solid var(--line-bright);
  border-radius: 0 0 10px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
.skip-link:focus { left: 0; }

/* -- Eyebrow: small-caps section label with rule -- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: '';
  width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.eyebrow--centered::after {
  content: '';
  width: 34px; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* -- Buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, border-color 0.3s, background 0.3s;
  position: relative;
  overflow: hidden;
  /* --mag-x/y are written by magic.js magnetic pull; compose so hover still lifts */
  transform: translate(var(--mag-x, 0px), var(--mag-y, 0px));
}
.btn:focus-visible, .nav-links a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}
.nav-links a:focus-visible::after { transform: scaleX(1); }
.btn--gold {
  background: linear-gradient(120deg, var(--gold), var(--ember));
  color: #1a1206;
  box-shadow: var(--glow-gold);
}
.btn--gold:hover { transform: translate(var(--mag-x, 0px), var(--mag-y, 0px)) translateY(-2px) scale(1.02); box-shadow: 0 0 60px -8px rgba(242, 193, 78, 0.65); color: #1a1206; }
.btn--ghost {
  background: rgba(242, 193, 78, 0.04);
  border-color: var(--line);
  color: var(--star-1);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--line-bright); color: var(--gold-hot); transform: translate(var(--mag-x, 0px), var(--mag-y, 0px)) translateY(-2px); }

/* -- Glass card -- */
.card {
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  backdrop-filter: blur(14px);
  transition: transform 0.4s var(--ease-spring), border-color 0.4s, box-shadow 0.4s;
}

/* -- Section scaffolding -- */
.section { padding: clamp(4.5rem, 9vw, 8rem) 1.5rem; position: relative; }
.section-inner { max-width: var(--page-max); margin: 0 auto; }
.section-head { max-width: 700px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-top: 0.9rem; }
.section-head p { margin-top: 1rem; color: var(--star-3); font-size: 1.08rem; }

/* -- Scroll reveal (js/magic.js flips .is-revealed via IntersectionObserver) -- */
.reveal { opacity: 0; }
.reveal.is-revealed {
  animation: reveal-in 0.9s var(--ease-spring) both;
  animation-delay: var(--reveal-delay, 0s);
}
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(34px); }
  to   { opacity: 1; transform: none; }
}

/* -- Rune divider between sections -- */
.rune-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 0 1.5rem;
  color: var(--star-4);
}
.rune-divider::before, .rune-divider::after {
  content: '';
  height: 1px;
  flex: 0 1 220px;
  background: linear-gradient(90deg, transparent, var(--line-bright), transparent);
}
.rune-divider svg { width: 22px; height: 22px; opacity: 0.8; }

/* -- Accent utilities (project cards etc. set data-accent) -- */
[data-accent="gold"]   { --accent: var(--gold);   --accent-hot: var(--gold-hot);   --accent-dim: var(--gold-dim); }
[data-accent="violet"] { --accent: var(--violet); --accent-hot: var(--violet-hot); --accent-dim: var(--violet-dim); }
[data-accent="aqua"]   { --accent: var(--aqua);   --accent-hot: var(--aqua-hot);   --accent-dim: var(--aqua-dim); }
[data-accent="ember"]  { --accent: var(--ember);  --accent-hot: var(--ember-hot);  --accent-dim: var(--ember-dim); }
[data-accent="jade"]   { --accent: var(--jade);   --accent-hot: var(--jade-hot);   --accent-dim: var(--jade-dim); }
[data-accent="rose"]   { --accent: var(--rose);   --accent-hot: var(--rose-hot);   --accent-dim: var(--rose-dim); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  background: rgba(6, 4, 15, 0.72);
  backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--star-1);
  letter-spacing: 0.01em;
}
.nav-brand:hover { color: var(--star-1); }
.nav-brand .sigil { width: 34px; height: 34px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 420;
  letter-spacing: 0.06em;
  color: var(--star-2);
  position: relative;
  padding: 0.4rem 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--aurora);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-spring);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--star-1); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 44px; height: 44px;
  color: var(--star-1);
}

@media (max-width: 820px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: rgba(6, 4, 15, 0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 1rem 0 1.5rem;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: block; padding: 0.9rem 0; font-size: 1.05rem; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 3.5rem 1.5rem 2.5rem;
  background: linear-gradient(180deg, transparent, rgba(16, 11, 36, 0.6));
}
.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
}
.footer-brand .sigil { width: 44px; height: 44px; margin-bottom: 1rem; }
.footer-brand p { color: var(--star-3); font-size: 0.95rem; max-width: 34ch; }
.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  margin-top: 1rem;
}
.footer-col .footer-heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--star-4);
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.footer-col ul { list-style: none; display: grid; gap: 0.65rem; }
.footer-col a { color: var(--star-3); font-size: 0.95rem; }
.footer-col a:hover { color: var(--gold-hot); }
.footer-base {
  max-width: var(--page-max);
  margin: 3rem auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--star-4);
  font-size: 0.85rem;
}

@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2.2rem; }
}

/* ==========================================================================
   Motion preferences — every animation must respect this
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; }
  .reveal.is-revealed { animation: none; }
  #magic-canvas, .nebula { display: none; }
}
