/* John Androulakis — one-screen portfolio.
   Layout: a fixed tab logo hangs from the top edge; a ring of five category frames sits in the middle
   over the active photograph, blurred to colour; project details and the project strip sit beneath. */


@font-face { font-family: "Syne"; src: url("fonts/syne-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; } /* the logo's face, for category names */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: dark;
  /* colour: the photographs bring the colour; the frame is ink on near-black */
  --ground: #0c0c0b;
  --tab: #0c0c0b;
  --ink: #f3f2ef;
  --soft: #c2bdb4;          /* secondary text, 9.9:1 on --ground */
  --scrim: rgb(10 10 9 / 0.5);
  --outline: rgb(255 255 255 / 0.1);
  /* type */
  --font: "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, "Nimbus Sans", sans-serif;
  --t-small: 0.8125rem;     /* 13px: captions, labels */
  --t-body: 1rem;           /* 16px: running text */
  --t-title: clamp(1.25rem, 1.05rem + 0.6vw, 1.75rem); /* project title */
  /* space and motion */
  --margin: clamp(16px, 2.2vw, 32px);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --t-move: 300ms;
  --t-quick: 150ms;
  --expo: cubic-bezier(0.16, 1, 0.3, 1);
  --settle: cubic-bezier(0.34, 1.3, 0.64, 1);
  --t-focus: 650ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--t-body)/1.5 var(--font);
  overflow: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--ink); color: var(--ground); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── background: the active photograph, blurred to colour ───────────────── */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--ground); }
/* the backdrop files are blurred already; nothing is filtered live, so the light never shifts when a fade ends */
.bg__img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; opacity: 0; transform: scale(1.08); will-change: opacity;
  transition: opacity 700ms var(--ease);
}
.bg__img.is-on { opacity: 1; }
.bg::before, .bg::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.bg::before { z-index: 3; background: rgb(8 8 7 / 0.42); opacity: 0; transition: opacity var(--t-focus) var(--expo); } /* focus dim */
.bg::after { /* a fixed vignette: the same on every photograph */
  z-index: 4;
  background: radial-gradient(120% 90% at 50% 42%, rgb(10 10 9 / 0.3) 0%, rgb(10 10 9 / 0.52) 55%, rgb(10 10 9 / 0.86) 100%); /* taste-skill-ignore: neutral scrim over a photograph */
}
body.is-focus .bg::before { opacity: 1; }

/* ── frame ──────────────────────────────────────────────────────────────── */
.app {
  position: relative; z-index: 1;
  height: 100%;
  display: grid; grid-template-rows: auto 1fr;
  padding-left: max(var(--margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--margin), env(safe-area-inset-right, 0px));
}

