/* Local fonts (Inter and Lora, SIL Open Font License) - see /fonts */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: local("Inter Regular"), url("../fonts/Inter-Regular.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: local("Inter Medium"), url("../fonts/Inter-Medium.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: local("Inter SemiBold"), url("../fonts/Inter-SemiBold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: local("Inter Bold"), url("../fonts/Inter-Bold.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: local("Inter ExtraBold"), url("../fonts/Inter-ExtraBold.woff") format("woff"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/Lora-Variable.woff") format("woff"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("../fonts/Lora-Italic-Variable.woff") format("woff"); }

:root {
  --paper: #EFF0F0;
  --paper-2: #E3E5E5;
  --ink: #0B0B0C;
  --muted: #55595C;
  --mist: #CDD0D1;
  --accent: #BE1622;
  --accent-ink: #FFFFFF;
  --neg: #0B0B0C;
  --foot: #0B0B0C;
  --foot-ink: #EFF0F0;
  --display: "Inter", "Segoe UI", system-ui, sans-serif;
  --text: "Lora", Georgia, "Times New Roman", serif;
  --gutter: clamp(20px, 5vw, 64px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121214;
    --paper-2: #1B1B1E;
    --ink: #EDEDED;
    --muted: #A5A7AD;
    --mist: #34353A;
    --accent: #FF5A66;
    --neg: #EDEDED;
    --foot: #0A0A0B;
    --foot-ink: #EDEDED;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand, .btn, nav a, .name, .t, label, output { font-family: var(--display); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 20; }
.skip:focus { top: 12px; }
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: 1400px; margin-inline: auto; padding: 20px var(--gutter);
  position: relative;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;  }
nav ul { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); list-style: none; margin: 0; padding: 0; }
nav a { text-decoration: none; font-weight: 500; font-size: 0.98rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
nav a:hover { border-bottom-color: var(--accent); }
nav a.donate { border: 2px solid var(--ink); padding: 6px 16px; border-radius: 999px; font-weight: 600; }
nav a.donate:hover { background: var(--ink); color: var(--paper); }
.menu-btn { display: none; font: 600 0.95rem var(--display); background: none; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 16px; cursor: pointer; }

/* hero */
.hero {
  max-width: 1400px; margin-inline: auto; padding: clamp(24px, 5vw, 72px) var(--gutter) clamp(56px, 8vw, 120px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 80px); align-items: center;
}
.hero-logo { display: block; width: clamp(150px, 20vw, 280px); height: auto; margin: 0 0 clamp(24px, 3.5vw, 44px) -6px; }
h1 {
  margin: 0 0 24px;
  font-weight: 600; font-size: clamp(1.7rem, 3.3vw, 3.1rem); line-height: 1.08; letter-spacing: -0.02em;
   text-wrap: balance;
}
.lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); max-width: 34em; margin: 0 0 32px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.btn { display: inline-block; text-decoration: none; font-weight: 600; padding: 13px 26px; border-radius: 999px; border: 2px solid var(--ink); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #121214; } }

.field { margin: 0; }
#field { display: block; width: 100%; aspect-ratio: 1; touch-action: none; }
.field figcaption { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 16px; align-items: center; margin-top: 12px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field output { font-weight: 500; font-size: 0.95rem; min-width: 11.5em; text-align: right; font-variant-numeric: tabular-nums; }
.hint { grid-column: 1 / -1; margin: 6px 0 0; font-size: 0.92rem; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }

/* sections */
.block { padding-block: clamp(56px, 8vw, 112px); }
.tinted { background: var(--paper-2); }
h2 { font-weight: 700; font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 clamp(24px, 4vw, 48px);  text-wrap: balance; }
.head { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px 48px; align-items: end; margin-bottom: clamp(24px, 4vw, 48px); }
.head h2 { margin: 0; }
.head p { margin: 0; color: var(--muted); max-width: 30em; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 88px; gap: 12px 32px; align-items: center; padding: 18px 0; border-top: 1px solid var(--mist); }
.rows li:last-child { border-bottom: 1px solid var(--mist); }
.rows .name { font-weight: 600; font-size: clamp(1.6rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.02em;  }
.rows .line { color: var(--muted); }
.glyph { width: 88px; height: 88px; display: block; }

.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { margin-left: calc(var(--i) * clamp(0px, 4.5vw, 72px)); border-top: 1px solid var(--mist); }
.ladder li:last-child { border-bottom: 1px solid var(--mist); }
.ladder a { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 24px; align-items: center; padding: 14px 8px; text-decoration: none; }
.ladder a:hover { background: var(--paper); }
.ladder .t { font-weight: 600; font-size: clamp(1.25rem, 2.4vw, 1.8rem); letter-spacing: -0.01em; grid-column: 2; }
.ladder .d { grid-column: 2; color: var(--muted); }
.ladder .glyph { grid-row: 1 / span 2; }

.echo { background: var(--accent); color: var(--accent-ink); padding-block: clamp(56px, 8vw, 112px); }
@media (prefers-color-scheme: dark) { .echo { color: #121214; } }
.echo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.echo h2 { margin-bottom: 20px; }
.echo p { margin: 0; max-width: 28em; font-size: 1.2rem; }
.echo-links { list-style: none; margin: 0; padding: 0; }
.echo-links li { border-top: 1px solid currentColor; }
.echo-links li:last-child { border-bottom: 1px solid currentColor; }
.echo-links a { display: flex; flex-direction: column; padding: 18px 0; text-decoration: none; }
.echo-links span { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -0.01em; }
.echo-links small { font-size: 1rem; opacity: 0.85; }
.echo-links a:hover span { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.echo :focus-visible { outline-color: currentColor; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px clamp(32px, 6vw, 96px); }
.two h2 { margin-bottom: 20px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { border-top: 1px solid var(--mist); }
.plain li:last-child { border-bottom: 1px solid var(--mist); }
.plain a { display: block; padding: 12px 0; text-decoration: none; font-family: var(--display); font-weight: 500; font-size: 1.2rem; }
.plain a:hover { color: var(--accent); }

.foot { background: var(--foot); color: var(--foot-ink); padding-block: 40px; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; }
.legal { margin: 0; max-width: 34em; font-size: 0.95rem; opacity: 0.85; }
.foot ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; font-family: var(--display); font-weight: 500; }
.foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot :focus-visible { outline-color: var(--foot-ink); }

/* responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .head, .echo-grid, .two { grid-template-columns: 1fr; }
  .rows li { grid-template-columns: minmax(0, 1fr) 72px; }
  .rows .line { grid-column: 1; grid-row: 2; }
  .rows .glyph { grid-column: 2; grid-row: 1 / span 2; width: 72px; height: 72px; }
  .menu-btn { display: inline-block; }
  nav { display: none; position: absolute; top: 100%; left: var(--gutter); right: var(--gutter); background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 12px 20px; z-index: 10; }
  nav.open { display: block; }
  nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  nav a { display: inline-block; padding: 8px 0; font-size: 1.1rem; }
}
@media (max-width: 520px) {
  .field figcaption { grid-template-columns: 1fr; }
  .field output { text-align: left; }
  .ladder a { grid-template-columns: 64px minmax(0, 1fr); column-gap: 16px; }
  .ladder .glyph { width: 64px; height: 64px; }
}

/* ---------- sub pages ---------- */
nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.page-head {
  max-width: 1200px; margin-inline: auto; padding: clamp(24px, 5vw, 64px) var(--gutter) clamp(24px, 4vw, 48px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px clamp(24px, 5vw, 80px); align-items: center;
}
.page-head h1 { font-size: clamp(2.2rem, 5.4vw, 4.6rem); line-height: 1; margin: 0 0 18px; font-weight: 700;  }
.page-head .meta { margin: 0 0 18px; font-family: var(--display); font-size: 0.95rem; color: var(--muted); }
.page-head .intro { margin: 0; max-width: 38em; font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--muted); }
.page-head .glyph { width: clamp(110px, 17vw, 220px); height: clamp(110px, 17vw, 220px); }

.subnav { max-width: 1200px; margin-inline: auto; padding: 0 var(--gutter); }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.subnav a { display: inline-block; text-decoration: none; font-family: var(--display); font-weight: 500; font-size: 0.95rem; padding: 6px 16px; border: 1.5px solid var(--mist); border-radius: 999px; }
.subnav a:hover { border-color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.content { max-width: 1200px; margin-inline: auto; padding: clamp(32px, 5vw, 64px) var(--gutter) clamp(56px, 8vw, 112px); }
.content section + section { margin-top: clamp(40px, 6vw, 72px); }
.content h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin-bottom: 18px; }
.content p { max-width: 40em; }
.content p.lede { color: var(--muted); }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { border-top: 1px solid var(--mist); }
.entries li:last-child { border-bottom: 1px solid var(--mist); }
.entries a { display: block; padding: 16px 4px; text-decoration: none; }
.entries a:hover .e-title { color: var(--accent); }
.entries .e-title { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.2; letter-spacing: -0.01em; }
.entries .e-desc { display: block; margin-top: 4px; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.entries .e-plain { display: block; padding: 16px 4px; }
.entries .e-plain .e-desc { color: var(--muted); }

.note { margin: 0 0 32px; padding: 14px 18px; border-left: 4px solid var(--accent); background: var(--paper-2); max-width: 40em; font-size: 0.98rem; }
.note p { margin: 0; }
.download { display: inline-block; margin-top: 8px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.mail { font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2.2rem); letter-spacing: -0.01em; word-break: break-all; }
.mail a { text-underline-offset: 6px; text-decoration-thickness: 2px; }
.mail a:hover { color: var(--accent); }

@media (max-width: 700px) {
  .page-head { grid-template-columns: 1fr; }
  .page-head .glyph { order: -1; width: 96px; height: 96px; }
}
h2 > a { text-decoration: none; }
h2 > a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.content > * { max-width: 820px; }

/* ---------- article content (from Publii posts) ---------- */
.article { max-width: 760px; font-size: 1.0625rem; line-height: 1.7; }
.article > :first-child { margin-top: 0; }
.article h2, .article h3, .article h4, .article h5 { font-family: var(--display); font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; margin: 2em 0 0.6em;  }
.article h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.article h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
.article h4 { font-size: 1.2rem; }
.article h5 { font-size: 1.05rem; }
.article p { margin: 0 0 1.1em; max-width: none; }
.article ul, .article ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.article li { margin-bottom: 0.35em; }
.article a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; color: var(--accent); }
.article a:hover { color: var(--ink); }
.article a.btn { color: var(--ink); text-decoration: none; }
.article a.btn:hover { color: var(--paper); }
.article blockquote { margin: 1.4em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 4px solid var(--accent); font-style: italic; }
.article hr { border: 0; border-top: 1px solid var(--mist); margin: 2em 0; }
.article .align-center { text-align: center; }
.article .align-right { text-align: right; }
.article img { max-width: 100%; height: auto; border-radius: 2px; }
.article img.post__image--center, .article img.post__image--none { display: block; margin: 1.4em auto; }
.article img.post__image--left { float: left; margin: 0.3em 1.6em 1em 0; max-width: 48%; }
.article img.post__image--right { float: right; margin: 0.3em 0 1em 1.6em; max-width: 48%; }
.article::after { content: ""; display: block; clear: both; }
.article h2, .article h3, .article h4 { clear: both; }
.article .table-wrap { overflow-x: auto; margin: 1.4em 0; max-width: 100%; }
.article table { border-collapse: collapse; width: 100%; font-size: 0.98rem; line-height: 1.45; }
.article th, .article td { border: 1px solid var(--mist); padding: 8px 12px; text-align: left; vertical-align: top; }
.article tr:nth-child(even) td { background: var(--paper-2); }
.article iframe, .article video { max-width: 100%; }
.featured { margin: 0 0 32px; max-width: 760px; }
.featured img { display: block; max-width: 100%; height: auto; }
.featured figcaption { margin-top: 8px; color: var(--muted); font-size: 0.92rem; }
.related { margin-top: clamp(40px, 6vw, 72px); }
.chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; font-family: var(--display); font-size: 0.85rem; text-decoration: none; padding: 3px 12px; border: 1.5px solid var(--mist); border-radius: 999px; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .article img.post__image--left, .article img.post__image--right { float: none; display: block; margin: 1.2em auto; max-width: 100%; }
}
