/* monsoonteardrops.com — warm paper, ink type, photographs first */
:root {
  --bg: #f3efe7; --surface: #ebe5da; --ink: #1f1c18; --muted: #6b6459; --line: #d9d1c3;
  --accent: #9a3f1c; --accent-ink: #fff8f0;
  --dark: #141210; --dark-ink: #ebe5d9; --dark-muted: #9d958a;
  --font-display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  --text-xs: 0.8125rem; --text-sm: 0.9375rem; --text-base: 1.0625rem; --text-lg: 1.25rem;
  --text-xl: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); --text-hero: clamp(2.6rem, 1.6rem + 4.2vw, 5.25rem);
  --gutter: clamp(1.25rem, 4vw, 3rem); --max: 1360px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--text-base)/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; margin: 0; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.wordmark { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; text-decoration: none; letter-spacing: -0.01em; }
.wordmark span { color: var(--accent); }
.site-header nav { display: flex; gap: clamp(.9rem, 3vw, 2.25rem); }
.site-header nav a { font-size: var(--text-sm); text-decoration: none; color: var(--muted); padding: .7rem 0; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); }
.site-header nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }

/* home */
.hero-text { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem 3rem; padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: clamp(2.5rem, 6vw, 5rem); align-items: end; }
.hero-text h1 { font-size: var(--text-hero); grid-row: span 2; }
.lede { font-size: var(--text-lg); line-height: 1.5; color: var(--muted); max-width: 40ch; margin: 0; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 0; font-size: var(--text-sm); color: var(--muted); }
.button { display: inline-flex; align-items: center; min-height: 46px; padding: 0 1.3rem; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500; border-radius: 2px; }
.button:hover { background: var(--accent); color: var(--accent-ink); }
.section { padding-bottom: clamp(3rem, 7vw, 6rem); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.5rem; margin-bottom: 1.75rem; }
.section-head h2 { font-size: var(--text-xl); }
.section-head a { font-size: var(--text-sm); color: var(--muted); }

.tribute { background: var(--surface); border-top: 1px solid var(--line); }
.tribute-inner { max-width: 640px; padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(3rem, 7vw, 5.5rem); text-align: center; font-family: var(--font-display); }
.tribute-inner p { margin: 0 0 1.4rem; font-size: var(--text-base); line-height: 1.75; }
.blossom { margin: 0 auto 1.25rem; width: 180px; }
.blossom img { width: 180px; height: 180px; object-fit: cover; filter: grayscale(1); }
.tribute-name { font-size: var(--text-lg) !important; }
.lyric-title { font-size: var(--text-lg) !important; margin-top: 2rem !important; }
.lyric-credit { font-family: var(--font-body); font-size: var(--text-sm) !important; color: var(--muted); }
.memory { font-size: var(--text-xl) !important; margin-top: 2.5rem !important; line-height: 1.2 !important; }

/* cards */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 2.25rem 1.5rem; }
.card a { display: block; text-decoration: none; }
.card-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); margin-bottom: .8rem; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.card a:hover img { transform: scale(1.03); }
.card-title { display: block; font-weight: 500; line-height: 1.35; }
.card a:hover .card-title { color: var(--accent); }
.card-meta { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: .25rem; }

