/* ==========================================================================
   About page - letter layout
   --------------------------------------------------------------------------
   The about page is written as a single letter. Paper colours are defined
   here (not in base/variables.css) because they are only used on this page.
   Dark mode is scoped to .about-page, matching the pattern in landing.css.
   ========================================================================== */

.about-page .landing-header nav a[aria-current='page'] {
  color: var(--landing-accent);
}

.about-page {
  --letter-surround: #f8f9fc;
  --letter-page: #f5f3ee;
  --letter-paper: #fffcf7;
  --letter-paper-edge: #e8e1d6;
  --letter-ink: #222b35;
  --letter-ink-soft: #514a43;
  --letter-ink-faint: #887d70;
  --letter-rule: #e4dcd0;
  --letter-seal: #438fb9;
  --letter-signature-font:
    'Segoe Script', 'Bradley Hand', 'Brush Script MT', 'Segoe Print', cursive;
  background: var(--letter-page);
}

@media (prefers-color-scheme: dark) {
  .about-page {
    --letter-surround: #0d1117;
    --letter-page: #101721;
    --letter-paper: #131a24;
    --letter-paper-edge: #232c3a;
    --letter-ink: #e6eaf0;
    --letter-ink-soft: #b0bac8;
    --letter-ink-faint: #8792a2;
    --letter-rule: #2a3444;
    --letter-seal: #8fd3f7;
  }
}

@media (min-width: 768px) {
  body.about-page {
    background: var(--letter-surround);
  }

  .about-page .landing-shell {
    width: min(1180px, calc(100% - 80px));
    background-color: var(--letter-page);
    background-image:
      linear-gradient(to bottom, var(--letter-surround), transparent 80px),
      linear-gradient(
        to right,
        var(--letter-surround),
        var(--letter-page) min(96px, 8vw),
        var(--letter-page) calc(100% - min(96px, 8vw)),
        var(--letter-surround)
      );
  }
}

.about-main {
  display: block;
  padding: 64px 0 80px;
}

/* ---------- Letter shell ---------- */

.about-page .letter {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto;
}

.about-page .letter-paper {
  position: relative;
  padding: 64px 52px 80px;
  border: 1px solid var(--letter-paper-edge);
  border-radius: 6px;
  color: var(--letter-ink);
  background: var(--letter-paper);
  box-shadow: 0 2px 12px rgba(24, 20, 12, 0.035);
}

/* Red margin rule, like ruled letter paper. */
.about-page .letter-paper::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(14px, 3.4vw, 38px);
  width: 1px;
  background: color-mix(in srgb, var(--letter-seal) 26%, transparent);
}

/* ---------- Meta line ---------- */

.about-page .letter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px clamp(14px, 3vw, 26px);
  margin: 0 0 clamp(24px, 4vw, 36px);
  padding-bottom: clamp(16px, 2.6vw, 22px);
  border-bottom: 1px solid var(--letter-rule);
  color: var(--letter-ink-faint);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-page .letter-meta span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.about-page .letter-meta em {
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--letter-ink-soft);
  text-transform: none;
}

/* ---------- Salutation ---------- */

.about-page .letter-salutation {
  margin: 0 0 clamp(20px, 3vw, 26px);
  color: var(--letter-ink);
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.55rem, 3.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.16;
  text-wrap: balance;
}

/* ---------- Body ---------- */

.about-page .letter-body p {
  margin: 0 0 1.15em;
  color: var(--letter-ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.075rem);
  line-height: 1.85;
}

.about-page .letter-body p:last-child {
  margin-bottom: 0;
}

.about-page .letter-body strong {
  color: var(--letter-ink);
  font-weight: 800;
}

/* Small section headings keep the letter readable without breaking the flow. */
.about-page .letter-body h2 {
  margin: clamp(28px, 4vw, 36px) 0 clamp(12px, 2vw, 16px);
  color: var(--letter-ink);
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.12rem, 2vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.about-page .letter-dropcap {
  display: inline-block;
  margin-right: 0.1em;
  color: var(--letter-seal);
  font-size: 2.9em;
  font-weight: 850;
  line-height: 1;
  vertical-align: baseline;
}

/* First paragraph of the letter needs room for the tall dropcap. */
.about-page .letter-body > p:first-of-type {
  margin-bottom: 1.5em;
}

.about-page .letter-break {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: clamp(26px, 4vw, 34px) 0;
  color: var(--letter-ink-faint);
}

.about-page .letter-break::before,
.about-page .letter-break::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--letter-rule);
}

.about-page .letter-break span {
  flex: 0 0 auto;
  color: var(--letter-seal);
  font-size: 1rem;
  letter-spacing: 0.35em;
  line-height: 1;
  opacity: 0.75;
}

/* ---------- Signature ---------- */

.about-page .letter-sign {
  margin-top: clamp(30px, 5vw, 42px);
  padding-top: clamp(20px, 3vw, 26px);
  border-top: 1px solid var(--letter-rule);
}

.about-page .letter-sign p {
  margin: 0 0 6px;
  color: var(--letter-ink-faint);
  font-size: 0.92rem;
  font-style: italic;
}

.about-page .letter-sign p:last-child {
  margin-bottom: 0;
}

.about-page .letter-signature {
  display: block;
  margin: 2px 0 10px;
  color: var(--letter-seal);
  font-family: var(--letter-signature-font);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* ---------- Links inside the paper ---------- */

.about-page .letter-paper a {
  color: var(--letter-seal);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--letter-seal) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.about-page .letter-paper a:hover {
  text-decoration-color: var(--letter-seal);
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .about-main {
    padding: 40px 0 56px;
  }

  .about-page .letter-paper {
    padding: 48px 40px 64px;
  }

  .about-page .letter-paper::before {
    left: 24px;
  }
}

@media (max-width: 767px) {
  html:has(> body.about-page) {
    scroll-padding-top: 76px;
  }

  body.about-page {
    padding-top: 61px;
  }

  .about-page funify-site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 15;
  }

  .about-page funify-site-header .landing-header {
    min-height: 61px;
  }

  .about-page .landing-footer {
    margin-top: 32px;
  }

  /* Full-bleed paper: the sheet meets the screen edges instead of floating
     inside the shell, so the letter reads like a page rather than a card. */
  body.about-page .landing-shell {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .about-main {
    padding: 0;
  }

  .about-page .letter {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .about-page .letter-paper {
    padding: 32px clamp(20px, 4vw, 24px) 48px;
    border: 0;
    border-top: 1px solid var(--letter-paper-edge);
    border-radius: 0;
    box-shadow: none;
  }

  .about-page .letter-paper::before {
    left: clamp(9px, 2.4vw, 14px);
  }

  .about-page .letter-dropcap {
    font-size: 2.4em;
  }
}

@media (max-width: 560px) {
  .about-main {
    padding: 0;
  }
}

@media (max-width: 470px) {
  .about-page .letter-meta {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .about-page .letter-meta em {
    font-size: 0.78rem;
  }
}
