/* Our Days — warm, calm family-album aesthetic */

:root {
  --paper:        #fbf7f2;
  --paper-2:      #f4ede4;
  --card:         #ffffff;
  --ink:          #2e2723;
  --ink-2:        #6b5f56;
  --ink-3:        #9a8b7f;
  --line:         #e9dfd3;
  --accent:       #c2603f;   /* terracotta */
  --accent-soft:  #f3e0d6;
  --heart:        #d4553f;
  --gold:         #c99a49;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --sh-1: 0 1px 2px rgba(60, 42, 30, .05), 0 2px 8px rgba(60, 42, 30, .045);
  --sh-2: 0 2px 6px rgba(60, 42, 30, .06), 0 14px 34px rgba(60, 42, 30, .09);
  --sh-3: 0 10px 26px rgba(40, 26, 16, .16), 0 40px 90px rgba(40, 26, 16, .22);

  --ease: cubic-bezier(.22, .68, .28, 1);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 620px at 12% -8%, #fdf3e8 0%, rgba(253,243,232,0) 62%),
    radial-gradient(1000px 560px at 92% 4%, #f6ece6 0%, rgba(246,236,230,0) 60%),
    var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }

svg { width: 100%; height: 100%; fill: none; stroke: currentColor;
      stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 247, 242, .82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 14px clamp(18px, 4vw, 40px);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }

.brand-mark {
  width: 34px; height: 34px; border-radius: 12px; flex: none;
  background: linear-gradient(145deg, #e8a87c 0%, #c2603f 55%, #9e5b6a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), var(--sh-1);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.brand-text em {
  font-style: normal; font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}

.nav { display: flex; gap: 4px; margin-left: auto; }

.nav-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-2);
  transition: background .22s var(--ease), color .22s var(--ease);
}
.nav-btn:hover { background: var(--paper-2); color: var(--ink); }
.nav-btn.is-active { background: var(--ink); color: #fdf8f2; }
.nav-btn.is-active .pill { background: rgba(255,255,255,.2); color: #fff; }

.pill {
  min-width: 21px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 700; text-align: center;
  transition: transform .3s var(--ease), background .22s var(--ease);
}
.pill.bump { transform: scale(1.34); }

.tools { display: flex; gap: 10px; align-items: center; }

.search { position: relative; display: flex; align-items: center; }
.search svg {
  position: absolute; left: 12px; width: 16px; height: 16px;
  color: var(--ink-3); pointer-events: none;
}
.search input {
  font: inherit; font-size: 14px;
  padding: 9px 14px 9px 35px; width: 236px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink);
  transition: box-shadow .22s var(--ease), border-color .22s var(--ease), width .28s var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus {
  outline: none; border-color: #dcc7b4;
  box-shadow: 0 0 0 4px rgba(194, 96, 63, .11);
}

#person {
  font: inherit; font-size: 14px;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  cursor: pointer;
}
#person:focus { outline: none; box-shadow: 0 0 0 4px rgba(194, 96, 63, .11); }

/* -------------------------------------------------------------------- page */

main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px) 96px; }

