/* Components, in page order: grain, hero, head, marquee, sections, work, steps, contact, footer. */

/* film grain, two ways (both driven from js/main.js):
   1. a flickering canvas laid over the hero and the text panels;
   2. for the case cards and case pages, only a texture in the background (--grain),
      so nothing ever sits on top of the case images. */
.grain {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 5; pointer-events: none;
  opacity: 0.025; image-rendering: pixelated;
}
/* the still texture on the text panels is faint enough to drop: a blended full-size layer on every sticky panel can render as a black sheet on very large screens */
.panel > .grain { display: none; }
body, #work, .case-hero { background-image: var(--grain, none); background-size: 220px 220px; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--paper); color: var(--paper-ink); overflow: hidden; }
.hero a:hover { color: var(--blue); }
.hero :focus-visible { outline-color: var(--blue); }
.hero .label { color: var(--paper-muted); }
.hero__inner {
  display: grid; grid-template-rows: auto 1fr auto;
  min-height: 100svh; padding-block: 20px 28px;
}

.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; position: relative; z-index: 2; }
.topbar__links { display: flex; gap: 22px; }
.topbar__links a { text-decoration: none; padding-block: 6px; }
.topbar__links a:hover { text-decoration: underline; }
.dot {
  display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 10px var(--blue);
  animation: blink 1.6s infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

.hero__stage { position: relative; display: grid; place-items: center; min-height: 0; padding-block: 12px; }
.hero__name {
  position: absolute; inset: 50% 0 auto; transform: translateY(-50%);
  font: 400 var(--step-hero)/0.86 var(--font-display);
  text-transform: uppercase; text-align: center; letter-spacing: 0.005em;
  color: var(--paper-ghost); user-select: none; pointer-events: none;
}
.hero__name span { display: block; text-shadow: 5px 3px 0 var(--misprint-a), -4px -2px 0 var(--misprint-b); }

.hero__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: end; position: relative; z-index: 2; }
.hero .hero__role { color: var(--blue); margin-bottom: 10px; }
.hero__tagline { font: 400 var(--step-3)/1.02 var(--font-display); text-transform: uppercase; }
.hero__tagline em { color: var(--pink); }
.hero__lede { margin-top: 10px; max-width: 78ch; text-wrap: balance; color: var(--paper-muted); }

.stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 28px; }
.stats div { display: flex; flex-direction: column-reverse; min-width: 0; }
.stats dd { font: 400 1.875rem/1 var(--font-display); white-space: nowrap; }
.stats dt { max-width: 22ch; font-size: var(--step--1); color: var(--paper-muted); }

/* ---------- head ---------- */
.head { position: relative; z-index: 1; height: min(62svh, 660px); aspect-ratio: 680 / 620; max-width: 100%; }
.head__turn {
  position: absolute; inset: 0; will-change: transform;
  -webkit-mask-image: linear-gradient(#000 86%, transparent 99%);
          mask-image: linear-gradient(#000 86%, transparent 99%);
}
.head__turn img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity 0.16s linear;
}
.head__turn img.is-on { opacity: 1; }
.head__turn img.is-flipped { transform: scaleX(-1); }
.head[data-mode="spin"] .head__turn img { transition: none; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: 14px; white-space: nowrap; }
.marquee__track { display: inline-flex; animation: marquee 38s linear infinite; }
.marquee__track span { font: 400 clamp(1.625rem, 4vw, 3rem)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ghost); }
.marquee__track span::after { content: '✦'; margin-inline: 0.5em; color: var(--accent-2); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding-block: var(--space-section); }
.section__kicker { display: flex; gap: 14px; margin-bottom: 22px; }
.section__kicker b { font-weight: 500; color: var(--accent-2); }
.section__title {
  max-width: 16ch; margin-bottom: clamp(2.25rem, 5vw, 4rem);
  font: 400 var(--step-4)/0.95 var(--font-display); text-transform: uppercase; text-wrap: balance;
}
.section__title em { color: var(--accent); }
.section__note { max-width: 60ch; margin-top: 30px; color: var(--muted); }

