/* ───────────────────────────────────────────────────────────────────────
   The Architect of Controlled Entropy
   Obsidian void · metallic gold · brutal glassmorphism.
   No rounded corners. No drop shadows. The panels ARE the depth.
   ─────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Space Grotesk';
  src: url('./fonts/space-grotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('./fonts/jetbrains-mono-var.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --void: #050506;
  --gold: #c9a227;
  --gold-bright: #e8c25a;
  --accretion: #ffd66b;
  --plasma: #fff4d6;
  --white: #f4f4f2;
  --dim: #6f6f69;
  --hb: 0.6; /* heartbeat, driven by JS */

  --sans: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0 !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--white);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  cursor: none;
  overflow-x: hidden;
}
a, button { cursor: none; }

/* the void canvas — fixed behind everything, never intercepts pointer */
#void {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* boot scrim */
#scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--void);
  display: grid;
  place-items: center;
  transition: opacity 1.4s ease 0.2s;
}
#scrim .boot {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--gold);
  text-transform: uppercase;
  opacity: 0.7;
  animation: flicker 2.4s infinite;
}
@keyframes flicker { 0%,100% { opacity: 0.7 } 50% { opacity: 0.25 } }
body.ready #scrim { opacity: 0; pointer-events: none; }

/* content layer — sharp, immune, scrolls above the void */
#content {
  position: relative;
  z-index: 10;
  width: 100%;
}

/* ── sections + reveal ("emerge from the singularity") ─────────────────── */
.sec {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 14vh 8vw;
}
.sec-inner { width: 100%; max-width: 1100px; margin: 0 auto; }

.sec, .panel, .exp, .ach, .skill-col {
  opacity: 0;
  transform: scale(0.965) translateY(16px);
  filter: blur(14px);
  transition: opacity 1.05s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.05s cubic-bezier(0.16, 1, 0.3, 1),
              filter 1.05s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}
.sec.in, .panel.in, .exp.in, .ach.in, .skill-col.in {
  opacity: 1; transform: none; filter: none;
}
.panel.in:nth-child(2) { transition-delay: 0.05s; }
.panel.in:nth-child(3) { transition-delay: 0.10s; }
.panel.in:nth-child(4) { transition-delay: 0.15s; }
.panel.in:nth-child(5) { transition-delay: 0.20s; }
.panel.in:nth-child(6) { transition-delay: 0.25s; }

.sec-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.4rem;
  opacity: 0.85;
}

/* ── masthead ──────────────────────────────────────────────────────────── */
.masthead { min-height: 100vh; }
.masthead .sec-label { color: var(--gold); opacity: 0.7; margin-bottom: 3rem; }
.name {
  font-size: clamp(2.6rem, 9vw, 8.2rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--white);
  text-transform: uppercase;
  white-space: nowrap; /* scrambled glyphs vary in width — never reflow/wrap the name */
}
.name .char {
  display: inline-block;
  width: 0.66em;      /* fixed slot per glyph — scrambling never reflows or shifts the line */
  text-align: center;
}
.name .char.space { width: 0.34em; }
.locus {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--dim);
}
.scrollcue {
  margin-top: 5rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--gold);
  opacity: 0.6;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: 0.25 } 50% { opacity: 0.7 } }

/* ── project panels — brutal glassmorphism ─────────────────────────────── */
#projects .sec-inner { display: grid; gap: 2px; }
.panel {
  position: relative;
  overflow: hidden;
  padding: 3rem 3rem 2.4rem;
  background: rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(201, 162, 39, calc(0.18 + var(--hb) * 0.34));
  transition: border-color 0.2s linear,
              opacity 1.05s cubic-bezier(0.16,1,0.3,1),
              transform 1.05s cubic-bezier(0.16,1,0.3,1),
              filter 1.05s cubic-bezier(0.16,1,0.3,1);
}
.backdrop {
  position: absolute;
  inset: 0;
  padding: 1.2rem 1.6rem;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--plasma);
  opacity: 0.03;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.panel > *:not(.backdrop) { position: relative; z-index: 1; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.pnum {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}
.pyear { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--dim); }
.ptitle {
  margin-top: 0.5rem;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--white);
}
.pstack {
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  opacity: 0.85;
}
.pbody {
  margin-top: 1.4rem;
  max-width: 62ch;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #c7c7c2;
}
.metric {
  margin-top: 1.8rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-top: 1px solid rgba(201,162,39,0.14);
  padding-top: 1.2rem;
}
.mval {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--accretion);
}
.mlabel { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }

/* ── experience ────────────────────────────────────────────────────────── */
.exp { padding: 2.2rem 0; border-top: 1px solid rgba(201,162,39,0.14); }
.exp:first-of-type { border-top: none; }
.exp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.exp-role { font-size: 1.3rem; font-weight: 500; color: var(--white); }
.exp-when { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--gold); }
.exp-org { margin-top: 0.4rem; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--dim); }
.exp-points { margin-top: 1.1rem; list-style: none; display: grid; gap: 0.7rem; }
.exp-points li {
  position: relative;
  padding-left: 1.4rem;
  max-width: 80ch;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #c2c2bd;
}
.exp-points li::before { content: '—'; position: absolute; left: 0; color: var(--gold); }

/* ── skills ────────────────────────────────────────────────────────────── */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2px; }
.skill-col { padding: 2rem; border: 1px solid rgba(201,162,39,0.12); background: rgba(8,8,10,0.4); }
.skill-group { font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--gold); margin-bottom: 1.2rem; }
.skill-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #d4d4cf;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(201,162,39,0.2);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.chip:hover,
.chip.active {
  background: var(--accretion);
  color: var(--void);
  border-color: var(--accretion);
}

