:root {
  --bg: #020203;
  --bg-2: #0c0c0e;
  --ink: #ecebf3;
  --muted: #a2a3b8;
  --dim: #6c6e86;
  --gold: #e9b53a;              /* from the Cosmic Dawn suit */
  --gold-soft: rgba(233, 181, 58, 0.18);
  --line: rgba(236, 235, 243, 0.08);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(1rem, 5vw, 4rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: #020203;   /* the canvas paints deep space over this */
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

em { font-style: italic; color: var(--gold); }
.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem var(--pad);
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(2, 2, 3, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.35rem;
}
.emblem { width: 2.1rem; height: 2.1rem; color: var(--gold); flex: none; }

.nav nav { display: flex; align-items: center; gap: 2rem; }
.nav nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav nav a:hover { color: var(--gold); }
.nav nav .nav-cta {
  color: var(--gold);
  border: 1px solid rgba(233, 181, 58, 0.5);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  transition: background 0.3s, color 0.3s;
}
.nav nav .nav-cta:hover { background: var(--gold); color: #140f02; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: 7rem var(--pad) 4rem;
}

h1 {
  margin: 1.4rem 0 1.6rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 6.2vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 33rem;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  margin-top: 2.5rem;
}

.btn {
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  background: var(--gold);
  color: #140f02;
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  box-shadow: 0 0 0 0 var(--gold-soft);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.btn:hover { box-shadow: 0 0 0 8px var(--gold-soft); transform: translateY(-1px); }

.link {
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0% 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.4s var(--ease);
}
.link:hover { background-size: 100% 1px; }

/* Telescope eyepiece */
.eyepiece {
  position: relative;
  width: min(100%, 34rem);
  justify-self: center;
}
.lens {
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(233, 181, 58, 0.35),
    0 0 0 14px rgba(233, 181, 58, 0.04),
    0 30px 120px rgba(233, 181, 58, 0.08);
}
.lens-photo {
  width: 100%;
  height: 100%;
  background: url("images/hero.jpg") 45% 55% / cover no-repeat;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1.04); }
  to   { transform: scale(1.14) translateX(-2%); }
}

.orbit {
  position: absolute;
  left: -12%;
  top: -12%;
  width: 124%;
  height: auto;
  overflow: visible;
  pointer-events: none;
}
.orbit ellipse { stroke: rgba(233, 181, 58, 0.45); stroke-width: 0.35; }
.orbit-body { fill: var(--gold); filter: drop-shadow(0 0 3px var(--gold)); }
.orbit-spin {
  transform-origin: 100px 100px;
  animation: precess 60s linear infinite;
}
@keyframes precess { to { transform: rotate(360deg); } }

.eyepiece figcaption { margin-top: 1.6rem; text-align: center; }

/* Staggered load-in */
.load {
  opacity: 0;
  transform: translateY(16px);
  animation: enter 1.1s var(--ease) forwards;
  animation-delay: calc(0.15s + var(--i) * 0.13s);
}
@keyframes enter { to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.section {
  padding: clamp(5rem, 11vw, 8.5rem) var(--pad);
  max-width: 78rem;
  margin: 0 auto;
}
.label { color: var(--gold); margin-bottom: 1.25rem; }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.05;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

figcaption.mono { color: var(--dim); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
  margin-top: 1rem;
}
.portrait {
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 1.25rem 1.25rem;   /* observatory-dome arch */
  background: var(--bg-2) url("images/portrait.webp") center 30% / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line);
}
.about-grid figcaption { margin-top: 1rem; }

.story h2 { margin-bottom: 2rem; }
.story p {
  color: #c3c4d4;
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  max-width: 38rem;
}
.story .lede {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink);
}

.facts {
  margin-top: 4.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.facts div {
  padding: 1.25rem 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(14, 14, 16, 0.55);
}
.facts dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.facts dd { font-size: 0.95rem; }

/* Work bento */
#work h2 { margin-bottom: 3rem; }
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  grid-template-rows: auto auto;
  gap: 1.25rem;
}
.tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  overflow: hidden;
  background: rgba(14, 14, 16, 0.7);
  transition: border-color 0.5s, transform 0.6s var(--ease);
}
.tile.reveal {
  transition: opacity 1s var(--ease), transform 1s var(--ease), border-color 0.5s;
}
.tile:hover { border-color: rgba(233, 181, 58, 0.35); transform: translateY(-4px); }
.tile.tall { grid-row: span 2; }

.tile-media {
  position: relative;
  aspect-ratio: 16 / 8;
  background-color: var(--bg-2);
  background-image: var(--img, none);
  background-size: var(--size, cover);
  background-position: var(--pos, center);
  background-repeat: no-repeat;
}
.tile.tall .tile-media { aspect-ratio: auto; flex: 1; min-height: 22rem; }

.tile-body { padding: 1.5rem 1.6rem 1.7rem; }
.tile h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.15;
  margin: 0.5rem 0 0.6rem;
}
.tile-body p:last-child { color: var(--muted); font-size: 0.95rem; }