.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  gap: 16px;
}
.catnav, .meta { display: flex; align-items: center; gap: 14px; padding-top: 26px; min-height: 44px; }
.meta { justify-content: flex-end; gap: 12px; }
.catnav__btn {
  display: grid; place-items: center; width: 44px; height: 44px; margin: -12px 0;
  transition: opacity var(--t-quick) var(--ease), scale var(--t-quick) var(--ease-out);
}
.catnav__btn svg { width: 24px; height: 12px; }
.catnav__btn:first-child { margin-left: -10px; }
.catnav__btn:not(:disabled):active { scale: 0.96; }
.catnav--below { display: none; }
.brand { margin: 0; font: inherit; display: flex; justify-content: center; }
.catnav__label {
  text-align: center;
  font-size: var(--t-small); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.meta__link {
  font-size: var(--t-small); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 12px 2px; margin: -12px 0;
  transition: opacity var(--t-quick) var(--ease);
}
.meta__sep { width: 1px; height: 14px; background: var(--ink); opacity: 0.6; }
@media (hover: hover) {
  .catnav__btn:hover, .meta__link:hover { opacity: 0.7; }
}

/* The tab: the logo hangs from the top edge, its top corners flared like the sketch */
.tab {
  position: relative; display: grid; place-items: center;
  background: var(--tab); color: var(--ink);
  padding: 20px 30px 18px; border-radius: 0 0 14px 14px;
  margin-top: calc(-1 * env(safe-area-inset-top, 0px));
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
}
.tab::before, .tab::after {
  content: ""; position: absolute; top: 0; width: 14px; height: 14px;
}
.tab::before { left: -14px; background: radial-gradient(circle at 0 100%, transparent 13.5px, var(--tab) 14px); } /* taste-skill-ignore: draws the tab's flared corner, not a colour gradient */
.tab::after { right: -14px; background: radial-gradient(circle at 100% 100%, transparent 13.5px, var(--tab) 14px); } /* taste-skill-ignore: flared corner shape */
.tab__logo { display: block; width: clamp(150px, 13vw, 210px); }
.tab__logo svg { display: block; width: 100%; height: auto; }

/* ── main ───────────────────────────────────────────────────────────────── */
.main {
  position: relative; min-height: 0;
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto;
  padding-block: 8px max(20px, env(safe-area-inset-bottom, 0px));
}

/* the ring of categories */
.stage { position: relative; min-height: 0; touch-action: pan-y; }
.stage__track { position: absolute; inset: 0; }
.card {
  --x: 0px; --s: 1; --f: 1;
  /* --cw/--ch: the frame's size; the centre frame takes the picture's own proportions in focus */
  position: absolute; left: 50%; top: var(--cy, 50%);
  width: var(--cw, var(--w0, 300px)); height: var(--ch, calc(var(--w0, 300px) * 1.25));
  margin-left: calc(var(--cw, var(--w0, 300px)) / -2);
  margin-top: calc(var(--ch, calc(var(--w0, 300px) * 1.25)) / -2);
  transform: translateX(var(--x)) scale(calc(var(--s) * var(--f)));
  transform-origin: 50% 50%;
  z-index: var(--z, 1);
  will-change: transform, filter;
  transition: transform var(--t-move) var(--ease), filter var(--t-move) var(--ease), opacity var(--t-move) var(--ease),
    width var(--t-move) var(--ease), height var(--t-move) var(--ease), margin var(--t-move) var(--ease);
}
.card__btn { position: absolute; inset: 0; display: block; width: 100%; }
.card__frame { position: absolute; inset: 0; overflow: hidden; background: #1a1918; }
.card__frame::after { content: ""; position: absolute; inset: 0; outline: 1px solid var(--outline); outline-offset: -1px; pointer-events: none; }
.card__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity var(--t-move) var(--ease);
}
.card__img--next { opacity: 0; }
.card__cap {
  position: absolute; left: 0; right: 0; top: 100%;
  margin-top: calc(12px / var(--s));
  font-family: "Syne", var(--font); font-size: calc(clamp(13px, calc(var(--w0, 300px) * 0.065), 18px) / var(--s)); font-weight: 700; letter-spacing: -0.02em; text-transform: lowercase;
  line-height: 1.1; white-space: nowrap; text-align: center;
  transition: font-size var(--t-move) var(--ease), margin var(--t-move) var(--ease), opacity var(--t-move) var(--ease);
}
.card:not(.is-center) .card__cap { opacity: 0.72; }
.card.is-center .card__cap { opacity: 0; visibility: hidden; } /* the details below name the centre category */
@media (hover: hover) {
  .card:not(.is-center) .card__btn:hover .card__img { filter: brightness(1.12); }
  .card:not(.is-center) .card__btn:hover + .card__cap { opacity: 1; }
}
.card__img { transition: opacity var(--t-move) var(--ease), filter var(--t-quick) var(--ease); }
.card.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: transform var(--t-move) var(--ease), opacity var(--t-move) var(--ease), visibility 0s linear var(--t-move); }
.card.is-wrapping { transition: none; opacity: 0; }

/* focus on a project: the chosen picture comes forward and settles; the other categories
   are pushed outwards, shrink, darken and go out of focus; the backdrop dims */
