:root {
  --white: #ffffff;
  --off-white: #fafafa;
  --black: #111111;
  --grey: #6b6b6b;
  --grey-light: #9a9a9a;
  --hairline: #d9d9d9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--black);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  margin: 0;
}

/* ---------- Login ---------- */

.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--white);
}

.login-card {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.login-card h1 {
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  color: var(--black);
  margin-bottom: 10px;
}

.login-hint {
  color: var(--grey);
  margin: 0 0 32px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#password-input {
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--white);
  color: var(--black);
  outline: none;
  text-align: center;
  transition: border-color 0.2s ease;
}

#password-input:focus {
  border-color: var(--black);
}

#login-form button {
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px;
  border: 1px solid var(--black);
  border-radius: 0;
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

#login-form button:active {
  background: var(--white);
  color: var(--black);
}

.login-error {
  color: var(--black);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  margin-top: 18px;
}

/* ---------- Story ---------- */

.story {
  max-width: 640px;
  margin: 0 auto;
}

.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--white);
  position: relative;
}

.hero-title {
  font-size: clamp(2.8rem, 12vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: var(--black);
}

.hero-sub {
  margin-top: 22px;
  color: var(--grey);
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.hero-sub::before,
.hero-sub::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--hairline);
  vertical-align: middle;
  margin: 0 12px 3px;
}

.hero-count {
  margin-top: 14px;
  color: var(--grey-light);
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.hero-count #photo-count {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--grey);
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--grey-light);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.5; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

.timeline {
  padding: 8px 16px 40px;
}

.month-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 56px 0 24px;
  color: var(--black);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.3rem;
  font-style: italic;
  letter-spacing: 0.04em;
}

.month-divider::before,
.month-divider::after {
  content: "";
  flex: 1;
  max-width: 64px;
  height: 1px;
  background: var(--hairline);
}

.month-divider:first-child {
  margin-top: 12px;
}

.photo-card {
  margin: 0 auto 20px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.photo-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  border: 1px solid var(--hairline);
  background: var(--off-white);
  cursor: zoom-in;
}

/* ---------- Progress bar + current-month indicator ---------- */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--black);
  z-index: 60;
}

.current-month {
  position: fixed;
  top: 18px;
  right: 18px;
  padding: 6px 12px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 55;
  pointer-events: none;
}

.current-month.visible {
  opacity: 1;
}

/* ---------- View toggle + map ---------- */

.view-toggle {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--black);
  z-index: 60;
}

.view-toggle-btn {
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--black);
  cursor: pointer;
}

.view-toggle-btn.active {
  background: var(--black);
  color: var(--white);
}

.map-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--off-white);
}

.map-view[hidden] {
  display: none;
}

#map {
  width: 100%;
  height: 100%;
}

.photo-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--black);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--black);
}

.photo-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--black);
}

.leaflet-popup-content-wrapper {
  border-radius: 0;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  touch-action: none;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-viewport img {
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  opacity: 0.65;
}

.closing {
  min-height: 70dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 32px;
  background: var(--white);
}

.closing-text {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  font-style: italic;
  color: var(--black);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

.closing-text.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 700px) {
  .timeline { padding: 8px 0 60px; }
}
