/* 23 Nov (home-fx): every font on the site is Geist Pixel Square (Vercel, OFL). The two family names below are the
   old Allo ones on purpose: the CSS and every canvas that draws text (names, labels, the Shutter) ask for "Allo" /
   "Allo Display Static", so pointing both at Geist Pixel swaps the font everywhere without touching anything else.
   (Allo's files stay in fonts/ to switch back.) */
@font-face {
  font-family: "Allo";
  src: url("../fonts/GeistPixel-Square.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Allo Display Static";
  src: url("../fonts/GeistPixel-Square.woff2") format("woff2");
  font-display: block;
}

:root {
  --bg: #e3e1db;
  --fg: #000;
  --ink: #141414;      /* veil, hover band, 1-bit image dither */
  --tone: #dbd9d2;     /* background dither dots: just off the paper */
  --veil-text: #fff;
  --accent: #dc3418;   /* the red accent (23 Nov): only the moving edge and the live moment, never solids, type or the work */
  --head-dark: #141414;  /* the dithered head's two tones */
  --head-light: #cbc8c0;
  --dim: .5;
  /* Figma grid: 12 columns, 24px margins, 12px gutters (105px columns at 1440) */
  --m: 24px;
  --g: 12px;
  --col: calc((100vw - 2 * var(--m) - 11 * var(--g)) / 12);
  --rhythm: 12px;     /* Figma: 12px between the blocks of the column */
  --info-gap: 32px;
  --shots: calc(7 * var(--col) + 6 * var(--g));
  --mini: calc(70.352 / 806);
}

[data-theme="dark"], [data-theme-probe="dark"] {
  --bg: #141414;
  --fg: #e3e1db;
  --ink: #e3e1db;
  --tone: #1a1a19;
  --veil-text: #000;
  --accent: #dc3418;
  --head-dark: #3a3a38;
  --head-light: #e3e1db;
}
[data-theme-probe="light"] { --bg: #e3e1db; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--fg); scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  font-family: "Allo", system-ui, sans-serif;
  font-variation-settings: "opsz" 14;
  font-size: 15px;
  line-height: 1.13;
  letter-spacing: -.03em;
  -webkit-font-smoothing: antialiased;
  background: transparent; /* the dithered ground shows through */
  color: var(--fg);
  min-height: 100svh;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
.dim { opacity: var(--dim); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  padding-inline: var(--m);
}

.display {
  display: block;
  font-size: 57.45px;
  font-variation-settings: "opsz" 32;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.13;
}

/* ---------- header ---------- */
.top {
  padding-top: var(--m);
  font-size: 13px;
  align-items: start;
}
/* Figma "project details t": name · Audio (col 3) · nav (col 5) · location (col 8) · social (col 10) · Get in touch (right) */
.me { grid-column: 1 / 3; justify-self: start; display: flex; align-items: flex-start; gap: 8px; }
.audio { grid-column: 3 / 5; justify-self: start; }
.audio button { all: unset; cursor: pointer; }
.audio button:focus-visible, .socials a:focus-visible, .inq a:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.socials { grid-column: 10 / 12; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.nav { grid-column: 5 / 8; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.nav a { opacity: var(--dim); }
.nav a[aria-current] { opacity: 1; }
.where { grid-column: 8 / 10; display: flex; flex-direction: column; gap: 3px; }
.where time { font-variant-numeric: tabular-nums; }
.inq { grid-column: 12 / 13; justify-self: end; display: flex; gap: 6px; white-space: nowrap; }

/* ---------- project ---------- */
/* the title's top sits 293px down the page (Figma "project details t"); the header above is 77px tall */
.project { margin-top: calc(293px - 77px); align-items: start; }
/* where the desk's TV push-in lands: the top 16:10 of the column's first block. Only the desk reads this (a hidden probe) */
.p-hero { position: absolute; top: 298px; left: calc(var(--m) + 4 * (var(--col) + var(--g))); width: var(--shots); aspect-ratio: 16 / 10; }

.info {
  grid-column: 1 / 4;
  position: sticky;
  top: 293px;
  display: grid;
  grid-template-columns: subgrid;
  font-size: 13px; /* Figma: everything in the info column is 13px */
}
/* the title sits in the description column at 42px (Figma "project details t"); About starts 47px under its line box */
.info h1 { grid-column: 2 / 4; margin-bottom: 47px; font-size: 42px; }
.info dl { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: var(--info-gap); }
.info dl > div { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
.info dt { grid-column: 1; opacity: var(--dim); }
.info dd { grid-column: 2 / 4; }

.visit {
  grid-column: 2 / 4;
  justify-self: start;
  margin-top: var(--info-gap);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.visit .px { --s: .5; margin-bottom: 0; }

.shots { grid-column: 5 / 12; padding-top: 9px; display: flex; flex-direction: column; gap: var(--rhythm); }
.shots figure { aspect-ratio: var(--ar); overflow: hidden; background: #d6d4cd; }
.shots img, .shots video { width: 100%; height: 100%; object-fit: cover; }
.shots video { position: absolute; inset: 0; }
/* arriving from the desk's TV: the still that filled the screen sits on the first block until its own picture is in */
html.tv .shots figure:first-child { background: var(--tv-img) top center / 100% auto no-repeat; }
html.tv .shots figure:first-child > :not(.px-cover) { visibility: hidden; }
.info [data-row][hidden] { display: none; }

/* ---------- footer ---------- */
.foot { margin-top: 318px; padding-bottom: var(--m); }
/* bottom line (Figma): newsletter + © · the reveal readout · contact */
.bar { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; margin-top: 151px; font-size: 13px; align-items: start; }
.bar-l, .bar-r { display: flex; flex-direction: column; gap: 4px; }
.bar-l { grid-column: 1 / 4; }
.bar-r { grid-column: 10 / 13; justify-self: end; align-items: flex-end; }
.bar-r a { transition: opacity .25s; }
.bar-r a:hover { opacity: var(--dim); }
.bar-reveal { grid-column: 5 / 8; grid-row: 1; display: flex; flex-direction: column; align-items: stretch; }   /* the rule spans cols 5–7 exactly, ending a gutter before the % */
.bar-pct { grid-column: 8; grid-row: 1; padding-left: 4px; font-variant-numeric: tabular-nums; }
/* the reveal's progress: a 1px rule with a 13px block that grows along it as you keep scrolling */
.bar .track { position: relative; display: block; width: 100%; height: 1px; margin-top: 15px; background: #fff; }
.bar .track-px { position: absolute; left: 0; bottom: 0; width: 100%; height: 6px; image-rendering: pixelated; color: #232323; }   /* main.js: 2px dots, Bayer edge */
[data-theme="dark"] .bar .track-px { color: var(--fg); }
[data-theme="dark"] .bar .track { background: color-mix(in srgb, var(--fg) 25%, transparent); }
.kicker { display: block; margin-bottom: 12px; }
.next { grid-column: 5 / 10; justify-self: start; }
.next .row { display: flex; align-items: flex-end; gap: 16px; }


/* pixel arrow from the frame: nine 3px squares on a 27x23 box */
.px { --s: 1; position: relative; width: calc(27px * var(--s)); height: calc(23px * var(--s)); margin-bottom: calc(6px * var(--s)); flex: none; }
.px i { position: absolute; width: calc(3px * var(--s)); height: calc(3px * var(--s)); background: var(--fg); left: calc(var(--x) * 1px * var(--s)); top: calc(var(--y) * 1px * var(--s)); }
/* once the hover label draws the arrow into its canvas, the DOM squares only hold the layout */
.px.px-drawn i { visibility: hidden; }

/* ---------- minimap ---------- */
.mini {
  grid-column: 12;
  grid-row: 1;
  justify-self: end;
  position: sticky;
  top: 296px;
  margin-top: 3px;
  display: flex;
  gap: 5px;
  align-items: stretch;
}
.thumbs { width: calc(var(--shots) * var(--mini)); display: flex; flex-direction: column; gap: calc(var(--rhythm) * var(--mini)); }
.thumbs button { all: unset; display: block; cursor: pointer; aspect-ratio: var(--ar); overflow: hidden; transition: opacity .25s; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs:hover button:not(:hover) { opacity: .4; }
.thumbs button:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.rail { width: 2px; display: flex; flex-direction: column; justify-content: space-between; }
.rail i { display: block; width: 2px; height: 2px; background: var(--fg); opacity: .1; }
.rail i.on { opacity: 1; }

/* ---------- fixed scroll hud ---------- */
.hud {
  position: fixed;
  inset: auto var(--m) var(--m) var(--m);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: var(--dim);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  z-index: 2;
  transition: opacity .3s;
}
.hud.away { opacity: 0; }   /* the footer's own line takes over at the bottom */

/* ---------- narrow screens (first pass) ---------- */
@media (max-width: 860px) {
  .me { grid-column: 1 / 7; }
  .nav { grid-column: 7 / 13; }
  .audio { grid-column: 1 / 7; grid-row: 2; margin-top: 20px; }
  .inq { grid-column: 7 / 13; grid-row: 2; margin-top: 20px; justify-self: start; }
  .where { grid-column: 1 / 7; grid-row: 3; margin-top: 20px; }
  .socials { grid-column: 7 / 13; grid-row: 3; margin-top: 20px; }
  .p-hero { top: 176px; left: var(--m); width: calc(100vw - 2 * var(--m)); }
  .project { margin-top: 48px; }
  .info { grid-column: 1 / -1; position: static; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); }
  .info dt { grid-column: 1 / 4; }
  .info dd { grid-column: 4 / 13; }
  .visit { grid-column: 4 / 13; }
  .shots { grid-column: 1 / -1; margin-top: 64px; gap: var(--g); padding-top: 0; }
  .foot { margin-top: 160px; padding-bottom: 64px; }
  .next { grid-column: 1 / -1; }
  .bar { margin-top: 96px; row-gap: 24px; }
  .bar-l { grid-column: 1 / 7; }
  .bar-r { grid-column: 7 / 13; }
  .bar-reveal { grid-column: 1 / 10; grid-row: 2; }
  .bar-pct { grid-column: 10 / 13; grid-row: 2; justify-self: end; }
  .bar .track { width: 100%; }
  .mini { display: none; }
  .display { font-size: 44px; }
  .info h1 { grid-column: 1 / -1; font-size: 44px; margin-bottom: 29px; }
  /* the scroll readout rides over text and pictures here: let it invert against whatever is under it */
  .hud { mix-blend-mode: difference; color: #e3e1db; opacity: .8; }
}

/* Figma uses the Display cut (opsz 32), no tracking, for the About copy and the footer labels */
.info .about dd, .kicker { font-variation-settings: "opsz" 32; letter-spacing: 0; }

/* Figma boxes: images start 9px below the title top; "Alina Papazova" sits in a 56px box (glyphs overflow it, as in the frame) */
.shots { padding-top: 6px; }   /* images start 5px below the title's top (298 vs 293) */
.next .display { height: 56px; }

/* ---------- smooth scroll (Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------- page transition: pixel dissolve onto black, then off it ---------- */
.veil { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 10; pointer-events: none; }
.veil.on { pointer-events: auto; }
body.leaving .next { pointer-events: none; }

/* ---------- pixel effects (pixels.js) ---------- */
/* PixelLabel: the canvas draws the text in both states; the DOM text stays for layout, selection and screen readers */
.has-px { position: relative; color: transparent; opacity: 1 !important; }
.px-label { position: absolute; pointer-events: none; }
/* revealImage: paper cover, one canvas pixel per cell, scaled up crisp */
.shots figure { position: relative; }
.px-cover { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

/* ---------- background ground (pixels.js Ground) ---------- */
.ground { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; image-rendering: pixelated; pointer-events: none; }

/* ---------- head by the name: the theme switch ---------- */
/* the head sits to the right of the name and only shows while the name (or the head) is hovered */
.head { all: unset; cursor: pointer; display: block; width: 22px; height: 32px;
  margin-top: calc((13px * 1.13 - 32px) / 2); } /* centred on the name's line, without moving the name */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.head canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.head:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

/* dark theme bits that aren't tokens */
.shots figure { background: color-mix(in srgb, var(--bg) 92%, var(--fg)); }

/* ---------- gallery (gallery.js) ---------- */
.shots figure { cursor: pointer; }
/* layers: the whole page under the backdrop (3) · enlarged picture + arrows 5 · header navigation 6 */
/* the navigation stays put while everything scrolls under it, and blends with "difference" so it reads over any picture.
   Its colour is (paper ± ink) so on bare paper it lands exactly on the ink colour: light #e3e1db − #e3e1db = black,
   dark |#141414 − #f7f5ef| = #e3e1db. Sticky, not fixed, so it keeps its place in the layout below it. */
.top { position: sticky; top: 0; z-index: 6; mix-blend-mode: difference; color: var(--nav-ink); }
:root { --nav-ink: #e3e1db; }
[data-theme="dark"] { --nav-ink: #f7f5ef; }
.nav a { transition: opacity .3s cubic-bezier(.25, .6, .3, 1); }
.nav a:hover, .nav a:focus-visible { opacity: 1; }

/* ---------- hover (site.js Hover): ink dithers out of where the cursor came in, the label knocked out of it in paper,
   and the action's pixel glyph slides into its slot beside the label (drawn in the canvas; the DOM squares only hold
   the place, and show on touch). No tags, no tooltips. ---------- */
.hv { -webkit-tap-highlight-color: transparent; }
.hv .bl { white-space: nowrap; }
.hv-cv { position: absolute; pointer-events: none; image-rendering: pixelated; z-index: 1; }
.gl { position: absolute; top: 50%; pointer-events: none; }
.gl .px { position: absolute; left: 0; top: 0; margin: 0; }
.gl .px i, .top .px i { background: currentColor; }
.gl .px, .hv-arrow#next .row > .px, .hv-arrow.visit > .px { opacity: 0; transition: opacity .26s cubic-bezier(.25, .6, .3, 1); }
/* arrow-only buttons (picture viewer): the arrow is the label, so it stays; the hover redraws it in the ink */
.lb-arrow.hv > .px { transition: opacity .12s cubic-bezier(.25, .6, .3, 1); }
.lb-arrow.hv.is-hover > .px { opacity: 0; }
.audio button.hv { display: inline-block; }
.top .inq a.hv:hover { opacity: 1; }
/* keyboard focus: the hover plays; a dotted rule says "this one has the keyboard" */
.hv:focus { outline: none; }
.hv:focus-visible { outline: 1px dotted currentColor; outline-offset: 4px; }
/* phones: no hover, so every glyph and arrow sits there at rest at half strength; a press draws it in the ink */
html.touch .gl .px, html.touch .hv-arrow#next .row > .px, html.touch .hv-arrow.visit > .px { opacity: .5; }
html.touch .is-hover .gl .px, html.touch .hv-arrow.is-hover .px { opacity: 0; }
/* tap targets on phones: pad the hit area to ~44px without moving the label */
html.touch .top a.hv::after, html.touch .top button.hv::after { content: ""; position: absolute; inset: -10px -6px; }
html.touch .top .nav a.hv::after, html.touch .top .socials a.hv::after { inset: -3px -6px; }
.foot { position: relative; z-index: 2; }
.mini, .hud, .info { z-index: 2; }
.cursor-tag { position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; }
.lb { display: none; }
.lb.on { display: contents; }
.lb-back { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 3; image-rendering: pixelated; }
.lb-img { position: fixed; z-index: 5; transform-origin: 0 0; cursor: pointer; }
.lb-arrow { all: unset; position: fixed; z-index: 5; cursor: pointer; padding: 10px; margin: -10px; opacity: 0; transition: opacity .2s steps(3, end); }
.lb-count { position: fixed; z-index: 5; font-size: 13px; opacity: 0; transition: opacity .2s steps(3, end); font-variant-numeric: tabular-nums; }
.lb.ready .lb-arrow { opacity: 1; }
.lb.ready .lb-count { opacity: var(--dim); }
.lb-prev .px { transform: scaleX(-1); }
.lb-arrow .px { display: block; margin-bottom: 0; transition: translate .25s steps(3, end); }
.lb-next:hover .px { translate: 3px 0; }
.lb-prev:hover .px { translate: -3px 0; }
.lb-arrow:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

/* arriving through a page transition: cover the page in the veil colour from the very first paint, until the page's
   own veil canvas has drawn its cover (otherwise the bare paper flashes for a frame between the two veils) */
html.veiled body::after { content: ""; position: fixed; inset: 0; z-index: 2147483000; background: var(--ink); pointer-events: none; }
