/* ============================================================
   THE GOLDEN BOY — Deniz Çağlarcan
   Dark, cinematic, mouse-interactive project page.
   Vanilla CSS. Mobile-first.
============================================================ */

:root {
  --bg:        #050505;
  --bg-soft:   #0c0a08;
  --ink:       #ededeb;
  --ink-dim:   #8a8580;
  --gold:      #d6b269;
  --gold-soft: #b08a3a;
  --line:      rgba(214, 178, 105, 0.18);

  --max:       1200px;
  --gutter:    clamp(20px, 5vw, 64px);

  --serif:     "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans:      -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --display:   -apple-system, "SF Pro Display", "Inter Display", "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip` (not `hidden`) so descendants with position: sticky still work. */
  overflow-x: clip;
}

body { cursor: default; }

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

::selection { background: var(--gold); color: #000; }

.skip {
  position: absolute; left: -9999px; top: -9999px;
}
.skip:focus { left: 16px; top: 16px; padding: 8px 12px; background: var(--gold); color: #000; z-index: 999; }

/* ============================================================
   HERO
============================================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 620px;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.hero__video {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;          /* crop the unused VR half */
  opacity: 0;
  /* Darken the video so the title doesn't fight bright golds. */
  filter: brightness(0.65) contrast(1.05) saturate(1.05);
  transition: opacity 2.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero__video.is-ready { opacity: 1; }

.hero__video iframe {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width:  max(100vw, 177.78vh);
  height: max(56.25vw, 100vh);
  border: 0;
  background: #000;
}

/* Fallback flat-crop: if WebGL/Three.js fails to init, the video shows
   directly with only its top half visible (overflow:hidden on parent
   clips the other half). When the 3D viewer initializes, .hero__sphere
   covers this entirely. */
.hero__video-player {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -25%);
  width:  max(100vw, 200vh);
  height: max(100vw, 200vh);
  object-fit: cover;
  background: #000;
  z-index: 0;
}

/* Three.js 360° viewer mount point — overlays the flat video. */
.hero__sphere {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  cursor: grab;
  background: transparent;
}
.hero__sphere:active { cursor: grabbing; }
.hero__sphere canvas {
  display: block;
  width: 100%;
  height: 100%;
}
/* Touch devices: don't intercept gestures — page must remain scrollable. */
@media (hover: none) and (pointer: coarse) {
  .hero__sphere { pointer-events: none; }
}

.hero__veil {
  position: absolute; inset: 0;
  z-index: 1;
  background:
    /* Uniform 5% black tint for added text contrast */
    linear-gradient(rgba(0,0,0,0.05), rgba(0,0,0,0.05)),
    radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.85) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 30%, transparent 70%, var(--bg) 100%);
  pointer-events: none;
}

.hero__copy {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 var(--gutter);
  /* Pass pointer events through to the 360° sphere underneath, except for
     explicitly interactive children (the sound button, etc.). */
  pointer-events: none;
}
.hero__copy a,
.hero__copy button { pointer-events: auto; }

.hero__title {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-weight: 200;
  font-size: clamp(44px, 10vw, 160px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0;
  text-transform: uppercase;
  color: var(--ink);
  /* Halo + drop shadow combo — each letter carries its own pool of
     darkness so it stays legible over bright video pixels. */
  text-shadow:
    0 0 22px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(0, 0, 0, 0.45),
    0 4px 28px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.hero__title-text {
  display: inline-block;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.hero__title-text .t-gold { color: var(--gold); }

.hero__title.is-revealed .hero__title-text { opacity: 1; }

/* Full-hero particle canvas — overlays everything except interactive UI.
   Sized to the entire .hero so origins span the full viewport. */
.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.55s ease;
}
.hero__particles.is-faded { opacity: 0; }

.hero__tag {
  display: inline-block;
  margin: 1.6em auto 0;
  max-width: 60ch;
  padding: 0.7em 4em;
  font-size: clamp(14px, 1.4vw, 17px);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-transform: none;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  /* Long, soft feather — opaque only in the small inner core, dissolving
     well before the box edge so the rectangle is invisible. */
  -webkit-mask-image: radial-gradient(ellipse at center, #000 8%, rgba(0,0,0,0.85) 30%, transparent 90%);
          mask-image: radial-gradient(ellipse at center, #000 8%, rgba(0,0,0,0.85) 30%, transparent 90%);
}

.hero__sound {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 2em;
  padding: 12px 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  /* Capsule-shaped pill keeps a softer feather so the gold border is
     still visible as a defined object. */
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, rgba(0,0,0,0.9) 60%, transparent 100%);
          mask-image: radial-gradient(ellipse at center, #000 35%, rgba(0,0,0,0.9) 60%, transparent 100%);
  transition: border-color 0.4s, background 0.4s, color 0.4s;
}
.hero__sound:hover,
.hero__sound.is-on {
  border-color: var(--gold);
  background: rgba(214,178,105,0.08);
  color: var(--gold);
}
.hero__sound.is-on .dot { animation: none; }
.hero__sound .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 var(--gold);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(214,178,105,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(214,178,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(214,178,105,0); }
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0.7;
}

/* Hero audio control — speaker button + volume slider, bottom-right */
.hero__audio {
  position: absolute;
  bottom: 26px;
  right: clamp(20px, 3vw, 40px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  pointer-events: auto;
}
.hero__audio-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.2s;
}
.hero__audio-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(214, 178, 105, 0.08);
}
.hero__audio-btn:active { transform: scale(0.94); }
.hero__audio-icon { width: 14px; height: 14px; display: block; }
.hero__audio-icon--off { display: none; }
.hero__audio.is-muted .hero__audio-icon--on  { display: none; }
.hero__audio.is-muted .hero__audio-icon--off { display: block; }
.hero__audio.is-muted .hero__audio-slider__fill { background: var(--ink-dim); }
.hero__audio.is-muted .hero__audio-slider__thumb { background: var(--ink-dim); }

.hero__audio-slider {
  position: relative;
  width: 84px;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.hero__audio-slider__track,
.hero__audio-slider__fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero__audio-slider__track {
  width: 100%;
  background: var(--line);
}
.hero__audio-slider__fill {
  background: var(--gold);
  width: 0%;
  transition: width 0.08s linear, background 0.3s;
}
.hero__audio-slider__thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  transition: left 0.08s linear, transform 0.22s ease, background 0.3s;
}
.hero__audio-slider:hover .hero__audio-slider__thumb,
.hero__audio-slider:focus-visible .hero__audio-slider__thumb {
  transform: translate(-50%, -50%) scale(1.5);
}

@media (max-width: 520px) {
  .hero__audio { bottom: 18px; right: 16px; gap: 10px; }
  .hero__audio-slider { width: 60px; }
}
.hero__scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 36px;
  margin: 10px auto 0;
  background: var(--ink-dim);
  animation: scrollLine 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(0.3); opacity: 0.3; }
  50%      { transform: scaleY(1);   opacity: 0.9; }
}

/* Reveal helpers */
[data-fade] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-fade].is-revealed { opacity: 1; transform: none; }
.hero__tag.is-revealed   { transition-delay: 0.55s; }
.hero__sound.is-revealed { transition-delay: 0.75s; }
.hero__scroll.is-revealed{ transition-delay: 1.0s;  }

/* ============================================================
   PROSE SECTIONS — Program Note / Compositional Process
============================================================ */
.prose {
  padding: clamp(80px, 14vh, 180px) var(--gutter);
  background: var(--bg);
}
.prose--alt { background: var(--bg-soft); }

.prose__inner {
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 2em;
}

.prose p {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.45;
  letter-spacing: -0.005em;
  margin: 0 0 1.2em;
  color: var(--ink);
}
.prose .lede {
  font-weight: 300;
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1.6em;
}
.prose em { color: var(--gold); font-style: italic; }

.tool {
  position: relative;
  padding: 0 0.05em;
  background: linear-gradient(transparent 70%, rgba(214,178,105,0.18) 70%);
  transition: background 0.4s;
  cursor: default;
}
.tool:hover { background: linear-gradient(transparent 0%, rgba(214,178,105,0.28) 100%); }

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* ============================================================
   VERTICAL REEL
============================================================ */
.reel {
  position: relative;
  padding: clamp(60px, 12vh, 140px) var(--gutter);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.reel__halo {
  position: absolute;
  top: 50%; left: 50%;
  width: 80vw;
  height: 80vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side,
    rgba(214, 178, 105, 0.18) 0%,
    rgba(214, 178, 105, 0.04) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.reel__frame {
  position: relative;
  width: min(420px, 64vw);
  aspect-ratio: 9 / 16;
  z-index: 1;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(214, 178, 105, 0.10),
    0 0 60px 0 rgba(214, 178, 105, 0.18);
}
.reel__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(1.05);
}
.reel__edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 4px;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.25) 0%, transparent 14%, transparent 86%, rgba(0,0,0,0.35) 100%);
}
.reel__caption {
  position: relative;
  z-index: 1;
  margin: 2.4em 0 0;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.reel__caption em {
  font-style: normal;
  color: var(--gold);
  margin-left: 0.4em;
}

/* ============================================================
   SCROLL-SCRUB GALLERY
============================================================ */
.scrub {
  position: relative;
  /* Reserve scroll length: 7 stills × ~80vh */
  height: 560vh;
  background: #000;
}
.scrub__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.scrub__stage {
  position: relative;
  width: min(100%, 1200px);
  aspect-ratio: 2 / 1;
  margin: 0 var(--gutter);
}
.scrub__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.7s ease, transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: contrast(1.05) saturate(1.05);
  border-radius: 2px;
}
.scrub__img.is-active {
  opacity: 1;
  transform: scale(1);
}
.scrub__caption {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.scrub__counter em {
  font-style: normal;
  color: var(--gold);
  font-weight: 500;
}

/* ============================================================
   PARALLAX TILE
============================================================ */
.tile {
  padding: clamp(40px, 8vh, 100px) var(--gutter) clamp(80px, 14vh, 160px);
  background: var(--bg);
}
.tile__frame {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
  will-change: transform;
}
.tile__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 1s ease;
}
.tile__frame:hover img { transform: scale(1.12); }

/* ============================================================
   TOOLS
============================================================ */
.tools {
  padding: clamp(80px, 14vh, 160px) var(--gutter);
  background: var(--bg-soft);
  text-align: center;
}
.tools .eyebrow { margin-bottom: 3em; }
.tools__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 28px;
  max-width: 800px;
  margin: 0 auto;
}
.tools__list li {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(18px, 2vw, 24px);
  color: var(--ink);
  letter-spacing: -0.01em;
  position: relative;
  padding: 0 4px;
}
.tools__list li::before {
  content: "·";
  position: absolute;
  left: -22px;
  color: var(--gold);
  opacity: 0.6;
}
.tools__list li:first-child::before { content: ""; }

/* ============================================================
   CONTACT
============================================================ */
.contact {
  padding: clamp(100px, 18vh, 200px) var(--gutter);
  background: var(--bg);
  text-align: center;
}
.contact__inner { max-width: 920px; margin: 0 auto; }
.contact__head {
  font-family: var(--display);
  font-weight: 200;
  font-size: clamp(28px, 4.5vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 2em;
  color: var(--ink);
}
.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}
.magnet {
  display: inline-block;
  padding: 18px 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  transition: border-color 0.4s, background 0.4s, color 0.4s;
  will-change: transform;
}
.magnet:hover {
  border-color: var(--gold);
  background: rgba(214,178,105,0.06);
  color: var(--gold);
}

/* ============================================================
   FOOTER
============================================================ */
.foot {
  padding: 60px var(--gutter) 80px;
  background: var(--bg);
  border-top: 1px solid rgba(255,255,255,0.04);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}
.foot p { margin: 0.4em 0; }
.foot__back a {
  color: var(--ink-dim);
  transition: color 0.3s;
}
.foot__back a:hover { color: var(--gold); }

/* ============================================================
   MOBILE
============================================================ */
@media (max-width: 720px) {
  .hero__title { gap: 0 0.18em; }
  .scrub { height: 420vh; }
  .scrub__stage { aspect-ratio: 16 / 10; }
  .magnet { padding: 14px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-fade], [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero__title span { opacity: 1 !important; transform: none !important; }
}
