:root {
  --ink: #070707;
  --muted: #353535;
  --paper: #fff;
  --navy: #410707;
  --blue: #321a36;
  --line: #d7d7d7;
  --max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.cosmic-theme {
  --ink: #f8fbff;
  --muted: #c5cedd;
  --paper: #020204;
  --line: rgba(255,255,255,.18);
  background: #020204;
  color: #f8fbff;
  isolation: isolate;
}
body.cosmic-theme::before,
body.cosmic-theme::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body.cosmic-theme::before {
  z-index: -2;
  background: #000;
  opacity: 0;
  transition: opacity .12s linear;
  will-change: transform, opacity;
}
body.cosmic-home::before {
  background: url("../cosmos-wormhole-optimized.jpg") center 72% / auto 165vh no-repeat;
  opacity: var(--ring-opacity, 1);
  transform: translate3d(var(--wormhole-x, 0), var(--wormhole-y, 0), 0) scale(var(--wormhole-scale, 1));
  transform-origin: 50% 58%;
  animation: cosmos-float 9s ease-in-out infinite;
}
@keyframes cosmos-float {
  0%, 100% { background-position: center 72%; }
  50%      { background-position: center 67%; }
}
@media (prefers-reduced-motion: reduce) {
  body.cosmic-home::before { animation: none; }
}
body.cosmic-theme::after {
  z-index: -1;
  background-color: rgba(0,0,0,var(--blackout, 0));
  background-image: none;
  will-change: background-color;
}
body.cosmic-theme main,
body.cosmic-theme .site-header,
body.cosmic-theme .footer {
  position: relative;
  z-index: 1;
}
a { color: inherit; text-underline-offset: 4px; }
img { display: block; max-width: 100%; }

.display {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: .015em;
  line-height: .95;
  text-transform: uppercase;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 44px 56px;
  color: var(--ink);
}
.cosmic-theme .site-header {
  color: #fff;
}
.site-header.on-dark {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.66), rgba(0,0,0,.38));
  text-shadow: 0 2px 16px rgba(0,0,0,.9);
  backdrop-filter: blur(8px);
}
.brand {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 28px;
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 700;
}
.nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.nav a:hover,
.nav a.active { border-bottom-color: currentColor; }
.socials {
  display: flex;
  align-items: center;
  gap: 20px;
}
.socials a {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  text-decoration: none;
  font-weight: 800;
}
.socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 68% at 50% 116%, rgba(156, 177, 255, .78) 0 16%, rgba(98, 126, 205, .76) 26%, rgba(13, 22, 38, .72) 42%, transparent 55%),
    linear-gradient(180deg, #000 0%, #010307 47%, #273d78 78%, #8ea5df 100%);
}
.cosmic-theme .hero {
  background: transparent;
}
.hero::before {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -28%;
  height: 58%;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background:
    radial-gradient(90% 55% at 20% 55%, rgba(255,255,255,.82), transparent 28%),
    radial-gradient(80% 48% at 70% 50%, rgba(255,255,255,.36), transparent 38%),
    linear-gradient(180deg, rgba(205, 220, 255, .95), rgba(90, 114, 190, .92));
  filter: saturate(.84) contrast(1.06);
  opacity: .95;
}
.cosmic-theme .hero::before {
  display: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.48) 45%, rgba(0,0,0,.04) 83%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px);
  pointer-events: none;
}
.cosmic-theme .hero::after {
  background:
    radial-gradient(circle at 50% 54%, rgba(0,0,0,0) 0 34%, rgba(0,0,0,.08) 58%, rgba(0,0,0,.28) 100%),
    linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,0) 48%, rgba(0,0,0,.26) 100%);
}
.hero-copy {
  position: relative;
  z-index: 3;
  width: min(900px, 92vw);
  margin-top: 260px;
  text-align: center;
}
.cosmic-home .hero-copy {
  opacity: var(--hero-copy-opacity, 1);
  transform: translate3d(0, var(--hero-copy-y, 0), 0);
  transition: opacity .08s linear;
  will-change: transform, opacity;
}
.hero h1 {
  font-size: clamp(48px, 5vw, 76px);
  text-shadow: 0 3px 22px rgba(0,0,0,.42);
}
.hero p {
  max-width: 760px;
  margin: 34px auto 0;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,.94);
}
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 38px;
  z-index: 4;
  transform: translateX(-50%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-decoration: none;
  text-transform: uppercase;
  animation: floatCue 1.7s ease-in-out infinite;
}
.cosmic-home .scroll-cue {
  opacity: var(--cue-opacity, 1);
  transition: opacity .08s linear;
}
.scroll-cue::after {
  content: "";
  display: block;
  width: 1px;
  height: 42px;
  margin: 10px auto 0;
  background: currentColor;
}
@keyframes floatCue {
  0%, 100% { transform: translate(-50%, 0); opacity: .8; }
  50% { transform: translate(-50%, 10px); opacity: 1; }
}

