/* ==========================================================================
   Dr. Sara Cheikh · Moodboard v2 · act-letter.css
   Act VII — The Letter.
   Editorial letterhead, promises ordered-list, signature block,
   callback note, footer, attribution block, end glyph.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Act VII outer — paper ground, slight grain signal
   -------------------------------------------------------------------------- */

:where([data-act="VII"] .act-letter) {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-agency);
  padding-block: var(--space-9);
  padding-inline: var(--space-5);
}

/* --------------------------------------------------------------------------
   Act VII heading (visually hidden; letterhead is the visual heading)
   -------------------------------------------------------------------------- */

:where(.act-letter__heading) {
  display: none;
}

/* --------------------------------------------------------------------------
   Letterhead band — full-width, top rule above wordmark
   -------------------------------------------------------------------------- */

:where(.act-letter__letterhead) {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-5);
  max-inline-size: 38rem;
  margin-inline: auto;
  padding-block-end: var(--space-6);
  border-block-end: 1.5px solid var(--hairline-strong);
  margin-block-end: var(--space-8);
  /* IO reveal */
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-reveal);
}

:where(.act-letter__letterhead.is-revealed) {
  opacity: 1;
}

:where(.act-letter__letterhead-left) {
  font-family: var(--font-agency);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  justify-self: start;
}

:where(.act-letter__letterhead-rule) {
  display: block;
  inline-size: 64px;
  block-size: 1.5px;
  background-color: var(--signal); /* agency signal — rationed to letterhead only */
  flex-shrink: 0;
}

:where(.act-letter__letterhead-right) {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-style: normal;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--ink-muted);
  justify-self: end;
  text-align: end;
}

/* Mobile: letterhead stacks */
@media (max-width: 767px) {
  :where(.act-letter__letterhead) {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: var(--space-3);
    text-align: start;
  }

  :where(.act-letter__letterhead-right) {
    justify-self: start;
    text-align: start;
  }
}

/* --------------------------------------------------------------------------
   Letter body — left-aligned, max 38rem
   -------------------------------------------------------------------------- */

:where(.act-letter__body) {
  max-inline-size: 38rem;
  margin-inline: auto;
}

:where(.act-letter__salutation) {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  color: var(--ink);
  margin-block-end: var(--space-5);
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-reveal);
}

:where(.act-letter__salutation.is-revealed) {
  opacity: 1;
}

:where(.act-letter__body > p) {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  color: var(--ink);
  margin-block-end: var(--space-5);
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-reveal);
}

:where(.act-letter__body > p.is-revealed) {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Promises ordered list — ONE / TWO / THREE headings
   -------------------------------------------------------------------------- */

:where(.act-letter__promises) {
  list-style: none;
  padding: 0;
  margin: var(--space-7) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

:where(.act-letter__promise) {
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-reveal);
}

:where(.act-letter__promise.is-revealed) {
  opacity: 1;
}

:where(.act-letter__promise-heading) {
  font-family: var(--font-agency);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-block-end: var(--space-3);
  /* ONE. TWO. THREE. treated as h3-level headers within letter */
}

:where(.act-letter__promise p) {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Callback note — italic, smaller
   -------------------------------------------------------------------------- */

:where(.act-letter__callback) {
  font-size: var(--fs-body);
  font-style: italic;
  color: var(--ink-muted);
  line-height: var(--lh-normal);
  margin-block: var(--space-6);
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-reveal);
}

:where(.act-letter__callback.is-revealed) {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Signature block — generous vertical space, right-aligned sigmark
   -------------------------------------------------------------------------- */

:where(.act-letter__signature) {
  margin-block-start: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  opacity: 0;
  transition: opacity 720ms var(--ease-reveal);
}

:where(.act-letter__signature.is-revealed) {
  opacity: 1;
}

:where(.act-letter__signature > p) {
  font-size: var(--fs-body-lg);
  font-style: italic;
  color: var(--ink);
  line-height: var(--lh-body);
}

/* Typographic monogram — large, centered */
:where(.act-letter__sigmark) {
  display: block;
  font-family: var(--font-agency);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-align: center;
  padding-block: var(--space-5);
}

/* --------------------------------------------------------------------------
   Contact address
   -------------------------------------------------------------------------- */

:where(.act-letter__contact) {
  font-style: normal;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  text-align: end;
  margin-block-start: var(--space-4);
}

:where(.act-letter__contact a) {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hairline-strong);
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur-fast) var(--ease-standard);
}

:where(.act-letter__contact a:hover) {
  text-decoration-color: var(--ink);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

:where(.act-letter__footer) {
  max-inline-size: 38rem;
  margin-inline: auto;
  margin-block-start: var(--space-9);
  border-block-start: 1px solid var(--hairline);
  padding-block-start: var(--space-5);
}

:where(.act-letter__footer-inner) {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin-block-end: var(--space-5);
}

:where(.act-letter__footer-center a) {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--hairline);
  transition: text-decoration-color var(--dur-fast) var(--ease-standard);
}

:where(.act-letter__footer-center a:hover) {
  text-decoration-color: var(--ink-quiet);
}

/* --------------------------------------------------------------------------
   Attribution block — very small, quiet
   -------------------------------------------------------------------------- */

:where(.act-letter__attribution) {
  font-family: var(--font-mono);
  font-size: 0.625rem; /* 10px — smallest permitted, attribution only */
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  opacity: 0.5;
  line-height: 1.8;
  margin-block-start: var(--space-4);
}

/* --------------------------------------------------------------------------
   End glyph — § centred, 96px below attribution
   -------------------------------------------------------------------------- */

:where(.act-letter__end-glyph) {
  font-family: var(--font-agency);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink-muted);
  text-align: center;
  margin-block-start: var(--space-9);
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-reveal);
}

:where(.act-letter__end-glyph.is-revealed) {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  :where(.act-letter__letterhead,
         .act-letter__salutation,
         .act-letter__body > p,
         .act-letter__promise,
         .act-letter__callback,
         .act-letter__signature,
         .act-letter__end-glyph) {
    opacity: 1 !important;
    transition: none !important;
  }
}

:where(html.motion-reduced) {
  :where(.act-letter__letterhead,
         .act-letter__salutation,
         .act-letter__body > p,
         .act-letter__promise,
         .act-letter__callback,
         .act-letter__signature,
         .act-letter__end-glyph) {
    opacity: 1 !important;
  }
}

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

@media (max-width: 767px) {
  :where([data-act="VII"] .act-letter) {
    padding-inline: var(--space-4);
  }

  :where(.act-letter__footer-inner) {
    flex-direction: column;
    gap: var(--space-2);
  }

  :where(.act-letter__contact) {
    text-align: start;
  }
}
