:root {
  color-scheme: light;
  /* "Letters Home" palette — matches the PDF edition */
  --paper: #FFFDF9;
  --ink: #2D2926;
  --heading: #1E3A4F;
  --meta: #7A7570;
  --light-meta: #A09A94;
  --line: #E0DCD5;
  --gold: #C9A96E;
  --gold-deep: #B08F52;
  --butterfly: #0066A1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; }
button, input { font: inherit; }
button {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  padding: 0 26px;
  background: var(--heading);
  color: #FFFDF9;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}
button:hover { background: #16405c; }
button:disabled { opacity: 0.6; cursor: default; }
input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
}
input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

/* ---------- Shared cover language ---------- */
.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-deep);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.gold-rule {
  width: 88px;
  height: 2px;
  margin: 22px auto;
  border: 0;
  background: var(--gold);
}
.gold-rule.short { width: 56px; margin: 16px auto; }
h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(2.15rem, 7vw, 3.65rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.subtitle {
  margin: 0;
  color: var(--meta);
  font-size: clamp(1.05rem, 3.6vw, 1.25rem);
  font-style: italic;
  line-height: 1.5;
}
.framed-photo {
  width: min(100%, 380px);
  margin: 0 auto;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(30, 58, 79, 0.12);
}
.framed-photo img {
  display: block;
  width: 100%;
  height: auto;
}
.butterfly {
  display: inline-block;
  width: 44px;
  height: auto;
  opacity: 0.9;
  vertical-align: middle;
}
.footer-butterfly { width: 34px; }

/* ---------- Login ---------- */
.login-page {
  display: grid;
  min-height: 100svh;
  padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  place-items: center;
}
.login-cover {
  width: min(100%, 560px);
  text-align: center;
}
.login-cover .framed-photo { width: min(78vw, 260px); }
.login-cover .names {
  margin: 16px 0 0;
  color: var(--heading);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.login-cover .occasion {
  margin: 2px 0 0;
  color: var(--light-meta);
  font-style: italic;
  font-size: 0.95rem;
}
.login-form {
  display: grid;
  gap: 14px;
  width: min(100%, 380px);
  margin: 26px auto 0;
  text-align: left;
}
.login-form label {
  display: grid;
  gap: 6px;
  color: var(--meta);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.form-error {
  min-height: 1.3em;
  margin: 0;
  color: #8B3A4A;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.login-footnote {
  margin: 18px 0 0;
  color: var(--light-meta);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Site chrome ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(14px);
}
.brand {
  color: var(--heading);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.ghost-button {
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  color: var(--heading);
  border: 1px solid var(--line);
}
.ghost-button:hover { background: #F4F0E8; }
main {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 0 20px 56px;
}

/* ---------- Cover hero ---------- */
.cover {
  padding: clamp(28px, 6vh, 54px) 0 8px;
  text-align: center;
}
.cover .names {
  margin: 20px 0 0;
  color: var(--heading);
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cover .occasion {
  margin: 3px 0 0;
  color: var(--light-meta);
  font-style: italic;
  font-size: 1rem;
}
.stats-line {
  margin: 0;
  color: var(--light-meta);
  font-style: italic;
  font-size: 0.98rem;
}

.cover-actions {
  display: flex;
  justify-content: center;
  margin: 22px 0 0;
}
.primary-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 22px;
  background: var(--heading);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.primary-link:hover { background: #16405c; }

.cover .butterfly { margin-top: 26px; }

/* ---------- Sections ---------- */
section { padding-top: clamp(34px, 6vh, 56px); }
.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 30px;
}
.section-head h2 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(1.7rem, 5.6vw, 2.3rem);
  font-weight: 400;
  line-height: 1.1;
}
.section-head .section-note {
  margin: 12px 0 0;
  color: var(--meta);
  font-style: italic;
  font-size: 1rem;
}

/* Collections */
.contents-grid {
  display: grid;
  gap: 16px;
}
.content-card {
  padding: 26px 22px 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  text-align: center;
}
.numeral {
  display: block;
  color: var(--gold-deep);
  font-size: 1rem;
  letter-spacing: 0.3em;
  margin-bottom: 8px;
}
.content-card h3 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.15;
}
.content-card p {
  margin: 0;
  color: var(--meta);
  font-size: 0.98rem;
  line-height: 1.55;
}
.chip {
  display: inline-block;
  margin-top: 14px;
  color: var(--light-meta);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Featured memory */
.spotlight-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(30, 58, 79, 0.1);
}
.spotlight-photo {
  display: block;
  width: 100%;
  height: min(58vw, 300px);
  object-fit: cover;
}
.spotlight-copy {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 28px 24px 30px;
  text-align: center;
}
.spotlight-copy .card-kicker {
  color: var(--gold-deep);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.spotlight-copy h3 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  font-weight: 400;
  line-height: 1.12;
}
.spotlight-copy p {
  margin: 0;
  color: var(--meta);
  font-size: 1rem;
  line-height: 1.6;
}
.spotlight-note {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-style: italic;
  font-size: 0.94rem;
  color: var(--light-meta);
}

/* Colophon & footer */
.colophon {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}
.colophon p {
  margin: 0;
  color: var(--meta);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.65;
}
.site-footer {
  margin-top: clamp(48px, 8vh, 76px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-footer p {
  margin: 10px 0 0;
  color: var(--light-meta);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

/* ---------- Wider screens ---------- */
@media (min-width: 600px) {
  .contents-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 880px) {
  .contents-grid { grid-template-columns: repeat(3, 1fr); }
  .spotlight-card { grid-template-columns: 0.85fr 1.15fr; }
  .spotlight-photo { height: 100%; }
  .spotlight-copy { padding: 36px 34px; }
}


/* ---------- Archive sample ---------- */
.archive-page {
  max-width: 900px;
}
.archive-hero {
  padding: clamp(34px, 7vh, 64px) 0 22px;
  text-align: center;
}
.provenance {
  margin: 16px auto 0;
  max-width: 560px;
  color: var(--light-meta);
  font-family: var(--sans);
  font-size: 0.82rem;
}
.letter-list {
  display: grid;
  gap: 22px;
  padding-top: 18px;
}
.letter-card {
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30, 58, 79, 0.07);
}
.letter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  color: var(--light-meta);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.letter-number {
  color: var(--gold-deep);
}
.letter-card h2 {
  margin: 12px 0 16px;
  color: var(--heading);
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 400;
  line-height: 1.16;
}
.letter-body p {
  margin: 0 0 1em;
  color: var(--ink);
}
.letter-images {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.letter-images img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}
.link-chip {
  text-decoration: none;
}
.link-chip:hover {
  color: var(--heading);
}
@media (min-width: 720px) {
  .letter-images { grid-template-columns: repeat(2, 1fr); }
}
