:root {
  --void: #0A0A0A;
  --deep: #050505;
  --black: #000000;
  --carbon: #141414;
  --line: #262626;
  --ash: #8C8C8C;
  --dim: #5E5E5E;
  --paper: #EDEDED;

  --font: Geist, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* Spacing: one scale, 4px steps that grow as things get further apart. Use these, not raw px.
     --s-1..--s-4 inside a component (icon to label, label to value, between buttons),
     --s-5..--s-7 between the parts of a block (heading to list, card to card),
     --s-8..--s-10 between blocks. Sections use the fluid rhythm below. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  /* page rhythm (fluid between phone and desktop) */
  --section: clamp(var(--s-9), 11vw, 160px);      /* above and below every section */
  --block: clamp(var(--s-8), 8vw, var(--s-10));    /* between big blocks inside a page */
  --page-top: clamp(120px, 12vw, 176px);           /* first content under the fixed bar */
  /* one edge for everything: bar, name, sections, footer and banner all line up on it */
  --gutter: clamp(var(--s-4), 2vw, var(--s-6));
  --name-size: calc((100vw - var(--gutter) * 2) / 6.85);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--void); color: var(--paper); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.mono { font-family: var(--mono); font-size: 12px; color: var(--ash); }
.mono--dim { color: var(--dim); }

.btn { display: inline-flex; align-items: center; gap: var(--s-2); height: 48px; padding: 0 var(--s-5); border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 500; }
.btn--primary { background: var(--paper); color: var(--void); }
.btn--primary .mono { color: inherit; font-size: 13px; }

/* ---------- Hero ---------- */

.hero { position: relative; height: 100vh; height: 100svh; min-height: 640px; }
html, body { overflow-x: clip; }

/* the canvas runs past the hero so the portrait can sink into the next section */
.hero__portrait { position: absolute; top: 0; left: 0; width: 100%; height: calc(100% + 45vh); z-index: 2; pointer-events: none; }

.hero__name {
  position: fixed; top: var(--s-5); transform-origin: 0 0; will-change: transform; left: var(--gutter); right: var(--gutter); z-index: 1;
  margin: 0; font-size: var(--name-size); line-height: .8; font-weight: 500; letter-spacing: -.06em; white-space: nowrap;
}
.hero__name .dot { color: var(--paper); }
/* the drawn D and A (see i18n.js): the mark's letters, cap-height tall, on the baseline.
   Margins = the title's tracking (-.06em), plus Geist's "Ar" kerning for the A. */
.glyph { display: inline-block; height: .71em; width: auto; fill: currentColor; vertical-align: baseline; overflow: visible; }
.glyph--d { margin-right: -.06em; }
.glyph--a { margin-right: -.08em; }
/* Folding into "DA.": the A slides back over the D to its place in the mark (-.147em once the
   letters between have folded away) and a dark outline around it cuts the gap into the D,
   growing to the mark's 36 units. */
.hero__name .glyph--a { margin-left: calc(var(--fold, 0) * -.147em); }
.hero__name .glyph--a path { stroke: var(--void); stroke-width: calc(var(--fold, 0) * 36px); stroke-linejoin: miter; paint-order: stroke; }
.mark { display: inline-block; height: .71em; width: auto; fill: currentColor; vertical-align: baseline; }
/* the rise-in masks clip each word; once the name folds the A must be free to slide over the D */
.hero__name.is-docked .rise-mask { overflow: visible; }
/* in "DA." the dot sits right after the A's foot: give it the gap "m." would have had */
.hero__name .name__keep.dot { margin-left: calc(var(--fold, 0) * .08em); }
.bar__logo .dot { margin-left: .08em; }
.hero__name a { color: inherit; text-decoration: none; }
/* scrolling folds the name into "DA.": the letters between D, A and the dot shrink away */
.name__fold { display: inline-block; overflow: hidden; vertical-align: bottom; white-space: pre; padding: .12em 0 .26em; margin: -.12em 0 -.26em; } /* room for ascenders and the y's tail */
.hero__name.is-docked { z-index: 61; }