/* Constellation / neural net */
.constellation {
  background: radial-gradient(circle at 80% 50%, rgba(233, 181, 58, 0.12), transparent 55%), var(--bg-2);
}
.constellation svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.constellation .edges line { stroke: rgba(236, 235, 243, 0.22); stroke-width: 0.8; }
.constellation .nodes circle { fill: var(--ink); animation: twinkle 3.5s ease-in-out infinite; }
.constellation .nodes circle:nth-child(2n) { animation-delay: 1.2s; }
.constellation .nodes circle:nth-child(3n) { animation-delay: 2.1s; }
.constellation .nodes .bright { fill: var(--gold); filter: drop-shadow(0 0 4px var(--gold)); }
@keyframes twinkle { 50% { opacity: 0.35; } }

/* Speaking */
.speak-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
}
.speak-grid > figure { order: 2; position: sticky; top: 6rem; }
.speak-photo {
  aspect-ratio: 853 / 1110;
  border-radius: 1.5rem;
  background: var(--bg-2) url("images/speaking.jpg") center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line), 0 30px 100px rgba(0, 0, 0, 0.6);
}
.speak-grid figcaption { margin-top: 1rem; }

.speak-body h2 { margin-bottom: 2rem; }
.speak-body > p {
  color: #c3c4d4;
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  max-width: 38rem;
}
.speak-body .lede {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink);
}

.talks { list-style: none; margin: 2.5rem 0 2rem; border-top: 1px solid var(--line); }
.talks li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.5s var(--ease);
}
.talks li:hover { padding-left: 0.5rem; }
.talks .mono { color: var(--gold); padding-top: 0.45rem; }
.talks h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.talks p { color: var(--muted); font-size: 0.95rem; }
.formats { color: var(--dim); }
.heard { color: var(--ink); font-family: var(--serif); font-size: 1.2rem; margin-bottom: 0.6rem; }
.heard .mono { color: var(--gold); margin-right: 0.6rem; }

.speak-cta { display: inline-block; margin-top: 2rem; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
}
.contact-intro h2 { margin-bottom: 1.75rem; }
.contact-intro p:not(.label) { color: #c3c4d4; font-size: 1.05rem; margin-bottom: 1.1rem; }
.contact-intro p.lede {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink);
}

.contact-form {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: rgba(14, 14, 16, 0.75);
}
.contact-form .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.field { display: block; margin-bottom: 1.1rem; }
.field .mono { display: block; margin-bottom: 0.45rem; color: var(--muted); }
.field i { font-style: normal; color: var(--dim); margin-left: 0.3rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(2, 2, 3, 0.7);
  border: 1px solid rgba(236, 235, 243, 0.14);
  border-radius: 0.75rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 1.2rem) 55%, calc(100% - 0.9rem) 55%; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; }
.field select option { background: #0c0c0e; }
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.field input::placeholder { color: var(--dim); }
.event-only[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-top: 0.5rem; }
.form-foot .btn { border: 0; cursor: pointer; font-family: var(--sans); }
.form-foot .btn[disabled] { opacity: 0.6; cursor: wait; }
.form-status { color: var(--muted); }
.form-status.ok { color: var(--gold); }
.form-status.err { color: #ff9a8a; }

/* Thank-you and 404 pages */
.simple-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.simple-page h1 { font-size: clamp(2.6rem, 7vw, 4.5rem); margin: 0.5rem 0 1.25rem; }
.simple-page > p:not(.label) { color: var(--muted); margin-bottom: 2rem; max-width: 30rem; }
.emblem-lg { width: 5rem; height: 5rem; margin-bottom: 1.5rem; }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* Featured / press */
#featured h2 { margin-bottom: 2.5rem; }
.press { list-style: none; border-top: 1px solid var(--line); }
.press a {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.4rem 0.25rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: padding-left 0.5s var(--ease), background 0.4s;
}
.press a:hover { padding-left: 0.9rem; background: rgba(233, 181, 58, 0.04); }
.press .outlet { font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; }
.press .headline { color: var(--muted); font-size: 0.98rem; }
.press a:hover .headline { color: var(--ink); }
.press .mono { color: var(--gold); white-space: nowrap; }

/* Closing */
.closing { text-align: center; }
.statement {
  max-width: 50rem;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  line-height: 1.12;
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--line);
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 6rem; gap: 3rem; }
  .eyepiece { order: -1; width: min(78%, 22rem); }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 20rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: 1fr; }
  .tile.tall { grid-row: auto; }
  .tile.tall .tile-media { flex: none; aspect-ratio: 4 / 5; min-height: 0; }
  .nav .brand span { display: none; }
  .nav nav { gap: 1.1rem; }
  .nav nav a[href="#about"], .nav nav a[href="#work"] { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-form .row { grid-template-columns: 1fr; gap: 0; }
  .speak-grid { grid-template-columns: 1fr; }
  .press a { grid-template-columns: 1fr auto; gap: 0.3rem 1rem; }
  .press .headline { grid-column: 1 / -1; grid-row: 2; }
  .speak-grid > figure { order: 0; position: static; max-width: 24rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lens-photo, .orbit-spin, .constellation .nodes circle { animation: none; }
  .load { animation: none; opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
