/* ==========================================================================
   EDIT ME: colors, fonts, and spacing all live in this one block.
   Change these and the whole page follows.

   The design is deliberately flat: no gradients, no shadows, no rounded
   corners, no animation. Structure comes from hairline rules, alignment,
   and type size — not from boxes.
   ========================================================================== */

:root {
  color-scheme: light;

  --color-bg: #faf7f2;
  --color-border: #e4ddd2;
  --color-text: #1f1a16;
  --color-text-muted: #6f655b;
  --color-accent: #8a5a3c;

  --font-sans:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  --font-serif:
    'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia,
    'Times New Roman', serif;

  --rule: 1px solid var(--color-border);
  --page-width: 36rem;
  --gutter: 1.5rem;
}

/* Dark theme. Two selectors so it works from the operating system setting on
   its own, and from the toggle button. Keep these blocks in sync. */

:root[data-theme='dark'] {
  color-scheme: dark;

  --color-bg: #15120f;
  --color-border: #2e2822;
  --color-text: #f3ede5;
  --color-text-muted: #a89d90;
  --color-accent: #d9a77f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --color-bg: #15120f;
    --color-border: #2e2822;
    --color-text: #f3ede5;
    --color-text-muted: #a89d90;
    --color-accent: #d9a77f;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--gutter);
  translate: 0 -200%;
  padding: 0.5rem 0.75rem;
  border: var(--rule);
  background: var(--color-bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 2;
}

.skip-link:focus-visible {
  translate: 0 0;
}

/* The sprite holds icon definitions only and must never take up space. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Small uppercase section label. */
.label {
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.page {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding: clamp(3.5rem, 12vh, 7rem) var(--gutter) 4rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding-bottom: 2.5rem;
  border-bottom: var(--rule);
  text-align: center;
}

.hero__names {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 11vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.hero__amp {
  color: var(--color-accent);
  font-style: italic;
}

.hero__date {
  margin-top: 1rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* ==========================================================================
   Letter
   ========================================================================== */

.letter {
  margin-top: 2.5rem;
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.letter p + p {
  margin-top: 1rem;
}

.letter__greeting {
  font-style: italic;
}

.letter--closing {
  margin-top: 3rem;
}

.letter__signoff {
  color: var(--color-text-muted);
}

.letter__signature {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-text);
  font-size: 1.625rem;
  font-style: italic;
}

/* ==========================================================================
   Details — hairline rows, no cards
   ========================================================================== */

.details {
  margin: 2.5rem 0 0;
  border-top: var(--rule);
}

.detail {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.375rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: var(--rule);
}

.detail dt {
  padding-top: 0.3rem;
}

.detail dd {
  margin: 0;
  min-width: 0;
}

.detail__main {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.detail__note {
  margin-top: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-style: normal;
}

.detail__link {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

.detail__link a {
  text-underline-offset: 3px;
}

@media (max-width: 30rem) {
  .detail {
    grid-template-columns: 1fr;
  }

  .detail dt {
    padding-top: 0;
  }
}

/* ==========================================================================
   Toolbar (theme toggle + copy link)
   ========================================================================== */

.toolbar {
  position: fixed;
  top: var(--gutter);
  right: var(--gutter);
  display: flex;
  gap: 0.5rem;
  z-index: 1;
}

.toolbar__button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: var(--rule);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
}

.toolbar__button:hover {
  color: var(--color-text);
}

/* Show the sun in light mode and the moon in dark mode. Both icons live in
   the same button so its size never shifts when the theme changes. */
.icon--dark {
  display: none;
}

:root[data-theme='dark'] .icon--light {
  display: none;
}

:root[data-theme='dark'] .icon--dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon--light {
    display: none;
  }

  :root:not([data-theme='light']) .icon--dark {
    display: block;
  }
}

.detail__main a {
  text-underline-offset: 3px;
}