section { padding: 112px 24px; }
.cosmic-theme section:not(.hero) {
  color: #f8fbff;
}
.cosmic-home section:not(.hero),
.cosmic-home .footer {
  background: #000;
}
.wrap {
  width: min(var(--max), 100%);
  margin: 0 auto;
}
.about-lead {
  max-width: 1060px;
  margin: 0 auto 132px;
  text-align: center;
}
.cosmic-theme .about-lead,
.cosmic-theme .about-text,
.cosmic-theme .contact form,
.cosmic-theme .contact-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.cosmic-theme .about-lead {
  padding: 42px;
}
.about-lead p {
  margin: 0 auto 34px;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(26px, 2.2vw, 38px);
  line-height: 1.32;
  text-transform: uppercase;
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 520px);
  justify-content: center;
  align-items: start;
  gap: 70px;
}
.about-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.caption {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.about-text h2,
.contact-title {
  font-size: clamp(34px, 3vw, 50px);
  margin-bottom: 32px;
}
.cosmic-theme .about-text {
  padding: 34px;
}
.cosmic-theme .contact form {
  padding: 32px;
}
.about-text p + p { margin-top: 22px; }

.home-projects {
  padding-top: 126px;
  padding-bottom: 126px;
  overflow: hidden;
}
.home-projects-head {
  max-width: 860px;
  margin-bottom: 58px;
}
.section-kicker {
  display: inline-block;
  margin-bottom: 16px;
  color: #9fb4f5;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.home-projects-head h2 {
  font-size: clamp(56px, 7vw, 104px);
  margin-bottom: 24px;
}
.home-projects-head p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}
.cinematic-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
}
.cinematic-card {
  --image-scale: 1.08;
  position: relative;
  display: grid;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  text-decoration: none;
  background: #05070d;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 22px 70px rgba(0,0,0,.42);
  transform-origin: 50% 70%;
}
.cinematic-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 3;
  border: 1px solid rgba(143, 180, 255, 0);
  box-shadow: 0 0 0 rgba(100, 151, 255, 0);
  pointer-events: none;
  transition: border-color .35s ease, box-shadow .35s ease;
}
.cinematic-card:hover::before,
.cinematic-card:focus-visible::before {
  border-color: rgba(143, 180, 255, .72);
  box-shadow: 0 0 34px rgba(83, 141, 255, .32);
}
.project-media,
.project-media img,
.project-overlay,
.project-body {
  display: block;
}
.project-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.project-media img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  filter: saturate(.95) contrast(1.06) brightness(.74);
  transform: translate3d(0, var(--parallax-y, 0px), 0) scale(var(--image-scale));
  transition: transform .7s cubic-bezier(.2,.7,.18,1), filter .45s ease;
  will-change: transform;
}
.cinematic-card:hover {
  --image-scale: 1.16;
}
.cinematic-card:hover .project-media img,
.cinematic-card:focus-visible .project-media img {
  filter: saturate(1.08) contrast(1.1) brightness(.86);
}
.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 20%, rgba(116, 164, 255, .22), transparent 30%),
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.82));
  z-index: 1;
}
.project-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  background: rgba(0,0,0,.28);
  transition: opacity .32s ease;
}
.project-overlay span {
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.76);
  background: rgba(0,0,0,.56);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.cinematic-card:hover .project-overlay,