.hero__bar {
  position: fixed; left: var(--gutter); right: var(--gutter); z-index: 3;
  top: var(--s-4);
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-5);
}
.nav { display: flex; gap: var(--s-6); }
.nav__link { white-space: nowrap; display: flex; align-items: center; gap: var(--s-2); min-height: 32px; text-decoration: none; font-size: 15px; color: var(--ash); transition: color .3s; }
.nav__link small { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.nav__link:hover, .nav__link.is-current { color: var(--paper); }
.hero__meta { display: flex; align-items: center; gap: var(--s-5); }
.lang { display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; -webkit-tap-highlight-color: transparent; font-family: var(--mono); font-size: 12px; }
.lang__sep { color: var(--dim); }
.lang__opt { all: unset; cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; color: var(--dim); transition: color .45s var(--ease); }
.lang__opt.is-active { color: var(--paper); }
.lang__opt:focus-visible { outline: 1px solid var(--paper); outline-offset: var(--s-1); border-radius: 2px; }
/* each label is stacked twice and rolls up like a split-flap on hover and when chosen */
.lang__roll { display: inline-flex; flex-direction: column; height: 1.25em; line-height: 1.25em; overflow: hidden; }
.lang__roll span { transition: transform .55s var(--ease); }
.lang__opt:hover .lang__roll span, .lang__opt.is-rolling .lang__roll span { transform: translateY(-100%); }
.lang__roll.no-anim span { transition: none; }


/* the bar is pinned to the top; once the name has folded into "DA." it sits at the bar's left
   and the links slide over to make room; a soft fade keeps the bar readable over the page */
.hero__bar { z-index: 60; transition: none; }
/* the bar is transformed, so its ::before is laid out relative to the bar: reach back out to the screen edges */
.hero__bar::before { content: ''; position: absolute; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); top: calc(-1 * var(--s-4)); height: 112px;
  background: linear-gradient(to bottom, rgba(10,10,10,.95) 45%, rgba(10,10,10,0)); opacity: var(--fade, 0); transition: opacity .35s var(--ease); }
.nav { margin-left: calc(var(--logo-w, 0px) * var(--dock, 0)); }
/* links, clock and language always sit above the fade */
.hero__bar > .nav, .hero__bar > .hero__meta, .hero__bar > .bar__logo { position: relative; z-index: 1; }

/* intro: once the portrait has assembled, every piece of the interface slides up out of a mask
   (same motion as the About text): first "Durytskyi", then "Artem.", then the rest */
.rise-mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .14em 0 .2em; margin: -.14em 0 -.2em; }
[data-rise] { transition: transform .85s var(--ease) var(--d, 0ms); }
span[data-rise] { display: inline-block; }
.is-loading [data-rise] { opacity: 0; transform: translateY(115%); }
.hero__name .rise-mask { padding: .1em .02em .22em; margin: -.1em -.02em -.22em; }

/* ---------- About ---------- */

.about { padding: var(--section) var(--gutter); }
.about__text { margin: 0 auto; max-width: 1140px; font-size: clamp(32px, 4.4vw, 60px); line-height: 1.12; font-weight: 500; letter-spacing: -.03em; color: var(--dim); }
.about__text em { font-style: normal; color: var(--paper); } /* only seen mid-translation, before the text is split into lines again */

/* line reveal (js/reveal.js) */
.reveal__line { display: block; overflow: hidden; white-space: nowrap; /* scrambled letters can't re-wrap a line */ padding-bottom: .06em; margin-bottom: -.06em; }
.reveal__inner { display: block; will-change: transform; }
.reveal__word { transition: color .7s var(--ease); }
.reveal__word.is-accent { color: var(--dim); }
.reveal__word.is-accent.is-lit { color: var(--paper); }

/* ---------- Macintosh ---------- */

