/* ============================================================
   HABIBULLAH — cinematic scroll portfolio
   ink black · emerald · cream — graded like a film
   ============================================================ */

:root {
  color-scheme: dark;
  --ink: #050807;
  --ink-2: #0b120e;
  --cream: #f2ede3;
  --muted: #8f9b93;
  --em: #1be68f;
  --em-deep: #0b6b45;
  --line: rgba(242, 237, 227, 0.12);
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--em); color: var(--ink); }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--em);
  outline-offset: 3px;
}

/* ---------- grain ---------- */
.grain {
  position: fixed;
  inset: -40px;
  z-index: 60;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* static grain: the animated version costs a full-screen compositor
     pass every frame on weaker GPUs */
}

/* ---------- header ---------- */
.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--pad) 1.6rem;
  background: linear-gradient(rgba(5, 8, 7, 0.75), transparent);
  pointer-events: none;
}
.site-head a { pointer-events: auto; }

.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--cream);
}
.brand-dot { color: var(--em); }

.head-nav {
  display: flex;
  gap: 1.75rem;
}
.head-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--cream);
  opacity: 0.75;
  transition: opacity 0.25s ease;
}
.head-nav a:hover { opacity: 1; }

.timecode {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--cream);
  opacity: 0.75;
  min-width: 12ch;
  text-align: right;
}

/* ---------- slates (film markers) ---------- */
.slate {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.slate::before {
  content: "▸ ";
  color: var(--em);
}
.slate-tl { position: absolute; top: 5.5rem; left: var(--pad); z-index: 5; }
.slate-br { position: absolute; bottom: 2rem; right: var(--pad); z-index: 5; }
.slate-section {
  padding: 0 0 1.5rem;
}

/* ============================================================
   SCENE 00 · HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* JS hides this; without JS it is the opening frame */
.hero-static-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: brightness(0.85);
}
body.js .hero-static-fallback { display: none; }

/* soft shade so the type stays readable over the footage */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(rgba(5, 8, 7, 0.35), transparent 30%, transparent 65%, rgba(5, 8, 7, 0.55)),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(5, 8, 7, 0.5) 100%);
}

.hero-copy {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 var(--pad);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 1.2vw, 0.8rem);
  letter-spacing: 0.42em;
  color: var(--em);
  margin-bottom: 1.2rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.4rem, 16.5vw, 17rem);
  line-height: 0.86;
  letter-spacing: 0.015em;
  color: var(--cream);
  text-shadow: 0 0 40px rgba(27, 230, 143, 0.2);
  white-space: nowrap;
}
.hero-title .ltr { display: inline-block; will-change: transform; }

.hero-sub {
  margin-top: 1.6rem;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  color: var(--muted);
}

.hero-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}
.cue-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--em), transparent);
  animation: cue-drop 1.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue-drop {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); }
  100% { transform: scaleY(0); }
}

/* ============================================================
   SCENE 01 · NUMBERS
   ============================================================ */
.numbers {
  position: relative;
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-left: 1px solid var(--line);
  padding-left: 1.4rem;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 7.5vw, 6.5rem);
  line-height: 1;
  color: var(--cream);
}
.stat-value .count { color: var(--em); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--muted);
}

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  background: var(--ink);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-roll 28s linear infinite;
}
.marquee-rev .marquee-track { animation-direction: reverse; }
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  letter-spacing: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 237, 227, 0.35);
  white-space: nowrap;
}
@keyframes marquee-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   SCENE 02 · THREE ACTS  (pinned)
   ============================================================ */
.acts {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
}

/* grade is baked into the frames — no per-frame CSS filter cost */
.acts-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.acts-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(5, 8, 7, 0.55), rgba(5, 8, 7, 0.85)),
    radial-gradient(80% 60% at 50% 50%, rgba(11, 107, 69, 0.22), transparent 75%);
}

.acts .slate-section {
  position: absolute;
  top: 5.5rem;
  left: var(--pad);
  z-index: 4;
  padding: 0;
}

.acts-stage {
  position: relative;
  z-index: 3;
  height: 60vh;
}

.act {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 60rem;
  opacity: 0;
  visibility: hidden;
}
.act.is-on { opacity: 1; visibility: visible; }

.act-no {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  color: var(--em);
  margin-bottom: 0.8rem;
}

.act-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.4rem, 10vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: 0.01em;
  color: var(--cream);
  margin-bottom: 1.4rem;
}

.act-text {
  max-width: 34rem;
  font-size: clamp(0.98rem, 1.5vw, 1.15rem);
  color: var(--muted);
}

/* ============================================================
   SCENE 03 · WORK  (sticky scrub backdrop)
   ============================================================ */
.work {
  position: relative;
  background: var(--ink);
}

.work-bg-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.work-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.work-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(5, 8, 7, 0.5), rgba(5, 8, 7, 0.92)),
    radial-gradient(90% 70% at 50% 30%, rgba(11, 107, 69, 0.18), transparent 70%);
}

