/* ════════════════════════════════════════════════════════════
   app.css  —  layout · components · views
   howard.baby / Elija Howard
════════════════════════════════════════════════════════════ */

/* ── Shell ───────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100dvh; }

/* ── View transition ─────────────────────────────────────────── */
#main-content {
  flex: 1;
  transition: opacity 0.18s ease, transform 0.18s ease;
  padding-bottom: var(--sp-11);
}
#main-content.fading {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
@media (max-width: 768px) {
  #main-content { padding-bottom: calc(var(--nav-h) + var(--sp-9)); }
}

/* ══════════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════════ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(247,245,242,.88);
  border-bottom: 1px solid var(--line-subtle);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: background var(--t-base-d);
}
[data-theme="dark"] #site-header {
  background: rgba(17,13,9,.88);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  gap: var(--sp-4);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-1);
}
.logo-sep { color: var(--line); font-size: 0.875rem; }
.logo-family {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
}

/* Desktop nav links */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.header-nav .nav-link {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 10px;
  border-radius: var(--r);
  transition: color var(--t-fast), background var(--t-fast);
  text-decoration: none;
}
.header-nav .nav-link:hover { color: var(--text-1); background: var(--surface-2); }
.header-nav .nav-link.active { color: var(--accent); background: var(--accent-subtle); }

.header-actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: var(--sp-3); }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r);
  color: var(--text-2);
  transition: color var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { color: var(--text-1); background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }

@media (max-width: 768px) {
  .header-nav { display: none; }
  .logo-family, .logo-sep { display: none; }
  .header-actions { margin-left: auto; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
══════════════════════════════════════════════════════════════ */
#mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(247,245,242,.92);
  border-top: 1px solid var(--line-subtle);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transition: background var(--t-base-d);
}
[data-theme="dark"] #mobile-nav { background: rgba(17,13,9,.92); }
@media (min-width: 769px) { #mobile-nav { display: none; } }

.mob-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--nav-h);
  padding: var(--sp-2) var(--sp-1) 10px;
  color: var(--text-3);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.mob-nav-item svg { width: 21px; height: 21px; stroke-width: 1.7; }
.mob-nav-item.active { color: var(--accent); }
.mob-nav-item:active { opacity: 0.65; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-size: var(--t-sm); font-weight: 500;
  cursor: pointer; border: none; font-family: var(--font-body);
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
  text-decoration: none; white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 14px rgba(184,104,64,.35);
}
.btn-secondary {
  background: var(--surface-2); color: var(--text-1);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text-2);
  padding: 8px 4px; border-radius: var(--r);
}
.btn-ghost:hover { color: var(--text-1); background: var(--surface-2); }
.btn-ghost:hover { color: var(--text-1); background: var(--surface-2); }

/* ── Home page recap CTA ─────────────────────────────────────── */
.home-recap-cta {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-8);
}


/* ══════════════════════════════════════════════════════════════
   BADGES / PILLS
══════════════════════════════════════════════════════════════ */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: var(--t-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  white-space: nowrap; line-height: 1.6;
}
.pill svg { width: 9px; height: 9px; }

.pill-age      { background: var(--accent-subtle); color: var(--accent-dk); }
.pill-star     { background: var(--gold-subtle);   color: var(--gold-dk);   }
.pill-newborn  { background: var(--sage-subtle);   color: var(--sage-dk);   }
.pill-monthly  { background: var(--accent-subtle); color: var(--accent-dk); }
.pill-holiday  { background: var(--gold-subtle);   color: var(--gold-dk);   }
.pill-first    { background: var(--plum-subtle);   color: var(--plum-dk);   }
.pill-family   { background: var(--slate-subtle);  color: var(--slate-dk);  }
.pill-outing   { background: var(--sage-subtle);   color: var(--sage-dk);   }
.pill-birthday { background: var(--gold-subtle);   color: var(--gold-dk);   }

/* ══════════════════════════════════════════════════════════════
   FILTER STRIP  (sticky below header)
══════════════════════════════════════════════════════════════ */
.filter-strip {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line-subtle);
  transition: background var(--t-base-d);
}
.filter-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
@media (min-width: 640px) {
  .filter-inner { flex-direction: row; align-items: center; gap: var(--sp-3); }
}

