/* ==========================================================
   Marcello Amora — Portfolio 2026
   Base tokens, chrome, scenes (work page), lightbox, cursor
   ========================================================== */

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --fg: #f4f2ec;
  --muted: #8c8a84;
  --line: rgba(244, 242, 236, 0.14);
  --accent: #f4f2ec;

  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --gutter: clamp(18px, 3.2vw, 48px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.83, 0, 0.17, 1);
  --dur: 1.1s;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
.page-work { scroll-snap-type: y mandatory; scrollbar-width: none; }
.page-work::-webkit-scrollbar { display: none; }
body { min-height: 100svh; overflow-x: hidden; background: var(--bg); }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--fg); color: var(--bg); }

/* film grain over everything */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  opacity: 0.055; mix-blend-mode: overlay;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- type utilities ---------- */
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.muted { color: var(--muted); }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; place-items: center; align-content: center; gap: 28px;
  transition: opacity 0.8s var(--ease-in-out), visibility 0s 0.8s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__mark { font-family: var(--display); font-weight: 300; font-size: clamp(40px, 8vw, 96px); letter-spacing: -0.02em; display: flex; gap: 0.15em; }
.loader__mark span { display: inline-block; animation: rise 1s var(--ease-out) both; }
.loader__mark span:nth-child(2) { color: var(--muted); animation-delay: 0.08s; }
.loader__mark span:nth-child(3) { animation-delay: 0.16s; }
.loader__bar { width: min(240px, 50vw); height: 1px; background: var(--line); overflow: hidden; }
.loader__bar i { display: block; height: 100%; width: 100%; background: var(--fg); transform-origin: left; animation: fill 1.1s var(--ease-in-out) both; }
@keyframes rise { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- fixed chrome ---------- */
.chrome {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: clamp(16px, 2.4vw, 28px) var(--gutter);
  mix-blend-mode: difference; pointer-events: none;
}
.chrome > * { pointer-events: auto; }
.chrome__logo { font-family: var(--display); font-weight: 400; font-size: 14px; letter-spacing: 0.02em; display: inline-flex; gap: 0.35em; justify-self: start; }
.chrome__slash { color: var(--muted); }
.chrome__counter { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; display: inline-flex; gap: 0.5em; font-variant-numeric: tabular-nums; }
.chrome__counter-sep { color: var(--muted); }

.btn-about {
  justify-self: end; display: inline-flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 6px 0 18px; border: 1px solid var(--fg); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.5s var(--ease-out), color 0.5s var(--ease-out);
  will-change: transform;
}
.btn-about__dot { width: 28px; height: 28px; border-radius: 50%; background: var(--fg); position: relative; transition: transform 0.6s var(--ease-out); }
.btn-about__dot::after { content: "→"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--bg); font-family: var(--body); font-size: 14px; }
.btn-about:hover { background: var(--fg); color: var(--bg); }
.btn-about:hover .btn-about__dot { transform: rotate(-45deg) scale(0.92); background: var(--bg); }
.btn-about:hover .btn-about__dot::after { color: var(--fg); }

/* ---------- side rail ---------- */
.rail {
  position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end; mix-blend-mode: difference;
}
.rail a { display: flex; flex-direction: row-reverse; align-items: center; gap: 10px; height: 14px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg); opacity: 0.35; transition: opacity 0.4s; }
.rail a::before { content: ""; width: 14px; height: 1px; background: currentColor; transform-origin: right; transition: transform 0.6s var(--ease-out); }
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity 0.4s, transform 0.6s var(--ease-out); white-space: nowrap; }
.rail a:hover span, .rail a.is-active span { opacity: 1; transform: none; }
.rail a:hover, .rail a.is-active { opacity: 1; }
.rail a.is-active::before { transform: scaleX(2); }
@media (max-width: 1023px) { .rail { display: none; } }
@media (min-width: 1024px) { .cover__meta { padding-right: 64px; } }

