:root {
  --ink: #0a0a0a;
  --paper: #ecebe6;
  --mist: #d9d8cf;
  --white: #f8f7f2;
  --coral: #ff7c5f;
  --sage: #bdc9ad;
  --blue: #9bb6c7;
  --charcoal: #161616;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

.page-wipe {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: var(--paper);
  transform: translateY(100%);
}

body.is-transitioning .page-wipe {
  animation: wipe 0.9s var(--ease);
}

.site-header {
  position: fixed;
  z-index: 120;
  top: 30px;
  left: clamp(20px, 5vw, 64px);
  right: clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

body.project-open .site-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-18px);
}

.brand,
.nav-pill a,
.back-button,
.eyebrow,
.section-label,
.project-kicker,
.project-number,
dt {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand {
  color: var(--ink);
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--white);
  background-image: linear-gradient(#deddd7, #deddd7);
  background-position: bottom;
  background-repeat: no-repeat;
  background-size: 100% 0;
  box-shadow: 0 10px 30px rgba(10, 10, 10, 0.08);
  transition: background-size 0.55s var(--ease), color 0.55s var(--ease), transform 0.55s var(--ease);
}

.nav-pill {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(10, 10, 10, 0.08);
}

.nav-pill a {
  min-width: 78px;
  padding: 14px 18px;
  border-radius: 999px;
  text-align: center;
  background-image: linear-gradient(#deddd7, #deddd7);
  background-position: bottom;
  background-repeat: no-repeat;
  background-size: 100% 0;
  transition: background-size 0.55s var(--ease), color 0.55s var(--ease);
}

.hero {
  min-height: 92vh;
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: end;
  gap: 34px;
  padding: 130px clamp(20px, 5vw, 64px) 72px;
  background: var(--paper);
  overflow: hidden;
}

.hero h1,
.profile-section h2,
.contact-section h2,
.overlay-copy h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 0.92;
}

.hero-copy {
  position: relative;
  z-index: 4;
}

.hero h1 {
  position: relative;
  z-index: 4;
  max-width: 1180px;
  color: rgba(10, 10, 10, 0.32);
  font-size: clamp(64px, 12vw, 168px);
}

.hero-asset {
  position: absolute;
  z-index: 2;
  top: 47%;
  left: 50%;
  width: min(28vw, 360px);
  min-width: 220px;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 124, 95, 0.45), rgba(155, 182, 199, 0.45)),
    repeating-linear-gradient(90deg, rgba(10, 10, 10, 0.12) 0 1px, transparent 1px 22px),
    #d8d6cd;
  color: rgba(10, 10, 10, 0.48);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(
    calc(-50% + var(--hero-asset-x, 0px)),
    calc(-50% + var(--hero-asset-y, 0px))
  ) scale(var(--hero-asset-scale, 1));
  transition: opacity 0.45s var(--ease), transform 0.9s var(--ease);
}

.hero-asset img,
.reel-frame video,
.project-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-asset img {
  z-index: 2;
  opacity: 0.82;
  user-select: none;
}

.hero-echo {
  position: absolute;
  display: block;
  z-index: 1;
  top: 47%;
  left: 50%;
  width: min(28vw, 360px);
  min-width: 220px;
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  opacity: 0;
  object-fit: cover;
  pointer-events: none;
  transform: translate(
    calc(-50% + var(--echo-x, 0px)),
    calc(-50% + var(--echo-y, 0px))
  ) scale(var(--echo-scale, 1));
  filter: saturate(0.9) contrast(0.94);
}

.hero-echo.is-active {
  animation: echoDecay 2.35s var(--ease) forwards;
}

.hero .hero-asset.is-visible {
  opacity: 1;
  transform: translate(
    calc(-50% + var(--hero-asset-x, 0px)),
    calc(-50% + var(--hero-asset-y, 0px))
  ) scale(var(--hero-asset-scale, 1));
}

.hero .hero-asset.is-hidden {
  opacity: 0;
  transform: translate(
    calc(-50% + var(--hero-asset-x, 0px)),
    calc(-30% + var(--hero-asset-y, 92px))
  ) scale(var(--hero-asset-scale, 1));
}

.hero-details {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 28px;
  max-width: 1180px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 24px;
}

.showreel-section,
.work-section,
.profile-section,
.contact-section {
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 64px);
  scroll-margin-top: 110px;
}

.section-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--white);
}

.reel-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 72vh;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 124, 95, 0.9), rgba(155, 182, 199, 0.8)),
    var(--mist);
  cursor: pointer;
  color: var(--white);
}

.reel-frame .poster-noise,
.reel-frame video,
.reel-frame .reel-title {
  transition: transform 0.8s var(--ease);
}

