/* ============================================================
   RAZVAN ILINCA — base styles (mobile-first)
   Direction-specific overrides live in styles-directions.css
   ============================================================ */

:root {
  --bg: #060606;
  --ink: #f2f0ec;
  --ink-dim: rgba(242, 240, 236, 0.55);
  --ink-faint: rgba(242, 240, 236, 0.28);
  --line: rgba(242, 240, 236, 0.14);
  --accent: #E0763A;
  --font-body: "Poppins", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-display: "Poppins", sans-serif;
  --display-weight: 400;
  --display-tracking: -0.01em;
  --display-transform: lowercase;
  --pad: clamp(20px, 5vw, 72px);
  --card-h: clamp(340px, 56svh, 560px);
  --cut-h: clamp(180px, 30svh, 300px);
  --tilt-max: 7;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* keep 16:9 cut cards narrower than small screens (snap UX) */
@media (max-width: 600px) {
  :root { --cut-h: clamp(160px, 46vw, 300px); }
}

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

html { scroll-behavior: smooth; background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

/* ---- film grain overlay ---- */
.grain {
  position: fixed;
  inset: -100px;
  z-index: 60;
  pointer-events: none;
  opacity: 0.5;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-grain="off"] .grain { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .grain { animation: grain-shift 0.9s steps(4) infinite; }
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-34px, 22px); }
  50% { transform: translate(20px, -28px); }
  75% { transform: translate(-12px, -40px); }
  100% { transform: translate(0, 0); }
}

/* ---- top nav ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--pad);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  mix-blend-mode: difference;
}
.nav-name { font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; }
.nav-logo { height: 16px; width: auto; display: block; }
.nav-links { display: flex; gap: clamp(14px, 3vw, 28px); }
.nav-links a { color: var(--ink-dim); transition: color 0.3s; padding: 14px 8px; margin: -14px -8px; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 560px) {
  .nav-links a.nav-optional { display: none; }
}

/* ---- burger + fullscreen menu (mobile) ---- */
.nav-burger { display: none; }
.mobile-menu { display: none; }
@media (max-width: 600px) {
  .nav-links { display: none; }
  /* timecode: out of the top bar, docked above the bottom timeline */
  .nav-tc {
    position: fixed;
    right: 14px;
    bottom: calc(44px + env(safe-area-inset-bottom));
    font-size: 12px !important;
    font-weight: 400 !important;
    color: var(--ink-dim);
  }
  .nav-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    width: 48px;
    height: 44px;
    padding: 10px 4px;
    margin: -10px 0;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .nav-burger span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.35s var(--ease-out), width 0.35s var(--ease-out);
  }
  .nav-burger span:last-child { width: 15px; }
  body.menu-open .nav-burger span:first-child { transform: translateY(3.75px) rotate(45deg); }
  body.menu-open .nav-burger span:last-child { width: 24px; transform: translateY(-3.75px) rotate(-45deg); }
  .mobile-menu {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 48;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 0 var(--pad);
    background: rgba(6, 6, 6, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
  }
  .mobile-menu .mm-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 16px;
  }
  .mobile-menu a {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    text-transform: var(--display-transform);
    letter-spacing: var(--display-tracking);
    font-size: clamp(34px, 11vw, 52px);
    line-height: 1.3;
    color: var(--ink);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  }
  body.menu-open .mobile-menu { opacity: 1; pointer-events: auto; }
  body.menu-open .mobile-menu a { opacity: 1; transform: translateY(0); }
  body.menu-open .mobile-menu a:nth-of-type(2) { transition-delay: 0.06s; }
  body.menu-open .mobile-menu a:nth-of-type(3) { transition-delay: 0.12s; }
  body.menu-open .mobile-menu a:nth-of-type(4) { transition-delay: 0.18s; }
  body.menu-open { overflow: hidden; }
}