.cinematic-card:focus-visible .project-overlay {
  opacity: 1;
}
.project-body {
  position: relative;
  z-index: 2;
  align-self: end;
  padding: 34px;
}
.project-index {
  display: block;
  margin-bottom: 12px;
  color: #b9c8ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.project-name {
  display: block;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(34px, 4vw, 56px);
  line-height: .96;
  letter-spacing: .015em;
  text-transform: uppercase;
}
.project-summary {
  display: block;
  max-width: 520px;
  margin-top: 18px;
  color: rgba(255,255,255,.82);
  font-size: 15px;
}
.home-projects-link {
  margin-top: 42px;
}
.home-projects-link a {
  display: inline-flex;
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.7);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.home-projects-link a:hover {
  background: #fff;
  color: #05070d;
  box-shadow: 0 0 28px rgba(143,180,255,.22);
}
.project-reveal {
  opacity: 0;
  transform: translateY(70px) scale(.95);
  transition:
    opacity .82s ease var(--delay, 0ms),
    transform .82s cubic-bezier(.2,.72,.18,1) var(--delay, 0ms),
    box-shadow .35s ease;
}
.project-reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.page-title {
  text-align: center;
  font-size: clamp(64px, 7vw, 96px);
  margin: 80px 0 96px;
}
.projects-page {
  padding-top: 20px;
}
.project-cluster {
  margin-bottom: 96px;
}
.cluster-title {
  font-size: clamp(38px, 4vw, 62px);
  margin-bottom: 34px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 58px 38px;
}
.project-card {
  color: var(--ink);
  text-decoration: none;
}
.cosmic-theme .project-card {
  border-top: 1px solid rgba(255,255,255,.22);
  padding-top: 18px;
  color: #f8fbff;
}
.project-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 18px;
  filter: saturate(.96);
  transition: opacity .2s ease, transform .28s ease;
}
.project-card:hover img {
  opacity: .82;
  transform: translateY(-2px);
}
.project-card h3 {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 700;
}
.project-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.project-tools {
  display: block;
  margin-top: 14px;
  color: #555;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.cosmic-theme .project-tools {
  color: #aab5c8;
}
.project-link {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.cosmic-theme .project-link {
  border-color: rgba(255,255,255,.72);
}

.resume {
  min-height: 76vh;
}
.resume .wrap { max-width: 880px; }
.resume h1 {
  text-align: center;
  font-size: 64px;
  margin: 80px 0 54px;
}
.resume-block { margin: 0 0 30px; }
.cosmic-theme .resume-block {
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 22px;
}
.resume-block h2 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 21px;
  font-weight: 400;
  margin-bottom: 14px;
}
.resume-block h3 {
  font-family: Inter, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 4px;
}
.resume-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}
.resume li {
  margin: 8px 0 8px 24px;
  font-size: 14px;
}

.contact {
  min-height: 82vh;
  display: grid;
  align-items: center;
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 560px);
  gap: 76px;
  align-items: start;
}
.contact-title { margin-top: 26px; }
.contact-card {
  padding: 32px 0;
}
.contact-card h2,
.contact-card h3 {
  max-width: 560px;
  margin-bottom: 20px;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 400;
  letter-spacing: .015em;
  line-height: 1;
  text-transform: uppercase;
}
.contact-card p {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
}
.contact-card p a {
  color: #fff;
  font-weight: 800;
}
.contact-eyebrow {
  margin-bottom: 14px;
  color: #9fb4f5 !important;
  font-size: 12px !important;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.contact-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(143,180,255,.22);
}
.contact-button.primary {
  background: #fff;
  color: #05070d;
}
.contact-button:not(.primary):hover {
  background: #fff;
  color: #05070d;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
label {
  display: block;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
}
label span {
  color: #666;
  font-size: 12px;
  font-weight: 400;
}
.cosmic-theme label span {
  color: #b4bfd2;
}
input,
textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #aaa;
  background: #fafafa;
  color: var(--ink);
  font: inherit;
}
.cosmic-theme input,
.cosmic-theme textarea {
  border-color: rgba(255,255,255,.3);
  background: rgba(0,0,0,.58);
  color: #fff;
}
textarea {
  min-height: 96px;
  resize: vertical;
}
button {
  border: 0;
  border-radius: 4px;
  background: #1f314f;
  color: #fff;
  padding: 18px 30px;
  font: 700 15px Inter, Arial, sans-serif;
  cursor: pointer;
}
.cosmic-theme button {
  background: #fff;
  color: #05070d;
}

.footer {
  padding: 42px 24px 54px;
  text-align: center;
}
.cosmic-theme .footer {
  color: #f8fbff;
}
.footer-links { margin-bottom: 18px; }
.footer-links a { font-size: 16px; }
.footer p { margin: 0 0 28px; }
.footer .socials { justify-content: center; }

.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1000px) {
  .site-header {
    padding: 28px 24px;
    align-items: flex-start;
  }
  .nav {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .socials { display: none; }
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cinematic-project-grid {
    grid-template-columns: 1fr;
  }
  .cinematic-card {
    min-height: 440px;
  }
}

@media (max-width: 640px) {
  .brand { font-size: 22px; }
  .site-header {
    display: grid;
    gap: 18px;
  }
  .nav {
    justify-content: flex-start;
    font-size: 13px;
  }
  .hero-copy { margin-top: 180px; }
  .hero p { font-size: 16px; }
  section { padding: 78px 18px; }
  .project-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  .cinematic-card {
    min-height: 380px;
  }
  .project-body {
    padding: 24px;
  }
  .page-title {
    font-size: 58px;
    margin-bottom: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}
