/* =========================================================================
   The Window Box: /the-window-box/ hub, plus the closing band on each issue
   page (redesigned 2026-10-11, the same pass as /join/, /founding/, /about/).
   Loaded only by the two Window Box layouts. Every class is prefixed wl- and
   scoped under .wl, so nothing reaches the shared sets or the issue body
   (whose inline wb- styles are untouched).

   The object that carries the page is a mailed letter: the subscribe form is
   the address label on an envelope, the latest issue is its stamp, the four
   standing sections are a letter sheet, and past issues are a sheet of stamps.

   Brand colors come from tokens.css. Manila, letter paper and the postmark
   ink are materials, declared once below as --wl-* and used nowhere else.
   No button is filled terracotta; the "Free · Monthly" mark is an outline.
   ========================================================================= */

.wl {
  --wl-gutter: clamp(16px, 4vw, 48px);
  --wl-manila: #E4D2A8;
  --wl-manila-lo: #D6C08F;
  --wl-paper: #FFFCF4;
  --wl-ink: #3C342C;         /* postmark and return-address ink */
  --wl-perf: 14px;           /* stamp perforation pitch; stamp sizes are multiples of it */
  --wl-shadow: rgba(42, 33, 27, 0.16);
}

.wl-wrap { max-width: 1120px; margin-inline: auto; padding-inline: var(--wl-gutter); }
.wl .wl-eyebrow {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--terracotta); margin: 0 0 12px;
}

/* ---------- hero: text left, envelope right ---------- */
.wl-hero { background: var(--cream); padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px); border-bottom: 1px solid var(--color-rule); overflow: hidden; }
.wl-hero__crumb { font-family: var(--font-sans); font-size: 13px; color: var(--aged-ink); margin: 0 0 28px; }
.wl-hero__crumb a { color: var(--aged-ink); text-decoration: underline; text-decoration-color: var(--walnut); }
.wl-hero__crumb .sep { margin: 0 8px; }
.wl-hero__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.wl-hero h1 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(44px, 6vw, 68px); line-height: 1.02; color: var(--walnut); margin: 0 0 18px; }
.wl-hero__lede { font-family: var(--font-serif); font-style: italic; font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--aged-ink); margin: 0 0 18px; max-width: 40ch; }
.wl-hero__terms { font-family: var(--font-sans); font-size: 14.5px; line-height: 1.6; color: var(--walnut); margin: 0; }
.wl-hero__scope { font-family: var(--font-sans); font-size: 14px; color: var(--aged-ink); margin: 14px 0 0; }

/* ---------- the envelope (the hero's subscribe form) ---------- */
.wl-env {
  position: relative; width: min(100%, 540px); margin: 0 auto; aspect-ratio: 1.6 / 1;
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(255, 255, 255, .35), transparent 60%),
    linear-gradient(160deg, var(--wl-manila) 0%, var(--wl-manila-lo) 100%);
  border-radius: 3px; transform: rotate(-1.6deg);
  box-shadow: 0 1px 0 rgba(42, 33, 27, .12), 0 18px 34px var(--wl-shadow), inset 0 0 0 1px rgba(42, 33, 27, .08);
}
.wl-env::after { /* paper grain */
  content: ""; position: absolute; inset: 0; border-radius: 3px; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: repeating-linear-gradient(90deg, rgba(42, 33, 27, .035) 0 1px, transparent 1px 3px),
                    repeating-linear-gradient(0deg, rgba(42, 33, 27, .025) 0 1px, transparent 1px 4px);
}
.wl-env__from { position: absolute; left: 6%; top: 9%; display: flex; gap: 10px; align-items: flex-start; font-family: var(--font-serif); font-size: 13.5px; line-height: 1.35; color: var(--wl-ink); }
.wl-env__from b { display: block; font-weight: 600; font-size: 14.5px; }
.wl-barn { width: 28px; height: auto; color: var(--wl-ink); flex: none; margin-top: 3px; }
.wl-env__class { position: absolute; left: 6%; top: 35%; font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--terracotta); border: 1.5px solid var(--terracotta); padding: 4px 8px 3px; transform: rotate(-4deg); }