/* ---------- progress ---------- */
.progress { position: fixed; left: 0; right: 0; bottom: 0; height: 2px; z-index: 100; background: rgba(128,128,128,0.25); mix-blend-mode: difference; }
.progress i { display: block; height: 100%; width: 100%; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease-out); }

/* ---------- scroll hint ---------- */
.hint { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 10px; mix-blend-mode: difference; transition: opacity 0.6s, transform 0.6s var(--ease-out); }
.hint span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase; }
.hint i { width: 1px; height: 40px; background: linear-gradient(var(--fg), transparent); animation: hint 1.8s var(--ease-in-out) infinite; transform-origin: top; }
.hint.is-hidden { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- scenes ---------- */
.scenes { display: block; }
.scene {
  position: relative; height: 100svh; overflow: hidden;
  scroll-snap-align: start; scroll-snap-stop: always;
  isolation: isolate;
}
.scene__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--bg-2); }
.scene__bg > img, .scene__bg > video { width: 100%; height: 100%; object-fit: cover; }
.scene__bg .ph { position: absolute; inset: 0; }
.scene__bg .ph::after { display: none; }

/* reveal system: elements animate in when .is-active is set on the scene */
/* Block, so each masked line is exactly one line-height tall (inline inflates it).
   The mask is padded so descenders (g, y, p) are not sliced off, and the padding is
   pulled back out of the layout — the slide starts far enough down to stay hidden. */
.reveal { display: block; overflow: hidden; padding: 0.12em 0 0.26em; margin: -0.12em 0 -0.26em; }
.reveal > * { display: block; transform: translateY(160%); transition: transform 1.2s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms + 120ms); }
.is-active .reveal > * { transform: none; }
.fade { opacity: 0; transform: translateY(14px); transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms + 300ms); }
.is-active .fade { opacity: 1; transform: none; }

/* --- hero --- */
.scene--hero { display: grid; grid-template-rows: 1fr auto auto; align-content: center; padding: 0 var(--gutter) clamp(24px, 4vh, 48px); }
.hero__cta { position: relative; z-index: 4; margin: clamp(14px, 3vh, 36px) 0 clamp(20px, 6vh, 80px); }
.hero__glow { position: absolute; inset: -20%; z-index: 3; pointer-events: none;
  background:
    radial-gradient(40% 50% at 30% 40%, rgba(255,255,255,0.05), transparent 70%),
    radial-gradient(35% 45% at 70% 65%, rgba(255,255,255,0.03), transparent 70%);
  filter: blur(40px); animation: glow 14s var(--ease-in-out) infinite alternate; }
@keyframes glow { from { transform: translate(-3%, -2%) rotate(0deg); } to { transform: translate(4%, 3%) rotate(6deg); } }
/* sized by width AND height, so short windows never clip the name */
.hero__name { position: relative; z-index: 4; align-self: center; font-family: var(--display); font-weight: 300; letter-spacing: -0.035em; line-height: 0.82; font-size: min(max(58px, 14.5vw), 21vh, 232px); margin: 0; }
.hero__name .reveal + .reveal { padding-left: 0.42em; }
.hero__name .slash { color: var(--muted); font-weight: 300; margin-right: 0.05em; }
.hero__bg { background: var(--bg); }
.hero__photo, .hero__bg > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__photo { opacity: 0; transform: scale(1.04); transition: opacity 1.6s var(--ease-out), transform 14s linear; }
.is-active .hero__photo { opacity: 1; transform: scale(1.09); }
.hero__bg > video { z-index: 1; opacity: 0; transition: opacity 2s var(--ease-out) 0.4s; }
.is-active .hero__bg > video { opacity: 1; }
/* the portrait is already very dark — just enough gradient to hold the type */
.hero__bg::after { content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(to top, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.2) 40%, rgba(10,10,10,0.1) 100%),
    linear-gradient(to right, rgba(10,10,10,0.6) 0%, rgba(10,10,10,0) 45%); }
