/* ==========================================================================
   Evaggelos Moraitis — Form & Light
   Extends the incumbent world: paper ground, Instrument Serif display,
   sage accent, hairline glass. Adds a nocturne twin of the same world.

   Sections
   01 tokens · 02 base · 03 backdrop · 04 preloader · 05 cursor
   06 chrome · 07 hero · 08 statement · 09 works · 10 ribbon
   11 practice · 12 path · 13 contact · 14 case study · 15 player
   16 motion utilities · 17 responsive · 18 reduced motion
   ========================================================================== */

/* -- 01 tokens ------------------------------------------------------------ */

:root {
  color-scheme: light;

  --ground: #f7f6f3;
  --ground-raised: #fffefc;
  --ground-sunken: #efeee9;

  --ink: #17181a;
  --ink-strong: rgba(23, 24, 26, 0.88);
  --ink-muted: rgba(23, 24, 26, 0.64); /* 4.6:1 on ground — safe for body */
  --ink-faint: rgba(23, 24, 26, 0.34); /* decorative rules only, never text */
  --hairline: rgba(23, 24, 26, 0.09);
  --hairline-soft: rgba(23, 24, 26, 0.05);

  --accent: #557f61; /* sage, darkened to carry text weight */
  --accent-lit: #82b184; /* the original sage — dots, glows, fills */
  --accent-wash: rgba(130, 177, 132, 0.14);
  --flare: #c4463f;

  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.86);

  --shadow-low: 0 1px 2px rgba(23, 24, 26, 0.03), 0 10px 26px rgba(23, 24, 26, 0.045);
  --shadow-mid: 0 2px 6px rgba(23, 24, 26, 0.04), 0 26px 64px rgba(23, 24, 26, 0.07);
  --shadow-high: 0 4px 12px rgba(23, 24, 26, 0.05), 0 48px 110px rgba(23, 24, 26, 0.11);

  --grain-opacity: 0.5;
  --plate-filter: saturate(0.92) contrast(1.01);

  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* one easing family, so every motion in the page is visibly related */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-inout: cubic-bezier(0.76, 0, 0.24, 1);

  --shell: 1360px;
  --pad: clamp(20px, 5vw, 64px);
  --section-gap: clamp(120px, 17vw, 232px);

  --dur-fast: 0.28s;
  --dur-mid: 0.6s;
  --dur-slow: 1.15s;
}

:root[data-theme='night'] {
  color-scheme: dark;

  --ground: #0b0d10;
  --ground-raised: #14171c;
  --ground-sunken: #07080a;

  --ink: #ecebe6;
  --ink-strong: rgba(236, 235, 230, 0.9);
  --ink-muted: rgba(236, 235, 230, 0.62); /* 5.8:1 on night ground */
  --ink-faint: rgba(236, 235, 230, 0.3);
  --hairline: rgba(236, 235, 230, 0.12);
  --hairline-soft: rgba(236, 235, 230, 0.07);

  --accent: #9ed0a6;
  --accent-lit: #a8dcaf;
  --accent-wash: rgba(158, 208, 166, 0.16);
  --flare: #e8776f;

  --glass: rgba(20, 24, 30, 0.6);
  --glass-strong: rgba(20, 24, 30, 0.84);

  --shadow-low: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.34);
  --shadow-mid: 0 2px 6px rgba(0, 0, 0, 0.32), 0 26px 64px rgba(0, 0, 0, 0.46);
  --shadow-high: 0 4px 12px rgba(0, 0, 0, 0.36), 0 48px 110px rgba(0, 0, 0, 0.58);

  --grain-opacity: 0.75;
  --plate-filter: saturate(0.72) brightness(0.82) contrast(1.04);
}

/* the theme crossfade — added by JS only for the duration of a switch */
:root.theme-shifting,
:root.theme-shifting * {
  transition:
    background-color 0.75s var(--ease-soft),
    border-color 0.75s var(--ease-soft),
    color 0.75s var(--ease-soft),
    fill 0.75s var(--ease-soft),
    box-shadow 0.75s var(--ease-soft) !important;
}

/* -- 02 base -------------------------------------------------------------- */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
html.study-open {
  overflow: hidden;
}

body {
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent-wash);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 400;
  padding: 10px 18px;
  border-radius: 100px;
  background: var(--ground-raised);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-mid);
  font-size: 13px;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* small tracked label — the page's only uppercase voice */
.label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: max(var(--pad), env(safe-area-inset-left, 0px));
  padding-inline-end: max(var(--pad), env(safe-area-inset-right, 0px));
}

.section {
  margin-bottom: var(--section-gap);
}

/* -- 03 backdrop ---------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  /* the fallback the WebGL field paints over, and what shows if it never boots */
  background:
    radial-gradient(120% 90% at 22% 12%, var(--ground-raised) 0%, transparent 58%),
    radial-gradient(110% 80% at 82% 88%, var(--accent-wash) 0%, transparent 62%),
    var(--ground);
}

