:root {
  --bg: #05060a;
  --bg-soft: #0a0d14;
  --panel: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef1f6;
  --muted: #8a93a6;
  --accent: #5eead4;
  --accent-2: #7c5cff;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: #05060a;
}

/* ---------- ambient layers ---------- */

.grain {
  position: fixed;
  inset: -50%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-drift 6s steps(6) infinite;
}

@keyframes grain-drift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: saturate(1.05) contrast(1.05);
  animation: hero-in 2.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hero-in {
  from { transform: scale(1.12); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(5, 6, 10, 0.15) 0%, rgba(5, 6, 10, 0.72) 70%, rgba(5, 6, 10, 0.95) 100%),
    linear-gradient(to bottom, rgba(5, 6, 10, 0.65) 0%, transparent 28%, transparent 62%, var(--bg) 100%);
}

.hero-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(18px, 4vw, 56px);
  animation: fade-down 1.1s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-decoration: none;
  color: #fff;
}

.brand span {
  color: var(--accent);
}

.hero-nav-links {
  display: flex;
  gap: clamp(14px, 3vw, 32px);
}

.hero-nav-links a {
  position: relative;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.hero-nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-nav-links a:hover {
  color: #fff;
}

.hero-nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  pointer-events: none;
}

.hero-title {
  margin: 0;
  font-size: clamp(3rem, 12vw, 10.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: #fff;
  text-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
  animation: title-in 1.4s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes title-in {
  from { opacity: 0; transform: translateY(40px); filter: blur(14px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-sub {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
  margin: clamp(14px, 2.4vw, 26px) 0 0;
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.5vw, 0.95rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
  animation: fade-up 1.2s 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-sub .rule {
  display: block;
  width: clamp(28px, 7vw, 96px);
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.7), transparent);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vh, 44px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
  animation: fade-up 1.2s 1.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: color 0.3s ease;
}

.scroll-cue:hover {
  color: #fff;
}

.scroll-cue-track {
  position: relative;
  width: 22px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
}

.scroll-cue-dot {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 3px;
  height: 6px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  animation: cue 1.9s ease-in-out infinite;
}

@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(13px); opacity: 0.15; }
}

.scroll-cue-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

/* ---------- shared section pieces ---------- */

main {
  position: relative;
  z-index: 1;
}

.section-intro,
.about,
.contact {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(80px, 12vh, 150px) clamp(20px, 5vw, 64px) clamp(30px, 6vh, 60px);
}

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 56ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

/* ---------- projects ---------- */

.projects {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 5vh, 50px) clamp(20px, 5vw, 64px) clamp(40px, 8vh, 90px);
  display: flex;
  flex-direction: column;
  gap: clamp(72px, 12vh, 150px);
}

.project {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(26px, 4vw, 64px);
  align-items: center;
}

.project.flip .project-media {
  order: 2;
}

.media-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
  aspect-ratio: 16 / 9;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s ease, box-shadow 0.6s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.media-frame video.is-expandable {
  cursor: zoom-in;
}

.media-frame video:fullscreen,
.media-frame video:-webkit-full-screen {
  object-fit: contain;
  transform: none;
  background: #000;
  cursor: auto;
}

.media-expand {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 6, 10, 0.55);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.82);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project:hover .media-expand {
  opacity: 1;
  transform: translateY(0);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.16), transparent 45%, rgba(94, 234, 212, 0.12));
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project:hover .media-frame {
  transform: translateY(-6px);
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: 0 40px 110px rgba(94, 234, 212, 0.1), 0 30px 80px rgba(0, 0, 0, 0.5);
}

.project:hover .media-frame::after {
  opacity: 1;
}

.project:hover .media-frame video {
  transform: scale(1.06);
}

.media-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 6, 10, 0.55);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.82);
}

.media-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5); }
  50% { opacity: 0.55; box-shadow: 0 0 0 6px rgba(94, 234, 212, 0); }
}

.media-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 2;
  border: 1px solid rgba(94, 234, 212, 0.65);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.media-corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; transform: translate(6px, 6px); }
.media-corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; transform: translate(-6px, 6px); }
.media-corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; transform: translate(6px, -6px); }
.media-corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; transform: translate(-6px, -6px); }

.project:hover .media-corner {
  opacity: 1;
  transform: translate(0, 0);
}

.project-index {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  color: var(--accent);
}

.project-title {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.title-note {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6em;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.project-role {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.project-text {
  margin: 18px 0 0;
  max-width: 46ch;
  color: rgba(238, 241, 246, 0.74);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.tag-row li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: rgba(238, 241, 246, 0.8);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.project:hover .tag-row li {
  border-color: rgba(94, 234, 212, 0.3);
}

.tag-row li:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- about + contact ---------- */

.about {
  border-top: 1px solid var(--line);
}

.about .lede + .lede {
  margin-top: 16px;
}

.about em {
  font-style: italic;
  color: rgba(238, 241, 246, 0.9);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: clamp(30px, 5vh, 56px);
}

.about-grid > div {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 0.35s ease, transform 0.35s ease;
}

.about-grid > div:hover {
  border-color: rgba(124, 92, 255, 0.45);
  transform: translateY(-4px);
}

.about-key {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.about-val {
  margin: 0;
  color: rgba(238, 241, 246, 0.82);
}

.shelf {
  margin-top: clamp(34px, 6vh, 64px);
  padding-top: clamp(24px, 4vh, 40px);
  border-top: 1px solid var(--line);
}

.shelf-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2px 48px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.shelf-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease, padding-left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.shelf-list li:hover {
  border-color: rgba(94, 234, 212, 0.35);
  padding-left: 8px;
}

.shelf-title {
  color: rgba(238, 241, 246, 0.9);
}

.shelf-author {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.contact {
  text-align: center;
  padding-bottom: clamp(70px, 12vh, 140px);
}

.contact-link {
  position: relative;
  display: inline-block;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.4vw, 1.5rem);
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--accent);
}

.contact-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover::after {
  transform: scaleX(1);
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px clamp(20px, 5vw, 64px) 40px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.site-footer a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-footer a:hover {
  color: var(--accent);
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .project,
  .project.flip {
    grid-template-columns: 1fr;
  }

  .project.flip .project-media {
    order: 0;
  }

  .hero-nav-links a {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