.work-content {
  position: relative;
  z-index: 2;
  margin-top: -100vh;
  padding: clamp(5rem, 14vh, 9rem) var(--pad) clamp(4rem, 10vh, 7rem);
}

.work-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.4rem, 11vw, 11rem);
  line-height: 0.88;
  color: var(--cream);
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

/* featured cards */
.featured {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: clamp(3rem, 8vh, 5.5rem);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.8rem 1.6rem 2rem;
  border: 1px solid var(--line);
  background: rgba(11, 18, 14, 0.88);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s ease, background 0.35s ease;
}
.card:hover {
  transform: translateY(-8px) rotate(-0.4deg);
  border-color: var(--em);
  background: rgba(11, 18, 14, 0.9);
}

.card-no {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--em);
}
.card-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 0.95;
  color: var(--cream);
}
.card-pitch {
  font-size: 0.95rem;
  color: var(--muted);
  flex-grow: 1;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}
.card-arrow {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  font-size: 1.2rem;
  color: var(--em);
  transition: transform 0.35s ease;
}
.card:hover .card-arrow { transform: translate(4px, -4px); }

/* index rows */
.index {
  border-top: 1px solid var(--line);
}
.row {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto auto;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.05rem 0.25rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease, padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.row:hover {
  background: rgba(27, 230, 143, 0.06);
  padding-left: 1rem;
}

.row-no {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--em);
}
.row-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  line-height: 1;
  color: var(--cream);
  transition: color 0.25s ease;
}
.row:hover .row-name { color: var(--em); }
.row-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.row-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  transition: color 0.25s ease;
}
.row:hover .row-link { color: var(--cream); }

/* ============================================================
   SCENE 04 · FINALE
   ============================================================ */
.finale {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 14vh, 9rem) var(--pad) 0;
  overflow: hidden;
}

.finale-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.finale-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(5, 8, 7, 0.62), rgba(5, 8, 7, 0.94)),
    radial-gradient(80% 60% at 50% 45%, rgba(11, 107, 69, 0.25), transparent 75%);
}

.finale .slate-section {
  position: relative;
  z-index: 2;
}

.finale-copy {
  position: relative;
  z-index: 2;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.finale-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 9.5vw, 9rem);
  line-height: 0.9;
  color: var(--cream);
  margin-bottom: 1.6rem;
}

.finale-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 32rem;
  margin-bottom: 2.4rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  padding: 1.05rem 2.2rem;
  border: 1px solid var(--em);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.cta-primary {
  background: var(--em);
  color: var(--ink);
  font-weight: 500;
}
.cta-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(27, 230, 143, 0.35);
}
.cta-ghost {
  color: var(--cream);
  border-color: var(--line);
}
.cta-ghost:hover {
  transform: translateY(-3px);
  border-color: var(--em);
  color: var(--em);
}

/* footer */
.site-foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  margin-top: clamp(4rem, 10vh, 7rem);
  padding: 1.6rem 0 1.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.foot-links {
  display: flex;
  gap: 1.75rem;
}
.foot-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  transition: color 0.25s ease;
}
.foot-links a:hover { color: var(--em); }
.foot-credit {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  opacity: 0.7;
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 900px) {
  .numbers-grid { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; }
  .row { grid-template-columns: 2.5rem 1fr auto; }
  .row-tag { display: none; }
  .head-nav { display: none; }
}

@media (max-width: 560px) {
  .hero-title { white-space: normal; line-height: 0.92; font-size: clamp(2.8rem, 15vw, 5rem); }
  .hero-sub br { display: none; }
  .numbers-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .stat { padding-left: 1rem; }
  .stat-value { font-size: clamp(2.6rem, 13vw, 4rem); }
  .stat-label { letter-spacing: 0.14em; font-size: 0.62rem; }
  .timecode { display: none; }
  .slate-tl { top: 4.5rem; }
  .slate-br { display: none; }
  .act-title { font-size: clamp(2.6rem, 15vw, 5rem); }
  .work-heading { font-size: clamp(2.6rem, 14vw, 5rem); }
  .finale-title { font-size: clamp(2.2rem, 11.5vw, 4rem); }
  .card { padding: 1.4rem 1.2rem 1.6rem; }
  .row { grid-template-columns: 2rem 1fr auto; gap: 0.9rem; }
  .row-link { font-size: 0.62rem; }
  .cta { padding: 0.95rem 1.5rem; font-size: 0.72rem; }
  .foot-credit { display: none; }
}

/* ============================================================
   reduced motion — everything readable, nothing moves
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain,
  .cue-line,
  .marquee-track { animation: none; }
  .act { position: static; opacity: 1; visibility: visible; margin-bottom: 3rem; }
  .acts { height: auto; padding-top: 8rem; padding-bottom: 4rem; }
  .acts-stage { height: auto; }
  .card, .row, .cta { transition: none; }
}