/* pinned for four screens of scroll: the Mac turns 75° → 0°, chapters take turns around it */
.mac {
  position: relative; height: 400vh;
  /* the page's soft #0A0A0A sinks very gradually into true black for the Mac, and back out again */
  background: linear-gradient(to bottom,
    var(--void) 0, var(--black) 70vh,
    var(--black) calc(100% - 70vh), var(--void) 100%);
}
.mac__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.mac__ascii {
  position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%);
  width: min(62vw, 900px); height: 78vh; margin: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-family: var(--mono); font-size: 7px; line-height: 1.1; color: #D2D2D2; white-space: pre; user-select: none;
}
.mac__chapter { position: absolute; top: 50%; width: min(300px, 22vw); transform: translateY(-50%); }
.mac__chapter--left { left: clamp(var(--s-4), 4vw, var(--s-8)); }
.mac__chapter--right { right: clamp(var(--s-4), 4vw, var(--s-8)); text-align: right; }
.mac__chapter h3 { margin: 0 0 var(--s-3); font-size: clamp(26px, 2.8vw, 42px); line-height: 1.05; font-weight: 500; letter-spacing: -.035em; }
.mac__chapter p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ash); }
.mac__mask { display: block; overflow: hidden; padding-bottom: .1em; }
.mac__mask > * { transform: translateY(140%); transition: transform .85s var(--ease); }
.mac__mask + .mac__mask > * { transition-delay: .08s; }
.mac__chapter.is-active .mac__mask > * { transform: none; }
.mac__chapter.is-past .mac__mask > * { transform: translateY(-140%); }


@media (max-width: 760px) {
  .mac__ascii { top: 40%; width: calc(100vw - 2 * var(--gutter)); height: 52vh; font-size: 4.4px; }
  .mac__chapter, .mac__chapter--left, .mac__chapter--right { top: auto; bottom: 10vh; left: var(--gutter); right: var(--gutter); width: auto; transform: none; text-align: left; }
  .mac__chapter h3 { font-size: 30px; }
  .mac__chapter p { font-size: 15px; }
}

/* ---------- Work ---------- */

