/* Mind Motion · Media portfolio. Dark, cinematic; brand tokens from the main site. */

@font-face { font-family: 'Source Serif 4'; font-weight: 500 600; font-display: swap; src: url('/fonts/source-serif-4-500.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 700; font-display: swap; src: url('/fonts/source-serif-4-700.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-600.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-arabic-500.woff2') format('woff2'); }

:root {
  --bg: #0a0d12;
  --bg-alt: #10151d;
  --panel: #161c26;
  --ink: #f2f1ed;
  --ink-2: #a8b2c0;
  --ink-3: #7f8a9a;
  --line: #262e3a;
  --brand: #0b1f33;
  --accent: #d8b064;          /* brass, dark-theme accent */
  --media: #b9673d;           /* media division, lifted for dark backgrounds */
  --focus: #9cc4e4;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --wrap: min(1200px, 100% - 2 * clamp(16px, 4vw, 40px));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[lang="ar"] { font-family: 'IBM Plex Sans Arabic', var(--sans); }

/* Viewing-only deterrents: no dragging or selecting media. */
img, video { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

.wrap { width: var(--wrap); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 12px; }

.eyebrow { margin: 0; font: 600 12px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; margin: 0; text-wrap: balance; }

/* header */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.bar__brand img { width: clamp(160px, 22vw, 230px); }
.bar__nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.bar__nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 15px; padding: 10px 0; }
.bar__nav a:hover { color: var(--ink); }
@media (max-width: 520px) { .bar__nav a[href="#more"] { display: none; } }

/* hero */
.hero { position: relative; min-height: min(78vh, 760px); display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,13,18,.15) 0%, rgba(10,13,18,.55) 55%, var(--bg) 100%), linear-gradient(90deg, rgba(10,13,18,.75), transparent 60%); }
.hero__body { padding-block: clamp(80px, 14vh, 140px) clamp(48px, 8vh, 80px); display: grid; gap: 18px; justify-items: start; }
.hero h1 { font-size: clamp(40px, 7vw, 84px); line-height: 1; }
.lede { margin: 0; max-width: 46ch; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); }
.button {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
}
.button:hover { background: var(--accent); }

/* sections */
.section { padding-block: clamp(64px, 10vw, 112px); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__head { display: grid; gap: 12px; margin-bottom: clamp(28px, 4vw, 44px); max-width: 62ch; }
.section__head h2 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.05; }
.section__lede { margin: 0; color: var(--ink-2); }
.sub { font-size: 22px; margin: clamp(48px, 7vw, 72px) 0 18px; }
.note { color: var(--ink-3); }

/* films */
.films { display: grid; gap: clamp(14px, 2vw, 24px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .films { grid-template-columns: minmax(0, 1fr); } }
.films--mixed { grid-template-columns: 2fr 1fr 1fr; align-items: start; }
@media (max-width: 900px) { .films--mixed { grid-template-columns: 1fr 1fr; } .films--mixed .film:first-child { grid-column: 1 / -1; } }
@media (max-width: 520px) { .films--mixed { grid-template-columns: minmax(0, 1fr); } }

.film { margin: 0; display: grid; gap: 10px; }
.film__stage, .film__play {
  position: relative; display: block; width: 100%; aspect-ratio: var(--ratio, 16/9);
  background: #000; border-radius: 10px; overflow: hidden;
}
.film__play { border: 0; padding: 0; cursor: pointer; color: inherit; }
.film__play img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter .3s; }
.film__play::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; translate: -50% -50%;
  border-radius: 50%; background: rgba(10,13,18,.62) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='%23f2f1ed'/%3E%3C/svg%3E") center / 30px no-repeat;
  border: 1px solid rgba(242,241,237,.35); backdrop-filter: blur(4px); transition: background-color .2s, scale .2s;
}
.film__play:hover img { transform: scale(1.03); }
.film__play:hover::after { background-color: var(--media); scale: 1.06; }
@media (prefers-reduced-motion: reduce) { .film__play img, .film__play::after { transition: none; } }
.film video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.film figcaption { display: flex; align-items: baseline; gap: 10px; color: var(--ink-2); font-size: 15px; }
.film__num { font: 600 12px/1 var(--sans); letter-spacing: .12em; color: var(--accent); }
.film__dur { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13px; }
.film__error { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--ink-2); background: rgba(0,0,0,.8); }
.film__error button { margin-top: 10px; }

/* stills */
.stills { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(160px, calc(50% - 5px)), 1fr)); }
.stills button { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: zoom-in; background: var(--panel); aspect-ratio: 14/9; }
.stills img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .3s; }
.stills button:hover img { transform: scale(1.04); }

/* papers */
.papers { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 2vw, 22px); grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.paper { display: grid; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: 500 15px/1.4 var(--sans); text-align: left; cursor: zoom-in; }
.paper:hover { border-color: var(--accent); }
.paper img { border-radius: 6px; aspect-ratio: 1755/1240; object-fit: cover; background: #fff; }

/* footer */
.foot { border-top: 1px solid var(--line); padding-block: 36px 48px; color: var(--ink-3); font-size: 14px; }
.foot__row { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.foot__row img { width: 34px; opacity: .8; }
.foot__row p { margin: 0; max-width: 70ch; }
.foot a { color: var(--ink-2); }
@media (max-width: 700px) { .foot__row { grid-template-columns: 1fr; } }

/* viewer (stills + papers) */
.viewer { width: min(1400px, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 auto; padding: 0; border: 0; background: rgba(5,7,10,.96); color: var(--ink); }
.viewer::backdrop { background: rgba(0,0,0,.85); }
.viewer[open] { display: grid; grid-template-rows: auto 1fr auto; }
.viewer__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.viewer__title { margin: 0; color: var(--ink-2); font-size: 15px; }
.viewer__close, .viewer__nav button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.viewer__body { position: relative; display: grid; place-items: center; overflow: auto; padding: 0 16px; }
.viewer__body img { max-height: calc(100dvh - 150px); width: auto; border-radius: 6px; }
.viewer__body .shield { position: absolute; inset: 0; }   /* sits over the image so it is never the drag/save target */
.viewer__nav { display: flex; justify-content: center; gap: 16px; padding: 12px; }
.viewer[data-single] .viewer__nav { visibility: hidden; }
