/*
 * Tellara editorial palette + typography.
 * Matches apps/tellara/src/constants/palette.ts so the mobile app and the
 * public memorial pages read as one visual system.
 */
:root {
  --paper: #f7efdc;
  --paper-inset: #f1e7cd;
  --paper-card: #fffcf4;
  --ink: #2c3320;
  --ink-muted: #6b7355;
  --ink-faint: #9aa17f;
  --olive: #7a8450;
  --olive-deep: #4f5b30;
  --terra: #bc5b33;
  --terra-soft: #c9714d;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
}

/* ────────────────────────────────────────────────────────────────
   Memorial page
   ──────────────────────────────────────────────────────────────── */

.memorial {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.75rem 5rem;
}

.memorial-header {
  text-align: center;
  padding-bottom: 2.5rem;
}

.memorial-header .name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.15;
  color: var(--olive-deep);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.memorial-header .dates {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--ink-muted);
  margin: 0 0 0.35rem;
  letter-spacing: 0.02em;
}

.memorial-header .place {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
  font-style: italic;
}

.memorial-header .roles {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-top: 1px solid var(--olive);
  border-bottom: 1px solid var(--olive);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 500;
  margin: 0;
}

/* Personal epigraph — a line he actually said, treated as a quiet
   editorial aside between the dates and the photo. Not a caption; not a
   category label. Italic Fraunces, generous line-height, muted colour. */
.memorial-header .epigraph {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 1.5rem auto 0;
  padding: 0 1rem;
  max-width: 26rem;
  position: relative;
}

/* Tiny olive rule above the epigraph — same purpose as the roles line's
   frame, half the weight. */
.memorial-header .epigraph::before {
  content: "";
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--olive);
  opacity: 0.35;
  margin: 0 auto 1.2rem;
}

.portrait {
  margin: 0 0 3rem;
  padding: 0;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow:
    0 1px 3px rgba(44, 51, 32, 0.08),
    0 10px 40px rgba(44, 51, 32, 0.1);
}

.portrait figcaption {
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-faint);
  margin-top: 0.85rem;
  letter-spacing: 0.02em;
}

/* ────────────────────────────────────────────────────────────────
   Story body — editorial, generous, quiet.
   ──────────────────────────────────────────────────────────────── */

.story h2 {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--olive-deep);
  text-align: center;
  margin: 0 0 2rem;
}

.story p {
  margin: 0 0 1.35rem;
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.72;
}

.story p:first-of-type::first-letter {
  font-family: "Fraunces", Georgia, serif;
  font-size: 3.2rem;
  line-height: 1;
  float: left;
  margin: 0.25rem 0.6rem 0 0;
  color: var(--olive-deep);
  font-weight: 500;
}

/* Section divider — a thin quiet rule the eye slides past. */
.divider {
  border: 0;
  height: 1px;
  background: var(--olive);
  opacity: 0.18;
  margin: 3rem auto;
  max-width: 4rem;
}

/* ────────────────────────────────────────────────────────────────
   Survived-by
   ──────────────────────────────────────────────────────────────── */

.survived {
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.survived .survived-heading {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.survived p {
  margin: 0.25rem 0;
}

.survived .names {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  color: var(--ink);
  font-size: 1rem;
}

/* ────────────────────────────────────────────────────────────────
   Tellara mark — subtle attribution, not a watermark.
   ──────────────────────────────────────────────────────────────── */

.tellara-mark {
  margin-top: 4rem;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.tellara-mark .tellara {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--olive-deep);
  margin-left: 0.4rem;
  vertical-align: baseline;
}

/* ────────────────────────────────────────────────────────────────
   Landing (index.html)
   ──────────────────────────────────────────────────────────────── */

.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.landing .wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 3.5rem;
  color: var(--olive-deep);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.landing .tagline {
  font-family: "Jost", -apple-system, sans-serif;
  font-size: 1rem;
  color: var(--ink-muted);
  max-width: 22rem;
  margin: 0 auto;
  line-height: 1.55;
}

/* ────────────────────────────────────────────────────────────────
   Redirect page — briefly-visible spinner.
   ──────────────────────────────────────────────────────────────── */

.redirect {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--ink-muted);
}

.redirect .wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 2rem;
  color: var(--olive-deep);
  margin: 0 0 1.5rem;
}

.redirect .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--paper-inset);
  border-top-color: var(--olive-deep);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.redirect .message {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.redirect .fallback {
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.redirect .fallback a {
  color: var(--terra);
  text-decoration: none;
  border-bottom: 1px solid rgba(188, 91, 51, 0.35);
}

/* ────────────────────────────────────────────────────────────────
   Small-screen niceties (phones scanning the QR).
   ──────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }
  .memorial {
    padding: 2rem 1.25rem 3.5rem;
  }
  .memorial-header .name {
    font-size: 2rem;
  }
  .memorial-header .roles {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
  }
  .story h2 {
    font-size: 1.35rem;
  }
  .story p:first-of-type::first-letter {
    font-size: 2.6rem;
  }
  .landing .wordmark {
    font-size: 2.6rem;
  }
}
