/* InboxPD stylesheet */
:root {
  /* Quieter paper: an off-white with almost no yellow in it.
     Alternatives if this is still too warm or too cool:
       #FFFFFF  (plain white)
       #FBF9F3  (a shade more cream)                                   */
  --paper: #FCFBF8;
  --ink: #1C1A17;
  --ink-soft: #726D66;
  --rule: #E6E2DA;
  --rule-strong: #CBC5BB;
  --blue: #29AAE2;
  --blue-ink: #1B87B5;
  --measure: 40rem;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.0625rem; line-height: 1.6;
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit; text-decoration: underline;
  text-decoration-color: var(--rule-strong); text-underline-offset: .18em; text-decoration-thickness: 1px;
  border-radius: 2px;
}
a:hover { color: var(--blue-ink); text-decoration-color: var(--blue); }
a:focus-visible { outline: 1px solid var(--blue); outline-offset: 3px; }

.page { max-width: var(--measure); margin: 0 auto; padding: 4.5rem 1.5rem 4rem; }

header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 1rem; border-bottom: 1px solid var(--rule); margin-bottom: 3rem;
}
.mark { font-family: "Raleway", "Inter", sans-serif; font-weight: 600; font-size: 1.125rem; letter-spacing: .01em; text-decoration: none; }
.updated, .meta { color: var(--ink-soft); font-size: .875rem; }

.intro p { margin: 0 0 1.25rem; }
.intro p.lead { font-size: 1.375rem; line-height: 1.4; margin-bottom: 1.75rem; text-wrap: balance; }

h2 {
  font-size: .9375rem; font-weight: 500;
  margin: 3.5rem 0 .5rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rule);
}

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--rule); }
.list a {
  display: grid; grid-template-columns: 3rem 1fr auto; gap: 1rem; align-items: baseline;
  padding: .8rem 0; text-decoration: none; transition: opacity .25s var(--ease);
}
.list .num, .list .date { color: var(--ink-soft); font-size: .875rem; white-space: nowrap; }
.list .title { line-height: 1.4; }
.list .desc { grid-column: 2 / -1; color: var(--ink-soft); font-size: .9375rem; margin-top: -.35rem; }
.list:hover a { opacity: .38; }
.list:hover a:hover { opacity: 1; }
.list a:hover .title { color: var(--blue-ink); text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: .18em; }
.list a:focus-visible { outline: 1px solid var(--blue); outline-offset: -1px; }

.new {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; margin-left: .6rem;
  border: 1px solid var(--blue); border-radius: 50%;
  color: var(--blue-ink); font-size: .7rem; font-weight: 500; letter-spacing: .02em;
  vertical-align: middle; transform: rotate(-12deg);
}

.archive { border-bottom: 1px solid var(--rule); }
.archive summary {
  cursor: pointer; list-style: none; padding: .8rem 0; color: var(--ink-soft); font-size: .9375rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.archive summary::-webkit-details-marker { display: none; }
.archive summary:hover { color: var(--blue-ink); }
.archive summary:focus-visible { outline: 1px solid var(--blue); outline-offset: -1px; }
.archive summary .hint::after { content: "Show"; }
.archive[open] summary .hint::after { content: "Hide"; }
.archive .list { border-top: 1px solid var(--rule); }
.archive .list li:last-child { border-bottom: 0; }

/* ---------- Article ---------- */
article .meta { margin-bottom: .75rem; }
article h1 {
  font-size: 1.75rem; line-height: 1.25; font-weight: 500; letter-spacing: -.01em;
  margin: 0 0 1.75rem; text-wrap: balance;
}
article p { margin: 0 0 1.25rem; }
article p.standfirst { font-size: 1.1875rem; color: var(--ink-soft); }
article h3 { font-size: 1.0625rem; font-weight: 500; margin: 2.25rem 0 .75rem; }
article ul { padding-left: 1.2rem; margin: 0 0 1.25rem; }
article li { margin-bottom: .35rem; }
article blockquote {
  margin: 1.5rem 0; padding-left: 1rem; border-left: 1px solid var(--rule-strong); color: var(--ink-soft);
}
.aside {
  margin: 2rem 0; padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 2px;
  font-size: .9375rem;
}
.aside p { margin: 0; }
.aside p + p { margin-top: .6rem; }

.pager {
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 1.5rem; font-size: .9375rem;
}
.pager a { text-decoration: none; max-width: 48%; }
.pager a:hover span { text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: .18em; }
.pager .lbl { display: block; color: var(--ink-soft); font-size: .8125rem; margin-bottom: .15rem; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- Subscribe ---------- */
.subscribe { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.subscribe p { margin: 0 0 .9rem; }
.subscribe form { display: flex; gap: .5rem; max-width: 26rem; }
.subscribe input[type=email] {
  flex: 1; min-width: 0; font: inherit; font-size: .9375rem; color: var(--ink);
  background: transparent; border: 1px solid var(--rule-strong); border-radius: 2px; padding: .5rem .7rem;
}
.subscribe input[type=email]:focus { outline: none; border-color: var(--blue); }
.subscribe button {
  font: inherit; font-size: .9375rem; font-weight: 500; color: #fff;
  background: var(--blue); border: 1px solid var(--blue); border-radius: 2px; padding: .5rem .9rem; cursor: pointer;
}
.subscribe button:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.subscribe button:focus-visible { outline: 1px solid var(--blue); outline-offset: 3px; }
.subscribe button[disabled] { opacity: .6; cursor: default; }
.subscribe .note { color: var(--ink-soft); font-size: .875rem; margin-top: .75rem; }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer and envelope ---------- */
footer {
  margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  color: var(--ink-soft); font-size: .875rem;
}
.footer-right { display: inline-flex; align-items: center; gap: .75rem; }

/* The envelope is drawn in four layers, back to front:
   back flap (seen only when open), letter, front pocket, front flap
   (seen only when closed). Opening runs in sequence: the flap lifts,
   then the letter rises. Closing runs the other way round. The two
   flaps swap at the instant the flap is edge-on, so the swap is
   invisible. The SVG box is the envelope body only; the animated parts
   overflow above it, which keeps the body aligned with the footer text. */
.envelope { display: inline-block; width: 44px; height: 25px; cursor: pointer; overflow: visible; vertical-align: middle; }
.envelope .letter { transition: transform .6s cubic-bezier(.3,.7,.3,1) 0s; }
.envelope .flap {
  transform-box: fill-box; transform-origin: 50% 0;
  transition: transform .45s cubic-bezier(.4,.6,.3,1) .45s, opacity 0s linear .675s;
}
.envelope .flap-back { opacity: 0; }
.envelope .flap-front { opacity: 1; }
.envelope:hover .letter, .envelope.open .letter { transform: translateY(-22px); transition-delay: .3s; }
.envelope:hover .flap, .envelope.open .flap { transform: scaleY(-1); transition-delay: 0s, .225s; }
.envelope:hover .flap-back, .envelope.open .flap-back { opacity: 1; }
.envelope:hover .flap-front, .envelope.open .flap-front { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .list a, .envelope .letter, .envelope .flap { transition: none !important; }
}
@media (max-width: 480px) {
  .page { padding-top: 3rem; }
  .intro p.lead { font-size: 1.25rem; }
  .list a { grid-template-columns: 2.5rem 1fr; }
  .list .date { grid-column: 2; }
  .list:hover a { opacity: 1; }
  article h1 { font-size: 1.5rem; }
}
