/* ============================================================
   asrorshef — portfolio
   Scenes (hero / portfolio / case / about / contacts) are fixed
   full screens; <html data-scene="..."> says which one is open.
   Sizes are in rem: 1rem = 1/192 of the screen width on a computer
   and 1/39 on a phone (like the reference), so the layout scales.
   ============================================================ */

@font-face { font-family: "TT Norms Pro"; src: url("/assets/fonts/tt-norms-pro-450.woff2") format("woff2"); font-weight: 450; font-style: normal; font-display: swap; }
@font-face { font-family: "TT Norms Pro"; src: url("/assets/fonts/tt-norms-pro-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "TT Norms Pro"; src: url("/assets/fonts/tt-norms-pro-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Helvetica Now Display"; src: url("/assets/fonts/helvetica-now-display-400.woff2") format("woff2"); font-weight: 400 450; font-style: normal; font-display: swap; }
@font-face { font-family: "Helvetica Now Display"; src: url("/assets/fonts/helvetica-now-display-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "ZT Neue Ralewe"; src: url("/assets/fonts/zt-neue-ralewe-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  /* colours taken from the portrait: cobalt background, electric yellow, cyan glow */
  --ink: #060b22;
  --ink-rgb: 6 11 34;
  --sand: #e4e9f7;
  --sand-rgb: 228 233 247;
  --fg: #0b1233;
  --fg-rgb: 11 18 51;
  --accent: #2443d6;
  --accent-rgb: 36 67 214;
  --gold: #ffe04f;
  --gold-rgb: 255 224 79;
  --cyan: #5ad8ff;
  --cyan-rgb: 90 216 255;
  --light: #ffffff;
  --light-rgb: 255 255 255;
  --dim: rgb(var(--fg-rgb) / .6);
  --ldim: rgb(var(--light-rgb) / .6);

  --font: "TT Norms Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --amp: "ZT Neue Ralewe", Georgia, serif;
  /* secondary font: all running text, menus, captions; the big headings stay in --font */
  --text: "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --margin: 2.4rem;
  --ease: cubic-bezier(.25, 1, .5, 1);
  --ease-io: cubic-bezier(.65, 0, .25, 1);
  --t: .9s;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html {
  background: var(--ink); -webkit-text-size-adjust: 100%;
  font-size: .520833vw;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
body {
  margin: 0; overflow: hidden; overscroll-behavior: none;
  background: var(--ink); color: var(--light);
  font-family: var(--text); font-weight: 450;
  font-size: max(1.8rem, 13px); line-height: max(2.3rem, 17px);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
:focus-visible { outline: 1px solid rgb(var(--gold-rgb) / .8); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* glowing film titles */
.glow { color: var(--gold); text-shadow: 0 0 .03em rgb(255 250 215 / .9), 0 0 .2em rgb(var(--gold-rgb) / .5), 0 0 .7em rgb(var(--cyan-rgb) / .3); }
.glow-soft { text-shadow: 0 0 .4em rgb(var(--light-rgb) / .35); }
.glow-accent { color: var(--accent); text-shadow: 0 0 .04em rgb(var(--accent-rgb) / .5), 0 0 .25em rgb(var(--accent-rgb) / .3); }

/* ---------------- background stage ---------------- */
.stage { position: fixed; inset: 0; z-index: 0; background: var(--ink); }
.stage__gl, .stage__fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__gl { cursor: default; }
.stage__fallback { background: url("/images/scene/color.webp") 50% 40% / cover no-repeat; display: none; }
.no-gl .stage__fallback { display: block; }
.no-gl .stage__gl { display: none; }
.stage__shade { position: absolute; inset: 0; pointer-events: none; background: rgb(var(--ink-rgb) / 0); transition: background var(--t) var(--ease); }
[data-scene="portfolio"].view-grid .stage__shade { background: rgb(var(--ink-rgb) / .35); }
[data-scene="case"] .stage__shade { background: rgb(var(--ink-rgb) / .35); }

/* ---------------- CRT frame over everything ---------------- */
.crt {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  border-radius: clamp(18px, 3vw, 44px);
  transition: box-shadow 1.1s var(--ease-io);
  box-shadow:
    0 0 0 80px #03061a,
    inset 0 0 clamp(40px, 6vw, 90px) clamp(10px, 1.4vw, 22px) rgb(3 6 26 / .85),
    inset 0 0 clamp(120px, 18vw, 260px) clamp(20px, 3vw, 50px) rgb(3 6 26 / .28);
}
[data-scene="about"] .crt, [data-scene="contacts"] .crt {
  box-shadow:
    0 0 0 80px #03061a,
    inset 0 0 clamp(40px, 6vw, 90px) clamp(10px, 1.4vw, 22px) rgb(8 16 52 / .7),
    inset 0 0 clamp(120px, 18vw, 260px) clamp(20px, 3vw, 50px) rgb(36 67 214 / .1);
}

/* ---------------- header ---------------- */
.header {
  position: fixed; z-index: 95; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(var(--margin), 16px) max(var(--margin), 16px) 0;
  letter-spacing: -.01em; font-size: max(1.8rem, 13px); font-weight: 500; line-height: max(2.3rem, 17px);
  pointer-events: none;
  transition: opacity 1s ease 1.6s;
}
.header a { pointer-events: auto; padding-right: .06em; }
/* when a page is scrolled, the header gets a frosted bar that fades out downwards (no line, no hard edge) */
.header::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: calc(100% + max(4rem, 28px));
  -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent);
  background: rgb(var(--sand-rgb) / .74); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  opacity: 0; transition: opacity .45s var(--ease);
}
.is-scrolled .header::before { opacity: 1; }
.is-scrolled .logo { color: var(--fg); }
.logo { color: var(--light); transition: color .5s var(--ease); }
.nav { display: flex; gap: 2.4rem; }
.nav__link { color: var(--ldim); transition: color .5s var(--ease); white-space: nowrap; }
.nav__link:hover, .nav__link.is-active { color: var(--light); }
[data-scene="about"] .nav__link, [data-scene="contacts"] .nav__link, [data-scene="case"] .nav__link { color: var(--dim); }
[data-scene="about"] .nav__link.is-active, [data-scene="contacts"] .nav__link.is-active, [data-scene="case"] .nav__link.is-active,
[data-scene="about"] .nav__link:hover, [data-scene="contacts"] .nav__link:hover, [data-scene="case"] .nav__link:hover { color: var(--fg); }
[data-scene="contacts"] .logo { color: var(--fg); }
.is-intro .header { opacity: 0; }

/* ---------------- scenes ---------------- */
.scene {
  position: fixed; inset: 0; z-index: 10;
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity var(--t) var(--ease), visibility 0s linear var(--t);
}
[data-scene="hero"] .hero, [data-scene="portfolio"] .portfolio, [data-scene="case"] .case,
[data-scene="about"] .about, [data-scene="contacts"] .contacts {
  visibility: visible; opacity: 1; pointer-events: auto;
  transition: opacity var(--t) var(--ease), visibility 0s;
}
.hero { pointer-events: none !important; }
.hero .hero__scroll { pointer-events: auto; }

/* headings keep the main font */
.hero__title, .case__title, .case__headline, .case__next-title, .about__title, .about__stat strong, .about__name, .about__company,
.about__list li, .about__motto, .contacts__links, .blog__title { font-family: var(--font); }

/* ---------------- HERO ---------------- */
.hero__title {
  position: absolute; left: 0; right: 0; top: calc(50% - 21.1rem); height: 14.8rem;
  font-size: 9.6rem; font-weight: 450; pointer-events: none;
}
/* the two words stand at the same distance from the middle of the face (the centre of the screen) */
.hero__lead { position: absolute; top: 0; right: calc(50% + 34rem); display: flex; align-items: baseline; gap: 6rem; height: 14.8rem; }
.hero__word, .hero__role { font-size: 11.6rem; font-weight: 600; letter-spacing: -.09em; padding-right: .09em; line-height: 14.8rem; }
/* like the reference: pale yellow, slightly soft edges (film), a quiet bloom instead of a neon glow */
.hero__title.glow { color: #f6e27e; text-shadow: 0 0 .02em rgb(255 244 190 / .7), 0 0 .18em rgb(246 226 126 / .28), 0 0 .55em rgb(246 226 126 / .12); }
.hero__word, .hero__role, .hero__amp { filter: blur(.06rem); }
.hero__amp { font-family: var(--amp); font-weight: 600; letter-spacing: -.08em; padding-right: .08em; line-height: 13.2rem; }
.hero__role { position: absolute; top: 0; left: calc(50% + 34rem); }
.hero__word, .hero__amp, .hero__role { display: inline-block; }

/* words come out of a blur; on the first visit slower, after the logo */
.hero__word, .hero__amp, .hero__role {
  transition: opacity 1s var(--ease), filter 1.2s var(--ease), transform 1.3s var(--ease);
  transition-delay: calc(.25s + var(--i) * .08s);
}
.is-first .hero__word, .is-first .hero__amp, .is-first .hero__role { transition-duration: 1.4s, 1.7s, 1.7s; transition-delay: calc(.3s + var(--i) * .15s); }
.is-first .header { transition-delay: .8s; }
.is-first .hero__scroll { transition: color .5s var(--ease), opacity 1s ease 1.2s; }
.is-intro .hero__word, .is-intro .hero__amp, .is-intro .hero__role { opacity: 0; filter: blur(20px); transform: scale(1.12); }
html:not([data-scene="hero"]) .hero__word, html:not([data-scene="hero"]) .hero__amp, html:not([data-scene="hero"]) .hero__role {
  opacity: 0; filter: blur(16px); transform: scale(1.35); transition-delay: 0s; transition-duration: .6s, .7s, .9s;
}

.hero__scroll {
  position: absolute; left: 0; right: 0; bottom: 6.3rem; margin-inline: auto; width: max-content;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  letter-spacing: -.01em; font-size: max(1.8rem, 12px); line-height: max(2.3rem, 15px); font-weight: 450;
  color: rgb(var(--light-rgb) / .75); white-space: nowrap; text-shadow: 0 0 1.2rem rgb(0 0 0 / .7), 0 0 .3rem rgb(0 0 0 / .5);
  transition: color .5s var(--ease), opacity 1s ease 2.4s;
}
.hero__scroll:hover { color: var(--light); }
.hero__scroll svg { width: 2.4rem; height: 2.4rem; min-width: 14px; min-height: 14px; fill: none; stroke: currentColor; stroke-width: 1; animation: bob 2.4s var(--ease-io) infinite; }
.hero__hint--touch { display: none; }
@media (hover: none), (pointer: coarse) { .hero__hint--wheel { display: none; } .hero__hint--touch { display: inline; } }
.is-intro .hero__scroll, html:not([data-scene="hero"]) .hero__scroll { opacity: 0; transition-delay: 0s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(.5rem); } }

/* ---------------- PORTFOLIO ---------------- */
.portfolio__bar {
  position: absolute; left: 0; right: 0; margin-inline: auto; width: max-content; z-index: 5;
  top: calc(50% - var(--card-h, 48rem) / 2 - 6.4rem);
  display: flex; align-items: center; gap: 4.8rem;
  transition: top var(--t) var(--ease), opacity .7s var(--ease) .45s, filter .7s var(--ease) .45s;
}
html:not([data-scene="portfolio"]) .portfolio__bar { opacity: 0; filter: blur(6px); transition-delay: 0s; }
.view-grid .portfolio__bar { top: 9.6rem; }
.filters { display: flex; gap: 1.5rem; letter-spacing: -.01em; font-size: max(1.8rem, 13px); line-height: max(2.3rem, 17px); font-weight: 500; }
.filters__item { color: var(--ldim); transition: color .4s var(--ease); padding-right: .06em; white-space: nowrap; }
.filters__item:hover, .filters__item.is-active { color: var(--light); }
.views { display: flex; gap: .6rem; }
.views__item { color: var(--ldim); padding: .4rem; transition: color .4s var(--ease); }
.views__item svg { display: block; width: max(2.6rem, 18px); height: max(1.8rem, 12px); fill: none; stroke: currentColor; stroke-width: 1.1; }
.views__item[aria-pressed="true"], .views__item:hover { color: var(--light); }

/* the strip is drawn in WebGL (strip in app.js); the camera itself flies in, so the box only fades */
.works {
  position: absolute; inset: 0;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility 0s linear .6s;
}
[data-scene="portfolio"] .works { opacity: 1; visibility: visible; transition: opacity .3s var(--ease), visibility 0s; }
[data-scene="hero"] .works { transition: opacity .6s var(--ease) .5s, visibility 0s linear 1.1s; }   /* back home: the camera flies out first */
.works__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.works__canvas.is-pointing { cursor: pointer; }
.works__canvas.is-dragging { cursor: grabbing; }
.no-strip .views { display: none; }
html:not(.no-strip) .grid { display: none; }   /* the grid is drawn in WebGL too; the HTML one is the fallback */
.frame-marks { position: absolute; inset: 0; pointer-events: none; }
.frame-marks i { position: absolute; width: 13px; height: 13px; }
.frame-marks i::before, .frame-marks i::after { content: ""; position: absolute; background: currentColor; }
.frame-marks i::before { left: 6px; top: 0; width: 1px; height: 13px; }
.frame-marks i::after { top: 6px; left: 0; width: 13px; height: 1px; }
.frame-marks i:nth-child(1) { left: -7px; top: -7px; }
.frame-marks i:nth-child(2) { right: -7px; top: -7px; }
.frame-marks i:nth-child(3) { left: -7px; bottom: -7px; }
.frame-marks i:nth-child(4) { right: -7px; bottom: -7px; }

.works__caption {
  position: absolute; left: 0; right: 0; margin-inline: auto; width: max-content;
  top: calc(50% + var(--card-h, 48rem) / 2 + 4.8rem);
  display: flex; flex-direction: column; align-items: center;
  text-align: center; white-space: nowrap; pointer-events: none; letter-spacing: -.01em;
  transition: opacity .35s ease, filter .35s ease;
}
.works__caption.is-swap { opacity: 0; filter: blur(6px); }
html:not([data-scene="portfolio"]) .works__caption, .view-grid .works__caption { opacity: 0; }
.works__title { font-size: max(2.4rem, 16px); line-height: max(3.1rem, 20px); font-weight: 500; color: var(--light); padding-right: .06em; }
.works__subtitle { font-size: max(1.8rem, 13px); line-height: max(2.3rem, 17px); color: var(--ldim); padding-right: .06em; }

/* grid */
.grid {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding: 18rem var(--margin) 14rem;
  visibility: hidden; opacity: 0;
  transition: opacity .7s var(--ease), visibility 0s linear .7s;
  scrollbar-width: none;
}
.grid::-webkit-scrollbar { display: none; }
[data-scene="portfolio"].view-grid .grid { visibility: visible; opacity: 1; transition: opacity .8s var(--ease) .15s, visibility 0s; }
.grid__inner { max-width: 130rem; margin: 0 auto; }
.grid__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4.8rem 2.4rem; }
.grid__list--wide { grid-template-columns: repeat(2, 1fr); }
.grid__label { margin: 9.6rem 0 2.4rem; letter-spacing: -.01em; color: var(--ldim); font-weight: 500; }
.grid__label[hidden] { display: none; }
.tile { opacity: 0; transform: translateY(3.2rem); transition: opacity .7s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 60ms); }
.view-grid .tile { opacity: 1; transform: none; }
.tile__link { display: block; }
.tile__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #0e1638; }
.grid__list--wide .tile__media { aspect-ratio: 16 / 9; }
.tile__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.tile__link:hover .tile__media img { transform: scale(1.03); }
.tile__meta { display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 1.2rem 0 1.6rem; border-bottom: 1px solid rgb(var(--light-rgb) / .16); letter-spacing: -.01em; }
.tile__title { font-weight: 500; color: var(--light); padding-right: .06em; }
.tile__sub { grid-column: 1; color: var(--ldim); padding-right: .06em; }
.tile__arrow { grid-row: 1 / span 2; grid-column: 2; width: 10px; height: 10px; color: var(--ldim); transition: transform .4s var(--ease), color .3s; }
.tile__arrow svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; }
.tile__link:hover .tile__arrow { color: var(--light); transform: translate(2px, 2px); }

/* ---------------- CASE ---------------- */
.case { --panel: 63.2rem; }
.case__scroll {
  position: absolute; top: 0; bottom: 0; left: 0; right: var(--panel);
  overflow-y: auto; overflow-x: hidden;
  padding: 9.6rem 2.4rem 12rem;
  scrollbar-width: none;
}
.case__scroll::-webkit-scrollbar { display: none; }
.case__media { transition: opacity .35s var(--ease), transform .6s var(--ease); display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 1.6rem; max-width: 150rem; margin: 0 auto; transition: opacity .3s; }
.case__item { position: relative; background: #0e1638; overflow: hidden; cursor: zoom-in; will-change: transform, opacity; transform-origin: 50% 50%; }
.case__item img { width: 100%; height: auto; transform: translate3d(0, var(--py, 0px), 0) scale(1.06); will-change: transform; }

.case__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--panel);
  background: var(--sand); color: var(--fg);
  padding: 9.6rem 2.4rem 4rem;
  overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  letter-spacing: -.01em;
  transform: translateX(100%);
  transition: transform 1s var(--ease);
}
.case__panel::-webkit-scrollbar { display: none; }
[data-scene="case"] .case__panel { transform: none; }
/* text comes out of a blur like on About: when its page opens and whenever it scrolls into view (both directions) */
.txt { opacity: 0; filter: blur(1.2rem); transform: translateY(2.4rem);
  transition: opacity .9s var(--ease), filter 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(.2s + var(--d, 0) * 90ms); }
[data-scene="case"] .txt.is-in, [data-scene="contacts"] .txt.is-in { opacity: 1; filter: none; transform: none; }
.case__panel.is-swap .txt { opacity: 0; filter: blur(.6rem); transform: translateY(1rem); transition-delay: 0s; transition-duration: .25s; }
.case__top { display: flex; justify-content: space-between; align-items: center; }
.case__back { display: inline-flex; align-items: center; gap: .6rem; margin-left: -.4rem; color: var(--dim); font-weight: 500; transition: color .4s var(--ease); }
.case__back:hover { color: var(--fg); }
.case__back svg { width: 1.6rem; min-width: 12px; height: 1.2rem; min-height: 9px; fill: none; stroke: currentColor; stroke-width: 1.2; transition: transform .3s var(--ease); }
.case__back:hover svg { transform: translateX(-3px); }
.case__count { color: rgb(var(--fg-rgb) / .4); font-feature-settings: "tnum"; }
.case__title { margin-top: 4.8rem; font-size: 7.6rem; line-height: 8.4rem; font-weight: 600; letter-spacing: -.06em; padding-right: .06em; }
.case__headline { margin-top: 2.4rem; max-width: 56rem; font-size: 4.4rem; line-height: 4.8rem; font-weight: 500; letter-spacing: -.055em; text-wrap: balance; }
.case__dim { color: rgb(var(--fg-rgb) / .36); }
.case__about { margin-top: 2.4rem; max-width: 46rem; color: var(--dim); }
.case__facts { margin-top: 3.6rem; display: grid; grid-template-columns: 1fr 1.35fr; grid-template-rows: repeat(2, auto); grid-auto-flow: column; gap: .6rem 2.4rem; }
.case__facts div { display: grid; grid-template-columns: 9rem 1fr; gap: 1.2rem; }
.case__facts dt { color: var(--dim); }
.case__nav { margin-top: auto; padding-top: 6.4rem; }
.case__next { display: grid; gap: .2rem; padding-top: 1.6rem; border-top: 1px solid rgb(var(--fg-rgb) / .2); }
.case__next-label { color: var(--dim); }
.case__next-title { font-size: 3.6rem; line-height: 1.1; font-weight: 600; letter-spacing: -.05em; transition: color .3s; }
.case__next-title::after { content: " →"; }
.case__next:hover .case__next-title { color: var(--accent); }

/* ---------------- ABOUT ---------------- */
.about { --split: 78rem; color: var(--fg); }
.about__photo { position: absolute; inset: 0; overflow: hidden; background: #1a3ccc; }
.about__layer {
  --ph: max(100vh, calc(var(--split) * 2.08));
  position: absolute; height: var(--ph); width: auto; max-width: none;
  top: calc(50% - var(--ph) * .47);
  left: calc(var(--split) - var(--ph) * .49);   /* the middle of the face sits on the edge of the panel */
  transform: translateX(calc(50vw - var(--split))) scale(1.14); transform-origin: 49% 42%;
  transition: transform 1.5s var(--ease-io) .15s;
}
[data-scene="about"] .about__layer { transform: none; transition-delay: .55s; }
.about__layer { width: var(--ph); }
.about__layer { background: var(--sand); }
.about__layer > * { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
/* the panel: sand background + the other half of the face as dots, wipes in together with the text */
.about__bg {
  position: absolute; top: 0; bottom: 0; right: 0; left: var(--split); overflow: hidden; background: var(--sand);
  clip-path: inset(0 0 0 100%); transition: clip-path 1.5s var(--ease-io);
}
[data-scene="about"] .about__bg { clip-path: inset(0 0 0 0); transition-delay: .7s; }
.about__dots--panel {
  --ph: max(100vh, calc(var(--split) * 2.08));
  position: absolute; width: var(--ph); height: var(--ph); max-width: none;
  top: calc(50% - var(--ph) * .47); left: calc(var(--ph) * -.49);
  opacity: calc(var(--dots, 1) * .42); transition: opacity .3s linear;
}
.about__scroll {
  position: absolute; top: 0; bottom: 0; right: 0; left: var(--split);
  background: transparent;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  clip-path: inset(0 0 0 100%);
  transition: clip-path 1.5s var(--ease-io);
}
.about__scroll::-webkit-scrollbar { display: none; }
[data-scene="about"] .about__scroll { clip-path: inset(0 0 0 0); transition-delay: .7s; }
.about__content { counter-reset: block; padding: 0 6.4rem 12rem 6.4rem; max-width: 100%; overflow-wrap: break-word; letter-spacing: -.01em; font-size: max(1.8rem, 12px); line-height: max(2.3rem, 15px); }
.about__head { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: max(3.2rem, 20px); }
.about__title { font-size: min(15.6rem, 9.2vw); line-height: 1; font-weight: 600; letter-spacing: -.06em; }
.about__line { display: block; padding-right: .06em; }
.about__lead { margin: 3.2rem 0 0 auto; width: 49.3rem; max-width: 100%; }
.about__block { position: relative; counter-increment: block; margin-top: 20rem; padding-top: 2.4rem; border-top: 1px solid rgb(var(--fg-rgb) / .25); }
.about__block::before { content: counter(block, decimal-leading-zero); position: absolute; top: 2.4rem; right: 0; color: var(--dim); }
.about__label { color: var(--dim); margin-bottom: 4.8rem; }
.about__numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4rem 2.4rem; align-items: start; }
.about__stat { display: flex; flex-direction: column; gap: 1.2rem; }
.about__stat strong { font-size: 9.4rem; line-height: 1; font-weight: 600; letter-spacing: -.06em; color: var(--accent); text-shadow: 0 0 .2em rgb(var(--accent-rgb) / .25); font-feature-settings: "tnum"; }
.about__services { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6.4rem 4rem; }
.about__item { display: flex; flex-direction: column; gap: 1.6rem; }
.about__num { color: var(--dim); }
.about__name { font-size: 3.6rem; line-height: 1; font-weight: 600; letter-spacing: -.05em; padding-right: .05em; }
.about__item p { color: rgb(var(--fg-rgb) / .8); }
.about__exp li { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: .4rem 2.4rem; padding: 2rem 0; border-bottom: 1px solid rgb(var(--fg-rgb) / .12); }
.about__exp li:first-child { padding-top: 0; }
.about__exp li:last-child { border-bottom: 0; }
.about__period { color: var(--dim); }
.about__company { font-size: 2.8rem; line-height: 1.1; font-weight: 600; letter-spacing: -.05em; }
.about__role { color: var(--dim); margin-top: .4rem; }
.about__exp p { grid-column: 2; color: rgb(var(--fg-rgb) / .8); margin-top: .8rem; }
.about__list li { display: inline; font-size: 4rem; line-height: 1.25; font-weight: 600; letter-spacing: -.05em; }
.about__list li:not(:last-child)::after { content: ", "; color: var(--accent); white-space: pre; }
.about__cta { margin-top: 20rem; display: flex; flex-direction: column; gap: 4.8rem; }
.about__motto { font-size: 8.4rem; line-height: .88; font-weight: 600; letter-spacing: -.06em; }
.about__motto span { display: block; padding-right: .06em; }
.about__dim { opacity: .4; text-shadow: none; }
.about__button {
  display: grid; place-items: center; width: 49.3rem; max-width: 100%; height: 8.4rem; border-radius: .6rem;
  background: var(--fg); color: var(--sand); letter-spacing: -.01em; font-size: max(1.8rem, 14px);
  transition: background-color .4s var(--ease);
}
.about__button:hover { background: var(--accent); }
.reveal > *, .about__head > * { opacity: 0; filter: blur(1.2rem); transform: translateY(2.4rem);
  transition: opacity .9s var(--ease), filter 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.is-in > *, [data-scene="about"] .about__head > * { opacity: 1; filter: none; transform: none; }
[data-scene="about"] .about__head > * { transition-delay: calc(1.25s + var(--d, 0) * 150ms); }
.reveal { border-top-color: transparent; transition: border-color .8s var(--ease); }
.reveal.is-in { border-top-color: rgb(var(--fg-rgb) / .25); }

/* ---------------- CONTACTS ---------------- */
.contacts { background: var(--sand); color: var(--fg); }
.contacts__scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.contacts__scroll::-webkit-scrollbar { display: none; }
.contacts__inner { width: 92.4rem; max-width: calc(100% - 4rem); margin: 0 auto; padding: 9.6rem 0 5.6rem; }
.contacts__meta { display: flex; justify-content: space-between; margin-bottom: .9rem; letter-spacing: -.01em; color: var(--dim); font-size: max(1.5rem, 12px); line-height: max(1.8rem, 15px); }
.contacts__time { display: inline-flex; align-items: center; gap: .8rem; font-feature-settings: "tnum"; }
.contacts__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }
.contacts__links { display: flex; justify-content: space-between; margin-top: 2.4rem; font-size: 5.4rem; line-height: 6.6rem; font-weight: 600; letter-spacing: -.09em; }
.contacts__link { padding-right: .09em; transition: transform .4s var(--ease), text-shadow .4s; }
.contacts__link:hover { transform: translateY(-.3rem); text-shadow: 0 0 .06em rgb(var(--accent-rgb) / .7), 0 0 .4em rgb(var(--accent-rgb) / .45); }
.contacts__send {
  display: flex; align-items: center; justify-content: center; gap: 1.6rem;
  width: 100%; height: 8.4rem; margin-top: 6.4rem; border-radius: .6rem;
  background: var(--fg); color: var(--sand); letter-spacing: -.01em; font-size: max(1.8rem, 14px);
  transition: background-color .4s var(--ease);
}
.contacts__send:hover { background: var(--accent); }
.contacts__tg-icon { width: max(2.4rem, 18px); height: max(2.4rem, 18px); flex: none; margin-right: -.6rem; }
/* keep the blur-in of .txt: the hover colour transition alone made the button pop in before the page */
.contacts__send.txt { transition-property: opacity, filter, transform, background-color; transition-duration: .9s, 1.1s, 1.1s, .4s;
  transition-delay: var(--txd), var(--txd), var(--txd), 0s; --txd: calc(.2s + var(--d, 0) * 90ms); }
.contacts__handle { opacity: .55; }
.contacts__legal { margin-top: 1.6rem; text-align: center; letter-spacing: -.01em; font-size: max(1.2rem, 11px); line-height: max(1.6rem, 14px); color: var(--dim); }

/* blog: the Telegram channel, two columns of posts moving in a loop */
.blog { margin-top: 9.6rem; padding-top: 2.4rem; border-top: 1px solid rgb(var(--fg-rgb) / .25); letter-spacing: -.01em; }
.blog[hidden] { display: none; }
.blog__bar { display: flex; justify-content: space-between; align-items: baseline; gap: 1.6rem; flex-wrap: wrap; font-size: max(1.5rem, 12px); line-height: max(1.8rem, 15px); color: var(--dim); }
.blog__meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.blog__meta b { color: var(--fg); font-weight: 500; }
.blog__meta a { color: var(--fg); }
.blog__meta a:hover { color: var(--accent); }
.blog__live { display: inline-flex; align-items: center; gap: .8rem; }
.blog__channel { display: flex; align-items: center; gap: 1.6rem; margin-top: 2.4rem; }
.blog__channel img { width: 7.2rem; height: 7.2rem; min-width: 48px; min-height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.blog__title { display: block; font-size: 4.2rem; line-height: 1; font-weight: 600; letter-spacing: -.07em; color: var(--accent); text-shadow: 0 0 .25em rgb(var(--accent-rgb) / .25); padding-right: .07em; }
.blog__desc { display: block; margin-top: 1.2rem; max-width: 64rem; color: var(--dim); }
.blog__channel:hover .blog__title { text-shadow: 0 0 .05em rgb(var(--accent-rgb) / .6), 0 0 .35em rgb(var(--accent-rgb) / .4); }
.blog__reels {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem;
  height: 84rem; margin-top: 2.4rem; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 95%, transparent);
  mask-image: linear-gradient(transparent, #000 10%, #000 95%, transparent);
}
.blog__reel { overflow: hidden; }
.blog__track { display: flex; flex-direction: column; gap: 1.6rem; animation: reel-up var(--dur, 60s) linear infinite; }
.blog__reel.is-down .blog__track { animation-name: reel-down; }
@keyframes reel-up { from { transform: translateY(0); } to { transform: translateY(calc(-50% - .8rem)); } }
@keyframes reel-down { from { transform: translateY(calc(-50% - .8rem)); } to { transform: translateY(0); } }
.post {
  display: flex; flex-direction: column; gap: 1.2rem; padding: 1.6rem;
  border: 1px solid rgb(var(--fg-rgb) / .14); border-radius: .6rem; background: rgb(255 255 255 / .16);
  transition: background-color .3s, border-color .3s;
}
.post:hover { background: rgb(255 255 255 / .32); border-color: rgb(var(--fg-rgb) / .3); }
.post__top { display: flex; justify-content: space-between; color: var(--dim); font-size: max(1.4rem, 11px); }
.post__text { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; font-size: max(1.4rem, 12px); line-height: max(1.9rem, 16px); }
.post__media { border-radius: .4rem; overflow: hidden; background: rgb(var(--fg-rgb) / .08); }
.post__media img { width: 100%; height: auto; max-height: 30rem; object-fit: cover; }
.post__more { color: var(--accent); font-size: max(1.4rem, 11px); }

/* ---------------- lightbox ---------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 85; display: grid; place-items: center;
  background: rgb(4 7 24 / .93); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: fadein .35s ease; letter-spacing: -.01em;
}
.lightbox[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } }
.lightbox__fig { display: grid; justify-items: center; gap: 1.2rem; }
.lightbox__fig img { max-width: min(1200px, 86vw); max-height: 84vh; max-height: 84dvh; width: auto; height: auto; box-shadow: 0 30px 90px rgb(0 0 0 / .6); cursor: zoom-in; transition: transform .4s var(--ease); }
.lightbox__fig img.is-zoom { transform: scale(1.8); cursor: zoom-out; }
.lightbox__fig figcaption { font-size: 12px; color: var(--ldim); font-feature-settings: "tnum"; }
.lightbox__btn { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; font-size: 18px; color: rgb(var(--light-rgb) / .7); transition: color .3s; }
.lightbox__btn:hover { color: var(--light); }
.lightbox__close { top: 22px; right: 28px; }
.lightbox__prev { left: 28px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 28px; top: 50%; transform: translateY(-50%); }

/* ---------------- phones and portrait screens ---------------- */
@media (orientation: portrait), (max-width: 767px) {
  html { font-size: min(2.5641vw, 1.18483svh); }
  .nav { font-size: 1.5rem; line-height: 2rem; gap: 1.6rem; }
  .logo { font-size: 1.5rem; line-height: 2rem; }

  /* hero: words stacked across the portrait, like a poster */
  /* phone: both words centred under the face, on the chest */
  .hero__title {
    top: 64%; height: auto; font-size: 7.1rem; line-height: 1;
    display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 0 2rem;
  }
  .hero__lead { position: static; display: block; height: auto; }
  /* a soft navy shade under the title so the yellow words read on the yellow shirt */
  .hero::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52%; pointer-events: none;
    background: linear-gradient(rgb(var(--ink-rgb) / 0), rgb(var(--ink-rgb) / .55) 45%, rgb(var(--ink-rgb) / .75));
    transition: opacity 1s var(--ease) 1.2s;
  }
  .is-intro .hero::before { opacity: 0; }
  .hero__word, .hero__role { font-size: 8.2rem; line-height: 1; }
  .hero__amp { font-size: 5.4rem; line-height: 1; }
  .hero__role { position: static; }
  .hero__scroll { bottom: max(3.6rem, calc(env(safe-area-inset-bottom) + 2rem)); font-size: 1.4rem; line-height: 1.8rem; }

  .portfolio__bar { gap: 3.2rem; top: calc(50% - var(--card-h) / 2 - 5.6rem); }
  .filters { font-size: 1.5rem; gap: 1.2rem; }
  .works__caption { top: calc(50% + var(--card-h) / 2 + 3rem); }
  .works__title { font-size: 2rem; line-height: 2.6rem; }
  .works__subtitle { font-size: 1.5rem; line-height: 2rem; }
  .view-grid .portfolio__bar { top: 7.6rem; }
  .grid { padding: 13rem 1.6rem 10rem; }
  .grid__list { grid-template-columns: 1fr 1fr; gap: 2.8rem 1.2rem; }
  .grid__list--wide { grid-template-columns: 1fr; }
  .tile__meta { font-size: 1.4rem; line-height: 1.8rem; padding: .8rem 0 1.2rem; }

  /* case: text first, pictures under it, one scroll */
  .case { overflow-y: auto; scrollbar-width: none; }
  [data-scene="case"] .case { display: flex; flex-direction: column; }
  .case__panel { position: relative; width: auto; order: -1; flex: none; transform: none; padding: 7.6rem 2rem 3.2rem; overflow: visible; font-size: 1.5rem; line-height: 2rem; }
  html:not([data-scene="case"]) .case__panel { transform: none; }
  .case__title { font-size: 5.2rem; line-height: 5.8rem; margin-top: 3.2rem; }
  .case__headline { margin-top: 1.2rem; font-size: 3rem; line-height: 3.3rem; }
  .case__about { margin-top: 1.6rem; }
  .case__facts { grid-template-columns: 1fr 1.25fr; gap: .4rem 1.6rem; margin-top: 2rem; }
  .case__facts div { grid-template-columns: 1fr; gap: 0; }
  .case__nav { display: none; }
  .case__scroll { position: relative; right: auto; top: auto; bottom: auto; overflow: visible; padding: 1.2rem 1.2rem 9rem; }
  .case__media { gap: .8rem; }

  /* about: photo on top, text below */
  .about { --split: 0px; }
  .about__photo { width: 100%; height: 52vh; bottom: auto; inset: 0 0 auto 0; }
  .about__layer { --ph: 100%; top: 0; left: 50%; height: 100%; width: auto; aspect-ratio: 1; transform: translateX(-50%); }
  [data-scene="about"] .about__layer { transform: translateX(-50%); }
  .about__bg, .about__dots { display: none !important; }
  .about__img { visibility: visible !important; }
  [data-scene="about"] .nav__link { color: var(--ldim); }
  [data-scene="about"] .nav__link.is-active { color: var(--light); }
  .about__scroll { left: 0; background: transparent; clip-path: none; }
  [data-scene="about"] .about__scroll { transition-delay: 0s; }
  [data-scene="about"] .about__head > * { transition-delay: calc(.3s + var(--d, 0) * 120ms); }
  .about__title { font-size: 5.4rem; }
  .about__content { padding: 0; font-size: 1.6rem; line-height: 2.1rem; }
  .is-scrolled[data-scene="about"] .nav__link { color: var(--dim); }
  .is-scrolled[data-scene="about"] .nav__link.is-active { color: var(--fg); }
  .about__head { min-height: auto; padding: 44vh 2rem 3.2rem; background: linear-gradient(transparent 0, transparent 40vh, var(--sand) 47vh); }
  .about__title { font-size: 5.4rem; }
  .about__lead { margin: 1.6rem 0 0; width: auto; }
  .about__block, .about__cta { background: var(--sand); margin: 0; padding: 4.8rem 2rem 2rem; border-top: 0; }
  .about__block::before { top: 4.8rem; right: 2rem; }
  .about__label { margin-bottom: 2.4rem; }
  .about__numbers { grid-template-columns: 1fr 1fr; }
  .about__stat strong { font-size: 5.6rem; }
  .about__services { grid-template-columns: 1fr; gap: 3.2rem; }
  .about__name { font-size: 2.8rem; }
  .about__exp li { grid-template-columns: 1fr; }
  .about__exp p { grid-column: 1; }
  .about__company { font-size: 2.4rem; }
  .about__list li { font-size: 3rem; }
  .about__cta { padding-bottom: 9rem; gap: 2.4rem; }
  .about__motto { font-size: 4.4rem; line-height: .95; }
  .about__button { width: 100%; height: 6rem; }

  .contacts__inner { width: 100%; max-width: none; padding: max(7.6rem, calc(env(safe-area-inset-top) + 6rem)) 2rem max(4rem, calc(env(safe-area-inset-bottom) + 2.4rem)); }
  .contacts__links { display: grid; grid-template-columns: 1fr 1fr; row-gap: .2rem; margin-top: 1.2rem; font-size: 3.8rem; line-height: 4.6rem; }
  .contacts__send { height: 6rem; margin-top: 3.2rem; }
  .blog { margin-top: 6.4rem; }
  .blog__channel { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .blog__title { font-size: 3.6rem; }
  .blog__reels { grid-template-columns: 1fr; height: 84rem; }
  .blog__reel.is-up { display: none; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; transform: none; }
  .lightbox__fig img { max-width: 94vw; }
}

/* calm mode (reduced motion) */
.is-calm *, .is-calm *::before, .is-calm *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }

/* ---------------- Hero <-> About transition (like the reference) ----------------
   On a computer About has no picture of its own: the Home photo (WebGL stage, app.js) stays on screen the whole time.
   1) the camera zooms onto the face; 2) when it is there (.cam-done) the same photo slides left while the panel
   wipes in from the right; 3) the text comes out of a blur. Back to Home (.about-out): the panel closes while the photo
   slides back to the middle, then the camera pulls out. */
.about-zoom .about__photo { background: transparent; }
.about-zoom .about__layer { display: none; }
.about-zoom[data-scene="about"] .about { transition: visibility 0s; }
.about-zoom[data-scene="about"] .about__scroll,
.about-zoom[data-scene="about"] .about__bg { transition: clip-path 1.4s var(--ease-io); }
.about-zoom[data-scene="about"]:not(.cam-done) .about__scroll,
.about-zoom[data-scene="about"]:not(.cam-done) .about__bg { clip-path: inset(0 0 0 100%); transition: none; }
.about-zoom[data-scene="about"] .about__head > * { transition-delay: calc(.9s + var(--d, 0) * 150ms); }
.about-zoom[data-scene="about"]:not(.cam-done) .about__head > * { opacity: 0; filter: blur(1.2rem); transform: translateY(2.4rem); transition: none; }
.about-zoom:not([data-scene="about"]) .about { transition: opacity .3s linear, visibility 0s linear .3s; }
.about-zoom.about-out .about { visibility: visible; opacity: 1; transition: none; }
.about-zoom.about-out .about__bg, .about-zoom.about-out .about__scroll { clip-path: inset(0 0 0 100%); transition: clip-path 1.4s var(--ease-io); }
.about-zoom.about-out .about__head > * { opacity: 0; transition: opacity .4s ease; transition-delay: 0s; }
.about-zoom.about-out .hero { transition-delay: 2.4s; }   /* the title comes back when the camera has almost pulled out */

/* ---------------- grid: cards roll over the top and bottom edge like a drum (scroll-driven, from app.js) ---------------- */
.grid { perspective: 1100px; perspective-origin: 50% 50%; }
.tile__link { transform-origin: 50% 100%; will-change: transform, opacity; backface-visibility: hidden; }

.case__media.is-out { opacity: 0; transform: translateY(2rem); transition-duration: .3s, .3s; }

/* ---------------- hand-over between pages ----------------
   The page you leave gets .is-leaving. If the new page is a solid one (About, Contacts), the old page stays whole
   underneath until the new one has fully come in — so the dark background never flashes through between two pages.
   Pages that open onto the photo (Home, Portfolio, a project) let the old page fade away as before. */
.scene.is-leaving { z-index: 9; pointer-events: none !important; }
[data-scene="about"] .scene.is-leaving,
[data-scene="contacts"] .scene.is-leaving {
  visibility: visible; opacity: 1;
  transition: opacity .35s ease var(--hold, .95s), visibility 0s linear calc(var(--hold, .95s) + .35s);
}
.about-zoom[data-scene="about"] .scene.is-leaving { --hold: 1.65s; }
/* the home title and the strip are see-through: they leave as before even under About/Contacts */
[data-scene="about"] .hero.is-leaving, [data-scene="contacts"] .hero.is-leaving,
[data-scene="about"] .portfolio.is-leaving, [data-scene="contacts"] .portfolio.is-leaving {
  opacity: 0; transition: opacity var(--t) var(--ease), visibility 0s linear var(--t);
}
.about-zoom[data-scene="about"] .portfolio.is-leaving { visibility: hidden; }
/* project → About/Contacts: the project pictures fade at once (held, they stood frozen and showed through the new page) */
[data-scene="about"] .case.is-leaving, [data-scene="contacts"] .case.is-leaving { opacity: 0; transition: opacity .5s var(--ease), visibility 0s linear .5s; }