.hero__foot { position: relative; z-index: 4; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.hero__roles { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hero__roles span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.hero__roles span::before { content: "#"; color: var(--muted); }
.hero__loc { margin-top: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hero__year { justify-self: end; font-family: var(--display); font-weight: 300; font-size: clamp(22px, 3vw, 40px); letter-spacing: 0.1em; text-transform: uppercase; line-height: 1; }
.hero__year b { font-weight: 300; color: var(--muted); }

/* --- project cover --- */
.scene--cover .scene__bg > * { transform: scale(1.12); transition: transform 2.4s var(--ease-out); }
.scene--cover.is-active .scene__bg > * { transform: none; }
.scene--cover .scene__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,10,0.82) 0%, rgba(10,10,10,0.25) 45%, rgba(10,10,10,0.05) 100%); }

/* light artwork: dark type over a pale scrim, so the frame keeps its own light */
.scene--cover.is-light { --fg: #0a0a0a; --muted: #56565a; --line: rgba(10,10,10,0.2);
  color: var(--fg); }   /* re-resolve: html's color was already computed from the dark token */
.scene--cover.is-light .scene__bg::after { background: linear-gradient(to top, rgba(248,247,244,0.7) 0%, rgba(248,247,244,0.16) 42%, rgba(248,247,244,0) 100%); }
.scene--cover.is-light .cover__credits { color: rgba(10,10,10,0.68); }
.scene--cover.is-light .cover__brief { color: var(--fg); }
.scene--cover.is-light .play__ring { border-color: var(--fg); }
.scene--cover.is-light .play__ring::before { border-left-color: var(--fg); }
.scene--cover.is-light .play:hover .play__ring { background: var(--fg); }
.scene--cover.is-light .play:hover .play__ring::before { border-left-color: #f6f5f2; }
.cover__meta { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: clamp(24px, 5vh, 56px); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; }
.cover__index { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 14px; display: flex; gap: 14px; align-items: center; }
.cover__index::after { content: ""; flex: 0 0 40px; height: 1px; background: var(--line); }
.cover__client { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 10px; }
.cover__title { font-family: var(--display); font-weight: 300; letter-spacing: -0.03em; line-height: 0.95; font-size: clamp(40px, 7vw, 112px); margin: 0 0 18px; }
.cover__format { font-size: 14px; color: var(--muted); }
.cover__side { display: grid; gap: 18px; justify-items: start; align-content: end; }
.cover__credits { max-width: 38ch; font-size: 13px; line-height: 1.55; color: rgba(244,242,236,0.75); }
.cover__brief { max-width: 46ch; font-size: 14px; line-height: 1.55; }

.play { display: inline-flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.play__ring { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--fg); display: grid; place-items: center; position: relative; transition: transform 0.6s var(--ease-out), background 0.5s; }
.play__ring::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--fg); margin-left: 3px; transition: border-color 0.5s; }
.play:hover .play__ring { transform: scale(1.1); background: var(--fg); }
.play:hover .play__ring::before { border-left-color: var(--bg); }

/* --- stills grid --- */
/* The stills block is centred, but the leftover height is split 1:3 instead of
   evenly, so the grid sits closer to the project title above it. */
.scene--grid { --pt: clamp(72px, 10vh, 108px); --pb: clamp(48px, 7vh, 72px); --gap: 10px;
  padding: var(--pt) var(--gutter) var(--pb); display: flex; flex-direction: column; }