.view { animation: viewIn .42s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

.page-head { padding: clamp(36px, 6vw, 68px) 0 clamp(22px, 3vw, 34px); max-width: 720px; }
.eyebrow {
  margin: 0 0 10px; font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.page-head h1 { font-size: clamp(34px, 5.6vw, 54px); line-height: 1.06; }
.lede { margin: 14px 0 0; color: var(--ink-2); font-size: clamp(15px, 1.6vw, 17.5px); max-width: 62ch; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 26px; padding: 7px 14px 7px 9px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2); background: var(--paper-2);
  transition: background .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
}
.back svg { width: 16px; height: 16px; }
.back:hover { background: var(--accent-soft); color: var(--accent); transform: translateX(-2px); }

.btn {
  padding: 11px 22px; border-radius: 999px;
  background: var(--ink); color: #fdf8f2; font-size: 14.5px;
  box-shadow: var(--sh-1);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

.empty { color: var(--ink-3); font-size: 15.5px; padding: 40px 0; }

/* ------------------------------------------------------------- album cards */

.album-grid {
  display: grid; gap: clamp(18px, 2.4vw, 30px);
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.album-card {
  position: relative; display: block; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid rgba(233, 223, 211, .9);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: transform .34s var(--ease), box-shadow .34s var(--ease);
}
.album-card:hover { transform: translateY(-5px); box-shadow: var(--sh-2); }
.album-card:hover .album-cover img { transform: scale(1.055); }
.album-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.album-cover { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-2); }
.album-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .62s var(--ease), opacity .7s var(--ease);
}
.album-count {
  position: absolute; right: 12px; bottom: 12px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(30, 22, 18, .58); color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  backdrop-filter: blur(6px);
}

.album-body { padding: 18px 20px 21px; }
.album-body h2 { font-size: 21px; }
.album-body .sub { margin: 5px 0 0; color: var(--ink-2); font-size: 14px; }
.album-range {
  margin: 13px 0 0; display: flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.album-range::before {
  content: ""; width: 18px; height: 1px; background: var(--line); flex: none;
}

/* ------------------------------------------------------------- photo cards */

.photo-grid {
  display: grid; gap: clamp(14px, 2vw, 24px);
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}

.photo-card {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background: var(--card); box-shadow: var(--sh-1);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.photo-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }

.photo-open {
  display: block; width: 100%; padding: 0; text-align: left;
  aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-2);
}
.photo-open img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s var(--ease), opacity .7s var(--ease);
}
.photo-card:hover .photo-open img { transform: scale(1.05); }

.photo-meta { padding: 13px 15px 15px; padding-right: 50px; }
.photo-meta h3 {
  font-size: 15.5px; font-family: var(--sans); font-weight: 600;
  letter-spacing: 0; line-height: 1.35;
}
.photo-meta p {
  margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3);
  display: flex; gap: 7px; flex-wrap: wrap;
}

/* fade-in on load */
img.ph { opacity: 0; }
img.ph.loaded { opacity: 1; }

/* -------------------------------------------------------------------- heart */

