/* Warm Technical Minimalism — adapted for a personal artifact.
   Calm by default. The photos are the content. Accent earns its appearance. */

:root {
  /* Neutral foundation — design brief tokens */
  --ink:            #111111;
  --charcoal:       #2E2E2B;
  --muted:          #77766F;
  --border:         #E5E1D8;
  --surface-warm:   #FAF7F1;
  --surface-white:  #FFFFFF;
  --surface-cream:  #F3EDE3;

  /* Single accent — Copper-leaning rose for warmth, used sparingly */
  --accent:         #E66B7E;
  --accent-soft:    #F7DEDF;

  /* Geometry */
  --radius-tight:   6px;
  --radius:         12px;
  --radius-lg:      20px;
  --radius-pill:    999px;

  --strip-h: clamp(280px, 56vh, 560px);

  /* Soft, low-blur shadow — only for raised elements */
  --shadow-soft:
    0 1px 0 rgba(17, 17, 17, 0.04),
    0 8px 24px -16px rgba(17, 17, 17, 0.18);

  /* Type stacks */
  --font-display: "Iowan Old Style", "GT Super Text", "Tiempos Text",
                  "Cochin", "Apple Garamond", "Hoefler Text", Georgia, serif;
  --font-ui:      -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text",
                  "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", "JetBrains Mono", "Geist Mono",
                  ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--surface-warm);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0;
}
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

main { max-width: 100%; margin: 0; padding: 0; }

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  position: relative;
  text-align: center;
  padding: 88px 24px 40px;
  background: var(--surface-warm);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  background-repeat: no-repeat;
  filter: saturate(1.05);
  z-index: -2;
  transform: scale(1.04);
  opacity: 0;
  animation: hero-fade-in 1.4s ease-out 0.1s forwards;
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    /* horizontal banner band aligned with the text up top */
    linear-gradient(180deg,
      rgba(250, 247, 241, 0.92)  0%,
      rgba(250, 247, 241, 0.92) 32%,
      transparent               46%,
      transparent              100%),
    /* bottom fade into the page background */
    linear-gradient(180deg,
      rgba(250, 247, 241, 0.0) 78%,
      rgba(250, 247, 241, 0.55) 90%,
      var(--surface-warm) 100%);
}
@keyframes hero-fade-in {
  from { opacity: 0;    transform: scale(1.06); }
  to   { opacity: 0.92; transform: scale(1.02); }
}
.hero-inner { max-width: 720px; position: relative; z-index: 1; }
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--accent);
  margin: 0 0 28px;
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 72px);
  margin: 0 0 14px;
  color: var(--ink);
}
.hero .sub {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--charcoal);
  margin: 0 auto;
  max-width: 540px;
}
.from {
  font-style: italic;
  font-size: clamp(14px, 1.2vw, 16px);
  color: var(--accent);
  margin: 40px 0 0;
  letter-spacing: 0.01em;
  opacity: 0.9;
}
.from:empty { display: none; }

.scroll-cue {
  display: inline-block;
  width: 22px;
  height: 36px;
  border: 1.5px solid var(--muted);
  border-radius: var(--radius-pill);
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  opacity: 0.5;
  transition: opacity 200ms ease;
}
.scroll-cue:hover { opacity: 1; }
.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  background: var(--muted);
  border-radius: 2px;
  transform: translate(-50%, 0);
  animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translate(-50%, 0);  opacity: 0.8; }
  50%      { transform: translate(-50%, 9px); opacity: 0.2; }
}

/* ---- Year switcher (only shown when 2+ years exist) ---- */
.year-switcher {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 16px 24px 4px;
  background: var(--surface-warm);
}
.year-switcher a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  transition: background 200ms ease, color 200ms ease;
}
.year-switcher a:hover { color: var(--ink); background: var(--surface-cream); }
.year-switcher a.active {
  background: var(--ink);
  color: var(--surface-white);
  border-color: var(--ink);
}

/* ---- Sticky month nav ---- */
.month-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  background: rgba(250, 247, 241, 0.86);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  border-bottom: 1px solid var(--border);
}
.month-nav::-webkit-scrollbar { display: none; }
.month-nav a {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: background 200ms ease, color 200ms ease;
  white-space: nowrap;
  text-transform: uppercase;
}
.month-nav a:hover { background: var(--surface-cream); color: var(--ink); }
.month-nav a.active {
  background: var(--accent);
  color: var(--surface-white);
}