.backdrop__canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.6s var(--ease-soft);
}
.backdrop__canvas.is-live {
  opacity: 1;
}

/* full-resolution grain, kept out of the (downsampled) WebGL buffer */
.grain {
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-repeat: repeat;
  background-size: 180px 180px;
  will-change: transform;
  animation: grain-drift 6s steps(6) infinite;
  mix-blend-mode: soft-light;
}

@keyframes grain-drift {
  0% { transform: translate3d(0, 0, 0); }
  16% { transform: translate3d(-2%, 1.5%, 0); }
  33% { transform: translate3d(1.5%, -2%, 0); }
  50% { transform: translate3d(-1%, 2.5%, 0); }
  66% { transform: translate3d(2%, 1%, 0); }
  83% { transform: translate3d(-2.5%, -1%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* -- 04 preloader --------------------------------------------------------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--ground);
  display: flex;
  align-items: flex-end;
  padding: var(--pad);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease-inout);
}
.preloader.is-done {
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}

.preloader__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
  transition: opacity 0.4s var(--ease-out), transform 0.7s var(--ease-out);
}
.preloader.is-done .preloader__row {
  opacity: 0;
  transform: translateY(-14px);
}

.preloader__word {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  overflow: hidden;
}
.preloader__word span {
  display: block;
  transform: translateY(105%);
  animation: rise-in 1s var(--ease-out) 0.15s forwards;
}

@keyframes rise-in {
  to { transform: translateY(0); }
}

.preloader__count {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.preloader__bar {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(var(--pad) - 14px);
  height: 1px;
  background: var(--hairline);
  overflow: hidden;
}
.preloader__bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent-lit);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.45s var(--ease-soft);
}

/* -- 05 cursor ------------------------------------------------------------ */

/* Only set once the custom cursor is actually running — coarse pointers and
   reduced-motion never get the class, so they keep the system cursor. */
html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 350;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.cursor.is-ready {
  opacity: 1;
}

.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}

.cursor__dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.cursor__ring {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid var(--ink-faint);
  display: grid;
  place-items: center;
  transition:
    width 0.45s var(--ease-out),
    height 0.45s var(--ease-out),
    margin 0.45s var(--ease-out),
    background-color 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out);
}

.cursor__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ground);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out);
  white-space: nowrap;
}

.cursor[data-state='link'] .cursor__ring {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-color: transparent;
  background: var(--accent-wash);
}
.cursor[data-state='link'] .cursor__dot {
  opacity: 0;
}

.cursor[data-state='open'] .cursor__ring {
  width: 82px;
  height: 82px;
  margin: -41px 0 0 -41px;
  border-color: transparent;
  background: var(--accent);
}
.cursor[data-state='open'] .cursor__dot {
  opacity: 0;
}
.cursor[data-state='open'] .cursor__label {
  opacity: 1;
  transform: scale(1);
}

/* -- 06 chrome ------------------------------------------------------------ */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-lit));
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: clamp(18px, 2.6vw, 30px) var(--pad);
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}

.wordmark {
  justify-self: start;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out);
}
.wordmark.is-shown {
  opacity: 1;
  transform: translateY(0);
}
.wordmark small {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.status-pill {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 13px;
  border-radius: 100px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-low);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out);
}
.status-pill:hover {
  transform: translateY(2px);
  box-shadow: var(--shadow-mid);
}

.status-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-lit);
  flex: none;
}
.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent-lit);
  animation: pulse-ring 2.8s var(--ease-soft) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  70% { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}

.theme-toggle {
  justify-self: end;
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-low);
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow-mid);
}
.theme-toggle svg {
  position: absolute;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.6s var(--ease-out), opacity 0.4s var(--ease-out);
}
.theme-toggle .icon-night {
  opacity: 0;
  transform: translateY(120%) rotate(-50deg);
}
:root[data-theme='night'] .theme-toggle .icon-day {
  opacity: 0;
  transform: translateY(-120%) rotate(50deg);
}
:root[data-theme='night'] .theme-toggle .icon-night {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

/* dock */
.dock {
  position: fixed;
  bottom: calc(clamp(18px, 2.6vw, 30px) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-mid);
  transform: translate(-50%, 0);
  transition: transform var(--dur-mid) var(--ease-out), opacity var(--dur-mid) var(--ease-out);
}
.dock.is-stowed {
  transform: translate(-50%, 180%);
  opacity: 0;
}

.dock__item {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--ink-muted);
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform 0.5s var(--ease-out);
  transform: translateY(calc(var(--lift, 0) * -9px)) scale(calc(1 + var(--lift, 0) * 0.16));
}
.dock__item:hover,
.dock__item.is-active {
  color: var(--ink);
}
.dock__item.is-active {
  background: var(--accent-wash);
}
/* the drawn box shrinks on narrow screens; the tap target never does */
.dock__item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-50%, -50%);
}

