/* =====================================================================
   Youssef Selim — Portfolio v2 (Cinematic 3D)
   styles.css
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Cinematic palette — Hollywood teal/orange grade */
  --bg:              #050608;
  --bg-deep:         #000000;
  --surface:         #0d0e12;
  --surface-hi:      #14161d;
  --surface-line:    rgba(255, 255, 255, 0.06);

  --text:            #e8e9ec;
  --text-soft:       #8a8f9c;
  --text-dim:        #4a4f5c;

  --gold:            #c9a96e;
  --gold-bright:     #e0c084;
  --gold-dim:        rgba(201, 169, 110, 0.4);
  --gold-glow:       rgba(201, 169, 110, 0.18);

  --teal:            #5d8aa8;
  --teal-glow:       rgba(93, 138, 168, 0.25);

  --grid-line:       rgba(201, 169, 110, 0.045);

  /* Typography */
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Timing — cinematic curves */
  --ease-cinema:     cubic-bezier(0.65, 0, 0.05, 1);
  --ease-cinema-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-cinema-in:  cubic-bezier(0.7, 0, 0.85, 0);
  --ease-micro:      cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container:       1400px;
  --pad-x-desktop:   80px;
  --pad-x-tablet:    40px;
  --pad-x-mobile:    24px;
  --section-pad-y:   192px;
  --section-pad-y-mobile: 112px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  cursor: none;
  position: relative;
  min-height: 100vh;
}

@media (hover: none) and (pointer: coarse) {
  body { cursor: auto; }
  .cursor { display: none !important; }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; cursor: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: none; }
ul { margin: 0; padding: 0; list-style: none; }
em { font-style: italic; }

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