/* ---- Timeline ---- */
.timeline { padding: 24px 0 60px; }

.month {
  margin: 56px 0;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  scroll-margin-top: 80px;
}
.month-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.month-title { display: flex; flex-direction: column; gap: 4px; }
.month-head h2 {
  font-size: clamp(30px, 4.5vw, 48px);
  margin: 0;
  color: var(--ink);
}
.month-caption {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  font-style: italic;
}
.month-head .count {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.month-head .progress-track {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  width: 100%;
  background: transparent;
  pointer-events: none;
}
.month-head .progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 180ms linear;
}

/* ---- Horizontal photo strip ---- */
.strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 8px 0 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft) transparent;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-track { background: transparent; }
.strip::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: var(--radius-pill); }

.tile {
  flex: 0 0 auto;
  height: var(--strip-h);
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-cream);
  border: 1px solid var(--border);
  cursor: zoom-in;
  position: relative;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1),
              box-shadow 220ms ease;
  opacity: 0;
  transform: translateY(8px);
}
.tile.in { opacity: 1; transform: translateY(0); }
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.tile img {
  display: block;
  height: 100%;
  width: auto;
  background: var(--surface-cream);
}
.tile.video::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--surface-white);
  font-size: 32px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* ---- Letter card ---- */
.letter {
  max-width: 680px;
  margin: 60px auto 40px;
  padding: 56px 40px;
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.letter h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  margin: 0 0 28px;
  color: var(--ink);
}
.letter-body p {
  margin: 0 0 18px;
  color: var(--charcoal);
  font-size: 17px;
  line-height: 1.7;
}
.letter-body p:last-child {
  font-family: "Snell Roundhand", "Apple Chancery", "Brush Script MT", cursive;
  font-size: 26px;
  color: var(--accent);
  margin-top: 28px;
}

/* ---- Closing full-bleed photo ---- */
.closing {
  margin: 60px 0 0;
  padding: 0;
  position: relative;
}
.closing-bg {
  height: clamp(320px, 70vh, 720px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---- Footer ---- */
footer {
  text-align: center;
  padding: 32px 0 80px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
footer p { margin: 4px 0; }
.footer-from { opacity: 0.7; }

/* ---- Music toggle ---- */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  background: var(--surface-white);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}
.music-toggle:hover { transform: translateY(-1px); color: var(--ink); }
.music-toggle.on {
  background: var(--accent);
  color: var(--surface-white);
  border-color: var(--accent);
}
.music-toggle .music-icon { font-size: 14px; }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.94);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lb-figure {
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lb-figure img,
.lb-figure video {
  max-width: 100%;
  max-height: 84vh;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -10px rgba(0,0,0,0.7);
}
.lb-figure figcaption {
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lb-close, .lb-nav {
  position: fixed;
  background: transparent;
  color: var(--surface-white);
  border: 0;
  font-size: 36px;
  cursor: pointer;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  transition: background 180ms ease;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,0.1); }
.lb-close { top: 16px; right: 16px; }
.lb-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  :root { --strip-h: 60vh; }
  .month { padding: 0 16px; }
  .month-nav { padding: 10px 16px; }
  .letter { padding: 40px 24px; margin: 40px 16px; }
  .music-toggle { bottom: 14px; right: 14px; padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; opacity: 1; transform: none; }
  .scroll-cue span { animation: none; }
  .hero-bg { animation: none; opacity: 0.55; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

/* ---- Print ---- */
@media print {
  body { background: white; color: black; }
  .music-toggle, .month-nav, .year-switcher, .scroll-cue,
  .lightbox, .hero-bg, .hero-veil { display: none !important; }
  .hero { min-height: auto; padding: 24px 0; }
  .hero h1 { font-size: 36pt; }
  .hero .sub, .from { color: #444; }
  .strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    overflow: visible;
    scroll-snap-type: none;
    page-break-inside: avoid;
    padding: 0;
  }
  .tile {
    height: auto;
    box-shadow: none;
    border: 1px solid #ddd;
    opacity: 1 !important;
    transform: none !important;
  }
  .tile img { width: 100%; height: auto; }
  .month { page-break-inside: avoid; padding: 0; margin: 24px 0; }
  .letter { box-shadow: none; border: 1px solid #ccc; page-break-before: always; }
  .closing { page-break-before: always; }
}
