/* ============================================================
   AMMAR ATEF — design system
   Ink black · bone-white type · Sonic Lime accent · film grain
   (--champagne var kept as the accent hook; now chartreuse)
   ============================================================ */

:root {
  --ink: #0b0b0a;
  --ink-2: #141413;
  --cream: #f0f0ea;
  --cream-55: rgba(240, 240, 234, 0.55);
  --cream-30: rgba(240, 240, 234, 0.3);
  --hairline: rgba(240, 240, 234, 0.12);
  --champagne: #c6ff3a;
  --champagne-dim: rgba(198, 255, 58, 0.32);
  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

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

html { scroll-behavior: auto; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

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

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

img { display: block; max-width: 100%; }

/* ---------- film grain ---------- */
.grain {
  position: fixed;
  inset: -100px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-jitter 0.9s steps(4) infinite;
}
@keyframes grain-jitter {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-30px, 20px); }
  50% { transform: translate(20px, -35px); }
  75% { transform: translate(-25px, -15px); }
  100% { transform: translate(0, 0); }
}

/* ---------- custom cursor ---------- */
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: auto !important; }
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 10000;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  will-change: transform;
}
html.has-cursor .cursor-dot, html.has-cursor .cursor-ring { opacity: 1; }
.cursor-dot {
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--champagne);
}
.cursor-ring {
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid var(--cream-55);
  transition: width 0.3s, height 0.3s, margin 0.3s, border-color 0.3s, background 0.3s;
}
.cursor-ring.is-active {
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-color: var(--champagne);
  background: rgba(201, 180, 137, 0.08);
}

/* ---------- kinetic marquee ---------- */
.marquee {
  border-top: 1px solid var(--hairline);
  overflow: hidden;
  padding: 1.1rem 0;
  white-space: nowrap;
}
.marquee__track {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cream-30);
  will-change: transform;
}
.marquee__track .accent { color: var(--champagne); padding: 0 0.5em; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem var(--pad);
  mix-blend-mode: difference;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav--hidden { transform: translateY(-110%); }
.nav__brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  text-decoration: none;
}
.nav__dot { color: var(--champagne); }
.nav__links { display: flex; align-items: center; gap: 1.75rem; }
.nav__links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.25s;
}
.nav__links a:hover { opacity: 1; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--cream);
  background: transparent;
  color: var(--cream);
  padding: 0.9rem 1.9rem;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
  display: inline-block;
  text-align: center;
}
.btn:hover { background: var(--cream); color: var(--ink); }
.btn--primary { background: var(--champagne); border-color: var(--champagne); color: var(--ink); }
.btn--primary:hover { background: var(--cream); border-color: var(--cream); }
.btn--ghost { border-color: var(--hairline); }
.btn--ghost:hover { border-color: var(--cream); background: transparent; color: var(--cream); }
.btn--small { padding: 0.6rem 1.25rem; font-size: 0.7rem; }
.btn--full { width: 100%; margin-top: 0.75rem; }

/* ---------- section label ---------- */
.section-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--champagne);
  margin-bottom: 3rem;
}
.section-label::before { content: "— "; color: var(--cream-30); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh; /* fallback for browsers without svh */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 6rem var(--pad) 9rem;
  overflow: hidden;
}
/* full-bleed looping showreel behind the name */
.hero__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}
.hero__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.03);
}
/* legibility scrim — darker at top (nav) and bottom (subtitle) */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11,11,10,0.55) 0%, rgba(11,11,10,0) 22%, rgba(11,11,10,0) 62%, rgba(11,11,10,0.72) 100%),
    radial-gradient(120% 80% at 50% 50%, rgba(11,11,10,0) 45%, rgba(11,11,10,0.35) 100%);
}
.hero__title {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(4rem, 15.5vw, 15rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--cream);
  text-shadow: 0 2px 40px rgba(11, 11, 10, 0.55), 0 1px 12px rgba(11, 11, 10, 0.45);
}
.hero__subtitle {
  text-shadow: 0 1px 20px rgba(11, 11, 10, 0.7);
}
.hero__title .char { display: inline-block; will-change: transform; }
.hero__title .word { display: inline-block; white-space: nowrap; }
.hero__title .word + .word { margin-left: 0.18em; }
.hero__subtitle {
  z-index: 2;
  margin-top: 2rem;
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream-55);
  text-align: center;
}
.hero__scroll-cue {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.6rem; letter-spacing: 0.4em; color: var(--cream-30);
}
.hero__scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(var(--champagne), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- stats ---------- */
.stats {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: clamp(2.5rem, 6vw, 5rem) var(--pad);
}
.stats__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.stat { text-align: center; }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  line-height: 1;
  color: var(--champagne);
}
.stat__label {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-55);
}