.work { padding: var(--section) var(--gutter); }
.work__head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-7); }
.work__title { margin: 0; font-size: clamp(48px, 7vw, 104px); line-height: .9; font-weight: 500; letter-spacing: -.05em; }
.work__title .mono { font-size: .3em; letter-spacing: 0; vertical-align: top; }
.work__all { color: var(--paper); text-decoration: none; border-bottom: 1px solid #444; padding-bottom: var(--s-1); font-size: 13px; transition: border-color .3s; }
.work__all:hover { border-color: var(--paper); }

.work__list { list-style: none; margin: 0; padding: 0; }
.work__row {
  display: grid; grid-template-columns: 48px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.6fr) 64px; gap: var(--s-4); align-items: baseline;
  padding: var(--s-6) 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--paper);
  transition: opacity .4s var(--ease);
}
.work__num { color: var(--dim); font-size: 13px; }
.work__name { font-size: clamp(28px, 3vw, 44px); font-weight: 500; letter-spacing: -.03em; transition: transform .5s var(--ease), color .4s; }
.work__arrow { display: inline-block; font-size: .7em; vertical-align: .25em; }
.work__type { font-size: 15px; color: #B5B5B5; }
.work__stack, .work__year { font-size: 13px; color: var(--ash); }
.work__year { text-align: right; }
.work__row.is-featured .work__name, .work__row.is-featured .work__num { color: var(--paper); }
/* hovering one project quietly dims the others */
@media (hover: hover) {
  .work__list:hover .work__row { opacity: .35; }
  .work__list .work__row:hover { opacity: 1; }
  .work__row:hover .work__name { transform: translateX(var(--s-3)); }
}

/* the character preview that follows the cursor */
.peek {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  border-radius: 10px; overflow: hidden;
  /* opens empty: the backing, border and shadow fade in while the characters assemble */
  background: rgba(10, 10, 10, 0); border: 1px solid rgba(38, 38, 38, 0); box-shadow: 0 30px 80px rgba(0, 0, 0, 0);
  opacity: 0; transition: opacity .25s var(--ease), background .9s var(--ease), border-color .9s var(--ease), box-shadow .9s var(--ease);
}
.peek.is-visible { opacity: 1; }
.peek.is-filled { background: rgba(10, 10, 10, 1); border-color: var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.peek canvas { display: block; }

@media (max-width: 760px) {
  .work__row { grid-template-columns: 32px 1fr auto; row-gap: var(--s-2); }
  .work__type { grid-column: 2; font-size: 13px; color: var(--ash); }
  .work__stack { display: none; }
  .work__year { grid-column: 3; grid-row: 1; }
}

/* ---------- Outside-link arrow ---------- */

/* ↗ on every link that leaves the site. On hover it flies out of its little cell to the top
   right while its twin (a text-shadow waiting at the bottom left) slides into place. */
.arr { display: inline-block; overflow: hidden; vertical-align: bottom; line-height: 1.15; padding: 0 .02em; }
.arr > span { display: inline-block; text-shadow: -1.1em 1.1em 0 currentColor; transition: transform .55s var(--ease); }
a:hover .arr > span, a:focus-visible .arr > span { transform: translate(1.1em, -1.1em); }

/* ---------- Footer ---------- */

.footer { padding: calc(var(--section) * 1.5) var(--gutter) var(--s-6); font-family: var(--mono); font-size: 13px; }
.footer a { color: var(--paper); text-decoration: none; transition: color .3s; }
.footer a:hover { color: var(--paper); }
.footer__top { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-6); flex-wrap: wrap; padding-bottom: var(--s-6); border-bottom: 1px solid #1E1E1E; }
.footer__title { margin: 0; font-family: var(--font); font-size: clamp(64px, 12vw, 200px); white-space: nowrap; transition: font-size .7s var(--ease); line-height: .86; font-weight: 500; letter-spacing: -.06em; color: var(--paper); }
.footer__title em { font-style: normal; }
.footer__mail { margin-left: auto; font-family: var(--font); font-size: clamp(22px, 3vw, 48px); letter-spacing: -.02em; padding-bottom: var(--s-3); border-bottom: 1px solid #333; margin-bottom: var(--s-2); }
.footer__mail:hover { border-color: var(--paper); }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); padding-top: var(--s-6); }
.footer__col { display: flex; flex-direction: column; gap: var(--s-3); align-items: flex-start; color: var(--paper); }
.footer__label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ash); margin-bottom: var(--s-1); }
.footer__sub { font-size: 11px; color: var(--dim); }
.footer__dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--paper); margin-right: var(--s-2); vertical-align: 1px; }
.footer__bottom { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-9); font-size: 12px; color: var(--ash); }
.footer__bottom a { color: var(--ash); }
.footer a.footer__credit { color: var(--dim); }

/* Ukrainian "Поговорімо." is longer, so it sets a little smaller */
:root[lang="uk"] .footer__title { font-size: clamp(44px, 8.6vw, 150px); }

/* the title uses the same line reveal as About */
.footer__title .reveal__word.is-accent:not(.is-lit) { color: var(--paper); }

@media (max-width: 760px) {
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-7); }
  .footer__bottom { flex-direction: column; margin-top: var(--s-8); }
}

/* ---------- Work page ---------- */

/* the bar is already docked here: logo at the left, fade behind it */
.hero__bar.is-static { --dock: 1; --fade: 1; --logo-w: 0px; }
.bar__logo { flex-shrink: 0; white-space: nowrap; font-size: 24px; line-height: .8; font-weight: 500; letter-spacing: -.06em; text-decoration: none; color: var(--paper); margin-right: var(--s-6); padding: var(--s-2) 0; }
.bar__logo .dot { color: var(--paper); }
.hero__bar.is-static { justify-content: flex-start; }
.hero__bar.is-static .hero__meta { margin-left: auto; }
.nav__link.is-current { color: var(--paper); }