.poster-noise {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.45), transparent 24%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22) 1px, transparent 1px);
  background-size: auto, 34px 100%;
  animation: drift 12s linear infinite;
}

.reel-title {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: inherit;
  height: 100%;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(76px, 14vw, 180px);
}

.overlay-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: inherit;
  height: 100%;
  padding: 32px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.9;
  text-align: center;
}

.reel-note {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 24px;
  color: rgba(248, 247, 242, 0.78);
  font-size: 14px;
}

.work-section {
  background: var(--ink);
  color: var(--white);
  mix-blend-mode: difference;
}

.work-heading {
  margin-bottom: 42px;
}

.section-title {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-section h2,
.contact-section h2 {
  max-width: 980px;
  font-size: clamp(42px, 8vw, 112px);
}

.project-list {
  display: grid;
  gap: 118px;
}

.project-card {
  color: var(--ink);
}

.project-trigger {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 0.58fr);
  width: 100%;
  min-height: 540px;
  padding: 32px;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--card-bg);
  text-align: left;
  cursor: pointer;
  transition: transform 0.7s var(--ease), min-height 0.7s var(--ease);
}

.color-coral {
  --card-bg: #f2f1ef;
}

.color-cream {
  --card-bg: #dddcd8;
}

.color-sage {
  --card-bg: #c3bfba;
}

.color-blue {
  --card-bg: #9b938f;
}

.project-media {
  position: relative;
  display: block;
  min-height: 460px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--charcoal);
  transition: min-height 0.7s var(--ease);
}

.project-media > span,
.project-media video {
  transition: transform 0.8s var(--ease);
}

.project-info {
  align-self: center;
  padding: 0 clamp(24px, 6vw, 84px);
}

.project-title {
  display: block;
  max-width: 740px;
  margin: 18px 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.92;
}

.project-line {
  display: block;
  font-size: 18px;
}

.project-number {
  position: absolute;
  top: 32px;
  right: 32px;
}

.motion-bars,
.orbital,
.frame-stack,
.waveform {
  position: absolute;
  inset: 0;
}

.motion-bars {
  background:
    linear-gradient(90deg, transparent 0 20%, #f8f7f2 20% 24%, transparent 24% 42%, #ff7c5f 42% 47%, transparent 47% 100%),
    linear-gradient(150deg, #252525, #606060);
  animation: slideBars 2.8s var(--ease) infinite alternate;
}

.orbital::before,
.orbital::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(248, 247, 242, 0.72);
  border-radius: 50%;
}

.orbital::before {
  inset: 18%;
  animation: rotate 5s linear infinite;
}

.orbital::after {
  inset: 34%;
  background: var(--coral);
  animation: pulse 2s var(--ease) infinite alternate;
}

.frame-stack {
  background:
    linear-gradient(135deg, transparent 42%, rgba(248, 247, 242, 0.92) 42% 58%, transparent 58%),
    repeating-linear-gradient(0deg, #222 0 28px, #343434 28px 56px);
  animation: frameShift 4s steps(4) infinite;
}

.waveform {
  background: linear-gradient(180deg, #101010, #3d4c55);
}

.waveform::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 160px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, #f8f7f2 0 6px, transparent 6px 22px);
  clip-path: polygon(0 45%, 8% 20%, 16% 65%, 25% 35%, 36% 80%, 48% 18%, 60% 58%, 72% 28%, 84% 72%, 100% 44%, 100% 100%, 0 100%);
  animation: wave 2s var(--ease) infinite alternate;
}

.profile-section {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(260px, 0.3fr);
  gap: 40px;
  background: var(--paper);
}

.profile-copy {
  align-self: end;
  font-size: 18px;
  line-height: 1.55;
}

.contact-section {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--white);
  color: var(--ink);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}

.contact-links a,
.back-button {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  background-image: linear-gradient(#2f2f2f, #2f2f2f);
  background-position: bottom;
  background-repeat: no-repeat;
  background-size: 100% 0;
  color: var(--white);
  padding: 16px 22px;
  cursor: pointer;
  transition: background-size 0.55s var(--ease), color 0.55s var(--ease), transform 0.55s var(--ease);
}

.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  visibility: hidden;
  pointer-events: none;
}

.project-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.overlay-panel {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.48fr) minmax(320px, 0.52fr);
  gap: 32px;
  padding: 70px clamp(20px, 5vw, 64px);
  background: var(--paper);
  transform: translateY(-100%);
  transition: transform 0.9s var(--ease);
}

.project-overlay.is-open .overlay-panel {
  transform: translateY(0);
}

.showreel-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  background: #050505;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}

.showreel-modal.is-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

