/* Hand-written and deliberately small: this loads on every page, and Core Web
   Vitals are both a ranking signal and the difference between a reader staying
   or leaving. No framework, no webfont, no render-blocking third party. */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --border: #dfe4ea;
  --text: #1a1d21;
  --muted: #5b6672;
  --accent: #1d6fe0;
  --accent-dark: #1558b0;
  --accent-soft: #e8f1fd;
  --danger: #c0392b;
  --radius: 10px;
  --wrap: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #181c21;
    --border: #2a3037;
    --text: #e7eaee;
    --muted: #9aa5b1;
    --accent: #61a0f5;
    --accent-dark: #8bbaf8;
    --accent-soft: #16283f;
    --danger: #e8776b;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

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

/* ---------- header / footer ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none;
}
.brand-mark {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: #fff; font-weight: 700;
}
.nav { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

.site-footer {
  margin-top: 56px; padding: 28px 0 40px;
  background: var(--surface); border-top: 1px solid var(--border);
  font-size: 14px; color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 14px; }
.footer-note { margin: 8px 0; max-width: 70ch; }

/* ---------- hero + mailbox ---------- */

.hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 40px 0 34px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(26px, 4vw, 38px); line-height: 1.2; }
.lede { margin: 0 0 24px; max-width: 68ch; color: var(--muted); font-size: 17px; }

.mailbox {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.mailbox-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.mailbox-row { display: flex; gap: 10px; flex-wrap: wrap; }

.address {
  flex: 1 1 260px; min-width: 0;
  padding: 13px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
}

.mailbox-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px;
}
.mailbox-note { font-size: 13px; color: var(--muted); }

.mailbox-mode {
  margin: 12px 0 0; padding: 9px 12px;
  font-size: 13px; line-height: 1.5;
  border-radius: 8px; border: 1px solid var(--border);
}
.mailbox-mode[data-mode="private"] {
  background: rgba(39, 174, 96, .10); border-color: rgba(39, 174, 96, .35);
}
.mailbox-mode[data-mode="public"] {
  background: rgba(224, 168, 0, .12); border-color: rgba(224, 168, 0, .40);
}

.custom-form { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.custom-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.custom-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.custom-row input, .custom-row select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 15px;
}
.custom-row input { flex: 1 1 140px; min-width: 0; }
.at { color: var(--muted); }
.custom-help { font-size: 13px; color: var(--muted); margin: 10px 0 0; max-width: 60ch; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid transparent; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-quiet {
  background: transparent; color: var(--accent); border-color: var(--border);
  padding: 9px 14px; font-weight: 500;
}
.btn-quiet:hover { background: var(--surface); color: var(--accent-dark); }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---------- inbox ---------- */

.inbox-section { margin-top: 32px; }
.inbox-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.inbox-head h2 { margin: 0; font-size: 21px; }
.inbox-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { font-size: 14px; color: var(--muted); }
.status.live::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px;
  border-radius: 50%; background: #27ae60; vertical-align: middle;
}

.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.message {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.message.unread { border-left: 3px solid var(--accent); }

.message-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "from time" "subject time" "preview preview";
  gap: 2px 12px;
  width: 100%; padding: 14px 16px;
  background: none; border: 0; text-align: left;
  font: inherit; color: inherit; cursor: pointer;
}
.message-head:hover { background: var(--accent-soft); }
.message-from { grid-area: from; font-weight: 600; font-size: 15px; }
.message-subject { grid-area: subject; font-size: 15px; }
.message-preview {
  grid-area: preview; color: var(--muted); font-size: 14px; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.message-time { grid-area: time; color: var(--muted); font-size: 13px; white-space: nowrap; }

.message-body { border-top: 1px solid var(--border); padding: 14px 16px; }
.message-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
.message-frame {
  width: 100%; height: 460px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.message-foot { margin-top: 12px; }

.images-notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px;
}

.message-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.attachment {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--text); text-decoration: none;
}
.attachment:hover { border-color: var(--accent); color: var(--accent); }

.empty {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 40px 24px; text-align: center;
  color: var(--muted);
}
.empty-title { font-weight: 600; color: var(--text); margin: 0 0 8px; font-size: 17px; }
.empty p { margin: 0 auto; max-width: 48ch; }

/* ---------- prose ---------- */

.prose { margin-top: 44px; }
.prose h1 { font-size: clamp(25px, 3.6vw, 33px); line-height: 1.25; margin: 0 0 14px; }
.prose h2 { font-size: 22px; margin: 34px 0 12px; line-height: 1.3; }
.prose h3 { font-size: 18px; margin: 26px 0 8px; }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose code {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: .9em;
}
.page { background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 28px 30px 36px; }

.steps li { margin-bottom: 12px; }
.checks { list-style: none; padding-left: 0; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before {
  content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700;
}

.meta-line { color: var(--muted); font-size: 14px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.section-title { grid-column: 1 / -1; margin: 0; font-size: 20px; }

.faq details {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 10px; background: var(--bg);
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; }

.table-wrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--bg); }

.cta {
  margin-top: 36px; padding: 22px 24px;
  background: var(--accent-soft); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cta h2 { margin-top: 0; }

.card-grid {
  display: grid; gap: 16px; margin-top: 26px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card h2, .card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.card h2 a, .card h3 a { text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }
.card p { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.card-meta { font-size: 13px; }

.contact-address { font-size: 17px; }
.more-reading { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- ads ---------- */

/* Reserved height stops a late-loading ad from shifting the article underneath
   it. Layout shift is a ranking signal and the fastest way to lose a reader. */
.ad {
  display: block; max-width: var(--wrap); margin: 32px auto; padding: 0 20px;
  min-height: 100px;
}
.ad-label {
  display: block; font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}

/* ---------- consent ---------- */

.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60;
  max-width: 660px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: 0 6px 26px rgba(0, 0, 0, .16);
  font-size: 14px;
}
.consent p { margin: 0 0 12px; }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 560px) {
  .hero { padding: 28px 0 24px; }
  .page { padding: 22px 18px 28px; }
  .message-head { grid-template-columns: 1fr; grid-template-areas: "from" "time" "subject" "preview"; }
  .message-frame { height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
