:root {
  --bg: #050505;
  --ink: #ede6da;
  --ink-dim: #b9b2a6;
  --red: #c1272d;
  --red-glow: rgba(193, 39, 45, .55);
  --line: rgba(237, 230, 218, .14);
  --display: "Pirata One", "UnifrakturMaguntia", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 20px;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* Grungy paper/noise texture, low opacity */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -0.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px;
  padding: 14px 28px;
  background: var(--red);
  color: var(--ink);
  font: 700 18px/1.2 var(--body);
  letter-spacing: .02em;
  text-decoration: none;
  border: 2px solid var(--red);
  border-radius: 4px;
  box-shadow: 0 0 0 0 var(--red-glow);
  transition: box-shadow .25s, transform .25s, background .25s;
}
.btn:hover { box-shadow: 0 0 28px 2px var(--red-glow); transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  padding: 40px var(--gutter) 40px;
  isolation: isolate;
  overflow: hidden;
}
.hero__bg, .hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__bg img { object-fit: cover; object-position: 50% 30%; }
.hero__bg { z-index: -3; }
.hero__video {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%;
  opacity: 0; transition: opacity 1s ease;
}
.hero__video.is-on { opacity: 1; }
/* Code-rain overlay: screen blend drops its black, mask keeps the text area clear */
.hero__code {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0;   /* driven by JS: intro + scroll-out only */
  -webkit-mask-image: radial-gradient(70% 60% at 50% 55%, rgba(0,0,0,.25), #000 85%);
          mask-image: radial-gradient(70% 60% at 50% 55%, rgba(0,0,0,.25), #000 85%);
}
@media (max-width: 759px) {
  /* phones only see the middle of the 16:9 clip, so fade the center less */
  .hero__code {
    -webkit-mask-image: linear-gradient(#000 0 30%, rgba(0,0,0,.4) 50% 75%, #000 100%);
            mask-image: linear-gradient(#000 0 30%, rgba(0,0,0,.4) 50% 75%, #000 100%);
  }
}
/* Lighter up top so the face + hands read; heavy at the bottom behind the text */
.hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(110% 70% at 50% 35%, rgba(5,5,5,.25), rgba(5,5,5,.7) 75%),
    linear-gradient(to bottom, rgba(5,5,5,.2) 0%, rgba(5,5,5,.15) 45%, rgba(5,5,5,.85) 72%, var(--bg) 100%);
}
.hero__inner {
  --logo-w: min(92vw, 620px);
  width: 100%; max-width: 860px; margin: 0 auto;
  min-height: calc(100svh - 80px);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
/* Text block sits at the bottom of the hero */
.hero__text {
  margin-top: auto;
  padding-top: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}

/* Logo over the hands in the studio loop (~42% down the hero) */
.logo-stage {
  position: relative;
  width: var(--logo-w);
  aspect-ratio: 3 / 1;
  margin-top: max(0px, calc(42svh - var(--logo-w) / 6 - 40px));
}
@media (max-width: 759px) {
  .hero__inner { --logo-w: 100vw; }
}
.logo-stage__flat, .logo-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.logo-stage__flat { object-fit: contain; mix-blend-mode: screen; transition: opacity .6s; }
.logo-stage canvas { opacity: 0; transition: opacity .8s; }
.logo-stage.is-3d canvas { opacity: 1; }
.logo-stage.is-3d .logo-stage__flat { opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }

.hero__title {
  position: relative;
  margin: 0;
  font: 400 clamp(38px, 9vw, 72px)/1.04 var(--display);
  letter-spacing: .01em;
  text-wrap: balance;
}
.type-ghost { visibility: hidden; }
.type-live { position: absolute; inset: 0; }
.type-cursor {
  display: inline-block;
  width: .08em; height: .9em;
  margin-left: .06em;
  vertical-align: -.08em;
  background: var(--red);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__sub {
  margin: 0;
  max-width: 32ch;
  font-size: clamp(19px, 4.4vw, 23px);
  color: var(--ink);
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px var(--gutter);
}
.section__title {
  margin: 0 0 36px;
  text-align: center;
  font: 400 clamp(40px, 8vw, 64px)/1 var(--display);
  color: var(--ink);
}
.section__title::after {
  content: "";
  display: block;
  width: 64px; height: 3px;
  margin: 16px auto 0;
  background: var(--red);
  box-shadow: 0 0 14px var(--red-glow);
}

/* What I Do */
.cards { display: grid; gap: 18px; }
.card {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(237,230,218,.05), rgba(237,230,218,.01));
  transition: border-color .3s, box-shadow .3s;
}
.card:hover { border-color: rgba(193,39,45,.6); box-shadow: 0 0 30px -8px var(--red-glow); }
.card__icon {
  width: 44px; height: 44px;
  fill: none; stroke: var(--red); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.card h3 { margin: 14px 0 6px; font: 400 34px/1 var(--display); }
.card p { margin: 0; color: var(--ink-dim); }

/* See It */
.video { max-width: 820px; margin: 0 auto; }
.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}
.video__frame iframe, .video__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__facade {
  position: absolute; inset: 0;
  padding: 0; border: 0; cursor: pointer;
  background: #000; color: var(--ink);
}
.video__facade img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; opacity: .45; filter: grayscale(.4) contrast(1.1); }
.video__facade:focus-visible { outline: 3px solid var(--ink); outline-offset: -6px; }
.video__play {
  position: absolute; left: 50%; top: 50%;
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 36px var(--red-glow);
  transition: transform .25s;
}
.video__play::after {
  content: ""; position: absolute; left: 34px; top: 26px;
  border-style: solid; border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent var(--ink);
}
.video__facade:hover .video__play { transform: scale(1.08); }
.video__name {
  position: absolute; left: 20px; bottom: 14px;
  font: 400 44px/1 var(--display);
  text-shadow: 0 2px 12px #000;
}
.wave { display: block; width: 100%; height: 72px; margin-top: 14px; }
.video__caption { margin: 10px 0 0; text-align: center; color: var(--ink-dim); }

/* Hear It — player */
.player {
  max-width: 820px; margin: 0 auto;
  display: grid; gap: 22px; align-items: center;
  padding: 20px;
  border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(160deg, rgba(237,230,218,.04), rgba(237,230,218,.01));
}
.player__viz {
  width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; display: block;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(193,39,45,.08), transparent 70%);
}
.player__body { display: grid; gap: 14px; min-width: 0; }
.player__now {
  margin: 0; text-align: center;
  font: 400 30px/1.1 var(--display);
  overflow-wrap: anywhere;
}
.player__seek { display: flex; align-items: center; gap: 10px; }
.player__time { font-size: 14px; color: var(--ink-dim); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; }
.player__seek input {
  flex: 1; min-width: 0; height: 28px; margin: 0;
  accent-color: var(--red); background: transparent; cursor: pointer;
}
.player__controls { display: flex; justify-content: center; align-items: center; gap: 18px; }
.pbtn {
  width: 48px; height: 48px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.pbtn svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.pbtn:hover { border-color: var(--red); }
.pbtn:focus-visible, .player__track:focus-visible, .player__seek input:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.pbtn--main { width: 64px; height: 64px; background: var(--red); border-color: var(--red); box-shadow: 0 0 24px var(--red-glow); }
.pbtn--main svg { width: 24px; height: 24px; }
.pbtn .i-pause, .player.is-playing .pbtn .i-play { display: none; }
.player.is-playing .pbtn .i-pause { display: block; }
.player__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: trk; }
.player__track {
  width: 100%; min-height: 44px; padding: 8px 12px;
  display: flex; align-items: center; gap: 12px;
  background: transparent; border: 0; border-radius: 4px;
  color: var(--ink-dim); font: 600 16px/1.3 var(--body); text-align: left; cursor: pointer;
}
.player__track::before { counter-increment: trk; content: counter(trk, decimal-leading-zero); color: var(--red); font-variant-numeric: tabular-nums; }
.player__track:hover { background: rgba(237,230,218,.05); color: var(--ink); }
.player__track.is-active { color: var(--ink); background: rgba(193,39,45,.14); }
@media (min-width: 760px) {
  .player { grid-template-columns: 280px 1fr; gap: 32px; padding: 28px; }
  .player__now { text-align: left; }
  .player__controls { justify-content: flex-start; }
}

/* My Promise */
.promise {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 760px;
  display: grid; gap: 26px;
}
.promise li {
  position: relative;
  padding-left: 30px;
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.35;
  font-weight: 600;
}
.promise li::before {
  content: ""; position: absolute; left: 0; top: .48em;
  width: 12px; height: 12px;
  background: var(--red);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--red-glow);
}

/* Final CTA */
.final { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.final__portrait {
  width: 148px; height: 148px;
  border-radius: 50%;
  object-fit: cover; object-position: 50% 20%;
  border: 3px solid var(--red);
  box-shadow: 0 0 40px -6px var(--red-glow);
}
.final__title {
  margin: 0; max-width: 18ch;
  font: 400 clamp(40px, 8.5vw, 68px)/1.05 var(--display);
  text-wrap: balance;
}

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px;
  padding: 40px var(--gutter) calc(110px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 16px;
  text-align: center;
}
.footer a { color: var(--ink); text-underline-offset: 3px; }
.footer a:hover { color: var(--red); }
.footer a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Sticky mobile CTA */
.btn--sticky {
  position: fixed; z-index: 40;
  left: var(--gutter); right: var(--gutter);
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateY(140%);
  transition: transform .35s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,.6), 0 0 24px var(--red-glow);
}
.btn--sticky.is-on { transform: none; }

/* Full-screen code takeover before email opens */
.takeover {
  position: fixed; inset: 0; z-index: 70;
  pointer-events: none;
  background: #050505;
  opacity: 0; transition: opacity .35s ease;
}
.takeover.is-on { opacity: 1; }
.takeover video { width: 100%; height: 100%; object-fit: cover; }

/* Cursor trail canvas */
#trail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* Scroll reveals (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Larger screens ---------- */
@media (min-width: 760px) {
  :root { --gutter: 32px; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .section { padding: 120px var(--gutter); }
  .btn--sticky { display: none; }
  .footer { padding-bottom: 48px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .type-cursor { animation: none; }
  .btn, .btn--sticky, .card { transition: none; }
}