.dock__item svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock__tip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--ground);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out);
  pointer-events: none;
}
.dock__item:hover .dock__tip,
.dock__item:focus-visible .dock__tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* -- 07 hero -------------------------------------------------------------- */

.scroll-view {
  will-change: transform;
}
html.has-smooth .scroll-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
}

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 128px 0 132px;
  position: relative;
}

.hero__inner {
  max-width: 900px;
}

.hero__title {
  font-size: clamp(3.1rem, 11vw, 6rem);
  margin-bottom: 26px;
}

.hero__display {
  display: block;
}

/* per-character emergence — the page's signature arrival */
.char {
  display: inline-block;
  white-space: pre;
  opacity: 0;
  transform: translateY(0.42em) scale(0.94);
  filter: blur(9px);
}
.is-lit .char {
  animation: char-emerge 1.25s var(--ease-out) both;
  animation-delay: calc(var(--ci) * 34ms + var(--cd, 0ms));
}

@keyframes char-emerge {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.hero__lede {
  font-size: clamp(1rem, 1.55vw, 1.16rem);
  color: var(--ink-muted);
  max-width: 46ch;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(14px);
}
.is-lit .hero__lede {
  animation: soft-rise 1.1s var(--ease-out) 0.72s both;
}

@keyframes soft-rise {
  to { opacity: 1; transform: translateY(0); }
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: clamp(116px, 15vh, 150px);
  transform: translate(-50%, 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
}
/* Its own keyframes, not soft-rise: that one animates transform to
   translateY(0), which drops the -50% doing the centring and shunts the cue
   half its own width to the right once the animation lands. */
.is-lit .hero__cue {
  animation: cue-rise 1.1s var(--ease-out) 1.05s both;
}

@keyframes cue-rise {
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.hero__cue span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.hero__cue i {
  display: block;
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--ink-faint), transparent);
  position: relative;
  overflow: hidden;
}
.hero__cue i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--accent-lit), transparent);
  animation: cue-fall 2.4s var(--ease-soft) infinite;
}

@keyframes cue-fall {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* -- 08 statement --------------------------------------------------------- */

.statement__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(48px, 6vw, 96px);
}

.statement__body {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.9vw, 3.05rem);
  line-height: 1.16;
  letter-spacing: -0.022em;
  max-width: 20ch;
}
.statement__body em {
  font-style: italic;
  color: var(--accent);
}

.statement__aside {
  display: grid;
  gap: 30px;
  align-content: start;
  max-width: 34ch;
}

.statement__note {
  font-size: 0.95rem;
  line-height: 1.68;
  color: var(--ink-muted);
  max-width: 68ch;
}

.facts {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--hairline);
}
.facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.8125rem;
}
.facts dt {
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.facts dd {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* the section's own heading treatment — no eyebrows anywhere in this page */
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: clamp(44px, 6vw, 76px);
  border-bottom: 1px solid var(--hairline);
}

.section__title {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
}

/* -- 09 works ------------------------------------------------------------- */

.works {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(28px, 4vw, 56px) clamp(24px, 3.4vw, 48px);
}

.work {
  grid-column: span 6;
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.work:nth-child(even) {
  margin-top: clamp(40px, 9vw, 132px);
}

/* The frame carries the original design's single slow transform transition;
   the pointer handler writes the transform inline and this does the easing. */
.work__frame {
  display: block;
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: clamp(18px, 2.2vw, 30px);
  overflow: hidden;
  background: var(--ground-sunken);
  border: 1px solid var(--hairline-soft);
  box-shadow: var(--shadow-mid);
  transition:
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.8s var(--ease-out);
}
.work:hover .work__frame {
  transform: scale(0.98);
  box-shadow: var(--shadow-high);
}
.work.is-hidden .work__frame {
  opacity: 0;
}

/* The original's signature: the work sits out of focus until you reach for it,
   then resolves. Kept exactly, over the generated plates. */
.work__plate {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
  filter: blur(40px) saturate(1.2);
  transition: filter 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.work:hover .work__plate,
.work:focus-visible .work__plate {
  filter: blur(0px) saturate(1);
}
:root[data-theme='night'] .work__plate {
  filter: blur(40px) saturate(1) brightness(0.82);
}
:root[data-theme='night'] .work:hover .work__plate,
:root[data-theme='night'] .work:focus-visible .work__plate {
  filter: blur(0px) saturate(0.78) brightness(0.84);
}

.work__index {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 2;
  padding: 5px 11px;
  border-radius: 100px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline-soft);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.work:hover .work__index,
.work:focus-visible .work__index {
  opacity: 1;
  transform: translateY(0);
}

.work__meta > span {
  display: block;
}

.work__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}

.work__name {
  font-family: var(--serif);
  letter-spacing: -0.02em;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.05;
  position: relative;
  display: inline-block;
}
.work__name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.65s var(--ease-out);
}
.work:focus-visible .work__name::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.work__tags {
  display: block;
  margin-top: 7px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.work__year {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 5px;
  flex: none;
}

/* -- 10 ribbon ------------------------------------------------------------ */

.ribbon {
  --ribbon-shift: 0px;
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 46px) 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--section-gap);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.ribbon__track {
  display: flex;
  width: max-content;
  will-change: transform;
  transform: translate3d(var(--ribbon-shift), 0, 0);
}

.ribbon__set {
  display: flex;
  align-items: center;
  flex: none;
}

.ribbon__word {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  padding: 0 clamp(20px, 3vw, 40px);
  white-space: nowrap;
}
.ribbon__word:nth-child(even) {
  font-style: italic;
  color: var(--ink-muted);
}

.ribbon__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-lit);
  flex: none;
}

