@font-face {
  font-family: Fanwood;
  src: url('fonts/Fanwood/Fanwood.woff2');
  font-display: optional;
}
@font-face {
  font-family: Manrope;
  src: url('fonts/Manrope/Manrope-Regular.woff2');
  font-display: optional;
}
@property --base-color {
  syntax: '<color>';
  inherits: true;
  initial-value: #6786aa;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 35px; }
/* One base controls every color. Mixes limit paper to 18% white and ink to
   at least 85% white. Even the dimmest pulse has a 4.59:1 contrast floor.
   Derived tokens live on body so they resolve against its changing base. */
body {
  --hero-height: clamp(210px, 27vw, 350px);
  --paper: color-mix(in srgb, var(--base-color) 18%, black);
  --ink: color-mix(in srgb, var(--base-color) 15%, white);
  --secondary: color-mix(in srgb, var(--ink) 78%, var(--paper));
  margin: 0;
  padding-bottom: 300px;
  background: var(--paper);
  color: var(--ink);
  font-family: Fanwood, Georgia, serif;
  transition: --base-color 1.6s ease, opacity .2s ease;
}
h1, p, figure { margin: 0; }
h1 {
  font-size: clamp(64px, 8vw, 112px);
  white-space: nowrap;
  font-weight: 400;
  line-height: .96;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  letter-spacing: -.015em;
}
.title-break { display: none; }
a, .controls button {
  color: inherit;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}
a:hover, .controls button:hover { text-decoration-thickness: 3px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}
main { max-width: 1100px; margin: auto; padding: 30px 55px 45px; }
header { margin: 10px 0 30px; }
.about { max-width: 650px; margin-left: 25%; font-size: 26px; line-height: 1.45; }
.about p + p { margin-top: 20px; }
.navigation { max-width: 650px; margin: 30px 0 0 25%; }
nav { display: flex; flex-wrap: wrap; gap: 35px; font-size: 30px; }
.navigation .secondary {
  align-items: flex-start;
  margin-top: 18px;
  gap: 12px 24px;
  font: 15px/1.6 Manrope, Arial, sans-serif;
}
.photo-details, .secondary, .listening { color: var(--secondary); }
.carousel {
  position: sticky;
  top: calc(15px - var(--hero-height));
  z-index: 2;
}
.images {
  height: var(--hero-height);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--paper);
}
.images img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-position, center center);
  opacity: 0;
  transition: opacity .8s ease;
}
.images img.active { opacity: 1; }
.photo-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 55px 0;
  max-width: 1100px;
  margin: auto;
  font: 12px/1.5 Manrope, Arial, sans-serif;
}
.controls { display: flex; align-items: center; gap: 10px; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 8px 11px;
  text-decoration-line: underline;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
}
#play { width: 62px; text-align: right; }
#count { position: relative; white-space: nowrap; font-variant-numeric: tabular-nums; }
#count::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.22em;
  height: 1px;
  background: currentColor;
  opacity: .65;
  transform: scaleX(var(--slide-progress, 0));
  transform-origin: left;
  transition: transform var(--slide-progress-duration, 0ms) linear;
}
.listening {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.5;
}
.listening { position: relative; margin-top: 30px; padding-top: 42px; }
.listening::before {
  content: '❦';
  position: absolute;
  top: 0;
  left: 0;
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1;
  opacity: .78;
}
#listening-label { flex: 0 0 6em; white-space: nowrap; }
.listening a {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.playing-pulse {
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  animation: playing-pulse 2s ease-in-out infinite;
}
@keyframes playing-pulse {
  0%, 100% { opacity: .78; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  top: 10px;
  left: 20px;
  z-index: 5;
  transform: translateY(-200%);
  background: var(--paper);
  padding: 10px;
}
.skip:focus { transform: none; }
@media (max-width: 767px) {
  h1 { font-size: clamp(64px, 12vw, 88px); white-space: normal; }
  .title-break { display: initial; }
}
@media (max-width: 600px) {
  main { padding: 25px; }
  .photo-details { padding: 10px 20px 0; gap: 5px; }
  .controls { gap: 0; }
  button { padding: 7px; }
  #play { width: 50px; }
  .about { font-size: 23px; line-height: 1.4; }
  header { margin-bottom: 25px; }
  nav { font-size: 28px; gap: 26px; }
  .about, .navigation { margin-left: 0; }
  .navigation .secondary { font-size: 14px; gap: 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  body, .images img { transition: none; }
  .playing-pulse { animation: none; }
}

/* Reserve the controls’ height even before scripts initialize (or without JS). */
.controls[hidden] { display: flex !important; visibility: hidden; }
html[data-font-fallback] body { font-family: Georgia, serif; }
html[data-font-fallback] .photo-details,
html[data-font-fallback] .navigation .secondary { font-family: Arial, sans-serif; }

/* Hidden playing indicators use the shared [hidden] rule and occupy no space. */

/* The restored photo is selected while concealed, without an initial crossfade. */
html[data-loading] .images img { transition: none; }