.scene--grid::after { content: ""; flex: 3 1 0; }
.grid__head { flex: 1 1 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.grid__head b { font-weight: 400; color: var(--fg); }
/* wide grids run the full column width — flush with the title on the left and the
   "Stills 01–04" label on the right; height yields to the screen when it must */
.grid { display: grid; gap: var(--gap); flex: 0 0 auto; margin: 18px auto 0; min-height: 0; min-width: 0; width: 100%; max-height: 100%; }
/* vertical stills keep their real shape instead of being stretched or letterboxed */
.grid[data-cols="tall"] { grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: 1fr;
  width: auto; max-width: 100%; aspect-ratio: calc(var(--n) * 3 / 4); }
.grid[data-cols="tall"] { margin-inline: auto; }
/* row: columns and aspect-ratio are set inline from the stills' real shapes */
.grid[data-cols="row"] { grid-template-rows: 1fr; width: 100%; }
.grid[data-cols="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; aspect-ratio: 16 / 9; }
.grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); grid-template-rows: 1fr; aspect-ratio: 32 / 9; }
/* 3 stills: one feature on the left, two stacked on the right */
.grid[data-cols="3"] { grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, 1fr); aspect-ratio: 8 / 3; }
.grid[data-cols="3"] > .cell:first-child { grid-row: span 2; }
.grid[data-cols="4"] { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); aspect-ratio: 32 / 18; }
.grid[data-cols="6"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); aspect-ratio: 48 / 18; }
.cell { position: relative; overflow: hidden; background: var(--bg-2); min-height: 0; clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + 80ms); }
.is-active .cell { clip-path: inset(0 0 0 0); }
.cell > img, .cell > video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.8s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.is-active .cell > img, .is-active .cell > video { transform: none; }
.cell:hover > img, .cell:hover > video { transform: scale(1.03); transition-duration: 1.2s; transition-delay: 0s; }
/* posters, squares and portraits: shown whole, over a blurred blow-up of themselves */
.cell.is-contained { background: #08080a; }
.cell.is-contained > img, .cell.is-contained > video { object-fit: contain; position: relative; z-index: 1; }
.cell.is-contained::before {
  content: ""; position: absolute; inset: -8%; z-index: 0;
  background-image: var(--fill); background-size: cover; background-position: center;
  filter: blur(28px) saturate(0.85) brightness(0.42); transform: scale(1.1);
}
.cell__n { position: absolute; left: 12px; bottom: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: rgba(244,242,236,0.7); mix-blend-mode: difference; }

/* --- generated placeholder (until real media is dropped in) --- */
.ph { position: absolute; inset: 0; overflow: hidden; background: var(--p1, #111);
  background-image:
    radial-gradient(60% 80% at 20% 30%, var(--p2, #333), transparent 70%),
    radial-gradient(50% 60% at 80% 70%, color-mix(in srgb, var(--p3, #777) 42%, transparent), transparent 70%),
    radial-gradient(90% 90% at 50% 120%, var(--p1, #111), transparent 60%);
  background-size: 160% 160%; animation: drift 22s var(--ease-in-out) infinite alternate; }
.ph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%); background-size: 300% 100%; animation: sheen 9s linear infinite; mix-blend-mode: soft-light; }
.ph::after { content: attr(data-label); position: absolute; left: 14px; top: 12px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55); mix-blend-mode: difference; }
@keyframes drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@keyframes sheen { from { background-position: 150% 0; } to { background-position: -150% 0; } }

/* --- outro --- */
.scene--outro { display: grid; grid-template-rows: 1fr auto; padding: 0 var(--gutter) clamp(24px, 4vh, 48px); }
.outro__body { align-self: center; display: grid; gap: clamp(24px, 4vh, 48px); }
.outro__title { font-family: var(--display); font-weight: 300; letter-spacing: -0.03em; line-height: 0.95; font-size: clamp(36px, 6.5vw, 108px); margin: 0; max-width: 14ch; }
.outro__title em { font-style: normal; color: var(--muted); }
.outro__mail { font-family: var(--display); font-weight: 300; letter-spacing: -0.02em; font-size: clamp(20px, 3.4vw, 52px); display: inline-block; position: relative; width: max-content; max-width: 100%; word-break: break-all; }
.outro__mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--fg); transform: scaleX(0); transform-origin: right; transition: transform 0.7s var(--ease-out); }
.outro__mail:hover::after { transform: scaleX(1); transform-origin: left; }
.outro__links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.outro__links a, .outro__links button { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); transition: color 0.4s; }
.outro__links a:hover, .outro__links button:hover { color: var(--fg); }
.outro__foot { display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding-top: 18px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(6,6,6,0.96); display: grid; place-items: center; padding: clamp(24px, 6vh, 72px) var(--gutter); opacity: 0; visibility: hidden; transition: opacity 0.6s var(--ease-out), visibility 0s 0.6s; }
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.6s var(--ease-out); }
.lightbox__frame { width: min(100%, calc((100svh - 160px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; transform: scale(0.96); transition: transform 0.8s var(--ease-out); }
.lightbox.is-open .lightbox__frame { transform: none; }
.lightbox__frame video, .lightbox__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.lightbox__title { position: absolute; left: var(--gutter); top: 30px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.lightbox__nav { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; gap: 6px; }
.lightbox__nav button { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); transition: color 0.4s, border-color 0.4s, background 0.4s; }
.lightbox__nav button:hover { color: var(--fg); border-color: var(--fg); }
.lightbox__nav button.is-current { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.play em { font-style: normal; color: var(--muted); }
.lightbox__close { position: absolute; right: var(--gutter); top: 18px; width: 44px; height: 44px; display: grid; place-items: center; }
.lightbox__close span { position: absolute; width: 22px; height: 1px; background: var(--fg); transform: rotate(45deg); transition: transform 0.5s var(--ease-out); }
.lightbox__close span + span { transform: rotate(-45deg); }
.lightbox__close:hover span { transform: rotate(90deg); }
.lightbox__close:hover span + span { transform: rotate(0deg); }

/* ---------- custom cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; display: none; mix-blend-mode: difference; }
.cursor__dot { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); transform: translate(-50%, -50%); transition: width 0.5s var(--ease-out), height 0.5s var(--ease-out), opacity 0.4s; }
.cursor__label { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--bg); opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.cursor.is-hover .cursor__dot { width: 84px; height: 84px; }
.cursor.is-hover .cursor__label { opacity: 1; }
.cursor.is-hidden { opacity: 0; }
@media (pointer: fine) {
  .cursor { display: block; }
  .page-work, .page-work a, .page-work button { cursor: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 800px) {
  .chrome { grid-template-columns: 1fr auto; }
  .chrome__counter { display: none; }
  .btn-about__label { display: none; }
  .btn-about { padding: 0 5px; height: 38px; }
  /* phones crop the portrait tight, so the type sits low and leaves the face clear */
  .hero__name { font-size: min(max(48px, 19vw), 16vh, 120px); align-self: end; }
  .hero__cta { margin: clamp(18px, 3vh, 28px) 0 clamp(20px, 4vh, 36px); }
  .hero__name .reveal + .reveal { padding-left: 0; }
  .hero__foot { grid-template-columns: 1fr auto; gap: 14px 24px; align-items: end; }
  .hero__loc { text-align: left; }
  .cover__meta { grid-template-columns: 1fr; gap: 18px; }
  .cover__credits { display: none; }
  .cover__brief { font-size: 13px; }
  .scene--grid { padding-top: 76px; }
  /* phones: one column — 2 stills fill the screen, 1 leftover goes full width */
  .grid[data-cols="1"] { aspect-ratio: 16 / 9; }
  .grid[data-cols="tall"] { grid-template-columns: 1fr; }
  .grid[data-cols="2"] { grid-template-columns: 1fr; grid-template-rows: repeat(2, 1fr); aspect-ratio: 16 / 18; }
  .grid[data-cols="3"] { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); aspect-ratio: 16 / 27; }
  .grid[data-cols="3"] > .cell:first-child { grid-row: auto; }
  .grid[data-cols="4"] { grid-template-columns: 1fr; grid-template-rows: repeat(4, 1fr); aspect-ratio: 16 / 36; }
  .grid[data-cols="6"] { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); aspect-ratio: 32 / 27; }
  .hint { display: none; }   /* on touch the swipe is self-evident, and the corner belongs to "Portfolio" */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__photo, .is-active .hero__photo { transform: none; transition: opacity .4s; }
  body::after, .hero__glow, .ph, .ph::before, .hint i { animation: none; }
  .reveal > *, .fade, .cell, .cell > img, .cell > video, .scene--cover .scene__bg > * { transition: none; transform: none; opacity: 1; clip-path: none; }
}