/* -- 11 practice ---------------------------------------------------------- */

.practice {
  position: relative;
}

.practice__list {
  border-top: 1px solid var(--hairline);
}

.practice__row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: clamp(18px, 3vw, 44px);
  padding: clamp(22px, 3vw, 34px) 4px;
  border-bottom: 1px solid var(--hairline);
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}
/* neighbours recede so the hovered row is the only thing in focus */
.practice.is-focused .practice__row {
  opacity: 0.34;
}
.practice.is-focused .practice__row.is-focus {
  opacity: 1;
  transform: translateX(clamp(10px, 1.6vw, 22px));
}

.practice__row::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--accent-lit);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.75s var(--ease-out);
}
.practice__row.is-focus::before {
  transform: scaleX(1);
}

.practice__name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.practice__detail {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  text-align: right;
  max-width: 30ch;
  line-height: 1.5;
}

/* cursor-tracked preview — desktop only */
.practice__preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 224px;
  height: 280px;
  margin: -140px 0 0 -112px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-high);
  border: 1px solid var(--hairline-soft);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.86);
  transition: opacity 0.45s var(--ease-out), transform 0.65s var(--ease-out);
  will-change: transform;
}
.practice__preview.is-shown {
  opacity: 1;
}
.practice__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--plate-filter);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}
.practice__preview img.is-current {
  opacity: 1;
}

/* -- 12 path -------------------------------------------------------------- */

.path {
  position: relative;
  display: grid;
  gap: 0;
  padding-left: clamp(22px, 4vw, 48px);
}

.path__rail {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: var(--hairline);
  overflow: hidden;
}
.path__rail i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--accent-lit), var(--accent));
  transform: scaleY(var(--fill, 0));
  transform-origin: 50% 0;
  will-change: transform;
}

.path__step {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(20px, 2.6vw, 30px) 0;
  align-items: baseline;
}
.path__step + .path__step {
  border-top: 1px solid var(--hairline);
}

.path__step::before {
  content: '';
  position: absolute;
  left: calc(clamp(22px, 4vw, 48px) * -1 + 0px);
  top: calc(clamp(20px, 2.6vw, 30px) + 8px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ground);
  border: 1px solid var(--ink-faint);
  transition: background-color 0.5s var(--ease-out), border-color 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.path__step.is-in::before {
  background: var(--accent-lit);
  border-color: var(--accent-lit);
  transform: scale(1.25);
}

.path__when {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.path__what h3 {
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  margin-bottom: 7px;
  letter-spacing: -0.015em;
}
.path__what p {
  font-size: 0.9rem;
  color: var(--ink-muted);
  max-width: 62ch;
  line-height: 1.65;
}

/* -- 13 contact ----------------------------------------------------------- */

.contact {
  text-align: center;
  padding-bottom: clamp(80px, 12vw, 150px);
}

.contact__line {
  font-size: clamp(2.2rem, 6.4vw, 4.4rem);
  margin-bottom: 34px;
}

.contact__mail {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 17px 30px;
  border-radius: 100px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-low);
  font-size: 0.95rem;
  font-weight: 500;
  overflow: hidden;
  transition: box-shadow 0.6s var(--ease-out), color 0.5s var(--ease-out);
}
.contact__mail::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.65s var(--ease-out);
}
.contact__mail:hover {
  color: var(--ground);
  box-shadow: var(--shadow-high);
}
.contact__mail:hover::before {
  transform: translateY(0);
}
.contact__mail svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.55s var(--ease-out);
}
.contact__mail:hover svg {
  transform: translate(3px, -3px);
}

.contact__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 34px);
  margin-top: 34px;
  flex-wrap: wrap;
}
.contact__links a {
  position: relative;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  transition: color 0.4s var(--ease-out);
}
/* the underline tracks the text, so the tap target is grown separately */
.contact__links a::before,
.colophon a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-50%, -50%);
}
.colophon a {
  position: relative;
}
.contact__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.5s var(--ease-out);
}
.contact__links a:hover {
  color: var(--ink);
}
.contact__links a:hover::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.colophon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px 0 calc(clamp(18px, 2.6vw, 30px) + 74px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--hairline);
  font-size: 0.75rem;
  color: var(--ink-muted);
}
.colophon__clock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.colophon__clock i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-lit);
  animation: tick 2s var(--ease-soft) infinite;
}

