/* ————————————————————————————————————————
   Artist Name — An Exhibition in Sound
   Catalogue typography · wayfinding rail ·
   tick-strip players · drawn rules
———————————————————————————————————————— */

:root {
  --bg: #f4f2ed;
  --ink: #191711;
  --muted: #7d786c;
  --faint: #c6c1b4;
  --line: #e1ddd2;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.4rem, 5vw, 5rem);
  --rail-w: 5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ——— paper grain ——— */

.grain {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ——— header ——— */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem var(--pad);
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), padding 0.5s var(--ease);
}
.site-head.scrolled {
  padding-block: 0.85rem;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav { display: flex; gap: 2rem; }
.site-nav a {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.35s var(--ease);
}
.site-nav a sup {
  font-size: 0.58em;
  color: var(--faint);
  margin-right: 0.45em;
  transition: color 0.35s var(--ease);
}
.site-nav a:hover,
.site-nav a.active { color: var(--ink); }
.site-nav a:hover sup,
.site-nav a.active sup { color: var(--ink); }

/* ——— wayfinding rail ——— */

.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5.5rem 0 2rem;
  border-right: 1px solid var(--line);
}

.rail-room {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.rail-track {
  flex: 1;
  width: 1px;
  margin: 1.6rem 0;
  background: var(--line);
  position: relative;
}
.rail-track i {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--ink);
}

.rail-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ——— layout shell ——— */

main { padding-left: var(--rail-w); }

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(5.5rem, 13vh, 9rem) var(--pad);
  border-top: 1px solid var(--line);
}

/* ——— hero ——— */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6.5rem var(--pad) 2.4rem;
}

.hero-cat {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: fade-in 1s var(--ease) 1s forwards;
}

.hero-main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: 1.5rem;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 9.75rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
}
.hero-title em { font-style: italic; padding-left: 0.45em; }
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}
.hero-title .word {
  display: inline-block;
  transform: translateY(112%);
  animation: rise 1.3s var(--ease) 0.15s forwards;
}
.hero-title .line:nth-child(2) .word { animation-delay: 0.3s; }

.resume-link {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  margin-top: 2.4rem;
  padding: 0.95em 1.8em;
  border: 1px solid var(--faint);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  opacity: 0;
  animation: fade-in 1s var(--ease) 1.05s forwards;
  transition: background 0.45s var(--ease), color 0.45s var(--ease), border-color 0.45s var(--ease);
}
.resume-link span { transition: transform 0.45s var(--ease); }
.resume-link:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.resume-link:hover span { transform: translate(2px, -2px); }

.portrait {
  grid-column: 2;
  grid-row: 1 / 3;
  margin: 0;
  opacity: 0;
  animation: fade-in 1.1s var(--ease) 0.7s forwards;
}

.portrait-frame {
  border: 1px solid var(--faint);
  padding: clamp(0.5rem, 1vw, 0.85rem);
  overflow: hidden;
  transition: border-color 0.6s var(--ease);
}
.portrait:hover .portrait-frame { border-color: var(--ink); }

.portrait img {
  display: block;
  width: clamp(200px, 25vw, 350px);
  height: auto;
  filter: grayscale(1) contrast(1.03);
  clip-path: inset(0 0 100% 0);
  animation: unveil 1.4s var(--ease) 0.9s forwards;
  transition: transform 1.4s var(--ease);
}
.portrait:hover img { transform: scale(1.02); }

@keyframes unveil {
  to { clip-path: inset(0 0 0 0); }
}

.portrait figcaption {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

#soundline {
  display: block;
  width: calc(100% + 2 * var(--pad));
  margin: 0 calc(-1 * var(--pad));
  height: 130px;
  opacity: 0;
  animation: fade-in 1.4s var(--ease) 1.2s forwards;
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: fade-in 1s var(--ease) 1.5s forwards;
}
.enter {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.22em;
  white-space: nowrap;
}
.enter:hover { color: var(--muted); }

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

/* ——— room headers ——— */

.room-head { margin-bottom: clamp(3rem, 7vh, 4.5rem); }

.room-no {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.room-title {
  display: flex;
  align-items: baseline;
  gap: 2rem;
}
.room-title h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.room-title .rule {
  flex: 1;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s var(--ease) 0.3s;
  align-self: center;
  margin-top: 0.5em;
}
.room-title .rule.in { transform: scaleX(1); }

.masked { overflow: hidden; }
.masked .word {
  display: inline-block;
  transform: translateY(112%);
  transition: transform 1.1s var(--ease);
}
.masked.in .word { transform: translateY(0); }

/* ——— reveal ——— */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ——— catalogue entries ——— */

.catalogue { list-style: none; }

.entry {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto auto;
  grid-template-areas:
    "cat title  time play"
    "cat meta   time play"
    "cat ticks ticks ticks";
  column-gap: 2rem;
  align-items: baseline;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }

.cat {
  grid-area: cat;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.7;
  color: var(--faint);
  transition: color 0.4s var(--ease);
}
.entry:hover .cat,
.entry.playing .cat { color: var(--ink); }

.entry-title {
  grid-area: title;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
  transition: transform 0.5s var(--ease), font-style 0s;
}
.entry:hover .entry-title { transform: translateX(8px); }
.entry.playing .entry-title { font-style: italic; }

.entry-genre {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 1.1rem;
  white-space: nowrap;
  vertical-align: 0.35em;
}

.entry-meta {
  grid-area: meta;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.5rem;
}

.entry-time {
  grid-area: time;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 7ch;
  text-align: right;
}
.entry.unavailable .entry-time { color: var(--faint); }

.entry-play {
  grid-area: play;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0 0 2px;
  cursor: pointer;
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease);
}
.entry-play:hover { border-bottom-color: var(--ink); }
.entry.playing .entry-play { border-bottom-color: var(--ink); }

