:root {
  --bg: #f7f6f5;
  --text: #5d5857;
  --text-muted: #a8a4a3;
  --accent: #8bb8c4;
  --accent-deep: #5f96a8;
  --blend: #c97b6f;
  --border: #d2d0cf;
  --card-width: clamp(200px, 22vw, 280px);
  --card-gap: clamp(12px, 2vw, 24px);
  --page-padding: clamp(20px, 4vw, 48px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  padding-top: var(--countdown-height, 56px);
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  min-height: var(--countdown-height, 56px);
  padding: 10px var(--page-padding);
  background: rgba(247, 246, 245, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 32px);
  flex-wrap: wrap;
  padding-right: clamp(140px, 18vw, 200px);
}

.top-bar__explore {
  position: absolute;
  top: 50%;
  right: var(--page-padding);
  transform: translateY(-50%);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.top-bar__explore:hover {
  color: var(--blend);
  border-color: var(--blend);
  background: #fff;
}

.top-bar__admin {
  position: absolute;
  top: 50%;
  right: calc(var(--page-padding) + clamp(148px, 20vw, 210px));
  transform: translateY(-50%);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.top-bar__admin:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.top-bar__admin[hidden] {
  display: none;
}

.countdown__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.countdown__units {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 18px);
}

.countdown__unit {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.countdown__value {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.countdown__name {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.countdown--live .countdown__label::after {
  content: " · we're here";
  color: var(--blend);
}

button {
  font: inherit;
}

.page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--page-padding);
  gap: clamp(20px, 3vh, 36px);
}

.hero {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  width: min(92vw, 1100px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  mix-blend-mode: multiply;
}

.hero__brand,
.hero__year {
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
  text-transform: uppercase;
  color: var(--text);
}

.hero__title {
  margin: 0;
  font-size: clamp(2.5rem, 10vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.88;
  text-transform: uppercase;
  color: var(--blend);
}

.hero__year {
  font-size: clamp(1rem, 2.5vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-top: 0.4em;
  color: var(--text-muted);
}

.gallery-shell {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: min(52vh, 520px);
  display: flex;
  align-items: center;
}

.gallery {
  display: flex;
  gap: var(--card-gap);
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: calc(50% - var(--card-width) / 2);
  padding-inline: calc(50% - var(--card-width) / 2);
  scrollbar-width: none;
  -ms-overflow-style: none;
  outline: none;
}

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

.card {
  flex: 0 0 var(--card-width);
  scroll-snap-align: center;
  display: grid;
  gap: 12px;
}

.card__media {
  width: 100%;
  aspect-ratio: 3 / 4.2;
  border-radius: 2px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.15), transparent 45%),
    linear-gradient(180deg, #9ec9d4 0%, #6fa3b3 55%, #4f8798 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.card__media--photo {
  display: block;
  object-fit: cover;
  background: var(--border);
}

.card:nth-child(3n + 2) .card__media {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.15), transparent 45%),
    linear-gradient(180deg, #a8d2dc 0%, #78adbc 55%, #5a92a3 100%);
}

.card:nth-child(3n) .card__media {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.15), transparent 45%),
    linear-gradient(180deg, #8fbfcc 0%, #6291a0 55%, #457c8d 100%);
}

.card__caption {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .card__caption,
.card:focus-within .card__caption {
  opacity: 1;
}

.card__number {
  color: var(--text);
  margin-right: 0.35em;
}

.timeline-shell {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  margin-top: auto;
  padding-bottom: clamp(4px, 1vh, 12px);
}

.timeline {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(3px, 0.45vw, 6px);
  min-height: 28px;
  padding: 0 8px;
  cursor: ew-resize;
  touch-action: none;
}

.timeline__tick {
  flex: 0 0 1px;
  width: 1px;
  height: 14px;
  padding: 0;
  border: 0;
  background: var(--border);
  cursor: pointer;
  transition: height 0.15s ease, background 0.15s ease;
}

.timeline__tick:hover {
  background: var(--text-muted);
}

.timeline__tick--active {
  height: 18px;
  background: var(--text);
}

.timeline-indicator {
  position: absolute;
  bottom: 28px;
  width: 1px;
  background: var(--text);
  transform: translateX(-50%);
  pointer-events: none;
  transition: left 0.12s ease-out, height 0.12s ease-out;
}

.timeline-toolbar {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.add-memory-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(93, 88, 87, 0.08);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.add-memory-btn:hover {
  background: var(--text);
  color: #fff;
}

.add-memory-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(93, 88, 87, 0.25);
}

.add-memory-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
}

.add-memory-btn:hover .add-memory-btn__icon {
  background: #fff;
  color: var(--text);
}

.bottom-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.bottom-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.bottom-nav__link:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.bottom-nav__link--active {
  color: var(--text);
  border-color: var(--text);
  background: #fff;
}

.memory-modal {
  width: min(92vw, 400px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.memory-modal::backdrop {
  background: rgba(93, 88, 87, 0.35);
}

.memory-modal__form {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.memory-modal__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.memory-modal__label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.memory-modal__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.95rem;
}

.memory-modal__message {
  min-height: 1rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--accent-deep);
}

.memory-modal__message--error {
  color: #a94442;
}

.memory-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.memory-modal__btn {
  padding: 10px 16px;
  border: 1px solid var(--text);
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.memory-modal__btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

@media (max-width: 720px) {
  body {
    padding-top: 88px;
  }

  .top-bar {
    padding-bottom: 12px;
  }

  .countdown {
    flex-direction: column;
    gap: 6px;
    padding-right: 0;
    padding-bottom: 36px;
  }

  .top-bar__explore {
    top: auto;
    bottom: 10px;
    right: var(--page-padding);
    transform: none;
    font-size: 0.68rem;
    padding: 7px 12px;
  }

  .top-bar__admin {
    top: auto;
    bottom: 10px;
    right: calc(var(--page-padding) + 118px);
    transform: none;
    font-size: 0.65rem;
    padding: 7px 10px;
  }

  .hero__brand,
  .hero__year {
    font-size: clamp(1.75rem, 10vw, 2.75rem);
  }

  .hero__title {
    font-size: clamp(2.25rem, 14vw, 4rem);
  }

  .bottom-nav__link {
    min-width: 78px;
    padding: 8px 14px;
    font-size: 0.75rem;
  }
}
