:root {
  --bg: #faf7f1;
  --ink: #2b2a26;
  --muted: #6b6862;
  --accent: #6b8a9a;
  --accent-deep: #4a6b7c;
  --rule: #d9d3c5;

  --serif-display: "Cormorant Garamond", "Garamond", "Georgia", serif;
  --serif-body: "EB Garamond", "Garamond", "Georgia", "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 1.125rem;
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 1.5rem 4rem;
}

@media (min-width: 720px) {
  .page {
    padding: 6rem 2rem 5rem;
  }
}

a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 200ms ease, color 200ms ease;
}

a:hover,
a:focus-visible {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Masthead ---------- */

.masthead {
  text-align: center;
}

.portrait {
  margin: 0 auto 2.25rem;
  max-width: 180px;
}

@media (min-width: 720px) {
  .portrait {
    max-width: 210px;
  }
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  box-shadow:
    0 1px 2px rgba(43, 42, 38, 0.08),
    0 12px 32px rgba(43, 42, 38, 0.12);
}

.name {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 5vw + 1rem, 3.5rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.dates {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
  letter-spacing: 0.02em;
}

/* ---------- Video links ---------- */

.video-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 0 auto;
}

@media (min-width: 560px) {
  .video-links {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
}

.video-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 17rem;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-family: var(--serif-display);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.video-link:hover,
.video-link:focus-visible {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.video-link__hint {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color 200ms ease;
}

.video-link:hover .video-link__hint,
.video-link:focus-visible .video-link__hint {
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Ornamental rule ---------- */

.ornament {
  position: relative;
  border: 0;
  height: 1.5rem;
  margin: 3.5rem auto;
  width: 100%;
  max-width: 360px;
  overflow: visible;
}

.ornament::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--rule) 20%,
    var(--rule) 80%,
    transparent 100%
  );
}

.ornament::after {
  content: "\2726";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 0.75rem;
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1;
}

/* ---------- Obituary ---------- */

.obituary p {
  margin: 0 0 1.35rem;
  text-align: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.obituary p:first-of-type::first-letter {
  font-family: var(--serif-display);
  font-size: 3.25rem;
  font-weight: 500;
  line-height: 0.95;
  float: left;
  padding: 0.35rem 0.55rem 0 0;
  color: var(--accent-deep);
}

.obituary p:last-of-type {
  margin-bottom: 0;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  margin-top: 2rem;
}

/* ---------- Sign-off ---------- */

.sign-off {
  text-align: center;
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0;
}

.sign-off p {
  margin: 0;
}

/* ---------- Print ---------- */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .video-links,
  .ornament {
    display: none;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