.wl-env__to { position: absolute; left: 22%; right: 10%; bottom: 13%; background: var(--wl-paper); padding: 14px 16px 16px; box-shadow: 0 1px 2px rgba(42, 33, 27, .18); transform: rotate(.6deg); z-index: 1; }
.wl-env__to label { display: block; font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--aged-ink); margin: 0 0 6px; }
.wl-row { display: flex; gap: 8px; }
.wl-row input { flex: 1; min-width: 0; font: 400 17px/1.2 var(--font-serif); color: var(--walnut); background: transparent; border: 0; border-bottom: 1.5px solid rgba(42, 33, 27, .45); padding: 8px 2px 6px; border-radius: 0; }
.wl-row input::placeholder { color: #7A6C5B; font-style: italic; }
.wl-row input:focus-visible { outline: 2px solid var(--forest-pine); outline-offset: 3px; }
.wl-row button { flex: none; font: 600 14px/1 var(--font-sans); color: var(--cream); background: var(--forest-pine); border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer; }
.wl-row button:hover { background: #1F372B; }
.wl-row button:focus-visible { outline: 2px solid var(--walnut); outline-offset: 3px; }
.wl-env-cap { font-family: var(--font-sans); font-size: 13px; color: var(--aged-ink); text-align: center; margin: 18px 0 0; }

/* ---------- postage stamp (hero, archive, issue band) ---------- */
.wl-stamp {
  position: relative; display: block; background: var(--wl-paper); padding: 9px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 4.4px, #0000 97%, #000) calc(var(--wl-perf) / -2) calc(var(--wl-perf) / -2) / var(--wl-perf) var(--wl-perf);
          mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 4.4px, #0000 97%, #000) calc(var(--wl-perf) / -2) calc(var(--wl-perf) / -2) / var(--wl-perf) var(--wl-perf);
  filter: drop-shadow(0 1px 1.5px rgba(42, 33, 27, .25));
}
.wl-stamp__art { position: relative; height: 100%; overflow: hidden; outline: 1px solid rgba(42, 33, 27, .18); outline-offset: -1px; }
.wl-stamp__art img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.92) contrast(1.02); }
.wl-stamp__no { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 18px 9px 6px; background: linear-gradient(transparent, rgba(30, 24, 19, .72)); color: #FFF8EA; font-family: var(--font-sans); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.wl-stamp__no > * { white-space: nowrap; }
.wl-stamp__no strong { font-family: var(--font-serif); font-size: 22px; letter-spacing: 0; font-weight: 600; text-transform: none; }
.wl-env .wl-stamp { position: absolute; right: 6%; top: 8%; width: 98px; height: 126px; transform: rotate(2.5deg); }
.wl-env .wl-stamp__no { padding: 12px 6px 4px; font-size: 8px; }
.wl-env .wl-stamp__no strong { font-size: 16px; }

/* ---------- postmark ---------- */
.wl-postmark { position: absolute; right: calc(6% + 22px); top: calc(8% + 30px); width: 200px; color: var(--wl-ink); opacity: .78; transform: rotate(-8deg); pointer-events: none; mix-blend-mode: multiply; }
.wl-postmark svg { display: block; width: 100%; height: auto; overflow: visible; }
.wl-postmark text { font-family: var(--font-sans); font-weight: 600; letter-spacing: .16em; fill: currentColor; }

/* ---------- inside every letter ---------- */
.wl-inside { background: var(--kraft); padding-block: clamp(64px, 9vw, 104px); }
.wl-letter { max-width: 860px; margin: 0 auto; background: var(--wl-paper); padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 64px) clamp(32px, 5vw, 56px); box-shadow: 0 1px 0 rgba(42, 33, 27, .1), 0 16px 32px rgba(42, 33, 27, .12); }
.wl-letter__head { display: flex; align-items: center; gap: 14px; border-bottom: 1.5px solid var(--walnut); padding-bottom: 14px; margin-bottom: 8px; }
.wl-letter__head .wl-barn { width: 32px; color: var(--walnut); margin: 0; }
.wl-letter__head h2 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(24px, 3vw, 30px); color: var(--walnut); margin: 0; }
.wl-letter__head p { margin: 0 0 0 auto; font-family: var(--font-sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--aged-ink); }
.wl-letter__intro { font-family: var(--font-serif); font-style: italic; font-size: 17px; color: var(--aged-ink); margin: 14px 0 22px; }
.wl-contents { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); }
.wl-contents li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; padding: 20px 0; border-top: 1px solid var(--color-rule); }
.wl-contents li:nth-child(-n+2) { border-top: 0; }
.wl-contents__num { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--terracotta); line-height: 1.2; }
.wl-contents h3 { font-family: var(--font-serif); font-weight: 600; font-size: 19px; color: var(--walnut); margin: 0 0 4px; }
.wl-contents p { margin: 0; font-family: var(--font-serif); font-size: 16px; line-height: 1.5; color: var(--aged-ink); }
.wl-contents .wl-last { margin-top: 10px; font-family: var(--font-sans); font-size: 13.5px; line-height: 1.5; color: var(--walnut); }
.wl-last span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--aged-ink); margin-bottom: 2px; }
.wl-letter__sign { font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--aged-ink); margin: 18px 0 0; text-align: right; }