/* ---------- Background canvas (z-0) ---------- */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Film grain (z-2) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.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 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- Loader (z-100) ---------- */
.loader {
  position: fixed; inset: 0;
  z-index: 100;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.loader__core {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.loader__mono {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 3rem;
  letter-spacing: -0.02em;
  color: var(--text);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}
.loader__dot { color: var(--gold); }
.loader__line {
  width: 200px; height: 1px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.loader__line-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transition: width 1200ms var(--ease-cinema);
}

/* ---------- Custom cursor (z-999) ---------- */
.cursor {
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 999;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor__dot {
  position: absolute; top: 50%; left: 50%;
  width: 5px; height: 5px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor__ring {
  position: absolute; top: 50%; left: 50%;
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 400ms var(--ease-cinema-out), border-color 400ms;
}
.cursor.is-hover .cursor__ring {
  transform: translate(-50%, -50%) scale(2);
  border-color: var(--gold);
}

/* ---------- Nav (z-50) ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 28px var(--pad-x-desktop);
  padding-top: max(28px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  transition: padding 800ms var(--ease-cinema), background 800ms var(--ease-cinema);
}
.nav.is-scrolled {
  padding-top: 16px; padding-bottom: 16px;
  background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--surface-line);
}
.nav__brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav__dot { color: var(--gold); }

.nav__links {
  display: flex; gap: 36px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}
.nav__links a {
  position: relative;
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 0;
  transition: color 300ms var(--ease-cinema);
}
.nav__num {
  color: var(--gold);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
}
.nav__links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 600ms var(--ease-cinema);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }

.nav__cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text);
  transition: border-color 400ms var(--ease-cinema), background 400ms;
}
.nav__cta:hover {
  border-color: var(--gold);
  background: var(--gold-glow);
  color: var(--gold-bright);
}

@media (max-width: 1024px) {
  .nav__links { display: none; }
}
@media (max-width: 768px) {
  .nav {
    padding: 16px var(--pad-x-mobile);
    padding-top: max(16px, env(safe-area-inset-top));
  }
  .nav__cta { padding: 9px 14px; font-size: 0.6875rem; }
}

/* ---------- Scroll progress (z-60) ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 60;
}
.scroll-progress__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 8px var(--gold-glow);
}

/* ===================================================================
   SCENES — shared structure
   =================================================================== */
main {
  position: relative;
  z-index: 1;
}

.scene {
  position: relative;
  padding: var(--section-pad-y) var(--pad-x-desktop);
  overflow: hidden;
}

.scene__bg {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.scene__mid {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}
.scene__fg, .scene__head, .scene__title {
  position: relative;
  z-index: 2;
}

@media (max-width: 1024px) {
  .scene { padding-left: var(--pad-x-tablet); padding-right: var(--pad-x-tablet); }
}
@media (max-width: 768px) {
  .scene { padding: var(--section-pad-y-mobile) var(--pad-x-mobile); }
}

/* Chapter labels — used in every scene */
.chapter-label {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.chapter-label__num { color: var(--gold); }
.chapter-label__rule {
  display: inline-block;
  width: 56px; height: 1px;
  background: var(--gold-dim);
}

.scene__head {
  max-width: 920px;
  margin-bottom: 120px;
}
.scene__head--centered {
  text-align: center;
  margin-left: auto; margin-right: auto;
}
.scene__head--centered .chapter-label { justify-content: center; }

.scene__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 200;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 32px 0 0;
}
.scene__title em {
  font-style: italic;
  color: var(--gold);
  font-weight: 200;
}
.scene__lede {
  margin-top: 28px;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 600px;
}

/* ===================================================================
   HERO
   =================================================================== */
.hero {
  min-height: 100vh; min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 0 var(--pad-x-desktop);
  padding-top: env(safe-area-inset-top);
}
.hero__vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(201, 169, 110, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(93, 138, 168, 0.04) 0%, transparent 50%);
}
.hero__rings {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 120vmin; height: 120vmin;
}
.hero__rings span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  opacity: 0;
  animation: ringPulse 6s var(--ease-cinema-out) infinite;
}
.hero__rings span:nth-child(2) { animation-delay: 2s; }
.hero__rings span:nth-child(3) { animation-delay: 4s; }
@keyframes ringPulse {
  0%   { transform: scale(0.3); opacity: 0; }
  20%  { opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0; }
}

.hero__mark {
  position: absolute;
  bottom: 12vh;
  left: var(--pad-x-desktop);
  font-family: var(--font-display);
  font-size: clamp(8rem, 22vw, 22rem);
  font-weight: 200;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--surface);
  opacity: 0.4;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.hero .scene__fg {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 120px 0 80px;
}

.hero__topline {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 56px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}
.hero__location { letter-spacing: 0.08em; }

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 16vw, 14rem);
  font-weight: 200;
  font-variation-settings: "opsz" 144;
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--text);
}
.hero__name-line {
  display: block;
  overflow: hidden;
}
.hero__name-line--italic {
  font-style: italic;
  font-weight: 200;
  color: var(--gold);
  padding-left: 0.12em;
}

.hero__role {
  margin: 56px 0 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: inline-flex; align-items: center; flex-wrap: wrap;
  gap: 4px 14px;
  max-width: 800px;
}
.hero__role-bullet {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 6px;
}
.hero__role-sep {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

.hero__lede {
  margin: 36px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.2vw, 2rem);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 760px;
}
.hero__lede .hi {
  color: var(--gold);
  font-style: italic;
}

.hero__bottomline {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--surface-line);
  display: flex; justify-content: space-between; align-items: center;
}
.hero__currently {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.hero__currently strong { color: var(--text); font-weight: 500; }

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.dot--pulse {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: pulse 2.4s var(--ease-cinema-out) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero__cue {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  transition: all 400ms var(--ease-cinema);
}
.hero__cue:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: var(--gold-glow);
}
.hero__cue svg {
  animation: cue 2.4s var(--ease-cinema-out) infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(3px); opacity: 1; }
}

@media (max-width: 768px) {
  .hero__topline, .hero__bottomline { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero__role { font-size: 0.7rem; }
  .hero__mark { font-size: clamp(6rem, 35vw, 14rem); bottom: 8vh; left: var(--pad-x-mobile); }
  .hero .scene__fg { padding: 100px 0 60px; }
}

/* ===================================================================
   CHAPTER I — THE OPERATOR (stats)
   =================================================================== */
.operator__bg-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(10rem, 24vw, 26rem);
  letter-spacing: -0.04em;
  color: var(--surface);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}