.archive { padding: var(--page-top) var(--gutter) var(--section); }
.archive__head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-6); flex-wrap: wrap; margin-bottom: var(--s-8); }
.archive__title { margin: 0; font-size: clamp(88px, 15vw, 220px); line-height: .82; font-weight: 500; letter-spacing: -.06em; display: flex; align-items: flex-start; gap: .08em; }
.archive__title sup { font-size: max(14px, .14em); letter-spacing: 0; color: var(--ash); margin-top: .2em; }
.archive__title .rise-mask { padding-bottom: .12em; margin-bottom: -.12em; }
.archive__lead { margin: 0; max-width: 380px; font-size: 16px; line-height: 1.55; color: var(--ash); }

.archive__tools { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chips, .toggles { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.chip { all: unset; cursor: pointer; height: 40px; padding: 0 var(--s-4); border-radius: 999px; border: 1px solid #333; font-size: 14px; color: var(--paper); display: inline-flex; align-items: center; gap: var(--s-2); transition: background .4s var(--ease), color .4s var(--ease), border-color .4s; }
.chip__n { font-size: 11px; color: var(--ash); transition: color .4s; }
.chip:hover { border-color: var(--ash); }
.chip.is-on { background: var(--paper); color: var(--void); border-color: var(--paper); }
.chip.is-on .chip__n { color: #555; }
.toggle { all: unset; cursor: pointer; min-height: 40px; padding: 0 var(--s-3); display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--mono); font-size: 13px; color: var(--ash); transition: color .3s; }
.toggle:hover, .toggle.is-on { color: var(--paper); }
.toggle__box { width: 12px; height: 12px; border: 1px solid #555; border-radius: 3px; display: inline-block; position: relative; transition: border-color .3s, background .3s; }
.toggle.is-on .toggle__box { background: var(--paper); border-color: var(--paper); }
.sort { all: unset; cursor: pointer; min-height: 40px; padding: 0 0 0 var(--s-4); display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ash); transition: color .3s; }
.sort:hover { color: var(--paper); }
.sort__arrow { display: inline-block; transition: transform .5s var(--ease); }
.sort.is-up .sort__arrow { transform: rotate(180deg); }
.chip:focus-visible, .toggle:focus-visible, .sort:focus-visible { outline: 1px solid var(--paper); outline-offset: 3px; }

.archive__grid { list-style: none; margin: var(--s-7) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-8) var(--s-6); }
.card { display: flex; flex-direction: column; gap: var(--s-4); }
.card.is-gone { display: none; }
.card__media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 24px; background: #0E0E0E; border: 1px solid #1E1E1E; overflow: hidden; transition: border-color .5s var(--ease), background .5s var(--ease); }
.card__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .8s var(--ease); }
.card__media:hover { border-color: #333; background: #111; }
.card__media:hover canvas { transform: scale(1.025); }
.card__media:focus-visible { outline: 1px solid var(--paper); outline-offset: var(--s-1); }
.card__info { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); }
.card__name { margin: 0; font-size: clamp(28px, 2.8vw, 44px); line-height: 1; font-weight: 500; letter-spacing: -.035em; }
.card__name a { text-decoration: none; }
.card.is-featured .card__name { color: var(--paper); }
.card__arrow { font-size: .65em; vertical-align: .3em; }
.card__meta { font-size: 13px; color: var(--ash); white-space: nowrap; }
.card__sub { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: calc(-1 * var(--s-2)); font-size: 12px; }
.card__stack { color: var(--dim); }
.card__links { display: flex; gap: var(--s-4); }
.card__link { color: var(--ash); text-decoration: none; transition: color .3s; }
.card__link:hover { color: var(--paper); }
.archive__empty { padding: var(--s-7) 0; color: var(--dim); text-align: center; }
/* entrance */
.archive__grid .card { transform: translateY(var(--s-6)); opacity: 0; transition: transform .9s var(--ease) calc(var(--i, 0) * 70ms + 300ms), opacity .9s var(--ease) calc(var(--i, 0) * 70ms + 300ms); }
.archive__grid.is-in .card { transform: none; opacity: 1; }

@media (max-width: 760px) {
  .archive__grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .card__media { border-radius: 18px; }
  .bar__logo { margin-right: var(--s-4); font-size: 20px; }
  /* on phones the three links sit centred between the logo and the language switch */
  .hero__bar.is-static .nav { flex: 1; justify-content: center; margin-left: 0; }
  .hero__bar.is-static .hero__meta { margin-left: 0; }
  .bar__logo { margin-right: 0; }
  .toggles { width: 100%; justify-content: space-between; }
}

/* ---------- Project page ---------- */

.case__media { position: relative; display: block; margin: 0; border-radius: 24px; background: #0E0E0E; border: 1px solid #1E1E1E; overflow: hidden; aspect-ratio: 16 / 10; }
.case__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.glyph-real { position: absolute; display: block; object-fit: fill; border-radius: 4px; visibility: hidden; pointer-events: none; }
.is-flippable { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color .5s var(--ease); }
.is-flippable:hover { border-color: #333; }
.is-flippable:focus-visible { outline: 1px solid var(--paper); outline-offset: var(--s-1); }
.is-flippable.is-busy { cursor: progress; }

.case__head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-6); margin-bottom: var(--s-7); }
/* the rise-in masks are the real layout boxes here */
.case__row { align-self: stretch; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--s-5) var(--s-7); }
.case__row > :last-child { flex: 0 1 420px; }
.case__back { text-decoration: none; transition: color .3s; }
.case__back:hover { color: var(--paper); }
.case__title { margin: 0; font-size: clamp(64px, 11vw, 168px); line-height: .86; font-weight: 500; letter-spacing: -.055em; }
.case__title .rise-mask { padding-bottom: .12em; margin-bottom: -.12em; }
.case__lead { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ash); overflow: hidden; }