.app.is-focus-moving .card {
  transition: transform var(--t-focus) var(--expo), filter var(--t-focus) var(--expo), opacity var(--t-focus) var(--expo),
    width var(--t-focus) var(--expo), height var(--t-focus) var(--expo), margin var(--t-focus) var(--expo);
}
.app.is-focus-moving .card.is-center {
  transition: transform 720ms var(--settle), width var(--t-focus) var(--expo), height var(--t-focus) var(--expo), margin var(--t-focus) var(--expo);
}
.app.is-focus .card:not(.is-center) { --f: 0.8; filter: brightness(0.2) blur(10px) saturate(0.4); opacity: 0.85; }
.app.is-focus .card.is-center { --f: 1; } /* the centre frame grows by its real size (--cw/--ch), never by scaling the bitmap */
.app.is-focus .card:not(.is-center) .card__cap { opacity: 0; }
.card__frame { transition: box-shadow var(--t-focus) var(--expo); }
.app.is-focus .card.is-center .card__frame { box-shadow: 0 40px 100px -24px rgb(0 0 0 / 0.75); }
.app.is-focus .card.is-center .card__btn { cursor: zoom-in; }
.card__zoom {
  position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%; background: rgb(0 0 0 / 0.5); color: #fff;
  opacity: 0; scale: 0.8; pointer-events: none;
  transition: opacity 200ms var(--ease), scale 200ms var(--ease);
}
.card__zoom svg { width: 16px; height: 16px; }
.app.is-focus .card.is-center .card__zoom { opacity: 1; scale: 1; transition-delay: 350ms; transition-duration: 300ms; }
.card.is-lifted .card__frame { visibility: hidden; }
.app.is-focus .thumb:not([aria-pressed="true"]) { opacity: 0.45; }
@media (prefers-reduced-motion: no-preference) {
  .details.is-reveal .details__title, .details.is-reveal .details__who, .details.is-reveal .details__text {
    animation: reveal 600ms var(--expo) both;
  }
  .details.is-reveal .details__who { animation-delay: 60ms; }
  .details.is-reveal .details__text { animation-delay: 120ms; }
}
@keyframes reveal { from { opacity: 0; translate: 0 18px; filter: blur(6px); } }

/* ── full-screen viewer ─────────────────────────────────────────────────── */
.viewer { position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / 0); transition: background-color 380ms var(--ease-in); }
.viewer.is-open { background: #000; transition: background-color 500ms var(--expo); }
.viewer__img { position: fixed; max-width: none; object-fit: contain; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; touch-action: none; cursor: zoom-in; }
.viewer.is-zoomed .viewer__img { cursor: grab; }
.viewer__close {
  position: fixed; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; color: #fff;
  top: max(10px, calc(env(safe-area-inset-top, 0px) + 6px)); right: max(10px, calc(env(safe-area-inset-right, 0px) + 6px));
  opacity: 0; transition: opacity 150ms var(--ease), scale var(--t-quick) var(--ease-out);
}
.viewer__close svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.6)); }
.viewer__close:active { scale: 0.96; }
.viewer__cap {
  position: fixed; margin: 0; display: flex; gap: 12px; align-items: baseline;
  left: max(var(--margin), env(safe-area-inset-left, 0px)); bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 14px));
  font-size: var(--t-small); color: #fff; opacity: 0; transition: opacity 150ms var(--ease);
}
.viewer__who { color: var(--soft); }
.viewer__cap { text-shadow: 0 1px 3px rgb(0 0 0 / 0.7); }
.viewer.is-zoomed .viewer__cap { opacity: 0 !important; }
.viewer.is-open .viewer__close, .viewer.is-open .viewer__cap { opacity: 1; transition: opacity 300ms var(--ease) 300ms, scale var(--t-quick) var(--ease-out); }
@media (hover: hover) { .viewer.is-open .viewer__close:hover { opacity: 0.7; } }

