/* ============================================================
   PERFUME SEVEN
   White, minimal, typography-led.
   Colour arrives slowly as you scroll — like scent drifting in.
   ============================================================ */

/* ============================================================
   1. FONTS  (self-hosted — no external services)
   ============================================================ */
@font-face { font-family: "Inter"; font-weight: 100; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-100-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 200; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-200-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }

@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-style: normal; font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 300; font-style: italic; font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2"); }

/* ============================================================
   2. TOKENS
   ============================================================ */
:root {
  --paper:      #ffffff;
  --ink:        #0b0b0c;
  --ink-2:      #6e6e73;   /* secondary text */
  --ink-3:      #a6a6ab;   /* labels, meta */
  --hair:       rgba(0, 0, 0, 0.10);
  --hair-soft:  rgba(0, 0, 0, 0.055);
  --accent:     #9c8b74;

  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  --serif: "Cormorant Garamond", "Songti SC", Georgia, serif;

  --pad: clamp(1.35rem, 6vw, 7rem);
  --gap: clamp(5rem, 15vh, 12rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --mist: 0;   /* driven by scroll (see main.js) */
}

/* ============================================================
   3. BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* no dark flash when tapping on a phone */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, p, ul, ol, figure, dl, dd, dt { margin: 0; padding: 0; }
ul, ol { list-style: none; }

::selection { background: rgba(156, 139, 116, 0.18); }

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

main { position: relative; z-index: 1; }

/* ============================================================
   4. THE MIST
   Five very large, very soft colour fields. They drift on their
   own, and slide at different speeds as the page scrolls.
   ============================================================ */
.mist {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: var(--mist);
}

.mist__p { position: absolute; inset: 0; display: block; will-change: transform; }

.mist__b {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}

.mist__b--1 {
  width: 78vw; height: 78vw; left: -16vw; top: -20vh;
  background: radial-gradient(closest-side, rgba(214, 205, 236, 0.55), rgba(214, 205, 236, 0) 70%);
  animation: drift-a 130s ease-in-out infinite;
}

.mist__b--2 {
  width: 64vw; height: 64vw; right: -14vw; top: 10vh;
  background: radial-gradient(closest-side, rgba(242, 214, 222, 0.5), rgba(242, 214, 222, 0) 70%);
  animation: drift-b 160s ease-in-out infinite;
}

.mist__b--3 {
  width: 72vw; height: 72vw; left: 18vw; bottom: -26vh;
  background: radial-gradient(closest-side, rgba(243, 233, 212, 0.5), rgba(243, 233, 212, 0) 70%);
  animation: drift-c 145s ease-in-out infinite;
}

.mist__b--4 {
  width: 58vw; height: 58vw; right: 4vw; bottom: 4vh;
  background: radial-gradient(closest-side, rgba(210, 226, 240, 0.5), rgba(210, 226, 240, 0) 70%);
  animation: drift-d 175s ease-in-out infinite;
}

.mist__b--5 {
  width: 50vw; height: 50vw; left: -10vw; top: 42vh;
  background: radial-gradient(closest-side, rgba(216, 233, 222, 0.45), rgba(216, 233, 222, 0) 70%);
  animation: drift-e 190s ease-in-out infinite;
}

@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(7vw, 9vh, 0) scale(1.14); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.08); }
  50%  { transform: translate3d(-8vw, 6vh, 0) scale(1); }
  100% { transform: translate3d(0, 0, 0) scale(1.08); }
}
@keyframes drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-6vw, -10vh, 0) scale(1.16); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes drift-d {
  0%   { transform: translate3d(0, 0, 0) scale(1.1); }
  50%  { transform: translate3d(5vw, -7vh, 0) scale(1); }
  100% { transform: translate3d(0, 0, 0) scale(1.1); }
}
@keyframes drift-e {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(9vw, 5vh, 0) scale(1.2); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* ============================================================
   5. TOP BAR
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  padding: 1.05rem var(--pad);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.topbar.is-shown { opacity: 1; transform: translateY(0); }

.topbar__mark { color: var(--ink); letter-spacing: 0.3em; }

.topbar__left { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }

/* the language switch: two letters and a hairline */
.lang { display: flex; align-items: center; gap: 0.6rem; }

.lang__link {
  letter-spacing: 0.16em;
  color: var(--ink-3);
  transition: color 0.45s var(--ease);
}

.lang__link:hover { color: var(--ink-2); }
.lang__link.is-on { color: var(--ink); }

.lang__sep { display: block; width: 1px; height: 10px; background: var(--hair); }

.topbar__nav { display: flex; align-items: center; gap: 1.7rem; }

.topbar__nav > a,
.topbar__item > .topbar__link {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.45s var(--ease);
}

.topbar__nav > a::after,
.topbar__item > .topbar__link::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.55s var(--ease);
}

