/* ==========================================================
   Fahmid Hasan — Video Editor Portfolio
   Clean, cinematic, warm-dark. Tokens first.
   ========================================================== */
:root {
  /* Light "paper" is the default; [data-theme="dim"] is the softened warm-gray
     alternative. Shared with the Hub and Lab (assets/brand.css there):
     keep the neutrals and world colours in step. theme.js sets data-theme. */
  color-scheme: light;
  --bg: #f4efe6;
  --bg-2: #ede6da;
  --surface: #e9e2d5;          /* image placeholders */
  --line: rgba(var(--ink-rgb), 0.12);
  --line-2: rgba(var(--ink-rgb), 0.22);
  --text: #2a2520;
  --text-soft: #463f37;
  --muted: #625a50;
  --faint: #6e655a;
  --accent: #8a5a16;           /* deep amber: text-safe on cream */
  --accent-bright: #c08a3e;    /* decorative lines and dots */
  --accent-ink: #fbf6ee;       /* text on an accent fill */
  --sweep: #c99446;
  --shadow: 0 40px 80px -40px rgba(60, 44, 24, 0.45);
  --ink-rgb: 42, 37, 32;
  --paper-rgb: 244, 239, 230;
  --paper2-rgb: 237, 230, 218;
  --leak-a: rgba(192, 138, 62, 0.13);
  --leak-b: rgba(196, 110, 62, 0.08);
  /* shared names used by the Hub · Studio · Lab switcher and theme toggle */
  --paper: var(--bg);
  --on-accent: #fbf6ee;
  --studio: #8a5a16;
  --studio-bright: #c08a3e;
  --studio-rgb: 192, 138, 62;
  --lab: #2c6650;
  --lab-bright: #4f9a7a;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 18px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="dim"],
.player, .viewer {
  /* Dim theme — and the video player / photo viewer in both themes,
     which keep a dark stage because that is how film is watched. */
  color-scheme: dark;
  --bg: #24211d;
  --bg-2: #292520;
  --surface: #2d2925;
  --text: #e6dfd3;
  --text-soft: #d2c9bc;
  --muted: #a69d90;
  --faint: #9c9386;
  --accent: #e0a95c;
  --accent-bright: #e0a95c;
  --accent-ink: #24190a;
  --sweep: #fff3dc;
  --shadow: 0 40px 80px -36px rgba(8, 6, 4, 0.7);
  --ink-rgb: 230, 223, 211;
  --paper-rgb: 36, 33, 29;
  --paper2-rgb: 41, 37, 32;
  --leak-a: rgba(224, 169, 92, 0.11);
  --leak-b: rgba(196, 92, 52, 0.08);
  --on-accent: #1f1a14;
  --studio: #e0a95c;
  --studio-bright: #e0a95c;
  --studio-rgb: 224, 169, 92;
  --lab: #8fd3ac;
  --lab-bright: #8fd3ac;
  --line: rgba(230, 223, 211, 0.1);
  --line-2: rgba(230, 223, 211, 0.18);
  --paper: #24211d;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
/* Scroll lock (works on iOS too): JS pins the body at the current offset */
body.is-locked { position: fixed; left: 0; right: 0; overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--faint); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }

.skip { position: absolute; left: -999px; top: 1rem; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; border-radius: 8px; }
.skip:focus { left: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  height: 3rem; padding: 0 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem; font-weight: 500;
  border: 1px solid var(--line-2);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn svg { font-size: 1.05rem; transition: transform 0.3s var(--ease); }
.btn:active { transform: scale(0.97); }
@media (hover: hover) { .btn:hover svg { transform: translateX(3px); } }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost:hover { border-color: var(--text); }
.btn-small { height: 2.5rem; padding: 0 1.1rem; font-size: 0.88rem; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
}
/* The glass lives on a pseudo-element: a backdrop-filter on .header itself
   would trap the fixed mobile menu inside the 72px bar. */
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(var(--paper-rgb), 0.86);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  opacity: 0; transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.header.is-scrolled::before { opacity: 1; }
.nav { position: relative; z-index: 2; }
.brand, .nav-toggle { position: relative; z-index: 2; }
.nav { height: 100%; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line-2);
  font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--accent);
}
.nav-links { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; gap: 2rem; }
.nav-links a { font-size: 0.92rem; color: var(--muted); transition: color 0.25s; }
.nav-links a:hover { color: var(--text); }
.nav-cta-mobile { display: none; }
.footer-world em { font-family: var(--serif); font-style: italic; color: var(--lab); font-size: 1.1em; }
.nav-toggle { display: none; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.nav-toggle span { width: 22px; height: 1.5px; border-radius: 2px; background: var(--text); transition: transform 0.4s var(--ease); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(1.5rem, 4vw, 3.5rem)) 0 clamp(4rem, 8vw, 6rem);
  overflow: hidden;
}
.hero-glow {
  position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(var(--studio-rgb), 0.16), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin: 0 0 1.75rem; padding: 0.4rem 0.9rem 0.4rem 0.75rem;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 0.82rem; color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 4px rgba(var(--studio-rgb), 0.2); }
