/* Shared styles for the static letter pages (/letters and theme pages).
   Visual language matches index.html. */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/CormorantGaramond-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/CormorantGaramond-Italic-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/InstrumentSans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FDF8F3;
  --paper: #FFFCF8;
  --text: #2C2318;
  --muted: #7E6B55;
  --accent: #C4785A;
  --accent-text: #A65D41;
  --accent2: #8B4F3A;
  --soft: #EDE0D0;
  --line: rgba(196,120,90,0.2);
  --glow-1: rgba(196,120,90,0.07);
  --glow-2: rgba(245,200,160,0.1);
  color-scheme: light;
}

/* Night mode (set by /site.js) */
:root[data-theme="dark"] {
  --bg: #17110D;
  --paper: #221A14;
  --text: #F3E8DA;
  --muted: #A99680;
  --accent: #D98E6E;
  --accent-text: #E8A585;
  --accent2: #E3A688;
  --soft: #3A2C22;
  --line: rgba(217,142,110,0.2);
  --glow-1: rgba(255,176,96,0.12);
  --glow-2: rgba(217,142,110,0.06);
  color-scheme: dark;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, var(--glow-1) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 80% 90%, var(--glow-2) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 2.5rem;
}
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
}
.logo span { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 1rem; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid rgba(196,120,90,0.25);
  border-radius: 50px;
  color: var(--muted);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
[hidden] { display: none !important; }
.link-btn {
  background: none; border: none; cursor: pointer;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
.link-btn:hover { color: var(--text); }

.header-link {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.header-link:hover { color: var(--text); }

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

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 3rem;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.headline {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}
.lede p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
  max-width: 560px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 50px;
  padding: 0.95rem 2rem;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-top: 1rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(139,79,58,0.25);
}
.btn svg { width: 15px; height: 15px; opacity: 0.75; }
.btn, .chip, .theme-toggle { white-space: nowrap; }

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.5rem;
  margin: 4rem 0 1.5rem;
}

.letter {
  background: var(--paper);
  border: 1px solid rgba(196,120,90,0.15);
  border-radius: 4px 4px 4px 28px;
  padding: 2.4rem 2.8rem;
  position: relative;
  box-shadow: 0 2px 8px rgba(196,120,90,0.06), 0 20px 60px rgba(139,79,58,0.08);
  margin-bottom: 1.6rem;
}
.letter::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  border-radius: 0 4px 0 0;
}
.letter-salutation, .letter-closing {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--muted);
}
.letter-salutation { margin-bottom: 1.1rem; }
.letter-closing { text-align: right; margin-top: 1.3rem; }
.letter-body {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  line-height: 1.6;
}

.cta {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.chip {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 50px;
  border: 1px solid rgba(196,120,90,0.25);
  background: rgba(196,120,90,0.04);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.25s ease;
}
.chip:hover { border-color: var(--accent); background: rgba(196,120,90,0.1); }

.theme-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  height: 100%;
  padding: 1.6rem 1.7rem;
  background: var(--paper);
  border: 1px solid rgba(196,120,90,0.15);
  border-radius: 4px 4px 4px 22px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(196,120,90,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}
.theme-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(139,79,58,0.1);
}
.theme-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  line-height: 1.2;
}
.theme-excerpt {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  flex: 1;
}
.theme-more {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3rem;
}
.disclaimer a { color: var(--accent-text); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  justify-content: center;
  padding: 2rem 1.5rem 2.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-help { text-decoration: underline !important; text-underline-offset: 3px; }

@media (max-width: 600px) {
  .site-header { padding: 1.4rem 1.5rem; }
  .page { padding-top: 1.5rem; }
  .crumbs { margin-bottom: 2rem; }
  .letter { padding: 1.8rem 1.6rem; }
  .site-footer { flex-direction: column; align-items: center; gap: 0.5rem; }
}

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