/* Spamtacular v2 theme. Navy bands, one blue accent, amber highlights, email-header details. */

/* ---- Fonts (MB Type, self-hosted) ------------------------------------ */
@font-face { font-family: "Concourse 3"; src: url("fonts/concourse-3-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Concourse 3"; src: url("fonts/concourse-3-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Equity A"; src: url("fonts/equity-a-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Equity A"; src: url("fonts/equity-a-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Equity A"; src: url("fonts/equity-a-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Triplicate A Code"; src: url("fonts/triplicate-a-code-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* ---- Tokens ---------------------------------------------------------- */
:root {
  --ground: #F7F8FB;
  --surface: #FFFFFF;
  --ink: #0B1020;
  --muted: #5B6478;
  --rule: #E1E5EE;
  --accent: #2B4DFF;
  --accent-tint: #EEF1FF;
  --amber: #FFB020;
  --navy: #0B1020;
  --navy-2: #11182E;
  --on-dark: #E8ECF8;
  --on-dark-muted: #AEB8D6;
  --on-dark-faint: #8A94B3;
  --good: #6EE7B7;

  --font-display: "Concourse 3", system-ui, -apple-system, sans-serif;
  --font-ui: "Concourse 3", system-ui, -apple-system, sans-serif;
  --font-body: "Equity A", Georgia, "Times New Roman", serif;
  --font-mono: "Triplicate A Code", "Courier New", monospace;

  /* SiteEngine theme contract: core partials (comments, forms) read these names. */
  --color-bg: var(--ground);
  --color-text: var(--ink);
  --color-accent: var(--accent);
  --color-muted: var(--muted);
  --color-surface: var(--surface);
  --font-heading: var(--font-display);
  --space-unit: 1rem;

  --w-page: 1160px;
  --w-prose: 680px;
  --gutter: 32px;
}
@media (max-width: 767px) { :root { --gutter: 20px; } }

/* ---- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { font-synthesis: none; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
@media (max-width: 767px) { body { font-size: 17px; } }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
p a, li a, dd a, figcaption a { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-header :focus-visible, .site-footer :focus-visible, .hero :focus-visible, .post-hero :focus-visible { outline-color: var(--amber); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; padding: 8px 16px; background: var(--ink); color: #fff; font-family: var(--font-ui); font-size: 14px; z-index: 200; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; transform: none !important; } }

.wrap { max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Typography ------------------------------------------------------ */
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-family: var(--font-display); font-weight: 700; }
h1 { font-size: 52px; line-height: 1.06; letter-spacing: -0.03em; }
h2 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 48px 0 16px; }
h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; margin: 32px 0 12px; }
h4 { font-size: 18px; line-height: 1.3; margin: 24px 0 8px; }
@media (max-width: 767px) { h1 { font-size: 34px; } h2 { font-size: 25px; } h3 { font-size: 20px; } }

p { margin: 0 0 1.2em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin: 0 0 0.5em; }
strong { font-weight: 700; }
em { font-style: italic; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }

code, pre, kbd { font-family: var(--font-mono); font-size: 14px; line-height: 1.6; }
pre { overflow-x: auto; background: var(--navy); color: var(--on-dark); padding: 20px 24px; margin: 0 0 1.4em; border-radius: 10px; tab-size: 2; }
code { background: var(--accent-tint); border: 1px solid var(--rule); padding: 0.05em 0.3em; border-radius: 4px; }
pre code { background: none; border: 0; padding: 0; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1.4em; font-family: var(--font-ui); font-size: 15px; line-height: 1.5; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { border-bottom: 2px solid var(--ink); }

blockquote { margin: 32px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--accent); font-style: italic; }
blockquote p:last-child { margin-bottom: 0; }

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--ink); color: #fff; text-decoration: none; }

/* ---- Header (navy band) --------------------------------------------- */
.site-header { background: var(--navy); color: var(--on-dark); }
.site-header-inner { max-width: var(--w-page); margin: 0 auto; padding: 22px var(--gutter); display: flex; align-items: center; gap: 16px 32px; }
.site-title {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}
.site-title:hover { text-decoration: none; }
/* Envelope mark */
.site-mark { position: relative; display: inline-block; width: 22px; height: 16px; border-radius: 3px; background: var(--amber); overflow: hidden; flex: none; }
.site-mark::after { content: ""; position: absolute; left: 3px; top: -7px; width: 16px; height: 16px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg); }

.site-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-nav a { font-family: var(--font-ui); font-size: 15px; line-height: 1; color: var(--on-dark-muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: #fff; text-decoration: none; border-bottom-color: var(--on-dark-faint); }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--amber); }

.mobile-nav { display: none; }
@media (max-width: 767px) {
  .site-header { position: relative; }
  .site-header-inner { padding-top: 14px; padding-bottom: 14px; }
  .site-nav { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-right: -12px; cursor: pointer; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .burger, .burger::before, .burger::after { display: block; width: 22px; height: 2px; background: #fff; transition: transform 0.15s ease, background-color 0.15s ease; }
  .burger { position: relative; }
  .burger::before, .burger::after { content: ""; position: absolute; left: 0; }
  .burger::before { top: -7px; }
  .burger::after { top: 7px; }
  .mobile-nav[open] .burger { background: transparent; }
  .mobile-nav[open] .burger::before { top: 0; transform: rotate(45deg); }
  .mobile-nav[open] .burger::after { top: 0; transform: rotate(-45deg); }
  .mobile-nav-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 100; background: var(--navy-2); border-bottom: 1px solid #1E2745; padding: 8px var(--gutter) 16px; }
  .mobile-nav-panel a { display: flex; align-items: center; min-height: 48px; font-family: var(--font-ui); font-size: 17px; color: #fff; border-bottom: 1px solid #1E2745; }
  .mobile-nav-panel a[aria-current="page"] { color: var(--amber); }
}

/* ---- Home hero ------------------------------------------------------- */
/* The header wordmark carries the site name, so the page's h1 is visually hidden (class sr-only)
   and the tagline (h2) is the visible headline. */
.hero { background: var(--navy); color: var(--on-dark); }
.hero-inner { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: stretch; padding-top: 40px; padding-bottom: 72px; }
.hero-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.masthead img { display: none; }
.masthead h2 { margin: 0 0 20px; font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1.08; letter-spacing: -0.03em; color: #fff; }
.masthead p { max-width: 540px; margin: 0; font-size: 17px; line-height: 1.6; color: var(--on-dark-muted); }
.hero-copy::before { content: "Received: since 2009"; display: block; margin-bottom: 20px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; color: var(--amber); }

.feature { flex: 1 1 380px; min-width: 0; position: relative; background: var(--surface); color: var(--ink); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.15s ease; }
.feature:hover { transform: translateY(-2px); }
.feature-head { background: var(--navy-2); color: var(--on-dark-muted); padding: 20px 24px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75; overflow: hidden; }
.feature-head p { margin: 0; overflow-wrap: anywhere; }
.feature-head span { color: var(--on-dark-faint); }
.feature-head strong { font-weight: 400; color: #fff; }
.feature-head em { font-style: normal; color: var(--amber); }
.feature-body { padding: 24px 28px 28px; }
.feature-flag { display: inline-block; margin: 0 0 14px; padding: 3px 8px; border-radius: 4px; background: var(--amber); color: var(--navy); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
.feature-title { margin: 0 0 12px; font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; }
.feature-title a { color: var(--ink); }
.feature-title a::after { content: ""; position: absolute; inset: 0; }
.feature-title a:hover { text-decoration: none; color: var(--accent); }
.feature-excerpt { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
@media (max-width: 767px) {
  .hero-inner { padding-top: 24px; padding-bottom: 40px; gap: 32px; }
  .masthead h2 { font-size: 30px; }
  .feature-title { font-size: 23px; }
}

/* ---- Post lists and cards ------------------------------------------- */
.list-section { padding: 56px 0 72px; }
.list-head { padding: 56px 0 28px; }
.list-head h1 { font-size: 44px; margin: 0; }
.list-head--bar { padding: 0 0 28px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; }
.list-head--bar h2 { margin: 0; font-size: 28px; }
.list-intro { max-width: var(--w-prose); margin: 16px 0 0; color: var(--muted); }
@media (max-width: 767px) { .list-head h1 { font-size: 34px; } .list-section { padding: 36px 0 48px; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--font-ui); font-size: 14px; line-height: 1; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chips--large .chip { font-size: 17px; padding: 12px 20px; }

.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
@media (max-width: 400px) { .post-list { grid-template-columns: minmax(0, 1fr); } }

.post-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; transition: border-color 0.15s ease, transform 0.15s ease; }
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-card-head { background: var(--navy); color: var(--on-dark-faint); padding: 9px 20px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; }
.post-card-head a, .post-card-head span { color: var(--amber); text-decoration: none; position: relative; z-index: 1; }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.post-card-title { margin: 0 0 auto; padding-bottom: 20px; font-size: 21px; line-height: 1.22; letter-spacing: -0.012em; }
.post-card-title a { color: var(--ink); }
.post-card-title a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover .post-card-title a { color: var(--accent); text-decoration: none; }
.post-card-date { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.post-card-date span { color: #9AA3B8; }
.empty-archive { color: var(--muted); padding: 24px 0; }

.pagination { display: flex; justify-content: space-between; gap: 16px; margin: 32px 0 0; font-family: var(--font-ui); font-size: 15px; color: var(--muted); }

/* ---- Single post ----------------------------------------------------- */
.post-hero { background: var(--navy); color: var(--on-dark); }
.post-hero-inner { max-width: 880px; margin: 0; padding-top: 32px; padding-bottom: 56px; }
.post-hero { padding-left: max(0px, calc((100% - var(--w-page)) / 2)); }
.post-hero h1 { color: #fff; font-size: 48px; margin: 0 0 24px; }
@media (max-width: 767px) { .post-hero-inner { padding-top: 20px; padding-bottom: 36px; } .post-hero h1 { font-size: 32px; margin-bottom: 20px; } }

.post-meta { margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.8; color: var(--on-dark-muted); }
.post-meta > div { display: flex; gap: 12px; }
.post-meta dt { flex: 0 0 140px; color: var(--on-dark-faint); }
.post-meta dd { margin: 0; min-width: 0; }
.post-meta dd.hl, .post-meta dd.hl a { color: var(--amber); }
.post-meta a { color: #fff; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }

.post-image { margin: 0 0 8px; }
.post-image img { width: 100%; max-height: 420px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0 0 14px 14px; }

.post-layout { display: grid; grid-template-columns: 220px minmax(0, var(--w-prose)); justify-content: start; gap: 48px 64px; align-items: start; padding: 48px 0 72px; }
.post-layout > .toc { grid-column: 1; grid-row: 1; }
.post-layout > .post { grid-column: 2; grid-row: 1; }
.post-layout--solo { grid-template-columns: minmax(0, var(--w-prose)); justify-content: center; }
.post-layout--solo > .post { grid-column: 1; }
@media (max-width: 960px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  .post-layout > .toc, .post-layout > .post { grid-column: 1; }
  .post-layout > .toc { grid-row: 1; }
  .post-layout > .post { grid-row: 2; }
}

.toc { position: sticky; top: 24px; font-family: var(--font-ui); }
.toc-label { margin: 0 0 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.toc li { margin: 0; }
.toc li a { display: block; font-size: 14px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.toc li a:hover { color: var(--accent); }
@media (max-width: 960px) { .toc { position: static; } }

.post-body > :first-child { margin-top: 0; }
.post-body h2 { scroll-margin-top: 24px; }
.post-body img { margin: 24px 0; border-radius: 8px; }
.post-body p:empty { display: none; }
.post-body a { word-break: break-word; }
.post-body blockquote { font-size: 1.25em; line-height: 1.4; }

/* Footnotes: importer markup is sup.fn > a, an h2 "Footnotes", and section.footnotes > ol. */
.post-body sup.fn { font-size: 0.72em; line-height: 0; }
.post-body sup.fn a { font-family: var(--font-ui); font-weight: 700; text-decoration: none; padding: 0 1px; }
.post-body sup.fn a:hover { text-decoration: underline; }
.post-body hr:has(+ .fn-heading) { display: none; }
.post-body .fn-heading { margin: 56px 0 14px; padding-top: 20px; border-top: 1px solid var(--rule); font-family: var(--font-mono); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.footnotes { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 32px; }
.footnotes ol { margin: 0; padding-left: 28px; }
.footnotes li { margin: 0 0 12px; padding-left: 6px; }
.footnotes li:target { background: var(--accent-tint); }
.footnotes a { overflow-wrap: anywhere; }
.footnotes .fn-back { text-decoration: none; font-family: var(--font-ui); }

/* Disclaimer paragraph that follows the footnotes heading. */
.post-body .fn-heading ~ p > em:only-child { font-size: 15px; line-height: 1.6; }

.post-terms { margin: 32px 0 0; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.post-terms a { color: var(--muted); }

.author-bio { margin: 48px 0 0; padding: 24px 28px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.author-bio .author-name { margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; }
.author-bio .author-name a { color: var(--ink); }
.author-bio p { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0 0 16px; }
.author-bio p:last-child { margin-bottom: 0; }

/* ---- Pages ----------------------------------------------------------- */
.page { max-width: var(--w-prose); padding: 56px 0 72px; }
.page > h1 { margin: 0 0 32px; }
@media (max-width: 767px) { .page { padding: 36px 0 48px; } .page > h1 { font-size: 34px; } }
.prose > :first-child { margin-top: 0; }

/* ---- Footer ---------------------------------------------------------- */
.site-footer { background: var(--navy); color: var(--on-dark); font-size: 15px; }
.site-footer-inner { max-width: var(--w-page); margin: 0 auto; padding: 48px var(--gutter) 32px; display: flex; flex-wrap: wrap; gap: 32px 56px; line-height: 1.55; }
.footer-col { flex: 1 1 280px; min-width: 0; }
.footer-brand strong { display: block; margin-bottom: 10px; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: #fff; }
.footer-brand p { margin: 0; color: var(--on-dark-muted); }
.footer-nav { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px 24px; }
.site-footer a { font-family: var(--font-ui); color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-sig { flex: 1 1 100%; }
.footer-sig-sep { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--amber); white-space: pre; }
.footer-legal { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--on-dark-faint); }

.embed-youtube { position: relative; aspect-ratio: 16 / 9; margin: 1.5em 0; }
.embed-youtube iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-pdf { margin: 1.5em 0; }
.embed-pdf iframe { display: block; width: 100%; height: 70vh; min-height: 24rem; border: 1px solid var(--color-muted); }
.embed-pdf figcaption { margin-top: 0.5em; font-size: 0.9em; }