.hero-title {
  margin: 0;
  font-size: clamp(3.4rem, 7.4vw, 6.6rem);
  line-height: 1.0;
  font-weight: 500;
  letter-spacing: -0.035em;
}
.hero-title em { font-size: 1.08em; letter-spacing: -0.01em; }
.hero-lede { margin: 1.5rem 0 0; max-width: 30rem; font-size: 1.2rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3rem);
  margin: 3rem 0 0; padding-top: 1.75rem; border-top: 1px solid var(--line);
}
.hero-stats div { margin: 0; }
.hero-stats dt { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; }
.hero-stats dd { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--faint); }

.hero-figure { margin: 0; justify-self: end; width: 100%; max-width: 460px; }
.hero-frame {
  position: relative; aspect-ratio: 3 / 4;
  border-radius: 24px; overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.hero-frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  transform: scale(1.02);
  transition: transform 1.6s var(--ease);
}
@media (hover: hover) { .hero-figure:hover .hero-frame img { transform: scale(1.05); } }
.hero-frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(20, 16, 12, 0.32));
  pointer-events: none;
}
.corner { position: absolute; width: 22px; height: 22px; border-color: rgba(255, 255, 255, 0.75); border-style: solid; border-width: 0; z-index: 2; }
.corner.tl { top: 16px; left: 16px; border-top-width: 1.5px; border-left-width: 1.5px; }
.corner.tr { top: 16px; right: 16px; border-top-width: 1.5px; border-right-width: 1.5px; }
.corner.bl { bottom: 16px; left: 16px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.corner.br { bottom: 16px; right: 16px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.rec {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.6rem; border-radius: 6px;
  background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; color: #fff;
}
.rec i { width: 7px; height: 7px; border-radius: 50%; background: #ff4d3d; animation: blink 1.4s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.hero-caption { display: flex; justify-content: space-between; margin-top: 0.9rem; font-size: 0.85rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: clamp(4.5rem, 8vw, 7rem) 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 44rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head-row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.section-head-row > div { max-width: 44rem; }
.kicker { margin: 0 0 1rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.section-title { margin: 0; font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.05; font-weight: 500; letter-spacing: -0.03em; }
.section-sub { margin: 1.1rem 0 0; color: var(--muted); max-width: 36rem; }

/* ---------- Films ---------- */
.films { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 3vw, 2rem); }
.film { display: block; }
.film-featured { grid-column: 1 / -1; }
.film-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.film-featured .film-media { aspect-ratio: 16 / 9; }
.film-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
@media (hover: hover) { .film:hover .film-media img { transform: scale(1.04); } }
.play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.9);
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(250, 246, 239, 0.92); color: #2a2520; box-shadow: 0 8px 24px -10px rgba(20, 16, 12, 0.5);
  opacity: 0; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.play svg { width: 22px; height: 22px; fill: currentColor; stroke: none; margin-left: 3px; }
@media (hover: hover) { .film:hover .play, .reel:hover .play { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.film:focus-visible .play, .reel:focus-visible .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.film, .reel { transition: transform 0.35s var(--ease); }
.film:active, .reel:active { transform: scale(0.985); }
.film-info {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: start;
  padding: 1.25rem 0.25rem 0;
}
.film-index { padding-top: 0.35rem; }
.film-info-plain { grid-template-columns: 1fr auto; }
.film-cat { margin: 0 0 0.25rem; font-size: 0.8rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.film-title { margin: 0; font-size: 1.35rem; font-weight: 500; letter-spacing: -0.015em; }
.film-featured .film-title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.film-desc { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; }
.film-arrow {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); color: var(--muted);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
@media (hover: hover) { .film:hover .film-arrow { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } }

/* ---------- Reels ---------- */
.reel-controls { display: flex; gap: 0.5rem; flex-shrink: 0; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); font-size: 1.15rem; transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.icon-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.reels-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 22vw, 280px); gap: 1.25rem;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  padding: 0 max(var(--gutter), calc((100% - var(--max)) / 2)) 0.5rem;
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
}
.reels-track::-webkit-scrollbar { display: none; }
.reel { scroll-snap-align: start; }
.reel-media {
  position: relative; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.reel-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
@media (hover: hover) { .reel:hover .reel-media img { transform: scale(1.05); } }
.reel-client { margin: 1rem 0 0.2rem; font-size: 0.78rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.reel-title { margin: 0; font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.about-body > p { margin: 0; font-size: 1.15rem; color: var(--muted); line-height: 1.7; }






/* ---------- Contact ---------- */
.contact { text-align: center; background: radial-gradient(60% 80% at 50% 100%, rgba(var(--studio-rgb), 0.14), transparent 70%), var(--bg); }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-title { margin: 0; font-size: clamp(3rem, 8vw, 6.5rem); line-height: 1; font-weight: 500; letter-spacing: -0.04em; }
.contact .section-sub { margin-inline: auto; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 2.5rem; padding: 1rem 1.6rem; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 500;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
  overflow-wrap: anywhere;
}
.contact-mail:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.socials { list-style: none; display: flex; gap: 1.75rem; margin: 2.25rem 0 0; padding: 0; }
.socials a { font-size: 0.92rem; color: var(--muted); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: color 0.25s, border-color 0.25s; }
.socials a:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; padding: 1.75rem 0; font-size: 0.85rem; color: var(--faint); }
.footer p { margin: 0; }
.footer a:hover { color: var(--text); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translate3d(0, 16px, 0); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: 0.08s; }
.hero .reveal:nth-child(3) { transition-delay: 0.16s; }
.hero .reveal:nth-child(4) { transition-delay: 0.24s; }
.hero .reveal:nth-child(5) { transition-delay: 0.32s; }
.hero-figure.reveal { transition-delay: 0.12s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .rec i { animation: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { justify-self: center; max-width: 440px; order: -1; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav .theme-toggle { margin-left: auto; }
  .m-on .nav .theme-toggle { margin-left: 0; }
  .nav-links {
    position: fixed; inset: 0; z-index: 1; margin: 0;
    height: 100vh; height: 100dvh;
    flex-direction: column; gap: 0;
    padding: calc(var(--header-h) + 1rem) var(--gutter) calc(2rem + env(safe-area-inset-bottom));
    background: var(--bg);
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    opacity: 0; visibility: hidden;
    clip-path: inset(0 0 100% 0);
    transition: opacity 0.35s var(--ease), clip-path 0.55s var(--ease), visibility 0s linear 0.55s;
  }
  .nav-links.is-open {
    opacity: 1; visibility: visible; clip-path: inset(0 0 0 0);
    transition: opacity 0.35s var(--ease), clip-path 0.55s var(--ease), visibility 0s;
  }
  .nav-links li {
    border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(14px);
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
  }
  .nav-links.is-open li { opacity: 1; transform: none; }
  .nav-links.is-open li:nth-child(1) { transition-delay: 0.08s; }
  .nav-links.is-open li:nth-child(2) { transition-delay: 0.12s; }
  .nav-links.is-open li:nth-child(3) { transition-delay: 0.16s; }
  .nav-links.is-open li:nth-child(4) { transition-delay: 0.20s; }
  .nav-links.is-open li:nth-child(5) { transition-delay: 0.24s; }
  .nav-links.is-open li:nth-child(6) { transition-delay: 0.28s; }
  .nav-links.is-open li:nth-child(7) { transition-delay: 0.32s; }
  .nav-links a { display: block; padding: 1.05rem 0; font-size: 1.6rem; letter-spacing: -0.02em; color: var(--text); }
  .nav-links a:active { color: var(--accent); }
  .nav-cta-mobile { display: block; }
  .nav-cta-mobile a { color: var(--accent); }
  body.nav-open .header::before { opacity: 0; }
  .films { grid-template-columns: 1fr; }
  .film-featured .film-media { aspect-ratio: 16 / 9; }
  .film-arrow { display: none; }
  .film-info { grid-template-columns: auto 1fr; }
  .film-info-plain { grid-template-columns: 1fr; }
  .section-head-row { flex-direction: column; align-items: flex-start; }
  .reel-controls { display: none; }
  .reels-track { grid-auto-columns: 62vw; }
  .services { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 0.5rem; }
}

/* ---------- Cards as buttons + previews ---------- */
.film, .reel { width: 100%; padding: 0; text-align: left; cursor: pointer; }
.film-media, .reel-media { isolation: isolate; }
.preview {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.6s var(--ease); pointer-events: none;
}
.preview.is-playing { opacity: 1; }
@media (hover: hover) { .film:hover .film-media .preview, .reel:hover .reel-media .preview { transform: scale(1.04); transition: opacity 0.6s var(--ease), transform 1s var(--ease); } }
.play { z-index: 2; }

/* ---------- Motion ---------- */
.motion-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 3vw, 2rem); }

/* ---------- Player ---------- */
.player { color: var(--text); position: fixed; inset: 0; z-index: 100; overscroll-behavior: contain; display: grid; place-items: center; padding: clamp(0.75rem, 3vw, 2.5rem); }
.player[hidden] { display: none; }
.player-backdrop { position: absolute; inset: 0; background: rgba(28, 26, 23, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.3s var(--ease); }
.player-box { position: relative; width: min(100%, 1200px); max-height: 100%; display: flex; flex-direction: column; gap: 1rem; opacity: 0; transform: translateY(12px) scale(0.985); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.player.is-open .player-backdrop { opacity: 1; }
.player.is-open .player-box { opacity: 1; transform: none; }
.player-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.player-cat { margin: 0 0 0.2rem; font-size: 0.78rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.player-title { margin: 0; font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 500; }
.player-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.player-link { font-size: 0.88rem; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.player-link:hover { color: var(--text); border-color: var(--accent); }
.player-link[hidden] { display: none; }
.player-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #100f0d; box-shadow: 0 0 0 1px var(--line); }
.player-stage video { display: block; width: 100%; max-height: calc(100svh - 9rem); aspect-ratio: 16 / 9; background: #100f0d; }
.player-stage.is-vertical { width: min(100%, calc((100svh - 9rem) * 9 / 16)); margin-inline: auto; }
.player-stage.is-vertical video { aspect-ratio: 9 / 16; }
.player-fallback { display: none; position: absolute; inset: 0; margin: 0; place-items: center; text-align: center; padding: 2rem; color: var(--muted); background: #100f0d; }
.player-stage.is-error .player-fallback { display: grid; }

@media (max-width: 760px) {
  .player-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(28, 26, 23, 0.96); }
  .motion-grid { grid-template-columns: 1fr; }
  .player-bar { flex-direction: column; align-items: flex-start; }
  .player-actions { width: 100%; justify-content: space-between; }
}

/* ---------- Photography ---------- */
.photo-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: row dense;
  gap: clamp(0.6rem, 1.4vw, 1rem);
}
.photo {
  display: block; width: 100%; padding: 0; margin: 0; aspect-ratio: 4 / 5;
  border-radius: calc(var(--radius) * 0.75); overflow: hidden;
  background: var(--surface); cursor: zoom-in; position: relative;
}
.photo--wide { grid-column: span 2; aspect-ratio: auto; }
.photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
@media (hover: hover) { .photo:hover img { transform: scale(1.03); } }
.photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 760px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo--wide { aspect-ratio: 8 / 5; }
}

.viewer { position: fixed; inset: 0; z-index: 110; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.5rem; padding: clamp(0.5rem, 3vw, 2rem); background: rgba(28, 26, 23, 0.97); color: var(--text); opacity: 0; transition: opacity 0.3s var(--ease); }
.viewer[hidden] { display: none; }
.viewer.is-open { opacity: 1; }
.viewer-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; min-width: 0; grid-column: 2; }
.viewer-fig img { max-width: 100%; max-height: calc(100svh - 6rem); width: auto; height: auto; border-radius: 6px; user-select: none; }
.viewer-fig figcaption { color: var(--faint); font-size: 0.8rem; letter-spacing: 0.08em; }
.viewer-close { position: absolute; top: clamp(0.75rem, 2vw, 1.5rem); right: clamp(0.75rem, 2vw, 1.5rem); }
.viewer-prev { grid-column: 1; }
.viewer-next { grid-column: 3; }
@media (max-width: 640px) {
  .viewer { grid-template-columns: 1fr; }
  .viewer-prev, .viewer-next { position: absolute; bottom: 1rem; }
  .viewer-prev { left: 1rem; } .viewer-next { right: 1rem; }
  .viewer-fig { grid-column: 1; }
}

/* ---------- Explainers ---------- */
.explainer-grid { display: grid; gap: 2.5rem; }
.explainer-reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; max-width: 900px; }
@media (max-width: 900px) {
  .explainer-reels { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 62vw; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .explainer-reels::-webkit-scrollbar { display: none; }
}

/* Previews are decoration: never take taps, never go fullscreen */
video.preview { pointer-events: none; }
video.preview::-webkit-media-controls { display: none !important; }

/* ---------- Worlds switcher: Hub · Studio · Lab (same block in Hub, Lab and Studio) ---------- */
.worlds {
  position: relative; z-index: 3;
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: 999px; border: 1px solid rgba(var(--ink-rgb), .16);
  background: rgba(var(--paper-rgb), .6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
}
.worlds a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .8rem; border-radius: 999px;
  font-size: .82rem; font-weight: 500; line-height: 1; letter-spacing: 0;
  color: var(--muted); text-decoration: none;
  transition: color .25s, background .25s;
}
.worlds a:hover { color: var(--text); background: rgba(var(--ink-rgb), .07); }
.worlds svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.worlds .w-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.worlds .w-studio .w-dot { background: var(--studio-bright); }
.worlds .w-lab .w-dot { background: var(--lab-bright); }
.worlds a[aria-current="page"] { color: var(--on-accent); }
.worlds .w-hub[aria-current="page"] { background: var(--text); color: var(--paper); }
.worlds .w-studio[aria-current="page"] { background: var(--studio); }
.worlds .w-lab[aria-current="page"] { background: var(--lab); }
.worlds a[aria-current="page"] .w-dot { background: currentColor; opacity: .6; }
@media (max-width: 520px) {
  .worlds a { padding: .4rem .62rem; font-size: .78rem; }
  .worlds .w-hub span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- Theme toggle: Light / Dim (same block in Hub, Lab and Studio) ---------- */
.theme-toggle {
  position: relative; z-index: 3; flex: none;
  display: inline-grid; place-items: center; width: 2.35rem; height: 2.35rem; padding: 0;
  border-radius: 50%; border: 1px solid rgba(var(--ink-rgb), .2);
  background: rgba(var(--paper-rgb), .55); color: var(--text); cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .25s, background .25s, color .25s;
}
.theme-toggle:hover { border-color: rgba(var(--ink-rgb), .42); background: rgba(var(--paper-rgb), .85); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .tt-sun, [data-theme="dim"] .theme-toggle .tt-moon { display: none; }
[data-theme="dim"] .theme-toggle .tt-sun { display: block; }

.nav-cta { white-space: nowrap; }
@media (max-width: 1180px) { .nav-links { gap: 1.35rem; } .nav { gap: 1.4rem; } }
@media (max-width: 520px) { .brand-name { display: none; } }