.operator .scene__head { max-width: var(--container); margin-left: auto; margin-right: auto; }

.operator__beats {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--surface-line);
}

.beat {
  position: relative;
  background: var(--bg);
  padding: 80px 56px;
  overflow: hidden;
  min-height: 380px;
}

.beat__layers {
  position: relative;
  height: 100%;
}

.beat__layer {
  position: relative;
}
.beat__layer--bg {
  position: absolute;
  top: -40px; right: -40px;
  z-index: 0;
}
.beat__shadow {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: 18rem;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--surface-hi);
  pointer-events: none;
  user-select: none;
  display: block;
}

.beat__layer--mid {
  position: relative;
  z-index: 2;
}
.beat__num-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
}
.beat__num {
  font-family: var(--font-display);
  font-size: clamp(4rem, 9vw, 8rem);
  font-weight: 200;
  font-variation-settings: "opsz" 144;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.beat__num-suffix {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  color: var(--text-soft);
  letter-spacing: -0.02em;
}

.beat__layer--fg {
  position: relative;
  z-index: 3;
  margin-top: 32px;
}
.beat__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}
.beat__body {
  margin: 16px 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 420px;
}

@media (max-width: 768px) {
  .operator__beats { grid-template-columns: 1fr; }
  .beat { padding: 56px 28px; min-height: 320px; }
  .beat__shadow { font-size: 12rem; }
}

/* ===================================================================
   CHAPTER II — THE LINE (career)
   =================================================================== */
.line {
  padding-bottom: 0;
}

.line__bg-text {
  position: absolute;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(8rem, 18vw, 18rem);
  letter-spacing: -0.04em;
  color: var(--surface);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  display: flex; gap: 0.2em;
}
.line__bg-text span { color: var(--gold-dim); font-style: italic; }

.line__horizon {
  position: relative;
  margin-top: 80px;
}

.line__track {
  display: grid;
  grid-template-columns: repeat(5, minmax(280px, 1fr));
  gap: 20px;
  max-width: var(--container);
  margin: 0 auto;
}

.chapter {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 4px;
  padding: 32px 24px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 800ms var(--ease-cinema), background 800ms var(--ease-cinema), transform 800ms var(--ease-cinema);
  min-height: 380px;
}
.chapter:hover {
  border-color: var(--gold-dim);
  background: var(--surface-hi);
  transform: translateY(-4px);
}
.chapter--current {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--surface-hi) 0%, var(--surface) 100%);
  box-shadow: 0 12px 60px -20px var(--gold-glow);
}

.chapter__year {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}
.chapter__year strong { font-weight: 500; color: var(--gold-bright); }

.chapter__company {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.chapter__role {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 300;
  font-variation-settings: "opsz" 36;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.chapter__where {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.chapter__body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.chapter__chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.chapter__chips li {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border: 1px solid var(--surface-line);
  border-radius: 2px;
  color: var(--text-soft);
}
.chapter--current .chapter__chips li { border-color: var(--gold-dim); color: var(--gold-bright); }

@media (max-width: 1280px) {
  .line__track { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .line__track { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .line__track { grid-template-columns: 1fr; }
}

/* ===================================================================
   CHAPTER III — THE STACK (skills)
   =================================================================== */
.stack__bg-text {
  position: absolute;
  top: 50%; left: -2vw;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(6rem, 14vw, 14rem);
  letter-spacing: -0.04em;
  color: var(--surface);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.stack__grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 64px;
}

.stack__col-head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--surface-line);
  margin-bottom: 24px;
}
.stack__col-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--gold);
  display: block;
  margin-bottom: 8px;
}
.stack__col-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stack__list {
  display: flex; flex-direction: column;
}
.stack__list li {
  position: relative;
  padding: 18px 0;
  border-bottom: 1px solid var(--surface-line);
  font-size: 1rem;
  letter-spacing: -0.005em;
  color: var(--text);
  cursor: none;
  transition: padding 500ms var(--ease-cinema), color 500ms;
}
.stack__list li::before {
  content: '';
  position: absolute; left: 0; bottom: -1px;
  height: 1px; width: 0%;
  background: var(--gold);
  transition: width 800ms var(--ease-cinema);
}
.stack__list li:hover {
  padding-left: 20px;
  color: var(--gold);
}
.stack__list li:hover::before { width: 100%; }

@media (max-width: 1024px) {
  .stack__grid { grid-template-columns: 1fr 1fr; gap: 48px; }
}
@media (max-width: 720px) {
  .stack__grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ===================================================================
   CHAPTER IV — THE METHOD (manifesto)
   =================================================================== */
.method {
  text-align: center;
}
.method__halo {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 1200px; height: 1200px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 50%);
  filter: blur(80px);
}

.method__statement {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 64px auto 144px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.625rem);
  font-weight: 200;
  font-variation-settings: "opsz" 144;
  line-height: 1.32;
  letter-spacing: -0.018em;
  color: var(--text);
  font-style: italic;
}
.method__statement .word { display: inline-block; overflow: hidden; }
.method__statement .word__inner { display: inline-block; transform: translateY(110%); will-change: transform; }