@keyframes tick {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* -- 14 case study -------------------------------------------------------- */

.study {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  visibility: hidden;
  pointer-events: none;
}
.study.is-open,
.study.is-closing {
  visibility: visible;
}
.study.is-open {
  pointer-events: auto;
}

.study__scrim {
  position: absolute;
  inset: 0;
  background: var(--ground);
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}
.study.is-open .study__scrim {
  opacity: 0.9;
}

/* the flying plate — a real element, FLIPped from the card's rect */
.study__flyer {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  border-radius: clamp(18px, 2.2vw, 30px);
  box-shadow: var(--shadow-high);
  transform-origin: 0 0;
  will-change: transform, border-radius;
  transition:
    transform 0.86s var(--ease-inout),
    border-radius 0.86s var(--ease-inout);
}
.study__flyer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--plate-filter);
}

.study__panel {
  position: relative;
  align-self: end;
  width: 100%;
  max-height: 100svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(28px, 5vw, 60px) var(--pad) clamp(28px, 4vw, 52px);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out) 0.28s;
}
.study.is-open .study__panel {
  opacity: 1;
}

/* the slot is the flyer's destination: it defines the geometry in CSS and is
   never painted itself, so the flight target stays responsive and measurable */
.study__slot {
  aspect-ratio: 4 / 5;
  height: min(64svh, 620px);
  width: auto;
  justify-self: center;
  visibility: hidden;
}

.study__copy {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  align-content: end;
  transform: translateY(26px);
  transition: transform 0.75s var(--ease-out) 0.28s;
}
.study.is-open .study__copy {
  transform: translateY(0);
}

.study__grid {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  display: grid;
  gap: clamp(20px, 3vw, 40px);
}

.study__title {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

.study__sub {
  display: flex;
  gap: clamp(16px, 3vw, 34px);
  flex-wrap: wrap;
  align-items: baseline;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
}

.study__text {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.68;
  color: var(--ink-muted);
  max-width: 68ch;
}

.study__close {
  position: absolute;
  top: clamp(18px, 2.6vw, 30px);
  right: var(--pad);
  z-index: 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass-strong);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-mid);
  opacity: 0;
  transform: scale(0.8) rotate(-45deg);
  transition: opacity 0.4s var(--ease-out) 0.35s, transform 0.6s var(--ease-out) 0.35s,
    background-color 0.3s var(--ease-out);
}
.study.is-open .study__close {
  opacity: 1;
  transform: scale(1) rotate(0);
}
.study__close:hover {
  background: var(--ink);
  color: var(--ground);
}
.study__close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* the page itself recedes behind the study */
.scroll-view {
  transition: filter 0.75s var(--ease-out), opacity 0.75s var(--ease-out);
}
html.study-open .scroll-view {
  filter: blur(7px);
  opacity: 0.5;
}
html.study-open .dock,
html.study-open .player,
html.study-open .topbar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

/* -- 15 player ------------------------------------------------------------ */

/* The capsule is one fixed-width strip clipped by a shell that animates only
   its width. The body never re-lays-out mid-transition, and justify-content
   flex-end means the overflow spills off the LEFT — so the disc stays pinned
   in the corner and the controls slide out from behind it. */

.player {
  --capsule: min(356px, calc(100vw - 32px));
  --disc: 46px;
  position: fixed;
  right: calc(clamp(16px, 2.6vw, 30px) + env(safe-area-inset-right, 0px));
  bottom: calc(clamp(18px, 2.6vw, 30px) + env(safe-area-inset-bottom, 0px));
  z-index: 160;
  display: flex;
  justify-content: flex-end;
  transition: transform 0.7s var(--ease-out), opacity 0.5s var(--ease-out);
}
.player.is-stowed {
  transform: translateY(190%);
  opacity: 0;
  pointer-events: none;
}

.player__shell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: none;
  width: 54px;
  height: 54px;
  padding: 4px;
  border-radius: 27px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-mid);
  overflow: hidden;
  transition:
    width 0.66s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
}
.player.is-open .player__shell {
  width: var(--capsule);
  box-shadow: var(--shadow-high);
}

/* the disc — always the rightmost thing, always the same size */
.player__disc {
  position: relative;
  order: 2;
  flex: none;
  width: var(--disc);
  height: var(--disc);
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background-color 0.4s var(--ease-out);
}
.player__disc:hover {
  background: var(--accent-wash);
}
.player__disc::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-50%, -50%);
}