/* ---- hero ---- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
  position: relative;
  overflow: hidden;
}
.hero > *:not(.hero-bg):not(.hero-wall):not(.hero-nle) { position: relative; z-index: 1; }
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-bg img {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(54px) saturate(1.35) brightness(0.62) contrast(1.05);
  transform: scale(1.06);
  opacity: 0;
  transition: opacity 3s ease;
}
.hero-bg img.on { opacity: 0.55; }
@media (prefers-reduced-motion: no-preference) {
  .hero-bg img { animation: bokeh-drift 26s ease-in-out infinite alternate; }
}
@keyframes bokeh-drift {
  from { transform: scale(1.06) translate(0, 0); }
  to { transform: scale(1.14) translate(-1.5%, 2%); }
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6,6,6,0.62), rgba(6,6,6,0.18) 38%, rgba(6,6,6,0.94) 92%),
    radial-gradient(110% 90% at 28% 42%, transparent 30%, rgba(6,6,6,0.55) 100%);
}
html[data-bokeh="off"] .hero-bg { display: none; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.3vw, 12px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: clamp(20px, 4svh, 44px);
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-eyebrow::before {
  content: "";
  width: clamp(24px, 5vw, 56px);
  height: 1px;
  background: var(--ink-faint);
}
.hero-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: var(--display-transform);
  letter-spacing: var(--display-tracking);
  font-size: clamp(58px, 14.5vw, 196px);
  line-height: 0.96;
}
.hero-name .name-line { display: block; overflow: hidden; }
.hero-name .name-inner { display: block; }
.hero-name em { font-style: normal; }

.hero-roles {
  margin-top: clamp(26px, 5svh, 52px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
  font-size: clamp(14px, 2vw, 19px);
  font-weight: 350;
  color: var(--ink-dim);
}
.hero-roles .role-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* hero intro animation */
@media (prefers-reduced-motion: no-preference) {
  body[data-intro] .hero-eyebrow,
  body[data-intro] .hero-roles { opacity: 0; }
  body[data-intro] .name-inner { transform: translateY(110%); }
  body.intro-play .hero-eyebrow { animation: fade-in 1.1s var(--ease-out) 1.5s forwards; }
  body.intro-play .hero-roles { animation: fade-up 1.1s var(--ease-out) 1.75s forwards; }
  body.intro-play .name-line:nth-child(1) .name-inner { animation: line-up 1.3s var(--ease-out) 0.45s forwards; }
  body.intro-play .name-line:nth-child(2) .name-inner { animation: line-up 1.3s var(--ease-out) 0.62s forwards; }
}
@keyframes line-up { to { transform: translateY(0); } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---- sections ---- */
.section { padding: clamp(72px, 14svh, 150px) 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 0 var(--pad);
  margin-bottom: clamp(28px, 5svh, 56px);
}
.section-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: var(--display-transform);
  letter-spacing: var(--display-tracking);
  font-size: clamp(34px, 7vw, 84px);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.section-title .index {
  display: none;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-weight: 400;
}
.section-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
@media (max-width: 560px) { .section-hint .hint-long { display: none; } }
/* "Hover" on pointer devices, "Tap" on touch */
.section-hint .hint-touch { display: none; }
@media (hover: none) {
  .section-hint .hint-mouse { display: none; }
  .section-hint .hint-touch { display: inline; }
}

/* reveal on scroll */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
  .reveal.in { opacity: 1; transform: none; }
}