/* ---------- archive: a sheet of stamps ---------- */
.wl-archive { background: var(--cream); padding-block: clamp(64px, 9vw, 104px); }
.wl-archive__head { text-align: center; margin: 0 auto 44px; max-width: 46ch; }
.wl-archive__head h2 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(28px, 4vw, 38px); color: var(--walnut); margin: 0 0 10px; }
.wl-archive__head p { font-family: var(--font-serif); font-size: 17px; color: var(--aged-ink); margin: 0; }
.wl-sheet { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: clamp(32px, 4vw, 48px); max-width: 960px; }
.wl-issue { position: relative; display: grid; justify-items: center; align-content: start; text-align: center; }
.wl-issue .wl-stamp { width: 238px; height: 294px; transition: transform .25s ease; }
.wl-issue:nth-child(3n+1) .wl-stamp { transform: rotate(-1.5deg); }
.wl-issue:nth-child(3n+2) .wl-stamp { transform: rotate(1deg); }
.wl-issue:nth-child(3n) .wl-stamp { transform: rotate(-.5deg); }
.wl-issue:hover .wl-stamp { transform: rotate(0) translateY(-4px); }
.wl-issue h3 { font-family: var(--font-serif); font-weight: 600; font-size: 21px; color: var(--walnut); margin: 18px 0 6px; }
.wl-issue p { margin: 0; max-width: 32ch; font-family: var(--font-serif); font-size: 15.5px; line-height: 1.5; color: var(--aged-ink); }
.wl-issue__go { margin-top: 10px; font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: var(--forest-pine); }
.wl-issue__link { position: absolute; inset: 0; z-index: 1; }
.wl-issue__link:focus-visible { outline: 2px solid var(--forest-pine); outline-offset: 6px; }
.wl-archive__empty { text-align: center; font-family: var(--font-serif); font-style: italic; color: var(--aged-ink); }

/* ---------- close ---------- */
.wl-close { background: var(--kraft); padding-block: clamp(48px, 7vw, 72px); border-top: 1px solid var(--color-rule); }
.wl-close .wl-wrap { max-width: 720px; text-align: center; }
.wl-close p { font-family: var(--font-serif); font-size: 18px; line-height: 1.6; color: var(--walnut); margin: 0; }
.wl-close a { color: var(--forest-pine); font-weight: 600; }

/* ---------- issue pages: closing band ---------- */
.wl-band-wrap { background: var(--kraft); padding: clamp(36px, 5vw, 64px) var(--wl-gutter); border-top: 1px solid var(--walnut); }
.wl-band { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 28px; align-items: center; }
.wl-band .wl-stamp { --wl-perf: 12px; width: 84px; height: 108px; padding: 7px; transform: rotate(-2deg); }
.wl-band h2 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(22px, 3vw, 26px); color: var(--walnut); margin: 0 0 6px; }
.wl-band p { margin: 0 0 12px; font-family: var(--font-serif); font-size: 16px; line-height: 1.55; color: var(--aged-ink); }
.wl-band .wl-row { max-width: 440px; }
.wl-band .wl-row label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .wl-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .wl-env { transform: none; margin-top: 8px; }
}
@media (max-width: 600px) {
  .wl-env { aspect-ratio: auto; min-height: 330px; }
  .wl-env__from { font-size: 12.5px; top: 18px; left: 18px; }
  .wl-env__from b { font-size: 13.5px; }
  .wl-env .wl-stamp { width: 84px; height: 112px; right: 16px; top: 16px; }
  .wl-postmark { width: 150px; right: 30px; top: 62px; }
  .wl-env__class { top: 104px; left: 18px; }
  .wl-env__to { left: 14px; right: 14px; bottom: 16px; }
  .wl-row { flex-direction: column; }
  .wl-row button { padding: 12px 18px; }
  .wl-contents { grid-template-columns: minmax(0, 1fr); }
  .wl-contents li:nth-child(2) { border-top: 1px solid var(--color-rule); }
  .wl-letter__head p { display: none; }
  .wl-band { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .wl-band > div { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .wl-issue .wl-stamp { transition: none; } }