.player__ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  overflow: visible;
}
.player__ring circle {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.player__ring .track {
  stroke: var(--hairline);
}
.player__ring .head {
  stroke: var(--accent-lit);
  stroke-dasharray: var(--circ, 140);
  stroke-dashoffset: var(--circ, 140);
  transition: stroke-dashoffset 0.25s linear;
}

/* glyph stack: play at rest, bars while running, pause under the pointer */
.player__glyph {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}
.player__glyph > * {
  grid-area: 1 / 1;
  transition: opacity 0.32s var(--ease-out), transform 0.42s var(--ease-out);
}
.player__play,
.player__pause {
  width: 18px;
  height: 18px;
  fill: var(--accent);
  stroke: none;
}
.player__pause,
.player__eq {
  opacity: 0;
}
.player.is-playing .player__eq,
.player.is-busy .player__eq {
  opacity: 1;
}
.player.is-playing .player__play,
.player.is-busy .player__play {
  opacity: 0;
  transform: scale(0.55);
}
.player.is-playing .player__disc:hover .player__eq {
  opacity: 0;
}
.player.is-playing .player__disc:hover .player__pause {
  opacity: 1;
}

/* equaliser — three bars, unequal periods so it never reads as a loop */
.player__eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 15px;
}
.player__eq i {
  display: block;
  width: 2px;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleY(0.24);
  transform-origin: 50% 50%;
  transition: transform 0.45s var(--ease-out);
}
.player.is-playing .player__eq i {
  animation: eq-pulse 1.1s var(--ease-soft) infinite alternate;
}
.player.is-playing .player__eq i:nth-child(1) { animation-duration: 0.94s; }
.player.is-playing .player__eq i:nth-child(2) { animation-duration: 1.32s; animation-delay: -0.4s; }
.player.is-playing .player__eq i:nth-child(3) { animation-duration: 1.08s; animation-delay: -0.75s; }

@keyframes eq-pulse {
  from { transform: scaleY(0.2); }
  to { transform: scaleY(1); }
}

.player.is-busy .player__eq i {
  animation: eq-wait 1.2s var(--ease-soft) infinite;
}
.player.is-busy .player__eq i:nth-child(2) { animation-delay: 0.14s; }
.player.is-busy .player__eq i:nth-child(3) { animation-delay: 0.28s; }

@keyframes eq-wait {
  0%, 100% { transform: scaleY(0.2); opacity: 0.4; }
  50% { transform: scaleY(0.55); opacity: 1; }
}

/* the strip: fixed width, so the expand animates without a single reflow */
.player__body {
  order: 1;
  flex: none;
  width: calc(var(--capsule) - var(--disc) - 8px);
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 0 12px 0 8px;
  opacity: 0;
  transition: opacity 0.34s var(--ease-out);
}
.player.is-open .player__body {
  opacity: 1;
  transition-delay: 0.12s;
}

.player__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player__controls {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: none;
}

.player__btn {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-muted);
  transition: color 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}
.player__btn:hover {
  color: var(--ink);
  background: var(--hairline-soft);
}
.player__btn svg {
  grid-area: 1 / 1;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.25s var(--ease-out);
}
.player__btn .icon-muted {
  opacity: 0;
}
.player.is-muted .player__btn .icon-loud {
  opacity: 0;
}
.player.is-muted .player__btn .icon-muted {
  opacity: 1;
}
.player.is-muted .player__btn[data-act='mute'] {
  color: var(--accent);
}

.player__titles {
  flex: 1;
  min-width: 0;
  display: grid;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent);
  mask-image: linear-gradient(90deg, #000 78%, transparent);
}