.chip-scroll {
  display: flex; gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.chip-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 5px 13px;
  border-radius: var(--r-full);
  font-size: var(--t-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-wrap svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  color: var(--text-1);
  font-size: var(--t-sm);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input::placeholder { color: var(--text-4); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* ══════════════════════════════════════════════════════════════
   PHOTO GRID
══════════════════════════════════════════════════════════════ */
.photo-grid {
  display: grid; gap: 3px;
  border-radius: var(--r-md); overflow: hidden;
  margin-top: var(--sp-5);
}
.pg-1 { grid-template-columns: 1fr; }
.pg-2 { grid-template-columns: 1fr 1fr; }
.pg-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pg-3 .photo-cell:first-child { grid-row: 1 / 3; }
.pg-4plus { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }

.photo-cell {
  aspect-ratio: 4/3;
  position: relative; overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
}
.pg-1  .photo-cell { aspect-ratio: 3/2; max-height: 440px; }
.pg-3  .photo-cell:first-child { aspect-ratio: unset; }
.pg-4plus .photo-cell { aspect-ratio: 1; }

.photo-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 380ms ease;
  display: block;
}
.photo-cell:hover img { transform: scale(1.045); }
.photo-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Placeholder when photo fails */
.photo-cell.no-img {
  background: var(--surface-2);
  background-image: none;
}
.photo-cell.no-img::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
}

/* Shimmer loading state */
.photo-cell.loading {
  background: linear-gradient(90deg,
    var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.photo-overflow {
  position: absolute; inset: 0;
  background: rgba(24,19,13,.52);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 600;
  color: #fff; letter-spacing: -0.02em;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════ */
#lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8,5,2,.94);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
#lightbox.open { display: flex; animation: fadeIn 180ms ease; }
body.lb-active { overflow: hidden; }

.lb-img {
  max-width: min(88vw, 1100px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  user-select: none;
}
.lb-close {
  position: absolute; top: 14px; right: 14px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6); border-radius: var(--r);
  transition: color var(--t-fast), background var(--t-fast);
}
.lb-close:hover { color: #fff; background: rgba(255,255,255,.1); }
.lb-close svg { width: 20px; height: 20px; }

.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6); border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast);
}
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-prev:hover, .lb-next:hover { color: #fff; background: rgba(255,255,255,.1); }
.lb-prev svg, .lb-next svg { width: 26px; height: 26px; }

.lb-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px; text-align: center;
  color: rgba(255,255,255,.55); font-size: var(--t-sm);
  pointer-events: none;
}
.lb-counter {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.45); font-size: var(--t-xs); font-weight: 600;
  letter-spacing: 0.06em;
}
@media (max-width: 600px) {
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-4); padding: var(--sp-11) var(--sp-6);
  text-align: center;
}
.empty-state svg { width: 36px; height: 36px; color: var(--text-4); }
.empty-title { font-family: var(--font-display); font-size: var(--t-xl); color: var(--text-2); }
.empty-body  { font-size: var(--t-sm); color: var(--text-3); max-width: 28ch; line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════
   PAGE SCAFFOLD  (wraps view content)
══════════════════════════════════════════════════════════════ */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page-header {
  padding: var(--sp-8) 0 var(--sp-6);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, var(--t-5xl));
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--text-1);
  margin-bottom: var(--sp-2);
}
.page-subtitle { font-size: var(--t-base); color: var(--text-3); }

.section-row {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--t-xl); font-weight: 600;
  letter-spacing: -0.015em; color: var(--text-1);
}
.section-link {
  font-size: var(--t-sm); font-weight: 500;
  color: var(--accent); flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  transition: gap var(--t-fast);
}
.section-link:hover { gap: 8px; }
.section-link svg { width: 13px; height: 13px; }

/* ══════════════════════════════════════════════════════════════
   HOME VIEW
══════════════════════════════════════════════════════════════ */

/* Featured memory at top */
.home-feature {
  position: relative;
  background: var(--surface-2);
}
.feature-photo {
  position: relative;
  overflow: hidden;
  max-height: 62dvh;
  min-height: 300px;
  background: var(--surface-2);
}
.feature-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.feature-photo.no-photo {
  min-height: 320px;
  background: linear-gradient(145deg, var(--accent-subtle), var(--sage-subtle));
}
/* Dark gradient overlay from bottom */
.feature-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 60px var(--gutter) var(--sp-5);
  background: linear-gradient(to top,
    rgba(8,5,2,.72) 0%,
    rgba(8,5,2,.3)  50%,
    transparent     100%);
}
.feature-meta {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.feature-date-text { font-size: var(--t-sm); color: rgba(255,255,255,.7); font-weight: 500; }
.feature-title-text {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.05;
  color: #fff;
}

.feature-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-5) var(--gutter) var(--sp-7);
}
.feature-caption {
  font-size: var(--t-md);
  line-height: 1.7;
  color: var(--text-2);
  max-width: 60ch;
  margin-bottom: var(--sp-4);
}
.feature-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-sm); font-weight: 600;
  color: var(--accent); letter-spacing: 0.01em;
  text-decoration: none;
  transition: gap var(--t-fast);
}
.feature-link:hover { gap: 10px; }
.feature-link svg { width: 14px; height: 14px; }