/* ---------- work ---------- */
.work__item {
  display: grid; grid-template-columns: 130px 1.2fr 1fr; gap: var(--space-3); align-items: start;
  padding-block: 28px; border-top: 1px solid var(--line);
}
.work__item:last-child { border-bottom: 1px solid var(--line); }
.work__item:hover { background: linear-gradient(90deg, rgba(25, 227, 200, 0.05), transparent); }
.work__name { margin-bottom: 8px; font: 400 var(--step-2)/1 var(--font-display); text-transform: uppercase; }
.work__text { max-width: 52ch; color: var(--muted); }
.work__result { font: 400 var(--step-3)/1 var(--font-display); }
.work__result small { display: block; margin-top: 8px; font: 400 var(--step--1)/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

/* ---------- steps (a real sequence, so it is numbered) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); counter-reset: step; }
.step { min-width: 0; padding: 26px 22px 30px; border-right: 1px solid var(--line); counter-increment: step; }
.step:first-child { padding-left: 0; }
.step:last-child { border-right: 0; }
.step::before { content: counter(step, decimal-leading-zero); display: block; font: 400 3.5rem/1 var(--font-display); color: var(--ghost); }
.step__name { margin-block: 10px; font: 400 var(--step-1)/1.1 var(--font-display); text-transform: uppercase; }
.step li { padding-block: 2px; font-size: 0.875rem; color: var(--muted); }

/* ---------- contact ---------- */
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.contact__mail { font: 400 clamp(1.875rem, 6vw, 5.25rem)/1 var(--font-display); text-decoration: none; overflow-wrap: anywhere; }
.button {
  padding: 12px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--button-fg);
  font: 500 var(--step--1) var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.button:hover { background: var(--text); color: var(--panel-bg); }

/* ---------- footer ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); padding-block: 22px 36px; border-top: 1px solid var(--line); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero__inner { min-height: max(100svh, 760px); }
  .topbar__clock { display: none; }
  .head { height: auto; width: min(100%, 420px); }
  .hero__foot { grid-template-columns: 1fr; }
  .stats { justify-content: flex-start; gap: 20px; }
  .stats dd { font-size: 1.5rem; }
  .work__item { grid-template-columns: 1fr; gap: 10px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .step:nth-child(3) { padding-left: 0; }
}

/* ---------- intro: the name arrives first, then steps back for the head ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__name span {
    animation:
      name-rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both,
      name-settle 0.9s 1.5s ease-in-out both;
  }
  .hero__name span:last-child { animation-delay: 0.14s, 1.5s; }
  .head { animation: head-in 1s 1.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}
@keyframes name-rise {
  from { opacity: 0; transform: translateY(0.25em); }
  to   { opacity: 1; transform: none; }
}
@keyframes name-settle {
  from { color: var(--paper-ink); text-shadow: 0 0 0 transparent, 0 0 0 transparent; }
  to   { color: var(--paper-ghost); text-shadow: 5px 3px 0 var(--misprint-a), -4px -2px 0 var(--misprint-b); }
}
@keyframes head-in {
  from { opacity: 0; transform: translateY(28px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}

/* ---------- loader: a dark curtain that counts to 100, then lifts ---------- */
.loader { display: none; }
.is-loading body { overflow: hidden; }
.is-loading .loader {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-rows: auto 1fr auto; align-items: end;
  padding: 20px max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px));
  background: var(--ink); color: var(--paper);
  clip-path: inset(0);
  transition: clip-path 0.85s cubic-bezier(0.7, 0, 0.2, 1);
}
.is-loading .loader.is-leaving { clip-path: inset(0 0 100% 0); }
.loader__line { align-self: start; color: var(--muted); }
.loader__count {
  font: 400 clamp(9rem, 38vw, 30rem)/0.8 var(--font-display);
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  text-shadow: 6px 4px 0 var(--pink), -5px -3px 0 var(--blue);
  transition: transform 0.85s cubic-bezier(0.7, 0, 0.2, 1);
}
.loader.is-leaving .loader__count { transform: translateY(-18%); }
.loader__bar { height: 6px; margin-top: 28px; margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); background: var(--line); }
.loader__bar i { display: block; height: 100%; width: 100%; background: var(--pink); transform-origin: left; transform: scaleX(0); }
/* hold the hero intro until the curtain lifts */
.is-loading .hero__name span, .is-loading .head { animation-play-state: paused; }