.heart {
  position: absolute; right: 11px; bottom: 11px;
  width: 34px; height: 34px; padding: 7px; border-radius: 50%;
  color: var(--ink-3); background: rgba(255, 255, 255, .86);
  box-shadow: var(--sh-1);
  transition: transform .25s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.heart:hover { transform: scale(1.12); color: var(--heart); }
.heart.is-fav { color: var(--heart); }
.heart.is-fav svg { fill: var(--heart); }
.heart.pop { animation: pop .42s var(--ease); }
@keyframes pop {
  30% { transform: scale(1.34); }
  60% { transform: scale(.94); }
}

.heart-lg {
  position: static; width: 52px; height: 52px; padding: 13px; flex: none;
  color: rgba(255,255,255,.75); background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2); box-shadow: none;
}
.heart-lg:hover { background: rgba(255,255,255,.2); color: #ff8f77; }
.heart-lg.is-fav { color: #ff7a60; }
.heart-lg.is-fav svg { fill: #ff7a60; }

/* ----------------------------------------------------------------- timeline */

.jumpbar {
  position: sticky; top: 78px; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 16px;
  background: linear-gradient(to bottom, var(--paper) 62%, rgba(251,247,242,0));
}
.jumpbar label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
#year-jump {
  font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
#year-jump:focus { outline: none; box-shadow: 0 0 0 4px rgba(194,96,63,.11); }

.year-block { padding-bottom: 26px; scroll-margin-top: 150px; }

.year-heading {
  position: sticky; top: 132px; z-index: 18;
  display: flex; align-items: baseline; gap: 14px;
  padding: 10px 0 8px; margin: 22px 0 6px;
  background: linear-gradient(to bottom, var(--paper) 72%, rgba(251,247,242,0));
}
.year-heading h2 { font-size: clamp(28px, 4vw, 40px); color: var(--ink); }
.year-heading span { font-size: 13px; color: var(--ink-3); }

.month-heading {
  position: sticky; top: 190px; z-index: 16;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; margin: 18px 0 14px;
  background: linear-gradient(to bottom, var(--paper) 70%, rgba(251,247,242,0));
  font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.month-heading::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------- empty state */

.empty-state {
  text-align: center; padding: clamp(50px, 9vw, 96px) 24px;
  border: 1px dashed var(--line); border-radius: var(--r-xl);
  background: rgba(255, 255, 255, .55);
}
.empty-heart {
  width: 62px; height: 62px; margin: 0 auto 20px; padding: 13px;
  border-radius: 50%; color: var(--accent); background: var(--accent-soft);
}
.empty-state h2 { font-size: 25px; }
.empty-state p { color: var(--ink-2); margin: 9px 0 24px; }

/* ----------------------------------------------------------------- lightbox */

.viewer {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(14px, 3vw, 40px);
}
.viewer[hidden] { display: none; }

.viewer-scrim {
  position: absolute; inset: 0;
  background: rgba(24, 17, 13, .88);
  backdrop-filter: blur(10px);
  animation: fadeIn .28s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } }

.viewer-figure {
  position: relative; margin: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 18px;
  width: min(1120px, 100%); max-height: 100%;
  animation: viewerIn .36s var(--ease) both;
}
@keyframes viewerIn {
  from { opacity: 0; transform: translateY(16px) scale(.975); }
}

.viewer-stage {
  border-radius: var(--r-lg); overflow: hidden; background: #1b1512;
  box-shadow: var(--sh-3); min-height: 0;
}
.viewer-stage img {
  display: block; width: 100%; max-height: min(66vh, 720px);
  object-fit: contain; background: #1b1512;
  transition: opacity .3s var(--ease);
}

.viewer-caption {
  display: flex; align-items: flex-start; gap: 20px;
  color: #f6ece2;
}
.vc-text { flex: 1; min-width: 0; }
.vc-meta {
  margin: 0 0 6px; display: flex; gap: 9px; flex-wrap: wrap;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(246, 236, 226, .58);
}
.vc-meta .dot { opacity: .45; }
.viewer-caption h2 { font-size: clamp(21px, 3vw, 29px); color: #fff8f0; }
.vc-caption { margin: 8px 0 0; color: rgba(246, 236, 226, .78); font-size: 15px; max-width: 70ch; }
.vc-people { margin: 10px 0 0; font-size: 12.5px; color: rgba(246, 236, 226, .5); }

.vbtn {
  position: absolute; z-index: 3;
  width: 46px; height: 46px; padding: 13px; border-radius: 50%;
  color: #fff; background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.vbtn:hover { background: rgba(255, 255, 255, .26); transform: scale(1.07); }
.vbtn-close { top: clamp(12px, 2.4vw, 26px); right: clamp(12px, 2.4vw, 26px); }
.vbtn-prev { left: clamp(8px, 2vw, 22px); top: 50%; transform: translateY(-50%); }
.vbtn-next { right: clamp(8px, 2vw, 22px); top: 50%; transform: translateY(-50%); }
.vbtn-prev:hover, .vbtn-next:hover { transform: translateY(-50%) scale(1.07); }

/* ------------------------------------------------------------------- footer */

.foot {
  border-top: 1px solid var(--line); padding: 30px 0 46px; margin-top: 20px;
  text-align: center; color: var(--ink-3); font-size: 13px;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .topbar-inner { gap: 12px; padding: 12px 18px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .tools { order: 2; margin-left: auto; }
  .search input { width: 180px; }
  .jumpbar { top: 130px; }
  .year-heading { top: 184px; }
  .month-heading { top: 240px; }
}

@media (max-width: 620px) {
  .tools { order: 4; width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  #person { flex: none; }
  .nav-btn { padding: 8px 13px; font-size: 14px; }
  .album-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .photo-meta { padding: 11px 12px 13px; padding-right: 44px; }
  .photo-meta h3 { font-size: 14px; }
  .viewer { padding: 10px; }
  .viewer-caption { gap: 12px; }
  .viewer-stage img { max-height: 48vh; }
  .vbtn-prev { left: 4px; }
  .vbtn-next { right: 4px; }
  .jumpbar { top: 168px; }
  .year-heading { top: 222px; }
  .month-heading { top: 278px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