/* details: between the categories and the projects */
.details {
  width: min(100%, 1040px); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; text-align: center;
  /* desktop: the project's title, artist and text take the name's place, halfway between picture and strip */
  position: absolute; left: 0; right: 0; top: var(--det-top, 60%); width: min(100% - 32px, 720px);
}
.details__head, .details__text { transition: opacity var(--t-quick) var(--ease); }
.details__title, .details__who, .details__text, .catname, .strip { will-change: transform, opacity, filter; }
.details.is-swapping .details__head, .details.is-swapping .details__text { opacity: 0; }
.details__title {
  margin: 0; font-size: var(--t-title); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em;
  text-wrap: balance;
}
.details__who { margin: 6px 0 0; font-size: var(--t-small); color: var(--soft); }
.details[data-state="category"] .details__text, .details[data-state="category"] .details__title, .details[data-state="category"] .details__who { display: none; }
.strip__label {
  margin: 0 0 14px; text-align: center; font-size: var(--t-small); text-transform: uppercase; letter-spacing: 0.18em; color: #d3cfc8;
}
.details[data-state="category"] .details__who { text-transform: uppercase; letter-spacing: 0.18em; color: #d3cfc8; margin: 0; }
.top > .catnav { visibility: hidden; } /* the categories are navigated by the split word under the frames */
/* "categ … ories": the word split across the screen, a long fine arrow over each half, the name it leads to under it */
.edge {
  position: absolute; z-index: 20; top: var(--edge-top, 50%); display: none; gap: 8px; padding: 8px 0; /* phone only */
  color: var(--ink); transition: opacity 300ms var(--ease);
}
.edge--prev { left: 0; justify-items: start; text-align: left; }
.edge--next { right: 0; justify-items: end; text-align: right; }
.edge__arrow { display: block; transition: translate 450ms var(--expo); }
.edge__arrow svg { display: block; width: 64px; height: 12px; overflow: visible; }
.edge__word { font-family: "Syne", var(--font); font-weight: 700; font-size: 1.375rem; line-height: 1; letter-spacing: -0.02em; text-transform: lowercase; }
.edge__to { font-size: 0.6875rem; line-height: 1; letter-spacing: 0.18em; text-transform: uppercase; color: #a29d95; transition: opacity 300ms var(--ease); }
@media (hover: hover) {
  .edge:hover .edge__arrow { translate: -8px 0; }
  .edge--next:hover .edge__arrow { translate: 8px 0; }
}
.edge:active .edge__arrow { translate: -8px 0; }
.edge--next:active .edge__arrow { translate: 8px 0; }
@media (prefers-reduced-motion: no-preference) { .edge.is-in .edge__to { animation: fade-in 450ms var(--expo) both; } }
.app.is-focus .edge { opacity: 0.25; }
/* desktop: the word set vertically at the left edge, level with the frames */
.vlabel {
  position: absolute; left: var(--vl-left, 0px); top: var(--cy, 50%); translate: 0 -50%; rotate: 180deg; writing-mode: vertical-rl;
  font-family: "Syne", var(--font); font-weight: 700; font-size: 0.9375rem; line-height: 1; letter-spacing: 0.04em; text-transform: lowercase;
  color: var(--ink); pointer-events: none; transition: opacity 300ms var(--ease);
}
.app.is-focus .vlabel { opacity: 0.25; }
/* the category's name, in the logo's face, halfway between its picture and the projects */
.catname {
  position: absolute; left: 0; right: 0; top: var(--cat-top, 60%); pointer-events: none;
  margin: 0; text-align: center; font-family: "Syne", var(--font); font-weight: 700;
  font-size: clamp(2.5rem, 1.3rem + 2.7vw, 4.25rem); line-height: 1; letter-spacing: -0.03em; text-transform: lowercase;
  transition: top 600ms var(--expo), opacity 200ms var(--ease);
}
.main.is-project .catname { opacity: 0; } /* desktop: the project's own title takes over */
@media (prefers-reduced-motion: no-preference) { .catname.is-in { animation: fade-in 450ms var(--expo) both; } }
@keyframes fade-in { from { opacity: 0; filter: blur(6px); } }
.details__text { margin: 0; max-width: 56ch; color: var(--ink); text-wrap: pretty; padding-top: 10px; }

/* the project strip */
.strip { width: min(100%, 1040px); margin-inline: auto; }
.strip__list {
  list-style: none; margin: -40px -40px; padding: 40px 40px 42px;
  display: flex; gap: 10px; justify-content: flex-start;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.strip__list::-webkit-scrollbar { display: none; }
.strip__item { flex: 0 0 auto; scroll-snap-align: start; }
/* centred when they fit, scrollable from the first one when they do not */
.strip__item:first-child { margin-left: auto; }
.strip__item:last-child { margin-right: auto; }
.thumb {
  display: grid; gap: 8px; width: clamp(96px, 9vw, 136px); text-align: left;
  transition: opacity var(--t-quick) var(--ease), scale var(--t-quick) var(--ease-out);
}
.thumb:not(:disabled):active { scale: 0.96; }
.thumb__frame { position: relative; aspect-ratio: 5 / 4; overflow: hidden; background: #1a1918; }
.thumb__frame::after { content: ""; position: absolute; inset: 0; outline: 1px solid var(--outline); outline-offset: -1px; }
.thumb__frame img { width: 100%; height: 100%; object-fit: cover; }
.thumb__label {
  display: block; font-size: 0.75rem; line-height: 1.3; color: var(--soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* the chosen project: an animated outline of light around its picture */
.thumb__frame::before {
  content: ""; position: absolute; inset: 0; z-index: 1; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0turn 0.5turn, rgb(255 255 255 / 0.95) 0.72turn, transparent 0.94turn); /* taste-skill-ignore: client-requested outline glow */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); /* taste-skill-ignore: ring mask */
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 300ms var(--ease);
}
.thumb__frame { transition: box-shadow 400ms var(--ease); }
.thumb[aria-pressed="true"] .thumb__frame::before { opacity: 1; }
.thumb[aria-pressed="true"] .thumb__frame { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.6), 0 0 22px 2px rgb(255 255 255 / 0.25); } /* taste-skill-ignore: client-requested glow */
@media (prefers-reduced-motion: no-preference) {
  .thumb[aria-pressed="true"] .thumb__frame::before { animation: spin 2.4s linear infinite; }
  .thumb[aria-pressed="true"] .thumb__frame { animation: glow 2.4s ease-in-out infinite; }
}
@keyframes spin { to { --spin: 360deg; } }
@keyframes glow { 50% { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.85), 0 0 36px 6px rgb(255 255 255 / 0.38); } } /* taste-skill-ignore: glow pulse */
.thumb__bar { display: block; height: 2px; background: var(--ink); scale: 0 1; transform-origin: left; transition: scale var(--t-move) var(--ease); }
.thumb[aria-pressed="true"] .thumb__bar { scale: 1 1; }
.thumb[aria-pressed="true"] .thumb__label { color: var(--ink); }
@media (hover: hover) {
  .strip__list:hover .thumb:not(:hover):not([aria-pressed="true"]) { opacity: 0.55; }
  .thumb:hover .thumb__label { color: var(--ink); }
}

/* ── about / info panels ─────────────────────────────────────────────────── */
.panel {
  position: fixed; inset: 0; z-index: 20;
  background: rgb(10 10 9 / 0.86);
  overflow-y: auto; overscroll-behavior: contain;
  padding-left: max(var(--margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--margin), env(safe-area-inset-right, 0px));
  opacity: 0; transition: opacity 150ms var(--ease-in);
}
.panel.is-open { opacity: 1; transition: opacity 300ms var(--ease-out); }
.panel__inner {
  position: relative; width: min(100%, 1040px); margin-inline: auto;
  padding-block: max(96px, calc(env(safe-area-inset-top, 0px) + 80px)) 64px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 24px 48px;
  translate: 0 12px; filter: blur(4px);
  transition: translate 150ms var(--ease-in), filter 150ms var(--ease-in);
}
.panel.is-open .panel__inner { translate: 0 0; filter: blur(0); transition: translate 300ms var(--ease-out), filter 300ms var(--ease-out); }
.panel__close {
  position: absolute; top: max(28px, calc(env(safe-area-inset-top, 0px) + 20px)); right: 0;
  font-size: var(--t-small); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 12px 2px; transition: opacity var(--t-quick) var(--ease), scale var(--t-quick) var(--ease-out);
}
.panel__close:active { scale: 0.96; }
@media (hover: hover) { .panel__close:hover { opacity: 0.7; } }
.panel__title { margin: 0; font-size: var(--t-title); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; }
.panel__body { max-width: 62ch; }
.panel__body p { margin: 0 0 1em; text-wrap: pretty; }
.panel__lead { font-size: 1.25rem; line-height: 1.4; }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 10px 32px; margin: 0 0 2em; }
.info dt { color: var(--soft); }
.info dd { margin: 0; }
.todo { color: var(--soft); }
.note { color: var(--soft); font-size: var(--t-small); }

/* ── first load ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .is-loading .card, .is-loading .details, .is-loading .strip, .is-loading .top > * {
    opacity: 0; filter: blur(4px);
  }
  .is-loading .card { translate: 0 12px; }
  .card, .details, .strip, .top > * { transition-property: transform, translate, filter, opacity; }
  .is-entering .card, .is-entering .details, .is-entering .strip, .is-entering .top > * {
    transition: transform var(--t-move) var(--ease), translate 300ms var(--ease-out), filter 300ms var(--ease-out), opacity 300ms var(--ease-out);
    transition-delay: var(--d, 0ms);
  }
}

/* ── reduced motion: keep the cross-fades, drop the travel ───────────────── */
@media (prefers-reduced-motion: reduce) {
  .card { transition: opacity 200ms linear, filter 200ms linear; }
  .panel__inner, .panel.is-open .panel__inner { translate: none; filter: none; }
  .thumb:active, .catnav__btn:active, .panel__close:active { scale: 1; }
  .bg__img { transition-duration: 300ms; }
}

/* ── phone: the same architecture, three frames, the side ones cut by the edges ── */
/* portrait tablets: the ring is cut by the screen edges, like the phone */
@media (max-width: 1023px) and (orientation: portrait) {
  .card__cap { visibility: hidden; } /* the frames are cut by the screen edges; the name sits under the centre one */
  .vlabel { display: none; }
  .edge--prev { left: max(var(--margin), env(safe-area-inset-left, 0px)); }
  .edge--next { right: max(var(--margin), env(safe-area-inset-right, 0px)); }
  .stage { margin-inline: calc(-1 * max(var(--margin), env(safe-area-inset-left, 0px))) calc(-1 * max(var(--margin), env(safe-area-inset-right, 0px))); }
  .app { overflow-x: clip; }
}

@media (max-width: 720px) {
  html, body { overflow: hidden; }
  .app { height: 100%; height: 100dvh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  .main { min-height: 0; }
  /* header: About · logo · Info; the category arrows move under the frames */
  .top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
  .top > .catnav { display: none; }
  .meta { display: contents; }
  .meta__sep { display: none; }
  .meta__link { grid-row: 1; align-self: start; margin-top: 4px; letter-spacing: 0.04em; }
  .meta__link[data-panel="about"] { grid-column: 1; justify-self: start; }
  .meta__link[data-panel="info"] { grid-column: 3; justify-self: end; }
  .brand { grid-row: 1; grid-column: 2; }
  .tab { padding: 15px 12px 13px; padding-top: calc(15px + env(safe-area-inset-top, 0px)); border-radius: 0 0 12px 12px; }
  .tab__logo { width: 150px; }
  /* "categ | ories" under the two cut frames, each half with its arrow above it */
  .edge { display: grid; top: var(--edge-top-m, auto); bottom: auto; gap: 5px; } /* just under the side frames (set by JS) */
  .edge--prev { left: max(var(--margin), env(safe-area-inset-left, 0px)); }
  .edge--next { right: max(var(--margin), env(safe-area-inset-right, 0px)); }
  .edge__arrow svg { width: 38px; }
  .edge__word { font-size: 0.9375rem; }
  .edge__to { display: none; }
  .app.is-focus .edge { opacity: 0; pointer-events: none; } /* the open picture can reach the screen edges */
  .stage { touch-action: none; } /* swipes are handled here; the page never rubber-bands under the finger */
  .details { min-height: 8.5rem; }
  .details[data-state="category"] { align-content: end; }
  .details__text { font-size: 0.8125rem; line-height: 1.55; max-width: 34ch; color: #d9d5ce; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .catname { position: static; translate: none; padding-top: 40px; font-size: 1.875rem; letter-spacing: -0.025em; }
  .main.is-project .catname { opacity: 1; }
  .thumb__label { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  /* the projects sit in the middle of the space left under the name, not crammed under it */
  .main { display: flex; flex-direction: column; padding-top: 34px; }
  .catname, .details, .strip { flex-shrink: 0; }
  .details { margin-top: auto; }
  .strip { margin-bottom: auto; padding-bottom: 28px; }
  .card:not(.is-center) .card__cap { opacity: 0; }
  /* the stage gives way first when the visible screen is short (browser toolbars), down to a smaller ring */
  .stage { height: auto; flex: 1 1 calc(58vw * 1.25 + 12px); min-height: calc(36vw * 1.25 + 12px); max-height: calc(66vw * 1.25 + 96px); margin-inline: calc(-1 * max(var(--margin), env(safe-area-inset-left, 0px))) calc(-1 * max(var(--margin), env(safe-area-inset-right, 0px))); }
  .details { position: static; translate: none; width: 100%; padding-block: 22px 14px; }
  .details[data-state="category"] .details__who { display: block; }
  .strip__label { display: none; }
  .strip { width: auto; margin-inline: calc(-1 * max(var(--margin), env(safe-area-inset-left, 0px))) calc(-1 * max(var(--margin), env(safe-area-inset-right, 0px))); }
  .strip__list { margin: -40px 0; padding: 40px max(var(--margin), env(safe-area-inset-left, 0px)) 42px; scroll-padding-inline: max(var(--margin), env(safe-area-inset-left, 0px)); }
  .strip__list { gap: 18px; padding-inline: 30px; }
  .strip__item { flex: 0 0 clamp(60px, calc((100vw - 60px - 54px) / 4), 92px); }
  .thumb { gap: 10px; }
  .thumb__label { min-height: 2.6em; } /* two lines reserved: the strip keeps its height in every category */
  .thumb { width: 100%; }
  .panel__inner { grid-template-columns: 1fr; padding-top: max(84px, calc(env(safe-area-inset-top, 0px) + 72px)); }
}
@media (max-width: 360px) {
  .tab { padding-inline: 10px; }
}

.strip { transition: opacity var(--t-quick) var(--ease); }
.strip.is-swapping { opacity: 0; transition: none; }

/* phones held sideways: the page scrolls and the frames keep a real size */
/* short phone screens (browser toolbars showing): the same rhythm, compressed */
@media (max-width: 720px) and (max-height: 760px) {
  .main { padding-top: 22px; }
  .catname { padding-top: 26px; font-size: 1.75rem; }
  .details { min-height: 7.75rem; padding-block: 16px 12px; }
  .strip { padding-bottom: 14px; }
}
@media (max-width: 720px) and (max-height: 620px) {
  .main { padding-top: 16px; }
  .catname { padding-top: 18px; font-size: 1.625rem; }
  .details { min-height: 7.25rem; padding-block: 12px 8px; }
  .strip { padding-bottom: 6px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  body { overflow-y: auto; }
  .app { height: auto; min-height: 100%; }
  .main { grid-template-rows: auto auto auto; }
  .stage { height: max(300px, 86vh); }
}