.method__pillars {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.pillar {
  position: relative;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 4px;
  text-align: left;
  transition: transform 800ms var(--ease-cinema), border-color 800ms var(--ease-cinema), background 800ms var(--ease-cinema);
}
.pillar:hover {
  transform: translateY(-6px);
  border-color: var(--gold-dim);
  background: var(--surface-hi);
}
.pillar__num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 2.5rem;
  color: var(--gold);
  display: block;
  margin-bottom: 20px;
  line-height: 1;
}
.pillar__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 300;
  letter-spacing: -0.015em;
  color: var(--text);
}
.pillar p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .method__pillars { grid-template-columns: 1fr; }
}

/* ===================================================================
   CHAPTER V — THE WORK (cases)
   =================================================================== */
.work__bg-text {
  position: absolute;
  top: 20%; right: -3vw;
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(10rem, 22vw, 24rem);
  letter-spacing: -0.04em;
  color: var(--surface);
  font-style: italic;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.work__list {
  max-width: var(--container);
  margin: 0 auto;
  display: flex; flex-direction: column;
}

.case {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 48px;
  padding: 64px 0;
  border-top: 1px solid var(--surface-line);
  position: relative;
  transition: padding 600ms var(--ease-cinema);
}
.case:last-child { border-bottom: 1px solid var(--surface-line); }
.case::before {
  content: '';
  position: absolute; left: -40px; top: 50%; bottom: 0;
  width: 0; height: 0;
  background: var(--gold);
  transition: width 600ms var(--ease-cinema), height 600ms var(--ease-cinema), top 600ms var(--ease-cinema);
}
.case:hover {
  padding-left: 20px;
}
.case:hover::before {
  width: 2px; height: 80%; top: 10%;
}

.case__num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--gold);
  padding-top: 8px;
}

.case__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 300;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
}
.case__body p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 720px;
}
.case__tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 24px;
}
.case__tags li {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--gold-glow);
  color: var(--gold-bright);
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .case { grid-template-columns: 40px 1fr; gap: 20px; padding: 40px 0; }
  .case:hover { padding-left: 12px; }
}

/* ===================================================================
   CONTACT
   =================================================================== */
.contact {
  text-align: center;
  padding-bottom: 80px;
}
.contact__halo {
  position: absolute;
  left: 50%; top: 60%;
  transform: translate(-50%, -50%);
  width: 100vw; height: 100vh;
  background:
    radial-gradient(circle at 50% 60%, var(--gold-glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 40%, var(--teal-glow) 0%, transparent 40%);
  filter: blur(60px);
}
.contact .chapter-label {
  position: relative; z-index: 2;
  justify-content: center;
}
.contact__title {
  position: relative; z-index: 2;
  margin: 40px 0 28px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 200;
  font-variation-settings: "opsz" 144;
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--text);
}
.contact__title em {
  font-style: italic; font-weight: 200; color: var(--gold);
}
.contact__lede {
  position: relative; z-index: 2;
  max-width: 640px; margin: 0 auto 64px;
  font-size: 1.125rem; line-height: 1.55;
  color: var(--text-soft);
}