/* ---------- pillars ---------- */
.pillars { padding: clamp(5rem, 12vw, 10rem) var(--pad); max-width: 1300px; margin: 0 auto; }
.pillar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: baseline;
  padding: clamp(2rem, 4.5vw, 3.5rem) 0;
  border-bottom: 1px solid var(--hairline);
}
.pillar:first-of-type { border-top: 1px solid var(--hairline); }
.pillar__index {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  color: var(--champagne-dim);
}
.pillar__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 4rem);
  line-height: 1.05;
  text-transform: uppercase;
  font-weight: 400;
}
.pillar__desc {
  grid-column: 2;
  margin-top: 0.9rem;
  max-width: 520px;
  color: var(--cream-55);
  font-size: 0.95rem;
}

/* ---------- work ---------- */
.work { padding: clamp(4rem, 10vw, 8rem) var(--pad); max-width: 1400px; margin: 0 auto; }
.work__intro { color: var(--cream-55); max-width: 460px; margin: -1.5rem 0 3rem; }
.work__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.2rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1.25rem;
}
.work__tab {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--cream-30);
  transition: color 0.3s;
  position: relative;
  padding: 0.1em 0;
}
.work__tab:hover { color: var(--cream-55); }
.work__tab[aria-selected="true"] { color: var(--cream); }
.work__tabs { position: relative; }
.work__tabline {
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--champagne);
  will-change: transform, width;
}
.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  min-height: 300px;
}
.project { cursor: pointer; }
.project__media {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
}
.project__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s;
  filter: grayscale(0.15);
}
.project:hover .project__media img { transform: scale(1.06); filter: grayscale(0); }
.project__ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(201, 180, 137, 0.12), transparent 55%),
    linear-gradient(160deg, var(--ink-2), #161410);
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--champagne-dim);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.project:hover .project__ph { transform: scale(1.03); }

.project__media--video { cursor: pointer; }
.project__media--video video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.project__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1px solid var(--cream);
  background: rgba(10, 10, 9, 0.45);
  backdrop-filter: blur(4px);
  cursor: pointer;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.project__play span {
  display: block;
  margin: 0 auto;
  width: 0; height: 0;
  border-left: 16px solid var(--cream);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  transform: translateX(3px);
}
.project__play.is-playing { opacity: 0; }
.project:hover .project__play:not(.is-playing) { transform: scale(1.08); }

.project__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 0.9rem;
}
.project__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.project__pitch {
  font-size: 0.8rem;
  color: var(--cream-55);
  text-align: right;
  max-width: 60%;
}

/* ---------- finale ---------- */
.finale {
  padding: clamp(7rem, 16vw, 14rem) var(--pad);
  text-align: center;
  border-top: 1px solid var(--hairline);
}
.finale__headline {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8.5vw, 8.5rem);
  line-height: 0.98;
  text-transform: uppercase;
  font-weight: 400;
  max-width: 1200px;
  margin: 0 auto;
}
.finale__headline .char { display: inline-block; }
.finale__headline .word { display: inline-block; white-space: nowrap; }
.finale__headline .word + .word { margin-left: 0.22em; }
.finale__headline .accent { color: var(--champagne); }
.finale__sub {
  margin: 2rem auto 3rem;
  color: var(--cream-55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.finale__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2rem var(--pad);
  border-top: 1px solid var(--hairline);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-30);
}
.footer__name { font-family: var(--font-display); font-size: 0.95rem; color: var(--cream-55); }
.footer__links { display: flex; gap: 1.75rem; }
.footer__links a { color: var(--cream-55); text-decoration: none; transition: color 0.25s; }
.footer__links a:hover { color: var(--champagne); }

