:root {
  --ink: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.64);
  --line: rgba(255, 255, 255, 0.2);
  --dark: #151b18;
  --accent: #d8b273;
  --duration: 6000ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #101512;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.album {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 72px minmax(430px, 1fr) 112px;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 64px);
  background: var(--dark);
  position: relative;
  z-index: 10;
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Playfair Display", serif;
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(216, 178, 115, 0.7);
  border-radius: 50%;
  color: var(--accent);
  font-style: italic;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.icon-button {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button svg,
.round-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.slides,
.slide {
  position: absolute;
  inset: 0;
}

.slide {
  margin: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1s ease, transform 7s ease;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 12, 10, 0.62) 0%, rgba(7, 12, 10, 0.08) 55%, rgba(7, 12, 10, 0.2) 100%),
    linear-gradient(0deg, rgba(7, 12, 10, 0.55), transparent 45%);
}

.caption {
  position: absolute;
  z-index: 3;
  left: clamp(24px, 8vw, 120px);
  top: 50%;
  transform: translateY(-50%);
  max-width: 630px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.caption h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(46px, 6.3vw, 92px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.92;
  text-shadow: 0 4px 36px rgba(0, 0, 0, 0.16);
}

.caption h1 em {
  color: var(--accent);
  font-weight: 500;
}

.description {
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.caption > * {
  opacity: 0;
  animation: reveal 0.8s forwards;
}

.caption h1 {
  animation-delay: 0.08s;
}

.caption .description {
  animation-delay: 0.16s;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.counter {
  position: absolute;
  top: 36px;
  right: clamp(24px, 5vw, 72px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.counter-line {
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
}

.total-number {
  color: rgba(255, 255, 255, 0.48);
}

.controls {
  position: absolute;
  z-index: 4;
  right: clamp(24px, 5vw, 72px);
  bottom: 34px;
  display: flex;
  gap: 10px;
}

.round-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(18, 25, 21, 0.18);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.round-button:hover {
  background: rgba(216, 178, 115, 0.25);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.play-button {
  border-color: var(--accent);
  background: rgba(216, 178, 115, 0.18);
}

.play-icon {
  display: none;
}

.is-paused .pause-icon {
  display: none;
}

.is-paused .play-icon {
  display: block;
}

.progress {
  position: absolute;
  z-index: 5;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.is-playing .progress span {
  animation: progress var(--duration) linear forwards;
}

@keyframes progress {
  to { transform: scaleX(1); }
}

.filmstrip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.3vw, 18px);
  padding: 14px 20px;
  background: var(--dark);
  overflow-x: auto;
  scrollbar-width: none;
}

.filmstrip::-webkit-scrollbar {
  display: none;
}

.thumbnail {
  position: relative;
  flex: 0 0 auto;
  width: clamp(64px, 7.5vw, 104px);
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #29312d;
  opacity: 0.48;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.thumbnail:hover {
  opacity: 0.8;
}

.thumbnail.active {
  opacity: 1;
  transform: translateY(-3px);
}

.thumbnail.active::after {
  border-color: var(--accent);
}

@media (max-width: 700px) {
  .album {
    grid-template-rows: 62px minmax(520px, calc(100vh - 150px)) 88px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar-meta {
    display: none;
  }

  .caption {
    left: 24px;
    right: 24px;
    top: auto;
    bottom: 102px;
    transform: none;
  }

  .caption h1 {
    font-size: clamp(43px, 13vw, 66px);
  }

  .description {
    max-width: 280px;
  }

  .counter {
    top: 24px;
  }

  .controls {
    left: 24px;
    right: auto;
    bottom: 30px;
  }

  .slide img {
    object-position: center;
  }

  .filmstrip {
    justify-content: flex-start;
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .caption > *,
  .progress span {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .caption > * {
    opacity: 1;
  }
}