.contact__cta {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 18px;
  padding: 26px 48px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold-glow);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.015em;
  color: var(--text);
  transition: background 600ms var(--ease-cinema), transform 600ms var(--ease-cinema);
  will-change: transform;
}
.contact__cta:hover {
  background: rgba(201, 169, 110, 0.18);
}
.contact__cta-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-deep);
  transition: transform 600ms var(--ease-cinema);
}
.contact__cta:hover .contact__cta-arrow { transform: rotate(45deg); }

.contact__links {
  position: relative; z-index: 2;
  margin: 104px auto 0;
  max-width: 720px;
  text-align: left;
}
.contact__links li {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--surface-line);
  align-items: center;
  font-size: 1.0625rem;
}
.contact__links li:last-child { border-bottom: 1px solid var(--surface-line); }
.contact__links-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact__links a {
  color: var(--text);
  position: relative;
  transition: color 400ms var(--ease-cinema);
}
.contact__links a:hover { color: var(--gold); }

@media (max-width: 640px) {
  .contact__cta {
    padding: 20px 32px;
    font-size: 1.125rem;
    gap: 14px;
    width: 100%;
    max-width: 380px;
    justify-content: center;
  }
  .contact__cta-arrow { width: 30px; height: 30px; }
  .contact__links li { grid-template-columns: 1fr; gap: 4px; }
}

/* ===================================================================
   FOOTER
   =================================================================== */
.footer {
  padding: 48px var(--pad-x-desktop);
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--surface-line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 2;
  background: var(--bg-deep);
}
.footer__mark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--text);
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.footer__back {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 400ms;
}
.footer__back:hover { color: var(--gold); }
@media (max-width: 768px) {
  .footer { padding: 32px var(--pad-x-mobile); flex-direction: column; gap: 16px; }
}

/* ===================================================================
   Animation hidden states (JS reveals)
   =================================================================== */
[data-fade], [data-reveal], [data-fade-words] {
  opacity: 0;
  transform: translateY(24px);
}
[data-beat], [data-chapter], [data-pillar], [data-case] {
  opacity: 0;
  transform: translateY(36px);
}
[data-skill] {
  opacity: 0;
  transform: translateY(12px);
}

.char {
  display: inline-block;
}
.char__inner {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}

.word { display: inline-block; overflow: hidden; }
.word__inner { display: inline-block; transform: translateY(110%); will-change: transform; }

/* ===================================================================
   Phone-sized screens
   =================================================================== */
@media (max-width: 540px) {
  .scene__head { margin-bottom: 64px; }
  .scene__title { font-size: clamp(2rem, 9vw, 3rem); }
  .scene__lede { font-size: 1rem; margin-top: 20px; }

  .hero__name { letter-spacing: -0.035em; line-height: 0.92; }
  .hero__role { font-size: 0.6875rem; gap: 4px 10px; }
  .hero__lede { font-size: 1.0625rem; }

  .beat__shadow { font-size: 9rem; }
  .beat { padding: 48px 24px; min-height: 280px; }
  .beat__num { font-size: clamp(3rem, 16vw, 4.5rem); }

  .method__statement { font-size: 1.25rem; margin-bottom: 80px; }
  .pillar { padding: 32px 24px; }

  .case__title { font-size: 1.375rem; }
  .case__body p { font-size: 0.9375rem; }

  .chapter { padding: 24px 20px; min-height: auto; }
  .chapter__role { font-size: 1.125rem; }
}

/* ===================================================================
   Reduced motion
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .bg-canvas { display: none; }
  .grain { display: none; }
  .hero__rings { display: none; }
  [data-fade], [data-reveal], [data-fade-words],
  [data-beat], [data-chapter], [data-pillar], [data-case], [data-skill] {
    opacity: 1; transform: none;
  }
  .char__inner, .word__inner { transform: none; }
  .cursor { display: none; }
  body { cursor: auto; }
}