/* ── achievements ──────────────────────────────────────────────────────── */
.ach { display: grid; grid-template-columns: 90px 1fr; gap: 1.4rem; align-items: baseline; padding: 1.4rem 0; border-top: 1px solid rgba(201,162,39,0.14); }
.ach:first-of-type { border-top: none; }
.ach-k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; color: var(--gold-bright); }
.ach-v { font-size: 1.05rem; line-height: 1.5; color: #d4d4cf; }

/* ── contact ───────────────────────────────────────────────────────────── */
/* center the whole REACH OUT block so it matches the width of the work above */
#contact .sec-label { text-align: center; }
.contact-links { display: grid; gap: 2px; max-width: 860px; margin: 0 auto; width: 100%; }
.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
  text-decoration: none;
  border: 1px solid rgba(201,162,39,calc(0.16 + var(--hb)*0.2));
  background: rgba(8,8,10,0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.contact-link:hover { background: rgba(201,162,39,0.06); transform: translateX(6px); }
.cl-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--gold); }
.cl-val { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; color: var(--white); }

/* the reset CTA — centered, set apart from the channels, quietly enticing */
.contact-btn {
  display: block;
  margin: 8rem auto 3rem;
  padding: 1.6rem 3.4rem;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--accretion);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s, letter-spacing 0.3s, box-shadow 0.3s, transform 0.3s;
  animation: cta-breathe 3.6s ease-in-out infinite;
}
.contact-btn:hover {
  background: rgba(255, 214, 107, 0.10);
  color: var(--plasma);
  letter-spacing: 0.48em;
  transform: scale(1.05);
  box-shadow: 0 0 44px rgba(255, 214, 107, 0.42);
  animation: none;
}
.contact-btn.firing {
  background: var(--accretion);
  color: var(--void);
  border-color: var(--accretion);
  letter-spacing: 0.52em;
  animation: none;
}
@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 214, 107, 0); border-color: rgba(201, 162, 39, 0.7); }
  50%      { box-shadow: 0 0 24px rgba(255, 214, 107, 0.26); border-color: var(--accretion); }
}

/* small footer: copyright + a plain note that the site collects no data */
.footer {
  margin-top: 4.5rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--dim);
  text-align: center;
}

/* ── audio toggle ──────────────────────────────────────────────────────── */
#audio-toggle {
  position: fixed;
  right: 1.6rem;
  bottom: 1.6rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: rgba(8,8,10,0.6);
  border: 1px solid rgba(201,162,39,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--dim);
  text-transform: uppercase;
}
#audio-toggle .dot { width: 6px; height: 6px; background: var(--dim); transition: background 0.3s, box-shadow 0.3s; }
#audio-toggle.on { color: var(--gold); border-color: var(--gold); }
#audio-toggle.on .dot { background: var(--accretion); }

/* ── proximity glitch (cursor near the COLLAPSE THE FIELD button) ───────── */
/* --glitch (0..1) is driven from JS by cursor distance to the reset button. */
body.glitching #content {
  animation: glitch-shift 0.13s steps(2, end) infinite;
  will-change: transform;
}
@keyframes glitch-shift {
  0%   { transform: translate3d(calc(var(--glitch) * -5px), 0, 0); }
  20%  { transform: translate3d(calc(var(--glitch) * 4px), calc(var(--glitch) * 1px), 0); }
  40%  { transform: translate3d(calc(var(--glitch) * -3px), calc(var(--glitch) * -2px), 0); }
  60%  { transform: translate3d(calc(var(--glitch) * 5px), 0, 0); }
  80%  { transform: translate3d(calc(var(--glitch) * -2px), calc(var(--glitch) * 2px), 0); }
  100% { transform: translate3d(0, 0, 0); }
}
/* RGB ghost split on text, amplitude scaled by proximity */
body.glitching .name,
body.glitching .ptitle,
body.glitching .sec-label,
body.glitching .pstack,
body.glitching .pbody,
body.glitching .contact-link,
body.glitching .cl-val,
body.glitching .contact-btn,
body.glitching .ach-v,
body.glitching .chip {
  text-shadow:
    calc(var(--glitch) * 3.5px) 0 rgba(255, 40, 90, 0.65),
    calc(var(--glitch) * -3.5px) 0 rgba(40, 210, 255, 0.6);
}
/* the reset button shakes harder the closer you get */
body.glitching .contact-btn {
  animation: glitch-shift 0.08s steps(2, end) infinite;
  border-color: rgba(255, 60, 90, calc(0.3 + var(--glitch) * 0.7));
}
/* scanline + flicker overlay */
body.glitching::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px);
  opacity: calc(var(--glitch) * 0.7);
  mix-blend-mode: overlay;
  animation: glitch-flicker 0.09s steps(2, end) infinite;
}
@keyframes glitch-flicker {
  0%   { opacity: calc(var(--glitch) * 0.7); transform: translateY(0); }
  50%  { opacity: calc(var(--glitch) * 0.2); transform: translateY(calc(var(--glitch) * 2px)); }
  100% { opacity: calc(var(--glitch) * 0.6); transform: translateY(0); }
}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .sec { padding: 12vh 6vw; }
  .panel { padding: 2rem 1.4rem; }
  .ach { grid-template-columns: 1fr; gap: 0.4rem; }
  body { cursor: auto; }
  a, button { cursor: pointer; }
}

@media (prefers-reduced-motion: reduce) {
  .sec, .panel, .exp, .ach, .skill-col { transition: opacity 0.5s ease; transform: none; filter: none; }
  .scrollcue, #scrim .boot, .contact-btn { animation: none; }
  html { scroll-behavior: auto; }
  body.glitching #content,
  body.glitching .contact-btn,
  body.glitching::after { animation: none; transform: none; }
}