.topbar__nav > a:hover,
.topbar__item > .topbar__link:hover,
.topbar__item:hover > .topbar__link,
.topbar__item:focus-within > .topbar__link,
.topbar__item.is-open > .topbar__link { color: var(--ink); }

.topbar__nav > a:hover::after,
.topbar__item > .topbar__link:hover::after,
.topbar__item:hover > .topbar__link::after,
.topbar__item:focus-within > .topbar__link::after,
.topbar__item.is-open > .topbar__link::after { transform: scaleX(1); }

/* the little lists that open under Personal / Archive / Contact */
.topbar__item { position: relative; display: flex; align-items: center; }

.subnav {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(-0.35rem);
  display: flex; flex-direction: column; gap: 0.7rem;
  padding: 1rem 1.4rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--hair-soft);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
  z-index: 60;
}

.topbar__item.is-open .subnav,
.topbar__item:hover .subnav,
.topbar__item:focus-within .subnav {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.subnav a {
  letter-spacing: 0.18em;
  color: var(--ink-2);
  transition: color 0.35s var(--ease), padding-left 0.5s var(--ease);
}

.subnav a:hover { color: var(--ink); padding-left: 0.3rem; }

.topbar__index {
  display: none;
  background: none; border: 0; padding: 0.4rem 0;
  font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink); cursor: pointer;
}

/* ============================================================
   6. RAIL — the index that follows you down the page
   ============================================================ */
.rail {
  position: fixed;
  right: var(--pad); top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
}

.rail.is-shown { opacity: 1; visibility: visible; }

.rail ol { display: flex; flex-direction: column; gap: 0.85rem; align-items: flex-end; }

.rail a {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--ink-3);
  transition: color 0.5s var(--ease);
}

.rail i { font-style: normal; font-variant-numeric: tabular-nums; }

.rail b {
  font-weight: 300;
  max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0;
  transition: max-width 0.65s var(--ease), opacity 0.5s var(--ease);
}

.rail a:hover b,
.rail li.is-current b { max-width: 11rem; opacity: 1; }

.rail li.is-current a { color: var(--ink); }

/* ============================================================
   7. HERO — the title card
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 7rem var(--pad) 6rem;
  text-align: center;
}

/* the faintest light behind the name */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(64% 54% at 50% 45%, rgba(253, 251, 247, 0.95), rgba(255, 255, 255, 0) 74%);
  pointer-events: none;
}

.hero__inner { position: relative; max-width: 1300px; }

.hero__title {
  font-weight: 200;
  font-size: clamp(2.1rem, 10.5vw, 11.5rem);
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* letters rise and resolve, one after another */
.hero__title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.28em);
  filter: blur(10px);
}

.hero__title span.is-in {
  opacity: 1; transform: none; filter: blur(0);
  transition: opacity 1.6s var(--ease), transform 1.6s var(--ease), filter 1.6s var(--ease);
}

.hero__title .space { width: 0.28em; }

/* the Chinese title card breathes a little more between the characters */
html[lang="zh-Hans"] .hero__title {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-indent: 0.04em;
}

/* Chinese titles do not take an italic */
html[lang="zh-Hans"] .entry__line em { font-style: normal; }