/* ---------- episodes: the case cards ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: var(--space-4); }
.filter {
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text);
  font: 400 var(--step--1) var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.filter:hover { border-color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--panel-bg); }
.filters__status { margin-left: auto; }

.episodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ghost); border-left: 1px solid var(--ghost); }
/* each card is a cell: the lines between cards are the cells' right and bottom borders */
.episode { min-width: 0; border-right: 1px solid var(--ghost); border-bottom: 1px solid var(--ghost); transition: background 0.2s; }
.episode:has(a.episode__link:hover) { background: #0e1014; }
.episode__link { display: block; height: 100%; padding: clamp(14px, 1.6vw, 22px) clamp(14px, 1.6vw, 22px) clamp(20px, 2vw, 28px); text-decoration: none; color: inherit; }
a.episode__link:hover { color: inherit; }
.episode__cover {
  position: relative; overflow: hidden; aspect-ratio: 16 / 10; margin-bottom: 16px;
  background: #0f1115;
}
.episode__cover img { width: 100%; height: 100%; object-fit: cover; }
.episode__cover--art { background: var(--art-bg, #0f1115); }
.episode__cover--art::before { content: none; }
.episode__cover--art img { object-fit: contain; padding: 14px 0 0; transition: transform 0.3s; }
a.episode__link:hover .episode__cover--art img { transform: scale(1.04); }
/* placeholder art until real covers arrive: the episode number and the name */
.episode__cover::before {
  content: attr(data-ep); position: absolute; right: 10px; bottom: -0.16em;
  font: 400 clamp(6rem, 13vw, 11rem)/1 var(--font-display); color: var(--line);
  transition: color 0.2s;
}
.episode__cover span { position: absolute; left: 14px; top: 12px; font: 400 var(--step-1)/1 var(--font-display); text-transform: uppercase; color: var(--ghost); }
a.episode__link:hover .episode__cover::before { color: var(--ghost); }
.episode__meta { display: flex; gap: 12px; margin-bottom: 8px; }
.episode__meta b { font-weight: 500; color: var(--accent-2); }
.episode__title { font: 400 var(--step-2)/1 var(--font-display); text-transform: uppercase; }
a.episode__link:hover .episode__title { color: var(--accent); }
.episode__text { margin-top: 8px; color: var(--muted); }
.episode__result { margin-top: 14px; font: 400 var(--step-1)/1 var(--font-display); }
.episode__result small { margin-left: 10px; font: 400 var(--step--1)/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.episode__tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; }
.episode__soon, .episode__more { margin-top: 12px; color: #b9bcc2; }
a.episode__link:hover .episode__more { color: var(--paper); }

.episodes__more { margin-top: 32px; text-align: center; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-4); align-items: end; }
.about__text { max-width: 58ch; font-size: 1.125rem; color: var(--text); }
.about__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
a.button { display: inline-block; text-decoration: none; }
a.button:hover { color: var(--panel-bg); }

@media (max-width: 1000px) { .episodes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .filters__status { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 620px) { .episodes { grid-template-columns: 1fr; } }

/* ---------- panels: alternating colours that stack like a deck ---------- */
/* Each panel re-points the shared tokens, so components inside need no colour rules of their own. */
.panel { position: relative; background: var(--panel-bg); color: var(--text); }
.panel--paper {
  --panel-bg: var(--paper); --text: var(--paper-ink); --muted: var(--paper-muted);
  --line: rgba(23, 19, 44, 0.16); --ghost: #cdc3b6;
  --accent: var(--blue); --accent-2: var(--pink); --button-fg: #fff;
}
.panel--pink {
  --panel-bg: var(--pink); --text: var(--paper-ink); --muted: #3d1226;
  --line: rgba(23, 19, 44, 0.28); --ghost: #d63f6f;
  --accent: #fff; --accent-2: var(--paper-ink); --button-fg: var(--paper-ink);
}
.panel .footer { border-top: 1px solid var(--line); }

/* The deck: a panel scrolls to its end, pins there, and the next one slides over it.
   --stick is set per panel in js/main.js (viewport height minus panel height, never above 0). */
@media (prefers-reduced-motion: no-preference) {
  .hero, .panel { position: sticky; top: var(--stick, 0px); }
  /* the shade the next panel casts on the one below, as a plain gradient (a blurred box-shadow this wide can glitch to black in Chrome) */
  .panel::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 80px; background: linear-gradient(to top, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0)); pointer-events: none; }
}

/* language switch: a small UA | EN pill at the far right of the top bar, apart from the menu links */
.topbar__end { display: flex; align-items: center; gap: 22px; }
.topbar .cvbtn, .hero .cvbtn { color: var(--paper); }
.cvbtn { display: inline-flex; align-items: center; padding: 7px 16px; border-radius: 999px; background: var(--paper-ink); color: var(--paper); text-decoration: none; font: 500 var(--step--1)/1 var(--font-mono); letter-spacing: 0.1em; transition: transform 0.15s ease, background 0.15s ease; }
.cvbtn:hover { background: var(--blue, #4a3cff); color: #fff; text-decoration: none; transform: translateY(-1px); }
.cvbtn:focus-visible { outline: 2px solid var(--blue, #4a3cff); outline-offset: 3px; }
.stickbar .topbar .cvbtn { background: #ece7df; color: #17132c; }
.stickbar .topbar .cvbtn:hover { background: #fff; color: #17132c; }
.langswitch { display: inline-flex; border: 1px solid var(--paper-muted); border-radius: 999px; overflow: hidden; font: 400 var(--step--1)/1 var(--font-mono); letter-spacing: 0.1em; }
.langswitch a, .langswitch span { padding: 7px 11px; text-decoration: none; color: var(--paper-muted); }
.langswitch a:hover { color: var(--paper-ink); text-decoration: none; }
.langswitch [aria-current="true"] { background: var(--paper-ink); color: var(--paper); }
@media (max-width: 860px) { .topbar__end { gap: 12px; } }

/* ---------- image viewer (js/lightbox.js) ---------- */
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 2px solid var(--accent, #1de9c9); outline-offset: 3px; }
.is-lightbox { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 12, 0.97); }
.lightbox[hidden] { display: none; }
.lightbox__stage { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; padding: 56px 16px 24px; }
.lightbox__img { display: block; max-width: 100%; max-height: calc(100vh - 80px); width: auto; height: auto; object-fit: contain; cursor: zoom-in; background: #fff0; border-radius: 4px; }
.lightbox__img.is-zoomed { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox__stage:has(.is-zoomed) { place-items: start; }
.lightbox__btn { position: fixed; z-index: 2; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%;
  background: rgba(20,20,26,.85); color: #fff; font: 400 22px/1 var(--font-mono, monospace); cursor: pointer; }
.lightbox__btn:hover, .lightbox__btn:focus-visible { background: #fff; color: #111; outline: none; }
.lightbox__close { top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: max(12px, env(safe-area-inset-left, 0px)); }
.lightbox__next { right: max(12px, env(safe-area-inset-right, 0px)); }
.lightbox--single .lightbox__prev, .lightbox--single .lightbox__next { display: none; }

/* ---------- more projects (below the cases) ---------- */
.more { margin-top: var(--space-5, 72px); text-align: center; }
.more__title { font: 400 var(--step-3, 2rem) var(--font-display); text-transform: uppercase; line-height: 1.05; text-wrap: balance; }
.more__text { max-width: 52ch; margin: 14px auto 0; color: var(--muted); }
.more__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px auto 0; max-width: 980px; }
.more__list li { padding: 10px 18px; border: 1px solid var(--muted); border-radius: 999px; color: var(--text); }
.more__shot { margin: 40px 0 0; border-radius: 18px; overflow-x: auto; background: #dcdbce; }
.more__shot img { display: block; width: 100%; min-width: 760px; height: auto; }

/* ---------- unified cards: same cover ratio, 3 text lines, result pinned to the bottom, nothing moves on hover ---------- */
.episode__link { display: flex; flex-direction: column; }
.episode__cover--art img { object-fit: cover; padding: 0; transition: none; }
a.episode__link:hover .episode__cover--art img { transform: none; }
.episode__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3em; }
.episode__result { margin-top: auto; padding-top: 16px; }
.episode__result small { display: block; margin: 6px 0 0; }
.episode__cover[data-ep] { background: #dcdbce; }
.episode__cover[data-ep] span { color: #17132c; }
.episode__cover[data-ep]::before { color: rgba(23, 19, 44, 0.09); }

/* Panopto card: "Soon" pill over the cover */
.episode__soon { position:absolute; left:14px; top:12px; padding:5px 12px 4px; border-radius:999px; background:#17132c; color:#ece7df; font:400 .8rem/1 var(--font-display); letter-spacing:.08em; text-transform:uppercase; }

/* more projects: on phones the strip is split into three stacked pictures */
.more__stack { display: none; }
@media (max-width: 700px) {
  .more__shot { display: none; }
  .more__stack { display: block; margin-top: 32px; border-radius: 18px; overflow: hidden; background: #dcdbce; }
  .more__stack img { display: block; width: 100%; height: auto; }
}

/* ---------- flicker switch (js/main.js): off stops only the flickering film grain; the texture stays ---------- */
.motiontoggle {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 0;
  border: 0; background: transparent; color: var(--paper-muted);
  font: 400 var(--step--1)/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}
.motiontoggle:hover { color: var(--paper-ink); }
.motiontoggle__track {
  position: relative; display: inline-block; width: 34px; height: 20px; border-radius: 999px;
  border: 1px solid var(--paper-muted); transition: background-color 0.2s, border-color 0.2s;
}
.motiontoggle__track > i {
  position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper-muted); transition: transform 0.2s, background-color 0.2s;
}
.motiontoggle[aria-checked="true"] .motiontoggle__track { background: var(--paper-ink); border-color: var(--paper-ink); }
.motiontoggle[aria-checked="true"] .motiontoggle__track > i { transform: translateX(14px); background: var(--paper); }
.motiontoggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* ---------- the top bar stays on screen: a copy slides in once the real one has scrolled away ---------- */
html { scroll-padding-top: 76px; }
.stickbar {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  padding-top: var(--bar-top, 20px); padding-bottom: 12px;
  /* solid dark bar: nothing blurred behind it */
  background: rgba(14, 14, 18, 0.9); color: #ece7df;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  transform: translateY(-101%); visibility: hidden;
}
.stickbar.is-on { transform: none; visibility: visible; }
.stickbar .label, .stickbar .topbar__links a { color: rgba(236, 231, 223, 0.82); }
.stickbar a:hover, .stickbar .motiontoggle:hover { color: #fff; }
.stickbar .dot { background: #8f93ff; box-shadow: 0 0 10px #8f93ff; }
.stickbar .langswitch { border-color: rgba(236, 231, 223, 0.4); }
.stickbar .langswitch a, .stickbar .langswitch span { color: rgba(236, 231, 223, 0.8); }
.stickbar .langswitch [aria-current="true"] { background: #ece7df; color: #17132c; }
.stickbar .motiontoggle { color: rgba(236, 231, 223, 0.82); }
.stickbar .motiontoggle__track { border-color: rgba(236, 231, 223, 0.5); }
.stickbar .motiontoggle__track > i { background: rgba(236, 231, 223, 0.8); }
.stickbar .motiontoggle[aria-checked="true"] .motiontoggle__track { background: #ece7df; border-color: #ece7df; }
.stickbar .motiontoggle[aria-checked="true"] .motiontoggle__track > i { background: #17132c; }
.stickbar :focus-visible { outline-color: #fff; }
@media (max-width: 700px) {
  .topbar__links { flex-wrap: wrap; gap: 4px 16px; }
  .topbar__links a { white-space: nowrap; }
  .topbar__end { flex-wrap: wrap; gap: 8px; }
  /* the pinned bar is one line you can swipe sideways */
  .stickbar { padding-top: 4px; padding-bottom: 4px; }
  /* finger-sized: every link is at least 44px tall */
  .stickbar .topbar a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .stickbar .topbar { flex-wrap: nowrap; overflow-x: auto; gap: 18px; scrollbar-width: none; }
  .stickbar .topbar::-webkit-scrollbar { display: none; }
  .stickbar .topbar > * { flex: none; }
  .stickbar .topbar__links { flex-wrap: nowrap; gap: 18px; }
  .stickbar .topbar__status, .stickbar .langswitch, .stickbar .motiontoggle { display: none; }
  .stickbar .topbar__end { flex: none; gap: 18px; }
  .stickbar .topbar > a.label[href$="#work"]::before { content: "\2190"; margin-right: 0.6em; }
}

/* the text panels (process, about, contact) keep a clean flat background, no grain texture */
.panel .grain { display: none; }

/* phone top bar: status and switches on one row, the menu on a second row */
@media (max-width: 700px) {
  .hero .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; }
  .hero .topbar__status { grid-column: 1; grid-row: 1; font-size: 0.72rem; letter-spacing: 0.08em; line-height: 1.3; }
  .hero .topbar__end { grid-column: 2; grid-row: 1; flex-wrap: nowrap; gap: 12px; }
  .hero .topbar__links { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding-top: 10px; border-top: 1px solid rgba(23, 19, 44, 0.14); }
  .hero .topbar__links a, .case-hero .topbar__links a { font-size: 0.78rem; letter-spacing: 0.08em; }
  .case-hero .topbar__end { flex-wrap: nowrap; width: 100%; justify-content: space-between; }
  .case-hero .topbar__links { flex-wrap: nowrap; gap: 0 16px; }
}

/* Ukrainian capitals carry descenders and breves (Д, Ц, Щ, Й, Ї), so tight display lines collide: give them room */
html:lang(uk) .section__title { line-height: 1.1; }
html:lang(uk) .case-hero__title, html:lang(uk) .case-hero__lede, html:lang(uk) .hero__tagline { line-height: 1.08; }

/* status chip: opens a small window with the email */
.status { position: relative; }
.status__btn { white-space: nowrap; all: unset; display: inline-flex; align-items: center; gap: 0.5em; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.status__btn:hover, .status__btn[aria-expanded="true"] { text-decoration: underline; text-underline-offset: 4px; }
.status__btn:focus-visible { outline: 2px solid var(--blue, #4a3cff); outline-offset: 4px; }
.status__pop { position: absolute; left: -6px; top: calc(100% + 12px); z-index: 30; min-width: 290px; max-width: calc(100vw - 32px); padding: 24px 28px 26px; border-radius: 18px; background: #14141a; color: #ece7df; text-transform: none; letter-spacing: 0; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.5); display: grid; justify-items: start; gap: 14px; }
.status__pop[hidden] { display: none; }
.status__hi { font-size: 0.78rem; color: rgba(236, 231, 223, 0.6); text-transform: uppercase; letter-spacing: 0.14em; }
.status .status__pop .status__mail { font: 400 1.5rem/1.1 var(--font-display); color: #fff; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 6px; word-break: break-all; transition: color 0.2s, text-decoration-color 0.2s; }
.status .status__pop .status__mail:hover, .status .status__pop .status__mail:focus-visible { color: #ff7aa8; text-decoration-color: currentColor; }
.status__copy { margin-top: 4px; padding: 9px 16px; border: 1px solid rgba(236, 231, 223, 0.35); border-radius: 999px; background: transparent; color: #ece7df; font: inherit; font-size: 0.78rem; cursor: pointer; transition: background 0.2s, color 0.2s; }
.status__copy:hover, .status__copy:focus-visible { background: #ece7df; color: #14141a; }
@media (max-width: 700px) { .hero .status__pop { left: 0; min-width: min(290px, calc(100vw - 32px)); } }

/* ---------- process: the four steps, and one quiet screen below them ---------- */
.flow { display: grid; gap: 40px; }
.flow .step { cursor: pointer; }
.flow .step__name button { all: unset; cursor: pointer; }
.flow .step__name button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.flow .step.is-on::before { color: var(--accent); }
.flow__stage { display: grid; justify-items: center; gap: 16px; }
.phone { width: min(230px, 62vw); aspect-ratio: 562 / 1157; border-radius: 30px; padding: 6px; background: #15151b; box-shadow: 0 18px 36px -22px rgba(20,20,30,0.4); }
.phone__screen { position: relative; width: 100%; height: 100%; border-radius: 25px; overflow: hidden; background: #f4f1ea; }
.scr { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.4s; }
.scr--sketch { opacity: 0; }
.scr--live { border: 0; background: #151515; pointer-events: none; }
.scr--sketch { padding: 9% 7%; display: flex; flex-direction: column; gap: 4%; background: #f4f1ea; }
.sk { display: block; border: 1.5px dashed #9a9588; border-radius: 9px; }
.sk--bar { height: 2.6%; width: 34%; border-radius: 6px; }
.sk--card { height: 22%; background: linear-gradient(to top right, transparent calc(50% - 1px), #9a9588 50%, transparent calc(50% + 1px)), linear-gradient(to bottom right, transparent calc(50% - 1px), #9a9588 50%, transparent calc(50% + 1px)); }
.sk--title { height: 3.2%; width: 40%; border-radius: 6px; }
.sk-row { display: flex; gap: 4%; }
.sk--sq { flex: 1; aspect-ratio: 1; }
.sk--wide { height: 12%; }
.sk--tabs { height: 5%; margin-top: auto; border-radius: 6px; }
.flow[data-stage="0"] .scr--sketch { opacity: 1; }
.flow[data-stage="0"] .scr--live { opacity: 0; }
.flow[data-stage="1"] .phone__screen::after { content: ''; position: absolute; inset: 0; border: 1.5px solid #0d99ff; border-radius: 25px; pointer-events: none; }
.flow[data-stage="2"] .scr--live, .flow[data-stage="3"] .scr--live { pointer-events: auto; }
.flow__cap { white-space: pre-line; text-wrap: balance; max-width: 36ch; min-height: 3.2em; text-align: center; font-size: var(--step--1); color: var(--muted); }
@media (min-width: 801px) { .flow { grid-template-columns: minmax(0, 1fr) 230px; gap: clamp(32px, 5vw, 72px); align-items: start; } .flow__stage { position: sticky; top: 90px; } .flow .steps { grid-template-columns: repeat(2, 1fr); } .flow .step:nth-child(2) { border-right: 0; } .flow .step:nth-child(n+3) { border-top: 1px solid var(--line); } .flow .step:nth-child(3) { padding-left: 0; } .flow .step:nth-child(2n+1) { padding-left: 0; } }
@media (prefers-reduced-motion: reduce) { .scr { transition: none; } }

/* tools as light tags */
.flow .step ul.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 4px 0 0; list-style: none; }
.flow .step ul.tags li { padding: 3px 10px; border: 1px solid rgba(23, 19, 44, 0.2); border-radius: 999px; font-size: 0.78rem; line-height: 1.35; color: var(--muted); transition: border-color 0.3s, color 0.3s; }
.flow .step.is-on ul.tags li { border-color: var(--accent); color: var(--paper-ink, inherit); }

.step__desc { margin: 2px 0 14px; max-width: 46ch; font-size: 0.875rem; line-height: 1.45; color: inherit; opacity: 0.8; text-wrap: pretty; }

.phone__live { position: absolute; top: 3.2%; left: 50%; transform: translate(-50%, -4px); display: flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; background: rgba(16,217,138,0.14); color: #10d98a; font: 600 9px/1 var(--font-mono, monospace); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0; pointer-events: none; transition: opacity 0.4s, transform 0.4s; }
.phone__live::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.flow[data-stage="3"] .phone__live { opacity: 1; transform: translate(-50%, 0); }


/* tap hint over the live prototype */
.phone__hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; opacity: 0; transition: opacity 0.4s; z-index: 3; }
.phone__hint i { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.28); border: 1.5px solid rgba(255,255,255,0.7); box-shadow: 0 0 0 0 rgba(79,142,255,0.55); animation: hint-pulse 1.8s ease-out infinite; }
.phone__hint b { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 5px 11px; border-radius: 99px; background: rgba(10,14,26,0.82); color: #fff; font: 600 11px/1 var(--font-body, system-ui, sans-serif); white-space: nowrap; backdrop-filter: blur(6px); }
.flow[data-stage="2"]:not([data-played]) .phone__hint, .flow[data-stage="3"]:not([data-played]) .phone__hint { opacity: 1; transition-delay: 0.9s; }
@keyframes hint-pulse { 0% { box-shadow: 0 0 0 0 rgba(79,142,255,0.6); transform: scale(0.85); } 70% { box-shadow: 0 0 0 18px rgba(79,142,255,0); transform: scale(1); } 100% { box-shadow: 0 0 0 0 rgba(79,142,255,0); transform: scale(0.85); } }
@media (prefers-reduced-motion: reduce) { .phone__hint i { animation: none; } }

/* App Store badge under the prototype caption (stage 4 only) */
.flow__store { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 14px; margin-top: -4px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.4s, transform 0.4s, visibility 0s 0.4s; }
.flow[data-stage="3"] .flow__store { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.step__store { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: inherit; text-decoration: none; }
.step__store img { width: 22px; height: 22px; border-radius: 6px; }
.step__store span { opacity: 0.6; transition: transform 0.2s, opacity 0.2s; }
.step__store:hover { text-decoration: underline; text-underline-offset: 3px; }
.step__store:hover span { opacity: 1; transform: translate(1px, -1px); }
.step__store:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.section__note--top { margin-top: calc(clamp(28px, 3.4vw, 44px) - clamp(2.25rem, 5vw, 4rem)); margin-bottom: clamp(36px, 5vw, 60px); line-height: 1.6; }

@media (max-width: 520px) { .hero .topbar__end .motiontoggle > span:first-child { display: none; } .hero .status__btn { white-space: nowrap; } }