.showreel-player {
  position: relative;
  width: min(100%, calc((100vh - clamp(28px, 6vw, 64px)) * 16 / 9));
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.showreel-modal.is-open .showreel-player {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.showreel-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.back-button {
  position: absolute;
  top: 30px;
  right: clamp(20px, 5vw, 64px);
}

.showreel-close {
  position: fixed;
  top: clamp(14px, 3vw, 28px);
  right: clamp(14px, 3vw, 28px);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.45s var(--ease), background 0.45s var(--ease);
}

.overlay-copy {
  align-self: center;
}

.overlay-copy h2 {
  margin: 16px 0 28px;
  font-size: clamp(56px, 8vw, 118px);
}

.overlay-summary {
  max-width: 520px;
  font-size: 20px;
  line-height: 1.45;
}

dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 640px;
  margin: 48px 0 0;
}

dt,
dd {
  margin: 0;
}

dd {
  margin-top: 8px;
}

.overlay-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  align-self: center;
  background:
    linear-gradient(135deg, rgba(22, 22, 22, 0.85), rgba(255, 124, 95, 0.72)),
    var(--charcoal);
  color: var(--white);
}

.overlay-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

[data-animate] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes wipe {
  0% {
    transform: translateY(100%);
  }
  50% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

@keyframes drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 0, 340px 0;
  }
}

@keyframes slideBars {
  to {
    transform: translateX(18%) scale(1.05);
  }
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  to {
    transform: scale(1.24);
  }
}

@keyframes frameShift {
  to {
    background-position: 0 0, 0 -224px;
  }
}

@keyframes wave {
  to {
    transform: translateY(-50%) scaleY(0.62);
  }
}

@keyframes echoDecay {
  0% {
    opacity: 0.54;
    transform: translate(
      calc(-50% + var(--echo-x, 0px)),
      calc(-50% + var(--echo-y, 0px))
    ) scale(var(--echo-scale, 1));
  }
  100% {
    opacity: 0;
    transform: translate(
      calc(-50% + var(--echo-x, 0px)),
      calc(-50% + var(--echo-y, 0px) + 34px)
    ) scale(calc(var(--echo-scale, 1) * 0.82));
  }
}

@media (hover: hover) and (pointer: fine) {
  .brand:hover {
    background-size: 100% 100%;
    color: var(--ink);
    transform: translateY(-2px);
  }

  .nav-pill a:hover {
    background-size: 100% 100%;
    color: var(--ink);
  }

  .reel-frame:hover .poster-noise,
  .reel-frame:hover video,
  .reel-frame:hover .reel-title {
    transform: scale(1.06);
  }

  .project-trigger:hover {
    transform: translateY(-12px);
    min-height: 660px;
  }

  .project-trigger:hover .project-media {
    min-height: 580px;
  }

  .project-trigger:hover .project-media > span,
  .project-trigger:hover .project-media video {
    transform: scale(1.06);
  }

  .contact-links a:hover,
  .back-button:hover {
    background-size: 100% 100%;
    color: var(--white);
    transform: translateY(-3px);
  }

  .showreel-close:hover {
    background: var(--white);
    transform: translateY(-3px);
  }
}

@media (max-width: 840px) {
  .site-header {
    top: 18px;
    left: 20px;
    right: 20px;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .brand {
    width: auto;
    max-width: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    line-height: 1;
    padding: 0 12px;
  }

  .brand,
  .nav-pill a {
    font-size: 9.5px;
  }

  .nav-pill {
    flex: 0 0 auto;
    justify-content: flex-start;
    min-height: 44px;
    padding: 4px;
  }

  .nav-pill a {
    flex: 0 0 auto;
    min-width: 58px;
    padding: 12px 8px;
  }

  .hero {
    min-height: 90vh;
  }

  .hero h1 {
    font-size: clamp(58px, 18vw, 96px);
  }

  .showreel-section,
  .work-section,
  .profile-section,
  .contact-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .reel-frame {
    aspect-ratio: 1 / 1.28;
    max-height: none;
  }

  .hero-asset,
  .hero-echo {
    display: none;
  }

  .profile-section,
  .overlay-panel {
    grid-template-columns: 1fr;
  }

  .project-list {
    gap: 56px;
  }

  .project-trigger {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px;
  }

  .project-media {
    min-height: 280px;
  }

  .project-info {
    padding: 34px 0 18px;
  }

  .project-number {
    top: 28px;
    right: 28px;
    color: var(--white);
  }

  .overlay-panel {
    padding-top: 104px;
  }

  .overlay-video {
    min-height: 0;
  }

  dl {
    grid-template-columns: 1fr;
  }
}

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