.case__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-5); margin: 0 0 var(--s-7); padding: var(--s-5) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case__facts dt { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--s-2); }
.case__facts dd { margin: 0; font-size: 15px; }
.case__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.case__links a { text-decoration: none; transition: color .3s; }
.case__links a:hover { color: var(--paper); }

.case__cover { aspect-ratio: 16 / 9; }

.case__about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s-6) var(--s-8); margin: var(--block) 0; overflow: hidden; }
.case__intro { margin: 0; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.22; letter-spacing: -.02em; }
.case__intro .reveal__line { white-space: nowrap; }
.case__more p { margin: 0 0 var(--s-4); font-size: 16px; line-height: 1.6; color: var(--ash); }

.case__features { margin: 0 0 var(--block); overflow: hidden; }
.case__features ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-7) var(--s-5); }
.case__features.has-shots ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-8) var(--s-6); }
.case__features li { display: grid; grid-template-columns: 32px 1fr; gap: 0 var(--s-3); align-content: start; padding-top: var(--s-4); border-top: 1px solid var(--line); }
.case__features.has-shots li { padding-top: 0; border-top: 0; }
.case__features li .case__media { grid-column: 1 / -1; margin-bottom: var(--s-5); aspect-ratio: 4 / 3; }
.case__features li .mono { padding-top: 3px; }
.case__features p { margin: 0; font-size: 16px; line-height: 1.5; }

.case__gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); margin-bottom: var(--block); }
.case__gallery.is-odd .case__media:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }

