/* Quiet on purpose. A memorial page should feel like paper, not like an
   app: generous margins, a serif for the words that matter, and nothing
   that moves or demands attention. */

:root {
  --bg: #faf8f5;
  --surface: #fffefc;
  --ink: #2b2724;
  --ink-soft: #6b6259;
  --rule: #e5ded4;
  --accent: #6d5642;
  --accent-soft: #f0e9df;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513;
    --surface: #201d1a;
    --ink: #ece7e1;
    --ink-soft: #a89e93;
    --rule: #35302b;
    --accent: #c9ab8b;
    --accent-soft: #2a2521;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 20px 96px;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 720px;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- masthead ---------------------------------------------------- */

.masthead {
  text-align: center;
  padding: 72px 0 40px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-family: system-ui, sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.lede {
  margin: 20px auto 0;
  max-width: 52ch;
  color: var(--ink-soft);
}

/* --- video ------------------------------------------------------- */

.video-section {
  margin-top: 24px;
}

.video-frame {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
}

video {
  display: block;
  width: 100%;
  /* The recording is 16:9; reserving the box up front stops the page
     jumping once metadata loads. */
  aspect-ratio: 16 / 9;
  background: #000;
}

/* Quality picker. Deliberately plain text buttons rather than a select:
   there are only ever two, and both should be visible at a glance. */
.quality-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quality-label {
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.quality-buttons {
  display: flex;
  gap: 8px;
}

.quality-buttons button {
  padding: 6px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.quality-buttons button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

.video-actions {
  text-align: center;
  margin-top: 22px;
}

.downloads {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.download {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: opacity 150ms ease;
}

.download:hover {
  opacity: 0.88;
}

.note {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-family: system-ui, sans-serif;
}

.note strong {
  font-weight: 600;
  color: var(--ink);
}

.quiet {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* --- photographs -------------------------------------------------- */

.slideshow {
  margin-top: 76px;
  border-top: 1px solid var(--rule);
  padding-top: 44px;
}

.slideshow[hidden] {
  display: none;
}

.slideshow h2 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 400;
  text-align: center;
}

.slideshow .lede {
  text-align: center;
  margin-top: 10px;
}

/* A fixed stage, because the photographs are a mix of portrait and
   landscape -- letting the box follow each image would make the page
   jump every time it advanced. object-fit keeps them whole rather than
   cropping someone out of the edge of the frame. */
.stage {
  position: relative;
  margin-top: 26px;
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  border-radius: 10px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 220ms ease;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  border: none;
  cursor: pointer;
}

.arrow:hover {
  background: rgba(0, 0, 0, 0.62);
}

.prev {
  left: 10px;
}

.next {
  right: 10px;
}

.stage-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.play {
  padding: 8px 20px;
  font-size: 0.9rem;
}

.counter {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 2px 6px;
  scrollbar-width: thin;
}

.filmstrip img {
  height: 62px;
  width: auto;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 150ms ease;
  flex: 0 0 auto;
}

.filmstrip img:hover {
  opacity: 0.85;
}

.filmstrip img.current {
  opacity: 1;
  border-color: var(--accent);
}

/* --- book of remembrance ----------------------------------------- */

.book {
  margin-top: 76px;
  border-top: 1px solid var(--rule);
  padding-top: 44px;
}

.book h2 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 400;
  text-align: center;
}

.book .lede {
  text-align: center;
}

.comment-form {
  margin: 32px 0 44px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 22px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

input,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

button {
  padding: 11px 24px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 150ms ease;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.form-status {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.form-status[hidden] {
  display: none;
}

/* --- the notes themselves ---------------------------------------- */

.comments {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent-soft);
  border-radius: 8px;
  padding: 18px 20px;
}

.comment-message {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-meta {
  margin: 12px 0 0;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.comment-name {
  font-weight: 600;
  color: var(--ink);
}