.player__track {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
.player__artist {
  display: block;
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--ink-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.player__time {
  flex: none;
  font-size: 9.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* the progress bar */
.player__seek {
  --pos: 0;
  position: relative;
  height: 11px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.player__seek::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--hairline);
}
.player__seek i {
  position: absolute;
  left: 0;
  height: 3px;
  width: 100%;
  border-radius: 3px;
  background: var(--accent);
  transform: scaleX(var(--pos, 0));
  transform-origin: 0 50%;
  will-change: transform;
}
/* left, not translateX: a transform percentage resolves against the thumb's
   own 9px box, which is why the handle used to barely move */
.player__seek b {
  position: absolute;
  top: 50%;
  left: calc(var(--pos, 0) * 100%);
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.3s var(--ease-out);
}
.player__seek:hover b,
.player__seek:focus-visible b {
  transform: scale(1);
}

/* first-run whisper, shown once then never again */
.player__hint {
  position: absolute;
  right: 62px;
  top: 50%;
  padding: 6px 13px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--ground);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(8px, -50%);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
}
.player__hint.is-shown {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Failure state. It may only take space while the capsule is open — growing a
   54px disc to fit a sentence is what made it look broken. */
.player__note {
  display: none;
  font-size: 10px;
  line-height: 1.4;
  color: var(--ink-muted);
  white-space: normal;
}
.player.is-broken.is-open .player__note {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.player.is-broken .player__row,
.player.is-broken .player__seek {
  display: none;
}

/* the YouTube host: rendered, never seen, never interactive */
.yt-host {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 200px;
  height: 120px;
  z-index: -3;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.yt-host iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* -- 16 motion utilities -------------------------------------------------- */

/* Content is visible by default. JS opts elements into their reveal by adding
   .can-reveal to <html>, so a failed script never hides the page. */
[data-reveal] {
  opacity: 1;
}

html.can-reveal .word > i {
  transform: translateY(105%);
}
html:not(.can-reveal) .word > i {
  transform: none;
}
html.can-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 1s var(--ease-out),
    transform 1.15s var(--ease-out);
  transition-delay: calc(var(--rd, 0) * 1ms);
}
html.can-reveal [data-reveal='soft'] {
  transform: translateY(14px);
  filter: blur(5px);
  transition:
    opacity 0.95s var(--ease-out),
    transform 1.1s var(--ease-out),
    filter 1.1s var(--ease-out);
}
html.can-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}
/* The original's card reveal: a longer, softer rise than the page default.
   Scoped with :not(.is-in) because this rule sits after the .is-in rule at
   equal specificity and would otherwise pin the cards down permanently. */
html.can-reveal .work[data-reveal] {
  transition:
    opacity 1.2s cubic-bezier(0.2, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}
html.can-reveal .work[data-reveal]:not(.is-in) {
  transform: translateY(40px);
}

/* word-by-word line reveal */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.word > i {
  display: inline-block;
  font-style: inherit;
  transition: transform 1.05s var(--ease-out);
  transition-delay: calc(var(--wi, 0) * 42ms + var(--rd, 0) * 1ms);
}
.is-in .word > i,
.word.is-in > i {
  transform: translateY(0);
}

.magnetic {
  will-change: transform;
}

/* -- 17 responsive -------------------------------------------------------- */

@media (min-width: 900px) {
  .statement__grid {
    grid-template-columns: 1.35fr 0.85fr;
    align-items: start;
  }
  .study__grid {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
  .study__panel {
    padding-bottom: clamp(36px, 4vw, 64px);
  }
}

@media (max-width: 899px) {
  .study__slot {
    height: min(34svh, 300px);
  }
  .practice__row {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .practice__detail {
    text-align: left;
    max-width: 46ch;
  }
  .practice__preview {
    display: none;
  }
}

@media (max-width: 719px) {
  :root {
    --section-gap: clamp(104px, 20vw, 160px);
  }
  .work {
    grid-column: span 12;
  }
  /* single column, so the plate can breathe wider than 4:5 */
  .work__frame {
    aspect-ratio: 5 / 6;
  }
  .work__meta {
    margin-top: 16px;
  }
  .statement__note,
  .path__what p,
  .practice__detail {
    font-size: 0.9375rem;
    line-height: 1.65;
  }
  .contact__mail {
    width: 100%;
    justify-content: center;
  }
  .colophon {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .work:nth-child(even) {
    margin-top: 0;
  }
  .hero__cue {
    bottom: clamp(108px, 14vh, 128px);
  }
  .path__step {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .topbar {
    grid-template-columns: auto 1fr auto;
  }
  .wordmark small {
    display: none;
  }
  .colophon {
    padding-bottom: calc(clamp(18px, 2.6vw, 30px) + 86px + env(safe-area-inset-bottom, 0px));
  }
  .section__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

/* The wordmark, the pill and the toggle stop fitting one row well before
   320px, and the hero already carries the name — so the wordmark goes. */
@media (max-width: 479px) {
  .wordmark {
    display: none;
  }
  /* Two controls now sit at the right edge, so there is no longer room to
     centre the pill against the viewport. It takes the left edge instead —
     the slot the wordmark just vacated. */
  .topbar {
    grid-template-columns: auto 1fr;
  }
  .status-pill {
    grid-column: 1;
    justify-self: start;
    font-size: 10px;
    padding: 6px 12px 6px 10px;
  }
  .topbar__end {
    grid-column: 2;
  }
  .theme-toggle {
    width: 44px;
    height: 44px;
  }
}

/* at 320px the centred dock and the corner disc were touching */
@media (max-width: 419px) {
  .dock {
    gap: 2px;
    padding: 6px;
    border-radius: 20px;
  }
  .dock__item {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .player {
    --disc: 40px;
  }
  .player__shell {
    width: 48px;
    height: 48px;
    border-radius: 24px;
  }
}

@media (max-width: 359px) {
  .status-pill {
    font-size: 9.5px;
    letter-spacing: 0;
    padding: 6px 10px 6px 9px;
  }
  .dock__item {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .dock__item svg {
    width: 18px;
    height: 18px;
  }
  .player__shell {
    width: 44px;
    height: 44px;
    border-radius: 22px;
  }
  .player {
    --disc: 36px;
  }
}

/* A phone on its side has ~390px of height to spend. The hero's fixed
   vertical rhythm has to collapse or the lede lands under the fold. */
@media (orientation: landscape) and (max-height: 520px) {
  .hero {
    min-height: auto;
    padding: 108px 0 96px;
  }
  .hero__title {
    font-size: clamp(2.4rem, 7.5vh, 3.6rem);
    margin-bottom: 16px;
  }
  .hero__lede {
    font-size: 0.95rem;
  }
  .hero__cue {
    display: none;
  }
  :root {
    --section-gap: clamp(96px, 12vw, 150px);
  }
}

/* pointer-coarse devices never get the cursor or the hover-only previews */
@media (hover: none), (pointer: coarse) {
  .cursor,
  .practice__preview {
    display: none !important;
  }

  /* There is no hover to resolve them with, so the work would stay behind the
     blur forever. The reach-and-resolve gesture is a desktop affordance. */
  .work__plate {
    filter: none;
    transform: scale(1.02);
  }
}

/* -- 18 reduced motion ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .char,
  .hero__lede,
  .hero__cue,
  html.can-reveal [data-reveal],
  .word > i {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .work__plate {
    filter: none !important;
  }

  .grain,
  .hero__cue i::after,
  .status-dot::after {
    animation: none !important;
  }

  .cursor {
    display: none !important;
  }

  /* the study still opens, it just arrives instead of flying */
  .study__flyer {
    transition: none !important;
  }
}

/* -- 19 late components --------------------------------------------------- */

.statement__lit {
  font-style: italic;
  color: var(--accent);
}

/* the mail line fills from below on hover — the pseudo must sit above the
   glass background, so the label is lifted onto its own layer */
.contact__mail {
  isolation: isolate;
}
.contact__mail::before {
  z-index: 0;
}
.contact__mail > * {
  position: relative;
  z-index: 1;
}

.contact .statement__note {
  margin-inline: auto;
  margin-bottom: 38px;
}

.study__fact {
  display: grid;
  gap: 3px;
}
.study__fact i {
  font-style: normal;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.study__fact b {
  font-size: 0.8125rem;
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  .player__glyph > * {
    transition: none;
  }
}

/* -- 20 language ---------------------------------------------------------- */

.topbar__end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 13px;
  border-radius: 100px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-low);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.lang-toggle:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-mid);
}

.lang-toggle__opt {
  color: var(--ink-faint);
  transition: color 0.45s var(--ease-out);
}
.lang-toggle__opt.is-on {
  color: var(--ink);
}

.lang-toggle__sep {
  width: 1px;
  height: 11px;
  background: var(--hairline);
}

/* Greek display voice. GFS Didot leads so mixed Greek/Latin strings stay in
   one letterform family instead of splitting across two serifs. */
:root[lang='el'] {
  --serif: 'GFS Didot', 'Instrument Serif', Georgia, serif;
}
:root[lang='el'] h1,
:root[lang='el'] h2,
:root[lang='el'] h3,
:root[lang='el'] .work__name,
:root[lang='el'] .practice__name,
:root[lang='el'] .ribbon__word,
:root[lang='el'] .preloader__word {
  /* -0.025em is drawn for Latin and jams Greek diacritics into the ascenders */
  letter-spacing: -0.004em;
  line-height: 1.04;
}
:root[lang='el'] .hero__title {
  font-size: clamp(2.9rem, 10vw, 5.4rem);
}
/* GFS Didot ships one weight and no true italic; a synthesised oblique on a
   didone shears the thin strokes, so Greek carries the accent in colour only */
:root[lang='el'] .statement__lit,
:root[lang='el'] .ribbon__word:nth-child(even) {
  font-style: normal;
}

/* -- the swap ------------------------------------------------------------- */

/* Both states need the same easing, and both have to outrank the reveal
   transitions already sitting on these elements at higher specificity. */
html.lang-out [data-i18n],
html.lang-out [data-i18n-block],
html.lang-settling [data-i18n],
html.lang-settling [data-i18n-block] {
  transition:
    opacity 0.44s var(--ease-out),
    transform 0.54s var(--ease-out),
    filter 0.54s var(--ease-out) !important;
  transition-delay: calc(var(--si, 0) * 26ms) !important;
}

html.lang-out [data-i18n],
html.lang-out [data-i18n-block] {
  opacity: 0 !important;
  transform: translateY(-9px) !important;
  filter: blur(3px) !important;
}

/* the toggle cannot be re-fired mid-wave */
html.lang-out .lang-toggle,
html.lang-settling .lang-toggle {
  pointer-events: none;
}

@media (max-width: 479px) {
  /* only the language you would switch to, as a disc the size of the others */
  .lang-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .lang-toggle__opt.is-on,
  .lang-toggle__sep {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.lang-out [data-i18n],
  html.lang-out [data-i18n-block] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