/* Recent photos strip */
.home-recent-section { margin-bottom: var(--sp-8); }
.recent-strip-wrap {
  overflow: hidden;
  padding-bottom: var(--sp-2);
}
.recent-strip {
  display: flex; gap: 6px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 var(--gutter) 4px;
}
.recent-strip::-webkit-scrollbar { display: none; }
.recent-thumb {
  flex-shrink: 0;
  width: 116px; height: 116px;
  border-radius: var(--r-md);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
}
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 380ms ease; }
.recent-thumb:hover img { transform: scale(1.06); }
.recent-thumb.no-img {
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}

/* Home milestone list */
.milestone-mini-list { display: flex; flex-direction: column; gap: var(--sp-1); }
.milestone-mini-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line-subtle);
}
.milestone-mini-item:last-child { border-bottom: none; }
.milestone-mini-star { color: var(--gold); flex-shrink: 0; }
.milestone-mini-star svg { width: 14px; height: 14px; fill: currentColor; }
.milestone-mini-label { font-size: var(--t-sm); font-weight: 500; color: var(--text-1); flex: 1; }
.milestone-mini-age { font-size: var(--t-xs); color: var(--text-3); white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════
   TIMELINE VIEW  (journal entries)
══════════════════════════════════════════════════════════════ */
.timeline-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Month group header */
.tl-month {
  display: flex; align-items: center; gap: var(--sp-4);
  margin: var(--sp-10) 0 var(--sp-5);
  color: var(--text-3);
  font-size: var(--t-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
}
.tl-month::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.tl-month:first-child { margin-top: var(--sp-6); }

/* Individual memory entry */
.memory-entry {
  padding: var(--sp-7) 0;
  border-bottom: 1px solid var(--line-subtle);
}
.memory-entry:last-child { border-bottom: none; }
.memory-entry.milestone-entry {
  border-left: 2px solid var(--gold);
  padding-left: var(--sp-5);
  margin-left: calc(-1 * var(--sp-5));
}

.entry-meta {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 7px;
  margin-bottom: var(--sp-3);
}
.entry-date {
  font-size: var(--t-sm); color: var(--text-3); font-weight: 500;
}
.entry-date-sep { color: var(--line); font-size: var(--t-xs); }

/* Title — the main clickable element */
.entry-title-link { display: block; text-decoration: none; }
.entry-title {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 4.5vw, var(--t-2xl));
  font-weight: 600; letter-spacing: -0.022em; line-height: 1.1;
  color: var(--text-1);
  margin-bottom: var(--sp-3);
  transition: color var(--t-fast);
}
.entry-title-link:hover .entry-title { color: var(--accent); }
.entry-title-link:focus-visible { border-radius: var(--r); }

.entry-caption {
  font-size: var(--t-md);
  line-height: 1.72; color: var(--text-2);
  max-width: 62ch;
  margin-bottom: var(--sp-2);
}

/* Read more link on truncated entries */
.entry-more {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-sm); font-weight: 500;
  color: var(--accent); margin-top: var(--sp-2);
  transition: gap var(--t-fast);
}
.entry-more:hover { gap: 9px; }
.entry-more svg { width: 13px; height: 13px; }

.entry-footer {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-subtle);
}
.entry-tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.entry-tag  { font-size: var(--t-xs); color: var(--text-3); }
.entry-loc  {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--t-xs); color: var(--text-3); margin-left: auto;
}
.entry-loc svg { width: 11px; height: 11px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   MEMORY DETAIL VIEW
══════════════════════════════════════════════════════════════ */
.detail-back-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-5) var(--gutter) 0;
}
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-sm); font-weight: 500; color: var(--text-3);
  cursor: pointer; text-decoration: none;
  transition: color var(--t-fast);
  padding: var(--sp-2) 0;
}
.detail-back:hover { color: var(--text-1); }
.detail-back svg { width: 14px; height: 14px; }

