@font-face {
  font-family: 'Baskervville';
  src: url('fonts/Baskervville-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #ffffff;
  --foreground: oklch(0.145 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --border: oklch(0.922 0 0);
  --drawer: oklch(0.962 0 0);
  --ring: oklch(0.708 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * 0.75);
  --radius-md: calc(var(--radius) * 0.875);
  --slide-width: clamp(420px, 58vw, 780px);
  --image-height: clamp(430px, 70vh, 820px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Baskervville', Baskerville, 'Baskerville Old Face', Georgia, serif;
  overflow: hidden;
}

body.is-slider-dragging {
  user-select: none;
  -webkit-user-select: none;
}

body.is-slider-dragging * {
  cursor: grabbing;
}

button {
  font: inherit;
}

.gallery {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: clamp(18px, 3vw, 42px) 0 48px;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 0;
}

.gallery-track {
  position: absolute;
  inset: 0;
}

.gallery-item {
  --x: 0px;
  --scale: 0.22;
  --opacity: 0;
  --caption-opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--slide-width);
  margin: 0;
  opacity: var(--opacity);
  transform: translate(-50%, -50%) translateX(var(--x)) scale(var(--scale));
  transform-origin: center center;
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
  will-change: transform;
}

.gallery-track.is-dragging .gallery-item {
  transition: none;
}

.gallery-item__image-wrap {
  height: var(--image-height);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-item figcaption {
  display: none;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 24px 0;
}

.line-slider {
  --knob-x: 0px;
  position: relative;
  width: min(700px, calc(100vw - 64px));
  height: 42px;
  cursor: grab;
  touch-action: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.line-slider:active {
  cursor: grabbing;
}

.line-slider:focus-visible .line-slider__knob {
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--ring) 28%, transparent);
}

.line-slider__ticks {
  position: absolute;
  inset: 0;
}

.line-slider__tick {
  --tick-height: 22px;
  --tick-shift: 0px;
  position: absolute;
  top: 50%;
  left: var(--tick-left);
  width: 1px;
  height: var(--tick-height);
  background: var(--foreground);
  transform: translate3d(calc(-50% + var(--tick-shift)), -50%, 0);
  transition:
    height 70ms ease,
    transform 70ms ease;
  will-change: transform, height;
}

.line-slider.is-dragging .line-slider__tick {
  transition: none;
}

.line-slider__knob {
  position: absolute;
  top: 50%;
  left: var(--knob-x);
  width: 24px;
  height: 24px;
  border: 1px solid var(--foreground);
  border-radius: 999px;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 140ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.line-slider.is-dragging .line-slider__knob {
  transition: none;
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--foreground);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition:
    color 140ms ease,
    opacity 140ms ease,
    box-shadow 140ms ease;
}

.slider-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: min(700px, calc(100vw - 64px));
  margin-top: 8px;
}

.current-title,
.statement-button {
  color: var(--foreground);
  font-size: 18px;
  font-weight: 200;
  line-height: 26px;
  letter-spacing: 0.6px;
}

.statement-button {
  appearance: none;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: color 160ms ease;
}

.statement-button:hover,
.statement-button:focus-visible {
  color: var(--muted-foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.modal__close:hover,
.modal__close:focus-visible {
  color: var(--foreground);
  opacity: 0.58;
  outline: none;
}

.statement-button:focus-visible,
.modal__close:focus-visible,
.statement-tab:focus-visible {
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--ring) 28%, transparent);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  opacity: 0;
  backdrop-filter: blur(0);
  transition:
    opacity 240ms ease,
    background-color 240ms ease,
    backdrop-filter 300ms ease;
}

.modal__panel {
  position: absolute;
  top: clamp(18px, 3vw, 36px);
  right: clamp(18px, 3vw, 36px);
  bottom: clamp(18px, 3vw, 36px);
  width: min(520px, calc(100vw - 36px));
  padding: clamp(20px, 4vw, 38px);
  overflow: auto;
  background: var(--drawer);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.modal.is-open {
  pointer-events: auto;
}

.modal.is-open .modal__scrim {
  background: rgba(255, 255, 255, 0.42);
  opacity: 1;
  backdrop-filter: blur(12px);
}

.modal.is-open .modal__panel {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 110ms;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.modal__header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 200;
  line-height: 26px;
  letter-spacing: 0.6px;
}

.modal__close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
}

.statement-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.statement-tab {
  padding: 0 0 10px;
  color: var(--muted-foreground);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: 18px;
  font-weight: 200;
  line-height: 26px;
  letter-spacing: 0.6px;
  cursor: pointer;
}

.statement-tab.is-active {
  color: var(--foreground);
  border-bottom-color: var(--foreground);
}

.statement-tab:focus-visible {
  outline: none;
}

.statement-panel {
  color: var(--foreground);
  font-size: 18px;
  font-weight: 200;
  line-height: 26px;
  letter-spacing: 0.6px;
}

.statement-panel p {
  margin: 0;
}

.statement-panel p + p {
  margin-top: 1.2em;
}

@media (max-width: 700px) {
  :root {
    --slide-width: min(90vw, 430px);
    --image-height: min(58svh, 520px);
  }

  .gallery {
    padding: 12px 0 calc(22px + env(safe-area-inset-bottom));
  }

  .controls {
    padding: 8px 22px 0;
  }

  .line-slider {
    width: calc(100vw - 44px);
  }

  .slider-meta {
    width: calc(100vw - 44px);
  }

  .modal__panel {
    inset: 12px;
    width: auto;
    max-height: calc(100svh - 24px);
    padding: 20px;
  }

  .modal__header {
    margin-bottom: 18px;
  }

  .modal__header h1 {
    font-size: 18px;
  }

  .statement-tabs {
    margin-bottom: 20px;
  }

  .statement-panel {
    font-size: 18px;
    line-height: 26px;
  }
}

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