/* ---- carousel ---- */
.carousel {
  position: relative;
  overflow: hidden;
  cursor: grab;
  perspective: 1200px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.carousel.dragging { cursor: grabbing; }
.track {
  display: flex;
  gap: clamp(14px, 2.4vw, 28px);
  padding: 10px var(--pad);
  width: max-content;
  will-change: transform;
}

/* poster card */
.card {
  position: relative;
  height: var(--card-h);
  flex: none;
  overflow: hidden;
  background: #101010;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
}
.card img {
  height: 100%;
  width: auto;
  object-fit: cover;
  transition: opacity 0.55s var(--ease-out), transform 0.8s var(--ease-out), filter 0.55s var(--ease-out);
  pointer-events: none;
}
.card-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: clamp(16px, 2vw, 26px);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
  background: linear-gradient(to top, rgba(4,4,4,0.55), rgba(4,4,4,0.1) 55%, transparent);
}
.card-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: auto;
  padding-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.card-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  text-transform: var(--display-transform);
  letter-spacing: var(--display-tracking);
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.08;
  transform: translateY(10px);
  transition: transform 0.5s var(--ease-out);
}
.card-role {
  font-size: clamp(13px, 1.5vw, 15px);
  color: var(--ink);
  font-weight: 500;
  transform: translateY(10px);
  transition: transform 0.5s var(--ease-out) 0.05s;
}
.card-meta {
  font-size: 12px;
  color: var(--ink-dim);
  transform: translateY(10px);
  transition: transform 0.5s var(--ease-out) 0.08s;
}
.card-watch {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  display: none;
  align-items: center;
  gap: 8px;
  transform: translateY(10px);
  transition: transform 0.5s var(--ease-out) 0.1s;
}
.card[data-haslink] .card-watch { display: inline-flex; }
.card-watch { color: var(--accent); }
.card-watch::after { content: "→"; font-size: 12px; }

/* tap-reveal state (touch) — always active */
.card.revealed img {
  opacity: 0.18;
  filter: grayscale(1);
  transform: scale(1.045);
}
.card.revealed .card-info { opacity: 1; }
.card.revealed .card-title,
.card.revealed .card-role,
.card.revealed .card-meta,
.card.revealed .card-watch { transform: translateY(0); }

/* hover reveal only on real pointers — on touch, iOS "sticks" :hover to
   whatever a swipe brushed, fighting the two-tap model */
@media (hover: hover) {
  .card:hover img {
    opacity: 0.18;
    filter: grayscale(1);
    transform: scale(1.045);
  }
  .card:hover .card-info { opacity: 1; }
  .card:hover .card-title,
  .card:hover .card-role,
  .card:hover .card-meta,
  .card:hover .card-watch { transform: translateY(0); }
}

/* poster slot (drag-and-drop placeholder for missing one-sheets) */
.card image-slot { display: block; height: 100%; }
.card.revealed image-slot { opacity: 0.35; }
@media (hover: hover) {
  .card:hover image-slot { opacity: 0.35; }
}
.card image-slot { transition: opacity 0.55s var(--ease-out); }

/* cut card (16:9) */
.cut-card { height: var(--cut-h); }
.cut-card img { aspect-ratio: 16/9; height: 100%; }
.cut-card .play {
  position: absolute;
  top: 50%; left: 50%;
  width: 58px; height: 58px;
  transform: translate(-50%, -50%) scale(0.85);
  border: 1px solid rgba(242,240,236,0.6);
  border-radius: 50%;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
.cut-card .play::after {
  content: "";
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent var(--accent);
  margin-left: 3px;
}
.cut-card.revealed .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (hover: hover) {
  .cut-card:hover .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* progress line under carousels */
.car-progress {
  margin: 22px var(--pad) 0;
  height: 1px;
  background: var(--line);
  position: relative;
}
.car-progress .bar {
  position: absolute;
  top: -0.5px; left: 0;
  height: 2px;
  width: 60px;
  background: var(--accent);
  transition: none;
}

/* ---- one card per screen on small screens (paged snap) ----
   Keep LAST in this file: must out-cascade the .card base rules above. */
@media (max-width: 600px) {
  .track { align-items: center; gap: 18px; }
  .card { height: auto; width: calc(100vw - 2 * var(--pad)); }
  .card img { width: 100%; height: auto; }
  .cut-card { height: auto; width: calc(100vw - 2 * var(--pad)); }
  .cut-card img { width: 100%; height: auto; }
}