/* ---------- booking modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; }
.modal.is-open { display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 5, 4, 0.8);
  backdrop-filter: blur(6px);
}
.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 2rem); /* fallback */
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ink-2);
  border: 1px solid var(--hairline);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) 0;
}
.modal__close {
  position: absolute;
  top: 0.9rem; right: 1.1rem;
  background: none; border: none;
  color: var(--cream-55);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}
.modal__close:hover { color: var(--cream); }
.modal__title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  text-transform: uppercase;
  font-weight: 400;
}
.modal__hint { color: var(--cream-55); font-size: 0.85rem; margin: 0.5rem 0 1.25rem; }
.modal__error { color: #e0705a; font-size: 0.85rem; margin-top: 0.75rem; }

#bookingForm { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.field { grid-column: span 2; display: flex; flex-direction: column; gap: 0.4rem; }
.field--half { grid-column: span 1; }
.field label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-55);
}
.field input, .field select, .field textarea {
  background: var(--ink);
  border: 1px solid var(--hairline);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 0.25s;
  border-radius: 0;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23f2ede4' fill-opacity='.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--champagne); }
.field textarea { resize: vertical; min-height: 68px; }
.field input, .field select, .field textarea { padding: 0.65rem 0.9rem; }
/* sticky submit footer — always visible without scrolling to find it */
#bookingForm .btn--full {
  grid-column: span 2;
  position: sticky;
  bottom: 0;
  width: 100%;
  margin-top: 0.25rem;
  padding: 1.05rem 1.9rem;
  background: var(--champagne);
  box-shadow: 0 -18px 20px -6px var(--ink-2);
}
.modal__error { grid-column: span 2; }

/* ---------- reveal helpers (JS sets initial state) ---------- */
.will-reveal { visibility: hidden; }
html.no-motion .will-reveal { visibility: visible; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .nav__links a[data-nav] { display: none; }
  .hero { padding-bottom: 7rem; }
  /* perf: stop the full-screen grain repaint on phones (static grain only) */
  .grain { animation: none; opacity: 0.04; }

  /* work images: 2 per row so all pieces are seen at a glance,
     half the downward scrolling */
  .work__grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .project__title { font-size: 0.85rem; }
  .project__pitch { font-size: 0.68rem; line-height: 1.35; }
  .project__play { width: 52px; height: 52px; }
  .project__play span { border-left-width: 12px; border-top-width: 7px; border-bottom-width: 7px; }
  .hero__subtitle { margin-top: 1.4rem; padding: 0 1rem; letter-spacing: 0.2em; }
  .project__info { flex-direction: column; gap: 0.25rem; }
  .project__pitch { text-align: left; max-width: 100%; }
  .field--half { grid-column: span 2; }

  /* brand tabs: wrap to multiple rows so EVERY brand is visible at once
     (no hidden side-scroll — clients must see all the work) */
  .work__tabs {
    flex-wrap: wrap;
    gap: 0.7rem 1.3rem;
    padding-bottom: 1rem;
  }
  .work__tab { flex: 0 0 auto; font-size: 1.25rem; line-height: 1.1; }

  /* booking modal becomes a full-screen sheet */
  .modal__panel {
    top: 0; left: 0;
    transform: none;
    width: 100vw;
    height: 100vh;   /* fallback */
    height: 100dvh;
    max-height: none;
    border: none;
    padding: 4rem 1.4rem 2.5rem;
  }
  .modal__close {
    top: 1rem; right: 1.1rem;
    font-size: 2.3rem;
    padding: 0.2rem 0.5rem;
  }
  .stats__row { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
  .finale__actions { flex-direction: column; align-items: stretch; padding: 0 1.5rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .hero__scroll-line { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