.hero__tagline {
  margin-top: clamp(1.5rem, 4vh, 2.8rem);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.5vw, 1.25rem);
  letter-spacing: 0.02em;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 1.8s var(--ease), transform 1.8s var(--ease);
}

.hero__tagline.is-in { opacity: 1; transform: none; }

.hero__cue {
  position: absolute;
  bottom: 2.2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  font-size: 0.56rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 1.6s var(--ease) 1.1s, color 0.4s var(--ease);
}

.hero__cue.is-in { opacity: 1; }

.hero__cue i {
  display: block; width: 1px; height: 2.8rem;
  background: linear-gradient(to bottom, var(--ink-3), transparent);
  transform-origin: top;
  animation: cue 3s var(--ease) infinite;
}

@keyframes cue {
  0%   { transform: scaleY(0.15); opacity: 0; }
  45%  { transform: scaleY(1);    opacity: 1; }
  100% { transform: scaleY(1);    opacity: 0; }
}

/* ============================================================
   8. SECTIONS
   ============================================================ */
.section {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--gap) var(--pad);
  scroll-margin-top: 4rem;
}

.section--wide { max-width: 1280px; }
.section--center { text-align: center; }

.section__head {
  margin-bottom: clamp(3rem, 8vh, 5.5rem);
}

.section__head--center { text-align: center; }