.detail-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--sp-6) var(--gutter) var(--sp-11);
}

.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: var(--sp-4); }
.detail-date  { font-size: var(--t-sm); color: var(--text-3); font-weight: 500; }

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 7vw, var(--t-4xl));
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.03;
  color: var(--text-1);
  margin-bottom: var(--sp-6);
}

.detail-caption {
  font-size: var(--t-md);
  line-height: 1.78; color: var(--text-2);
  max-width: 60ch;
  margin-bottom: var(--sp-7);
}

.detail-video { border-radius: var(--r-md); overflow: hidden; margin-top: var(--sp-5); }
.detail-video video { width: 100%; display: block; }

.detail-footer {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--sp-3);
}
.detail-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.detail-tag  { font-size: var(--t-sm); color: var(--text-3); }
.detail-location {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--t-sm); color: var(--text-3); margin-left: auto;
}
.detail-location svg { width: 13px; height: 13px; }

/* Prev / next navigation */
.detail-nav-wrap {
  margin-top: var(--sp-9);
  padding-top: var(--sp-7);
  border-top: 1px solid var(--line);
}
.detail-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.detail-nav-btn {
  display: flex; flex-direction: column; gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  cursor: pointer;
}
.detail-nav-btn:hover { background: var(--surface-2); border-color: var(--line); transform: translateY(-2px); }
.detail-nav-btn.next { text-align: right; align-items: flex-end; }
.detail-nav-label {
  font-size: var(--t-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3);
}
.detail-nav-title {
  font-family: var(--font-display);
  font-size: var(--t-lg); color: var(--text-1);
  line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════════
   GALLERY VIEW
══════════════════════════════════════════════════════════════ */
.gallery-masonry {
  columns: 2; column-gap: 5px;
  padding: var(--sp-5) var(--gutter) var(--sp-11);
  max-width: var(--max-w);
  margin: 0 auto;
}
@media (min-width: 540px) { .gallery-masonry { columns: 3; } }
@media (min-width: 820px) { .gallery-masonry { columns: 4; } }

.gallery-thumb {
  display: block; width: 100%;
  break-inside: avoid; margin-bottom: 5px;
  border-radius: var(--r); overflow: hidden;
  position: relative; cursor: pointer;
  background: var(--surface-2);
  border: none; padding: 0; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.gallery-thumb img {
  width: 100%; display: block;
  transition: transform 380ms ease;
}
.gallery-thumb:hover img,
.gallery-thumb:focus-visible img { transform: scale(1.045); }
.gallery-thumb.no-img {
  min-height: 120px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.gallery-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(8,5,2,.68) 0%, transparent 65%);
  padding: 28px 10px 10px;
  opacity: 0; transform: translateY(4px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.gallery-thumb:hover .gallery-overlay,
.gallery-thumb:focus-visible .gallery-overlay {
  opacity: 1; transform: none;
}
.gallery-ov-title { font-size: var(--t-sm); color: rgba(255,255,255,.92); font-weight: 500; line-height: 1.3; }
.gallery-ov-age   { font-size: var(--t-xs); color: rgba(255,255,255,.6); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   MILESTONES VIEW
══════════════════════════════════════════════════════════════ */
.progress-bar-wrap { margin-bottom: var(--sp-8); }
.progress-bar-track {
  height: 5px; background: var(--surface-3);
  border-radius: var(--r-full); overflow: hidden;
  margin-bottom: var(--sp-2);
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent), var(--gold));
  border-radius: var(--r-full);
  transition: width 0.9s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.progress-label { font-size: var(--t-xs); color: var(--text-3); font-weight: 500; }

/* Milestone timeline */
.ms-timeline { position: relative; padding-left: 26px; }
.ms-timeline::before {
  content: ''; position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
.ms-item {
  position: relative;
  padding: 0 0 var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.ms-item::before {
  content: ''; position: absolute;
  left: -26px; top: 4px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--gold);
}
.ms-item.pending::before {
  background: var(--surface);
  border-color: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}
.ms-label { font-size: var(--t-base); font-weight: 600; color: var(--text-1); }
.ms-label.dimmed { color: var(--text-3); }
.ms-meta  { font-size: var(--t-sm); color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════
   STATS VIEW
══════════════════════════════════════════════════════════════ */
.stat-cards { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.stat-card {
  flex: 1; min-width: 130px;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--sp-2); padding: var(--sp-5) var(--sp-5);
  background: var(--surface); border: 1px solid var(--line-subtle);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.stat-card-icon { color: var(--accent); }
.stat-card-icon svg { width: 18px; height: 18px; }
.stat-card-val {
  font-family: var(--font-display);
  font-size: var(--t-3xl); font-weight: 600; color: var(--text-1);
  letter-spacing: -0.025em; line-height: 1;
}
.stat-card-label { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.stat-card-note  { font-size: var(--t-xs); color: var(--text-4); margin-top: calc(-1 * var(--sp-1)); }

.growth-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--sp-3); }
.growth-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.growth-table th {
  text-align: left; padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2); color: var(--text-3);
  font-size: var(--t-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.growth-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line-subtle);
  color: var(--text-2); white-space: nowrap;
}
.growth-table tr:last-child td { border-bottom: none; }
.growth-table td:first-child { font-weight: 600; color: var(--text-1); }
.table-note { font-size: var(--t-xs); color: var(--text-3); margin-top: var(--sp-3); }

.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3); }
.fav-card {
  padding: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line-subtle);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.fav-key   { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.fav-value { font-size: var(--t-base); font-weight: 500; color: var(--text-1); }
.fav-since { font-size: var(--t-xs); color: var(--text-4); }
.fav-empty { color: var(--text-4); font-style: italic; }

/* ══════════════════════════════════════════════════════════════
   GUESTBOOK VIEW
══════════════════════════════════════════════════════════════ */
.gb-form-wrap { max-width: 560px; }
.gb-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-field label { font-size: var(--t-sm); font-weight: 600; color: var(--text-1); }
.form-field input,
.form-field textarea {
  padding: 10px var(--sp-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); color: var(--text-1);
  outline: none; resize: vertical;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-4); }
.form-note { font-size: var(--t-xs); color: var(--text-3); }

.gb-success {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-3); padding: var(--sp-10) var(--sp-6); text-align: center;
}
.gb-success svg { width: 36px; height: 36px; color: var(--sage); }
.gb-success p { font-size: var(--t-base); color: var(--text-2); }

.gb-messages { display: flex; flex-direction: column; gap: var(--sp-4); }
.gb-msg {
  padding: var(--sp-5); background: var(--surface);
  border: 1px solid var(--line-subtle); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.gb-msg-header {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.gb-author { font-weight: 600; font-size: var(--t-base); color: var(--text-1); }
.gb-date   { font-size: var(--t-xs); color: var(--text-3); white-space: nowrap; }
.gb-text   { font-size: var(--t-base); line-height: 1.68; color: var(--text-2); }

/* ══════════════════════════════════════════════════════════════
   RECAP VIEW
══════════════════════════════════════════════════════════════ */
.recap-cover {
  background: linear-gradient(145deg, var(--accent-subtle), var(--sage-subtle));
  border-radius: var(--r-xl); padding: var(--sp-10) var(--sp-6);
  text-align: center; margin-bottom: var(--sp-9);
}
.recap-cover-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, var(--t-5xl));
  font-weight: 600; letter-spacing: -0.03em; color: var(--text-1);
  margin: var(--sp-2) 0;
}
.recap-cover-sub { font-size: var(--t-sm); color: var(--text-3); }

.recap-month-group { margin-bottom: var(--sp-9); }
.recap-month-head {
  font-family: var(--font-display);
  font-size: var(--t-xl); font-weight: 600; color: var(--text-1);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.recap-entries { display: flex; flex-direction: column; gap: var(--sp-5); }
.recap-entry {
  padding: var(--sp-5);
  background: var(--surface); border: 1px solid var(--line-subtle);
  border-radius: var(--r-md);
}
.recap-entry-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--sp-4); margin-bottom: var(--sp-2);
}
.recap-entry-title { font-weight: 600; font-size: var(--t-base); color: var(--text-1); }
.recap-entry-age   { font-size: var(--t-xs); color: var(--accent); font-weight: 700; white-space: nowrap; }
.recap-entry-cap   { font-size: var(--t-sm); color: var(--text-2); line-height: 1.65; margin-bottom: var(--sp-3); }
.recap-mini-photos {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px; border-radius: var(--r); overflow: hidden;
}
.recap-mini-photos .photo-cell { aspect-ratio: 4/3; }