.case__next { display: block; text-decoration: none; padding-top: var(--s-6); border-top: 1px solid var(--line); }
.case__next-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); margin: var(--s-4) 0 var(--s-6); }
.case__next-name { font-size: clamp(44px, 7vw, 104px); line-height: .9; font-weight: 500; letter-spacing: -.05em; }
.case__next-arrow { display: inline-block; transition: transform .6s var(--ease); }
.case__next:hover .case__next-arrow { transform: translateX(.18em); }
.case__next-media { aspect-ratio: 21 / 8; transition: border-color .5s var(--ease); }
.case__next:hover .case__next-media { border-color: #333; }

/* entrance: after the head rises, the cover slides up */
.case__cover, .case__next { transform: translateY(var(--s-6)); opacity: 0; transition: transform .9s var(--ease) .35s, opacity .9s var(--ease) .35s; }
.case.is-in .case__cover, .case.is-in .case__next { transform: none; opacity: 1; }

@media (max-width: 760px) {
  .case__facts { grid-template-columns: 1fr 1fr; }
  .case__media { border-radius: 18px; }
  .case__cover { aspect-ratio: 4 / 3; }
  .case__about { grid-template-columns: 1fr; }
  .case__features ol, .case__features.has-shots ol, .case__gallery { grid-template-columns: 1fr; gap: var(--s-6); }
  .case__next-row { flex-direction: column; gap: var(--s-2); }
  .case__next-media { aspect-ratio: 16 / 9; }
}

/* ---------- 404 ---------- */

/* the one unfinished page: "404" stalls before its end, the sentence has a cursor for a full stop */
.nf { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; gap: var(--s-5); padding: var(--page-top) var(--gutter) var(--section); }
.nf__art { position: relative; height: clamp(200px, 27vw, 400px); margin: 0 calc(-1 * var(--gutter)); }
.nf__art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.nf__title { margin: 0; font-size: clamp(40px, 6vw, 96px); line-height: 1; font-weight: 500; letter-spacing: -.045em; }
.nf__title .rise-mask { padding-right: .3em; }
/* the cursor where the dot belongs; putting the dot folds it into a square full stop */
.nf__dot { all: unset; cursor: pointer; position: relative; display: inline-block; width: .3em; height: .72em; margin-left: .03em; vertical-align: baseline; -webkit-tap-highlight-color: transparent; }
.nf__dot:focus-visible { outline: 1px solid var(--paper); outline-offset: .1em; }
.nf__caret { position: absolute; left: .02em; bottom: 0; width: .07em; height: .74em; background: var(--paper); animation: caret 1.06s steps(1) infinite;
  transition: width .45s var(--ease), height .45s var(--ease); }
.nf.is-done .nf__caret { animation: none; opacity: 1; width: .16em; height: .16em; }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.nf__note { margin: 0; max-width: 560px; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.5; color: var(--ash); }
.nf__hint { margin: 0; color: var(--dim); }
.nf__hint kbd { font-family: var(--mono); color: var(--paper); border: 1px solid #333; border-radius: 4px; padding: 0 var(--s-1); }

/* ...and when the name has risen in after the intro, its dot blinks twice, then stays */
.hero__name .name__keep.dot { animation: caret .5s steps(1) .95s 2 reverse; } /* right as "Artem." has risen in */
.is-loading .hero__name .name__keep.dot { animation: none; }
/* only once: a language switch re-renders the name, and its dot must not blink again */
.dot-done .hero__name .name__keep.dot { animation: none; }

/* ---------- Page transition ---------- */

.glyph-nav { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 200; pointer-events: none; }
/* one wave between pages (js/wave.js): the new page shows inside the ring, the old one outside */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(root) { animation: none; }
::view-transition-old(root) { animation: none; }
/* the transition is held open (up to 8s) and wave.js ends it the moment its wave has crossed
   the screen, so a busy page can delay the wave but never cut it short */
::view-transition-new(root) {
  animation: wave-hold 8s linear both;
  /* set every frame by wave.js: a circle from the click, a wide ellipse for a reload */
  -webkit-mask-image: var(--wave-mask, linear-gradient(transparent, transparent));
  mask-image: var(--wave-mask, linear-gradient(transparent, transparent));
}
.glyph-wave { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 200; pointer-events: none; view-transition-name: glyph-wave; }
::view-transition-group(glyph-wave) { animation: none; z-index: 2; }
::view-transition-new(glyph-wave) { animation: wave-hold 8s linear both; }
@keyframes wave-hold { from { opacity: 1; } to { opacity: 1; } }

/* arrived through the wave: the page is simply there, no second entrance (js/wave.js) */
.is-waved [data-rise], .is-waved .archive__grid .card, .is-waved .case__cover, .is-waved .case__next { transition: none !important; }
.is-waved .is-loading [data-rise] { opacity: 1; transform: none; }
.is-waved .archive__grid .card, .is-waved .case__cover, .is-waved .case__next { opacity: 1; transform: none; }

/* fallback: until the arriving page's cover is drawn, show nothing but black */
html.is-arriving body::after, html.is-refreshing body::after { content: ''; position: fixed; inset: 0; z-index: 200; background: var(--void); }

/* ---------- Cookie banner ---------- */

/* a small file window: a cookie drawn in characters, its name like a Finder title, two choices */
.consent {
  position: fixed; left: var(--gutter); bottom: var(--gutter); z-index: 80; width: min(460px, calc(100vw - 2 * var(--gutter)));
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-5); align-items: center; padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4);
  background: rgba(14, 14, 14, .9); border: 1px solid var(--line); border-radius: 16px;
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(18px) scale(.98); transform-origin: 0 100%;
  transition: opacity .6s var(--ease), transform .7s var(--ease);
}
.consent.is-visible { opacity: 1; transform: none; }
/* hidden or still fading in: never in the way of the footer links underneath */
.consent[hidden] { display: none; }
.consent:not(.is-visible) { pointer-events: none; }
.consent__art { margin: 0; font-family: var(--mono); font-size: 8.5px; line-height: 1.1; color: #8A8478; white-space: pre; user-select: none; }
.consent__art b { font-weight: 500; color: var(--paper); animation: crumb 2.4s var(--ease) infinite; }
.consent__art b:nth-of-type(2n) { animation-delay: .4s; }
.consent__art b:nth-of-type(3n) { animation-delay: .9s; }
@keyframes crumb { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.consent__body { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.consent__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.consent__title { font-family: var(--mono); font-size: 12px; color: var(--paper); }
.consent__size { font-size: 11px; color: var(--dim); }
.consent__text { margin: 0; font-size: 13.5px; line-height: 1.5; color: #A8A8A8; }
.consent__actions { display: flex; gap: var(--s-2); align-items: center; }
.consent__btn { all: unset; cursor: pointer; height: 36px; padding: 0 var(--s-4); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ash); transition: color .3s, background .3s; }
.consent__btn:hover { color: var(--paper); }
.consent__btn--yes { background: var(--paper); color: var(--void); padding: 0 var(--s-5); }
.consent__btn--yes:hover { background: var(--paper); color: var(--void); }
.consent__btn:focus-visible { outline: 1px solid var(--paper); outline-offset: 3px; }
@media (max-width: 480px) { .consent__art { display: none; } .consent { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .consent__art b { animation: none; } }

.footer__legal { display: inline-flex; gap: var(--s-5); align-items: center; }
.footer__cookies { all: unset; cursor: pointer; color: var(--dim); transition: color .3s; }
.footer__cookies:hover { color: var(--paper); }

/* no scrolling while the portrait assembles */
html:has(body.is-loading), body.is-loading { overflow: hidden; height: 100%; touch-action: none; }

.placeholder { height: 60vh; display: flex; align-items: center; justify-content: center; }

@media (max-width: 760px) {
  .lang { min-height: 44px; padding: 0 var(--s-1); margin-right: calc(-1 * var(--s-1)); }
  .nav { gap: var(--s-3); }
  .nav__link { font-size: 14px; }
  .nav__link small { display: none; }
  #clock { display: none; }
}

/* narrow phones: the bar still fits in one line, in Ukrainian too */
@media (max-width: 380px) {
  .nav { gap: var(--s-2); }
  .nav__link { font-size: 13px; }
  .lang { gap: var(--s-1); }
}
@media (max-width: 340px) {
  .nav { gap: 6px; }
  .nav__link { font-size: 11px; }
  .bar__logo { font-size: 16px; }
  .lang__sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