/* galleries index */
.page-head { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: 2rem; }
.page-head h1 { font-size: var(--text-xl); max-width: 30ch; }
.page-head .lede { margin-top: .9rem; }
.page-head .meta, .prose .meta { font-size: var(--text-xs); color: var(--muted); margin: 1rem 0 0; letter-spacing: .02em; }
.filter { margin-top: 2rem; max-width: 560px; }
.filter input { width: 100%; min-height: 48px; padding: 0 1rem; font: inherit; font-size: var(--text-sm); color: var(--ink); background: #fbf9f5; border: 1px solid var(--line); border-radius: 2px; }
.filter input:focus { outline: none; border-color: var(--ink); }
.filter-count { font-size: var(--text-xs); color: var(--muted); margin: .5rem 0 0; min-height: 1.2em; }
.year-nav { display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin-top: 1rem; }
.year-nav a { font-size: var(--text-xs); text-decoration: none; color: var(--muted); border: 1px solid var(--line); padding: .35rem .7rem; border-radius: 2px; }
.year-nav a:hover { color: var(--ink); border-color: var(--ink); }
.year-group { border-top: 1px solid var(--line); padding: 1.5rem 0 3.5rem; display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.5rem; scroll-margin-top: 80px; }
.year-label { font-size: var(--text-xl); position: sticky; top: 88px; align-self: start; }
.year-label small { display: block; font-family: var(--font-body); font-size: var(--text-xs); color: var(--muted); font-weight: 400; margin-top: .4rem; letter-spacing: 0; }
.no-results { color: var(--muted); padding: 2rem 0 4rem; }

/* gallery: justified rows */
.crumbs { font-size: var(--text-xs); color: var(--muted); margin: 0 0 1rem; display: flex; gap: .5rem; }
.crumbs a { text-decoration: none; }
.justified { list-style: none; margin: 0 0 clamp(3rem, 7vw, 6rem); padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.justified::after { content: ''; flex-grow: 999999; }
.justified li { min-width: 0; flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * 230px); aspect-ratio: var(--r); background: var(--surface); overflow: hidden; }
.justified a { display: block; height: 100%; }
.justified img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.justified a:hover img { opacity: .88; }

/* prose pages */
.prose { max-width: 720px; padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(3rem, 7vw, 6rem); }
.prose h1 { font-size: var(--text-xl); margin-bottom: 1.5rem; }
.prose h2 { font-family: var(--font-body); font-size: var(--text-lg); font-weight: 600; margin: 2.25rem 0 .5rem; }
.prose p { margin: 0 0 1.1rem; }
.portrait { margin: 1.75rem 0; }
.portrait img { width: 200px; height: 200px; object-fit: cover; }
.contact-email { font-family: var(--font-display); font-size: var(--text-xl); margin: 1.75rem 0 !important; }

/* footer */
.site-footer { border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-top: 1.75rem; padding-bottom: 2rem; }
.footer-row p { margin: 0; }
.footer-links { display: flex; gap: 1.25rem; }

/* photo viewer: neutral grey surround; title bar and arrows sit against the photo */
.viewer { --viewer-bg: #6b6b6b; --viewer-ink: #ffffff; --viewer-muted: #e4e4e4; --arrow: 56px;
  background: var(--viewer-bg); color: var(--viewer-ink); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.viewer main { flex: 1; display: flex; flex-direction: column; }
.viewer-stage { flex: 1; margin: 0; display: flex; align-items: center; justify-content: center; padding: 1rem calc(var(--gutter) / 2) 1.5rem; }
.viewer-frame { display: grid; grid-template-columns: var(--arrow) auto var(--arrow); align-items: center; }
.viewer-bar { grid-column: 2; width: 0; min-width: 100%; display: flex; align-items: center; gap: 1rem; min-height: 44px; font-size: var(--text-sm); color: var(--viewer-muted); }
.viewer-bar a { text-decoration: none; color: var(--viewer-ink); }
.viewer-back { flex: 1; min-width: 0; width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: .6rem 0; }
.viewer-back:hover, .viewer-close:hover { text-decoration: underline; }
.viewer-count { font-variant-numeric: tabular-nums; }
.viewer-close { font-size: 1.75rem; line-height: 1; width: 44px; height: 44px; display: grid; place-items: center; margin-right: -12px; }
.viewer-frame img { grid-column: 2; display: block; width: auto; height: auto;
  max-height: calc(100dvh - 170px); max-width: calc(100vw - 2 * var(--arrow) - var(--gutter)); box-shadow: 0 2px 14px rgba(0,0,0,.25); }
.viewer-frame figcaption { grid-column: 2; width: 0; min-width: 100%; text-align: center; display: grid; gap: .3rem; padding-top: 1rem; }
.viewer-caption { font-family: var(--font-display); font-size: var(--text-lg); color: var(--viewer-ink); line-height: 1.35; }
.viewer-file { font-size: var(--text-xs); color: var(--viewer-muted); }
.viewer-prev, .viewer-next { grid-row: 2; align-self: stretch; display: flex; align-items: center; text-decoration: none; color: var(--viewer-ink); opacity: .6; transition: opacity .2s; }
.viewer-prev { grid-column: 1; justify-content: flex-end; padding-right: .6rem; }
.viewer-next { grid-column: 3; justify-content: flex-start; padding-left: .6rem; }
a.viewer-prev:hover, a.viewer-next:hover, a.viewer-prev:focus-visible, a.viewer-next:focus-visible { opacity: 1; }
.viewer-prev span, .viewer-next span { font-size: 3rem; line-height: 1; font-family: var(--font-body); font-weight: 300; }

.preview-flag { position: fixed; left: 12px; bottom: 12px; z-index: 50; background: var(--accent); color: var(--accent-ink); font-size: 12px; padding: .35rem .7rem; border-radius: 2px; pointer-events: none; }

@media (max-width: 860px) {
  .hero-text { grid-template-columns: 1fr; }
  .hero-text h1 { grid-row: auto; }
  .year-group { grid-template-columns: 1fr; gap: 1rem; }
  .year-label { position: static; }
}
@media (max-width: 560px) {
  .wordmark { font-size: 1.1rem; }
  .site-header nav { gap: .75rem; }
  .header-row { gap: .5rem; }
  .wordmark { font-size: 1.02rem; white-space: nowrap; }
  .justified li { flex-basis: calc(var(--r) * 130px); }
  .justified { gap: 5px; }
  .viewer { --arrow: 34px; }
  .viewer-prev span, .viewer-next span { font-size: 2.25rem; }
  .viewer-frame img { max-height: calc(100dvh - 200px); }
  .card-grid { gap: 1.75rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-title { font-size: var(--text-sm); }
}