.ticks {
  grid-area: ticks;
  height: 44px;
  margin-top: 1.4rem;
  cursor: pointer;
}
.ticks svg { display: block; width: 100%; height: 100%; }
.ticks rect {
  fill: var(--faint);
  transition: fill 0.25s linear;
}
.entry:hover .ticks rect { fill: #aaa496; }
.ticks rect.on { fill: var(--ink); }
.entry:hover .ticks rect.on { fill: var(--ink); }

/* ——— archive register ——— */

.register { border-top: 1px solid var(--line); }

.register-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto 6ch;
  column-gap: 2rem;
  align-items: baseline;
  padding: 1.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), padding 0.35s var(--ease);
}

.register-head {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
  padding-block: 0.8rem;
}

.register-row span:nth-child(1) {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.35s var(--ease);
}
.register-row span:nth-child(2) {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.2;
}
.register-head span:nth-child(2) {
  font-family: var(--mono);
  font-size: 0.62rem;
}
.register-row span:nth-child(3),
.register-row span:nth-child(4) {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}
.register-row span:nth-child(4) { text-align: right; }

a.register-row:hover {
  background: var(--ink);
  color: var(--bg);
  padding-left: 1.4rem;
  padding-right: 1.4rem;
}
a.register-row:hover span { color: var(--bg) !important; }

/* ——— notes ——— */

.notes-grid {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.marginalia {
  list-style: none;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.8;
}
.marginalia li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.marginalia li:last-child { border-bottom: 1px solid var(--line); }

.statement {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  font-weight: 400;
  line-height: 1.32;
  max-width: 21em;
  margin-bottom: 2.4rem;
}
.statement em { font-style: italic; }

.bio {
  max-width: 44em;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 3.5rem;
}

.stats {
  list-style: none;
  display: flex;
  gap: clamp(2.5rem, 7vw, 5.5rem);
}
.stats li { display: flex; flex-direction: column; gap: 0.3rem; }
.stats strong {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stats span {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ——— correspondence ——— */

.contact-label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.contact-mail {
  position: relative;
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(2rem, 6.5vw, 5rem);
  line-height: 1.1;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 3.5rem;
  transition: font-style 0s;
}
.contact-mail:hover { font-style: italic; }
.contact-mail::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.08em;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.contact-mail:hover::after { transform: scaleX(1); transform-origin: left; }

.elsewhere {
  list-style: none;
  max-width: 30rem;
  border-top: 1px solid var(--line);
}
.elsewhere a {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 1rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.35s var(--ease), padding-left 0.35s var(--ease);
}
.elsewhere a sup { font-size: 0.6rem; color: var(--faint); }
.elsewhere a span {
  margin-left: auto;
  opacity: 0;
  transform: translate(-6px, 4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.elsewhere a:hover {
  color: var(--ink);
  padding-left: 1.2rem;
}
.elsewhere a:hover span { opacity: 1; transform: translate(0, 0); }

/* ——— footer ——— */

.site-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-left: var(--rail-w);
  padding: 2rem var(--pad) 2.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-foot a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.35s var(--ease);
}
.site-foot a:hover { color: var(--ink); }

/* ——— now playing bar ——— */

.nowbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.8rem var(--pad);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: translateY(101%);
  transition: transform 0.55s var(--ease);
}
.nowbar.on { transform: translateY(0); }

.nowbar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.nowbar-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nowbar-time {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.nowbar-stop {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0 0 2px;
  cursor: pointer;
}

/* ——— responsive ——— */

@media (max-width: 900px) {
  .rail { display: none; }
  main, .site-foot { padding-left: 0; margin-left: 0; }

  .hero-main {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }
  .portrait { grid-column: 1; grid-row: auto; justify-self: end; }
  .portrait img { width: clamp(160px, 44vw, 300px); }

  .entry {
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "cat   time  play"
      "title title title"
      "meta  meta  meta"
      "ticks ticks ticks";
    column-gap: 1.2rem;
  }
  .entry-title { margin-top: 0.7rem; }

  .register-row { grid-template-columns: 3rem 1fr 6ch; }
  .register-row span:nth-child(3) { display: none; }

  .notes-grid { grid-template-columns: 1fr; }
  .marginalia { max-width: 26rem; }
}

@media (max-width: 560px) {
  .wordmark { font-size: 0.9rem; white-space: nowrap; }
  .site-nav { gap: 0.9rem; }
  .site-nav a { font-size: 0.56rem; letter-spacing: 0.08em; }
  .site-nav a sup { display: none; }
  .hero-cat span:last-child { display: none; }
  .hero-foot { gap: 1.5rem; }
  .nowbar-title { max-width: 9rem; }
}

/* ——— reduced motion ——— */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .hero-title .word, .masked .word { transform: none; }
  .hero-cat, .hero-foot, #soundline, .portrait, .resume-link { opacity: 1; }
  .portrait img { clip-path: none; }
  .reveal { opacity: 1; transform: none; }
  .room-title .rule { transform: scaleX(1); }
}