.label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section__title {
  margin-top: 0.7rem;
  font-weight: 200;
  font-size: clamp(2.1rem, 6.2vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.section__note {
  margin-top: 1.1rem;
  max-width: 30em;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.section__head--center .section__note { margin-left: auto; margin-right: auto; }

.statement {
  margin-top: clamp(3rem, 8vh, 5rem);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  line-height: 1.5;
  color: var(--ink);
  max-width: 30em;
}

.statement--center { margin-left: auto; margin-right: auto; text-align: center; }
.statement em { font-style: italic; color: var(--ink-3); }

/* ---------- 01 about ---------- */
.qa {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
}

.qa__item h3 {
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--hair-soft);
}

.qa__item p { color: var(--ink-2); font-size: 0.95rem; }
.qa__item em { font-style: normal; color: var(--ink); border-bottom: 1px solid var(--hair); }

/* ---------- 01 about — a short welcome, centred ---------- */
.about-note {
  max-width: 34em;
  margin: 0 auto;
  text-align: center;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.9;
}

.about-note p + p { margin-top: 1.15rem; }

.about-note__lead {
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  color: var(--ink);
}

.about-note strong { font-weight: 500; color: var(--ink); }

/* ============================================================
   9. 02 SCREEN — the edit index
   ============================================================ */
.entries { border-top: 1px solid var(--hair); }

.entry {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto 2rem;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  padding: clamp(1.3rem, 3.4vh, 2rem) 0;
  background: none; border: 0; border-bottom: 1px solid var(--hair-soft);
  text-align: left;
  cursor: pointer;
  transition: padding-left 0.9s cubic-bezier(0.16, 0.84, 0.44, 1);
}

.entry:hover:not(.is-active) { padding-left: 0.55rem; }

/* while a row is open it stays lined up, and it lines up quickly */
.entry.is-active, .arch.is-active {
  padding-left: 0;
  transition-duration: 0.28s;
}

.entry__num {
  font-size: 0.62rem; letter-spacing: 0.2em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.entry__main { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }

.entry__title {
  font-weight: 200;
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  transition: color 0.5s var(--ease);
}

.entry__line {
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* the grey English line that sits under a Chinese title */
.entry__alt {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

/* the film or series a work was cut from */
.entry__line em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.12em;
  color: var(--ink);
}

/* the personal titles take the same voice as the film names */
.entry--serif .entry__title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
}
.entry__meta {
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.entry__arrow {
  font-size: 0.95rem;
  color: var(--ink-3);
  opacity: 0;
  transform: translateX(-0.5rem);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.entry:hover .entry__arrow,
.entry:focus-visible .entry__arrow { opacity: 1; transform: none; }

/* ============================================================
   10. 03 PERSONAL — the stills
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2.6vw, 2.2rem);
}

.still { grid-column: span 5; min-width: 0; }
.still--wide { grid-column: span 7; }
.still--tall { grid-column: span 5; }

.still__btn {
  display: block; width: 100%;
  background: none; border: 0; padding: 0;
  text-align: left; cursor: pointer;
}

.still .ph {
  display: block;
  aspect-ratio: 4 / 3;
  transition: transform 1.4s var(--ease), filter 1s var(--ease);
  filter: saturate(0.92);
}

.still--wide .ph { aspect-ratio: 16 / 10; }
.still--tall .ph { aspect-ratio: 3 / 4; }
.still--full { grid-column: span 12; }
.still--full .ph { aspect-ratio: 16 / 9; }

.still__btn:hover .ph,
.still__btn:focus-visible .ph { transform: scale(1.015); filter: saturate(1.05); }

.still__cap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--hair-soft);
}

.still__cap b {
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.still__cap span {
  font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

/* subsection heading inside PERSONAL (新生 / WHEN) */
.subhead {
  display: flex; align-items: baseline; gap: 1rem;
  margin: 0 0 clamp(1.6rem, 4vh, 2.6rem);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  letter-spacing: 0.02em;
  color: var(--ink);
}

.subhead--spaced { margin-top: clamp(4rem, 13vh, 8rem); }

.subhead__en {
  margin: -0.9rem 0 clamp(1.8rem, 4.5vh, 2.8rem) 0.15rem;
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* personal works sit a touch inset from the section edge */
.entries--sub { margin-left: clamp(0rem, 2vw, 1.5rem); }

.numeral {
  font-style: normal;
  color: var(--ink-3);
  font-size: 0.8em;
  margin-right: 0.55rem;
  letter-spacing: 0.06em;
}

/* ---------- image placeholders ---------- */
.ph {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--hair-soft);
  background: #fafafa;
}

.ph--1 { background: linear-gradient(148deg, #f2eef8 0%, #e8e2f2 55%, #f7f3ee 100%); }
.ph--2 { background: linear-gradient(162deg, #f8eff2 0%, #f2e3e8 52%, #eef2f6 100%); }
.ph--3 { background: linear-gradient(140deg, #f7f3ea 0%, #f0ead9 50%, #f4f1ec 100%); }
.ph--4 { background: linear-gradient(200deg, #eef4f7 0%, #e6edf3 48%, #f5f2f4 100%); }
.ph--5 { background: linear-gradient(126deg, #eff6f1 0%, #e6efe8 50%, #f7f5f0 100%); }
.ph--6 { background: linear-gradient(172deg, #f8f1ee 0%, #f1e6e1 46%, #eef1f5 100%); }

.ph--16x9 { aspect-ratio: 16 / 9; width: 100%; }

/* ============================================================
   11. 04 FRAGMENTS — an avatar, a date, and a few words
   The list stays quiet: only the portrait and the line. The
   background photograph lives inside the piece it belongs to.
   ============================================================ */
.fragments {
  display: flex; flex-direction: column;
  gap: clamp(3.2rem, 10vh, 6.5rem);
}

.fragment {
  /* one measurement, used for both the portrait and its grid track,
     so the picture can never overlap the words */
  --face: clamp(8rem, 19vw, 14rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: 100%;
  padding: 0;
  background: none; border: 0;
  text-align: left;
  cursor: pointer;
}

.fragment--media-right .fragment__portrait { order: 2; }
.fragment--media-right .fragment__text { order: 1; }

/* the round portrait — the whole row is the way in */
.fragment__portrait {
  display: block;
  justify-self: center;
  width: var(--face);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: #f7f6f4;
  transition: transform 1.2s var(--ease), box-shadow 1.2s var(--ease);
}

.fragment__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.fragment:hover .fragment__portrait,
.fragment:focus-visible .fragment__portrait {
  transform: scale(1.035);
  box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.45);
}

.fragment__text { max-width: 32em; }

.fragment__meta {
  display: block;
  padding-bottom: 0.9rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--hair-soft);
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.fragment__words {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.75;
  color: var(--ink);
}

/* ---------- a fragment, opened ---------- */
/* the photograph keeps its own proportions and dissolves on all four sides,
   so nothing is ever cut off and no hard edge meets the page */
.detail__frag { display: block; position: relative; width: 100%; }

.detail__frag-bg {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0) 0, #000 12%, #000 88%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, #000 11%, #000 89%, rgba(0, 0, 0, 0) 100%);
  mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 0) 0, #000 12%, #000 88%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, #000 11%, #000 89%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* (the plainer `.detail__media img` rule would otherwise stretch this) */
.detail__media img.detail__frag-avatar {
  position: absolute;
  right: 8%;
  bottom: 8%;
  width: 24%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.92), 0 14px 34px -20px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   12. 05 ARCHIVE
   ============================================================ */
.tabs {
  display: flex; flex-wrap: wrap;
  gap: 0.4rem 2.2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--hair);
}

.tab {
  background: none; border: 0; padding: 0.35rem 0;
  font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease);
}

.tab:hover { color: var(--ink-2); }

.tab.is-on { color: var(--ink); border-bottom-color: var(--ink); }

.panel { padding-top: clamp(1rem, 3vh, 1.8rem); }

.panel li { border-bottom: 1px solid var(--hair-soft); }

/* every line in the archive opens its own page */
.arch {
  display: grid;
  /* the third column is fixed so every row lines up, whatever its content */
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 5.5rem;
  gap: 1.5rem;
  align-items: baseline;
  width: 100%;
  padding: 0.7rem 0;
  background: none; border: 0;
  text-align: left; cursor: pointer;
  transition: padding-left 0.9s cubic-bezier(0.16, 0.84, 0.44, 1);
}

.arch:hover:not(.is-active), .arch:focus-visible { padding-left: 0.5rem; }

.panel b {
  font-weight: 300; font-size: 0.98rem; letter-spacing: -0.005em;
  transition: color 0.5s var(--ease);
}

.arch:hover b { color: var(--accent); }
.panel span { color: var(--ink-2); font-size: 0.85rem; }

.panel em {
  font-style: normal;
  font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

/* ============================================================
   13. 06 CONTACT + CLOSING
   ============================================================ */
.mailto {
  display: inline-block;
  font-weight: 200;
  font-size: clamp(1.25rem, 4.2vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
  word-break: break-word;
  transition: color 0.5s var(--ease);
}

.mailto:hover { color: var(--accent); }

.socials {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.8rem 2rem;
  margin-top: clamp(2.5rem, 7vh, 4rem);
  font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-2);
}

.socials a {
  padding-bottom: 0.22rem;
  border-bottom: 1px solid var(--hair);
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease);
}
.socials a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- the note a visitor can leave ---------- */
.feedback {
  max-width: 34rem;
  margin: clamp(2.8rem, 8vh, 4.5rem) auto 0;
  text-align: left;
}

.feedback label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
}

.feedback textarea {
  display: block;
  width: 100%;
  min-height: 8.5rem;
  padding: 1.1rem 1.2rem;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--hair);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}

.feedback textarea:focus {
  outline: none;
  border-color: var(--ink-3);
  background: #fff;
}

.feedback textarea::placeholder { color: var(--ink-3); }

.feedback__row {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 0.9rem 1.5rem;
  margin-top: 1rem;
}

.feedback__note {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.feedback__btn {
  padding: 0.75rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  cursor: pointer;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.4s var(--ease);
}

.feedback__btn:hover { background: #000; }
.feedback__btn[disabled] { opacity: 0.45; cursor: default; }

.feedback__status {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-2);
  min-height: 1.2em;
}

.feedback__honey { position: absolute; left: -9999px; }

.closing {
  position: relative;
  text-align: center;
  padding: clamp(6rem, 20vh, 14rem) var(--pad) clamp(3rem, 8vh, 5rem);
}

.closing__title {
  font-weight: 200;
  font-size: clamp(1.5rem, 7vw, 6rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.closing__tagline {
  margin-top: 1.4rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  color: var(--ink-2);
}

/* the mark closes the inverted triangle: title → line of words → logo */
.closing__logo {
  display: block;
  width: clamp(20px, 1.9vw, 28px);
  height: auto;
  margin: clamp(1.4rem, 4vh, 2.2rem) auto 0;
  opacity: 0.85;
}

.closing__fine {
  margin-top: clamp(3rem, 9vh, 6rem);
  font-size: 0.58rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   14. MENU (small screens)
   ============================================================ */
.menu {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; }

.menu__close {
  position: absolute; top: 1.2rem; right: var(--pad);
  background: none; border: 0; padding: 0.5rem 0;
  font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-2); cursor: pointer;
}

.menu__nav { display: flex; flex-direction: column; gap: clamp(0.9rem, 3vh, 1.6rem); }

.menu__nav a {
  display: flex; align-items: baseline; gap: 1.2rem;
  font-weight: 200;
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  letter-spacing: -0.025em;
  transition: padding-left 0.6s var(--ease), color 0.5s var(--ease);
}

.menu__nav a:hover { padding-left: 0.6rem; }

.menu__nav i {
  font-style: normal;
  font-size: 0.6rem; letter-spacing: 0.22em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   15. DETAIL VIEW
   ============================================================ */
.detail {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(255, 255, 255, 0.985);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  overflow-y: auto;
  padding: clamp(4rem, 10vh, 7rem) var(--pad) clamp(3rem, 8vh, 6rem);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.detail[hidden] { display: none; }
.detail.is-open { opacity: 1; }

.detail__close {
  position: fixed; top: 1.1rem; right: var(--pad);
  z-index: 1;
  background: none; border: 0; padding: 0.5rem 0;
  font-size: 0.6rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-2); cursor: pointer;
  transition: color 0.4s var(--ease);
}

.detail__close:hover { color: var(--ink); }

.detail__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.detail__title {
  font-weight: 200;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.detail__sub {
  margin-top: 0.7rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--hair);
  color: var(--ink-2);
  font-size: 0.9rem;
}

.detail__fields { margin-top: 0.4rem; }

.detail__fields dt {
  margin-top: 1.6rem;
  font-size: 0.58rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-3);
}

.detail__fields dd {
  margin-top: 0.45rem;
  color: var(--ink);
  font-size: 0.95rem;
  max-width: 38em;
}

.detail__fields dd em { font-family: var(--serif); font-style: italic; font-size: 1.1em; }

.detail__link {
  display: inline-block;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--hair);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.detail__link:hover { color: var(--accent); border-color: var(--accent); }

/* the personal notes inside a work — Chinese, set in the serif */
.intro {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.95;
  color: var(--ink);
}

.intro__mark {
  display: block;
  margin: 0.9rem 0;
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.5em;
  text-align: center;
  color: var(--ink-3);
}

/* media inside the detail panel */
.detail__media video,
.detail__media iframe,
.detail__media img { width: 100%; display: block; border: 0; }

/* embedded players keep their own proportions */
.detail__media iframe { aspect-ratio: 16 / 9; height: auto; background: #0b0b0c; }

/* the artwork in an archive entry stays small, like a record sleeve */
.detail__media img.detail__cover {
  width: min(320px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--hair-soft);
}

/* a film poster keeps its own tall shape */
.detail__media img.detail__poster {
  width: min(230px, 100%);
  aspect-ratio: 2 / 3;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--hair-soft);
}

/* the grey line under a poster */
.detail__caption {
  display: block;
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.2rem;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.detail__caption:hover { color: var(--ink-2); border-bottom-color: var(--hair); }

/* a name that links out, quietly underlined */
.detail__u {
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--hair);
  transition: text-decoration-color 0.4s var(--ease);
}

.detail__u:hover { text-decoration-color: var(--ink); }

/* the little Apple Music player that comes with a song */
.detail__media iframe.detail__embed {
  width: 100%;
  max-width: 660px;
  height: 175px;
  margin-top: 1.2rem;
  aspect-ratio: auto;
  border: 0;
  background: transparent;
  margin-left: auto;
  margin-right: auto;
}

/* the player shows the film's own still until the stream is ready */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b0b0c;
}

.player iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  aspect-ratio: auto;
  border: 0;
}

.player__poster {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: opacity 0.9s var(--ease);
}

.player.is-ready .player__poster { opacity: 0; }

/* the two-step way out to Apple Music */
.confirm { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }

.confirm__ask { font-size: 0.85rem; color: var(--ink-2); }

.confirm__row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; }

.detail__play {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  text-decoration: none;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease);
}

.detail__play:hover { background: #000; padding-left: 1.7rem; }

/* two ways to watch the same piece, side by side */
.detail__watch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 0.9rem;
}

/* a song's page: the note reads as prose, then a single button */
.detail__prose p + p { margin-top: 1.15rem; }
.detail__action { margin-top: 1.8rem; }

.confirm__cancel {
  padding: 0;
  background: none; border: 0;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.4s var(--ease);
}

.confirm__cancel:hover { color: var(--ink); }

.detail__media .video-note {
  margin-top: 0.9rem;
  font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   16. REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity 1.3s var(--ease), transform 1.3s var(--ease);
}

.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   17. RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .rail { display: none; }
}

@media (max-width: 900px) {
  .detail__inner { grid-template-columns: 1fr; }

  .grid { grid-template-columns: repeat(6, 1fr); }
  .still, .still--tall { grid-column: span 3; }
  .still--wide { grid-column: span 6; }
  .still--full { grid-column: span 6; }
}

@media (max-width: 820px) {
  .topbar__nav { display: none; }
  .topbar__index { display: block; }

  .entry {
    grid-template-columns: 3rem 1fr;
    gap: 0.5rem 1rem;
    align-items: start;
  }
  .entry__meta { grid-column: 2; }
  .entry__arrow { display: none; }

  /* fragments: the round portrait beside the words, the side still alternating.
     the portrait gets its own fixed track — sized from the same --face value —
     so the words can never slide under it */
  .fragment {
    --face: clamp(4.25rem, 22vw, 5.75rem);
    grid-template-columns: var(--face) minmax(0, 1fr);
    gap: 1.4rem;
    align-items: center;
  }

  .fragment__portrait { grid-area: 1 / 1; width: var(--face); }
  .fragment__text { grid-area: 1 / 2; width: 100%; }

  .fragment--media-right { grid-template-columns: minmax(0, 1fr) var(--face); }
  .fragment--media-right .fragment__portrait { grid-area: 1 / 2; }
  .fragment--media-right .fragment__text { grid-area: 1 / 1; }

  /* on phones the words keep the left / right rhythm of the pairs above */
  .fragment--media-left .fragment__text { text-align: left; }
  .fragment--media-right .fragment__text { text-align: right; }

  .entries--sub { margin-left: 0; }
}

@media (max-width: 620px) {
  .still,
  .still--wide,
  .still--tall,
  .still--full { grid-column: span 6; }

  .arch { grid-template-columns: 1fr auto; gap: 0.3rem 1rem; }
  .arch span { grid-column: 1; }
  .arch em { grid-column: 2; grid-row: 1; }

  .still__cap { flex-direction: column; gap: 0.3rem; }

  /* three platform names stay on one tidy line */
  .socials { gap: 0.7rem 1.4rem; }

  /* the send button sits on the right on a phone */
  .feedback__row { flex-direction: column; align-items: stretch; }
  .feedback__btn { align-self: flex-end; }
}

/* ============================================================
   18. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mist__b { animation: none; }
  .hero__title span { opacity: 1; transform: none; filter: none; }
  .hero__tagline, .hero__cue { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
  .hero__cue i { animation: none; }
  *, *::before, *::after { transition-duration: 0.001s !important; }
}
