/* hg theme - main stylesheet */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --text: #0f1115;
  --text-2: #3d4149;
  --muted: #5c616b;
  --line: #e5e7eb;
  --line-2: #d5d8de;
  --accent: #1d4fd8;
  --accent-ink: #153c9c;
  --accent-soft: #e6edfc;
  --on-accent: #ffffff;
  --plate: #1d4fd8;
  --on-plate: #ffffff;
  --sel: #d9e4fb;
  --shadow: 0 10px 28px -10px rgba(23, 24, 28, 0.22);
  --font-display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  --container: 1120px;
  --measure: 720px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f13;
    --surface: #14171c;
    --surface-2: #1b1f26;
    --text: #e8e9ec;
    --text-2: #c2c6cd;
    --muted: #9aa0aa;
    --line: #262a31;
    --line-2: #333841;
    --accent: #7aa2ff;
    --accent-ink: #a9c1ff;
    --accent-soft: #1a2440;
    --on-accent: #0f1114;
    --plate: #1b3d94;
    --on-plate: #eef2ff;
    --sel: #27407a;
    --shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0f13;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --text: #e8e9ec;
  --text-2: #c2c6cd;
  --muted: #9aa0aa;
  --line: #262a31;
  --line-2: #333841;
  --accent: #7aa2ff;
  --accent-ink: #a9c1ff;
  --accent-soft: #1a2440;
  --on-accent: #0f1114;
  --plate: #1b3d94;
  --on-plate: #eef2ff;
  --sel: #27407a;
  --shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-color: var(--line-2) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  overflow-x: clip; /* third-party footer injections must not widen the page */
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
}

::selection { background: var(--sel); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent-ink); }

img, svg, video { max-width: 100%; height: auto; display: block; }
svg { fill: none; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -0.02em; }

button { font: inherit; color: inherit; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; }
.skip-link:focus {
  left: 16px; width: auto; height: auto; clip: auto; margin: 0;
  padding: 10px 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
}

.wrap { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.prose-wrap { width: min(100% - 32px, var(--measure)); margin-inline: auto; }

@media (max-width: 640px) {
  .wrap, .prose-wrap { width: calc(100% - 32px); }
}

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  font-weight: 500; font-size: 0.95rem; line-height: 1.2;
  color: var(--on-accent); background: var(--accent);
  border: 1px solid transparent; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.btn:hover { background: var(--accent-ink); color: var(--on-accent); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-lg { padding: 14px 22px; font-size: 1.05rem; }

.btn-secondary {
  color: var(--text); background: transparent; border-color: var(--line-2);
}
.btn-secondary:hover { color: var(--text); background: var(--surface-2); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  color: var(--text-2); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.97); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Header ---------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
@supports not (color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 32px; width: auto; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }

.nav-primary ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-primary a {
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 1rem;
  padding: 6px 0;
}
.nav-primary a:hover, .nav-primary .current-menu-item > a, .nav-primary .current_page_item > a { color: var(--text); }
.nav-primary .current-menu-item > a, .nav-primary .current_page_item > a { text-decoration: underline; text-underline-offset: 0.35em; text-decoration-color: var(--line-2); }

.nav-tools { display: flex; align-items: center; gap: 10px; }

.lang { display: inline-flex; gap: 2px; }
.lang a, .lang span {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted); text-decoration: none; padding: 5px 7px; border-radius: 7px;
}
.lang a:hover { color: var(--text); background: var(--surface-2); }
.lang [aria-current] { color: var(--text); background: var(--surface-2); }

.icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

.nav-toggle { display: none; cursor: pointer; }
.nav-toggle .icon-x { display: none; }
.nav-check:checked ~ .nav-tools .nav-toggle .icon-x { display: block; }
.nav-check:checked ~ .nav-tools .nav-toggle .icon-menu { display: none; }
.nav-check:focus-visible ~ .nav-tools .nav-toggle { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-primary {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    display: none;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 4px 16px 12px;
  }
  .nav-check:checked ~ .nav-primary { display: block; }
  .nav-primary ul { flex-direction: column; gap: 0; }
  .nav-primary li + li { border-top: 1px solid var(--line); }
  .nav-primary a { display: block; padding: 14px 0; font-size: 1.05rem; }
  .nav-primary .current-menu-item > a { text-decoration: none; }
}

/* Home: hero ------------------------------------------------------------ */

.hero { padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 7vw, 88px); }
.hero h1 {
  margin: 0 0 clamp(28px, 4vw, 44px);
  font-weight: 600;
  font-size: clamp(2.5rem, 1.4rem + 3.4vw, 4rem);
  line-height: 0.98; letter-spacing: -0.04em;
  text-wrap: balance;
}
.hero-row {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px; align-items: center;
}
.hero p { margin: 0 0 28px; font-size: 1.25rem; line-height: 1.5; color: var(--text-2); max-width: 50ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-portrait {
  justify-self: end; position: relative; overflow: hidden;
  width: 320px; height: 320px; max-width: 100%;
  background: var(--accent); border-radius: var(--radius);
}
.hero-portrait img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.05); mix-blend-mode: luminosity;
  transition: filter 320ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .hero-portrait:hover img { filter: none; mix-blend-mode: normal; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.hero h1 { animation: rise 360ms var(--ease-out) both; }
.hero .hero-copy { animation: rise 360ms var(--ease-out) 60ms both; }
.hero .hero-portrait { animation: rise 360ms var(--ease-out) 120ms both; }

@media (max-width: 820px) {
  .hero-row { grid-template-columns: 1fr; gap: 28px; }
  .hero-portrait { justify-self: start; width: 160px; height: 160px; }
}

/* Sections -------------------------------------------------------------- */

.section { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.section-title {
  margin: 0 0 32px;
  font-weight: 600;
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
  line-height: 1.05; letter-spacing: -0.035em;
}
.section-lead { margin: -16px 0 28px; color: var(--text-2); max-width: 56ch; }

.work { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; }
.work .section-title { margin-bottom: 12px; }
.work-list { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; margin: 0; }
.work-list > div { padding-top: 16px; border-top: 1px solid var(--line-2); }
.work-list dt { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.15; letter-spacing: -0.025em; }
.work-list dd { margin: 6px 0 0; color: var(--text-2); }

@media (max-width: 820px) {
  .work { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .work-list { grid-template-columns: 1fr; gap: 24px; }
}

.writing { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; }
.writing-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; grid-column: 1 / -1; }
.writing-head .section-title { margin: 0; }
.writing-head a { font-size: 0.95rem; }
.writing .post-list .post-row:first-child { border-top: 0; padding-top: 0; }

@media (max-width: 820px) {
  .writing { grid-template-columns: 1fr; gap: 32px; }
}

.post-featured {
  display: flex; flex-direction: column; justify-content: flex-start; gap: 0;
  padding: clamp(24px, 3vw, 36px);
  background: var(--plate); color: var(--on-plate); border-radius: var(--radius);
}
.post-featured ::selection { background: rgba(255, 255, 255, 0.25); }
.post-featured .post-kicker, .post-featured .post-kicker a, .post-featured .entry-meta, .post-featured .entry-meta a, .post-featured p { color: inherit; }
.post-featured .post-kicker, .post-featured .entry-meta { opacity: 0.85; }
.post-featured .post-kicker { margin: 0 0 14px; }
.post-featured .entry-meta { margin-top: auto; padding-top: 28px; }
.post-featured h3 {
  margin: 0 0 16px;
  font-weight: 600;
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.625rem);
  line-height: 1.06; letter-spacing: -0.035em;
  text-wrap: balance;
}
.post-featured h3 a { color: inherit; text-decoration: none; }
.post-featured h3 a:hover { text-decoration: underline; text-decoration-color: currentColor; }
.post-featured p { margin: 0; font-size: 1.125rem; line-height: 1.55; opacity: 0.92; }
.post-featured .post-kicker { font-size: 0.9rem; }

.topics ul { display: flex; flex-wrap: wrap; gap: 12px 34px; list-style: none; padding: 0; margin: 0; }
.topics a { color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); letter-spacing: -0.025em; }
.topics a:hover { color: var(--accent); }
.topics li span { color: var(--muted); font-size: 0.9rem; margin-left: 8px; }

.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.projects article { padding-top: 20px; border-top: 1px solid var(--line-2); }
.projects h3 { margin: 0 0 10px; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; }
.projects h3 a { color: inherit; text-decoration: none; }
.projects h3 a:hover { color: var(--accent); }
.projects h3 svg { display: inline-block; width: 20px; height: 20px; vertical-align: -2px; margin-left: 4px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.projects p { margin: 0; color: var(--text-2); }

@media (max-width: 640px) {
  .projects { grid-template-columns: 1fr; gap: 24px; }
}

.band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.band .section-title { margin: 0 0 6px; }
.band p { margin: 0; color: var(--text-2); max-width: 52ch; }

/* Post lists ------------------------------------------------------------ */

.post-list { margin: 0; padding: 0; }
.post-row {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.post-row time { color: var(--muted); font-size: 0.85rem; padding-top: 0.25em; }
.post-row h3 {
  margin: 0; font-weight: 600; font-size: 1.2rem; line-height: 1.3; letter-spacing: -0.02em;
}
.post-row h3 a { color: inherit; text-decoration: none; }
.post-row h3 a:hover { text-decoration: underline; text-decoration-color: var(--line-2); }
.post-row p { margin: 6px 0 0; color: var(--text-2); font-size: 0.95rem; }
.post-row .post-kicker { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.post-list-page .post-row { padding: 22px 0; }

@media (max-width: 560px) {
  .post-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Page headers ---------------------------------------------------------- */

.page-header { padding: clamp(40px, 6vw, 64px) 0 20px; }
.page-header h1 {
  margin: 0 0 16px;
  font-weight: 600;
  font-size: clamp(2.5rem, 1.4rem + 3vw, 4rem);
  line-height: 1; letter-spacing: -0.04em;
  text-wrap: balance;
}
.page-header p { margin: 0; color: var(--text-2); font-size: 1.1rem; max-width: 60ch; }
.page-header .page-count { margin-top: 8px; color: var(--muted); font-size: 0.9rem; }

.filters { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 22px 0 6px; font-size: 0.9rem; }
.filters a { color: var(--muted); text-decoration: none; }
.filters a:hover, .filters a[aria-current] { color: var(--text); }
.filters a[aria-current] { font-weight: 600; }

/* Single ---------------------------------------------------------------- */

.entry-header { padding: clamp(36px, 5vw, 56px) 0 24px; }
.entry-header .prose-wrap { width: min(100% - 32px, 880px); }
.rank-math-breadcrumb, .hg-breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }
.rank-math-breadcrumb p, .hg-breadcrumb p { margin: 0; }
.rank-math-breadcrumb a, .hg-breadcrumb a { color: var(--muted); text-decoration: none; }
.rank-math-breadcrumb a:hover, .hg-breadcrumb a:hover { color: var(--text); }
.rank-math-breadcrumb .separator, .hg-breadcrumb .separator { margin: 0 8px; }

.entry-title {
  margin: 0 0 18px;
  font-weight: 600;
  font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.5rem);
  line-height: 1.02; letter-spacing: -0.04em;
  text-wrap: balance;
}
.standfirst { margin: 0 0 20px; font-size: 1.3rem; line-height: 1.5; color: var(--text-2); max-width: 60ch; }
.entry-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  margin-top: 4px; font-size: 0.9rem; color: var(--muted);
}
.entry-meta a { color: var(--text-2); text-decoration: none; }
.entry-meta a:hover { color: var(--accent); }
.entry-meta .meta-author { display: inline-flex; align-items: center; gap: 8px; }
.entry-meta .meta-author img { width: 26px; height: 26px; border-radius: 50%; }

.entry-content { padding-bottom: 8px; }
.entry-content > * { margin-block: 0 1.35em; }
.entry-content p { margin: 0 0 1.35em; }
.entry-content h2 {
  margin: 2.1em 0 0.65em; font-weight: 600; font-size: 1.75rem; line-height: 1.25; letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.entry-content h3 {
  margin: 1.8em 0 0.6em; font-weight: 600; font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.015em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.entry-content h4 { margin: 1.6em 0 0.5em; font-size: 1.05rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1.35em; }
.entry-content li { margin: 0.35em 0; }
.entry-content li > ul, .entry-content li > ol { margin: 0.35em 0 0; }
.entry-content blockquote {
  margin: 1.6em 0; padding: 0 0 0 1.2em;
  border-left: 1px solid var(--line-2); color: var(--text-2);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content pre {
  margin: 0 0 1.5em; padding: 16px 18px; overflow: auto;
  font: 0.9rem/1.55 var(--font-mono);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.entry-content code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: var(--surface-2); padding: 0.12em 0.35em; border-radius: 5px;
}
.entry-content pre code { background: none; padding: 0; font-size: inherit; }
.entry-content img { border-radius: var(--radius); }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--muted); text-align: left; }
.entry-content .wp-block-image img { height: auto; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 1.5em; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry-content th { font-weight: 600; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.entry-content a { text-decoration: underline; }
.entry-content strong { font-weight: 600; }
.entry-content .wp-block-embed iframe { max-width: 100%; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content .wp-block-buttons .wp-block-button__link { border-radius: var(--radius); }

.toc {
  margin: 28px 0 36px; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.toc summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-2); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: '+'; float: right; color: var(--muted); }
.toc details[open] summary::after { content: '\2212'; }
.toc ol { margin: 12px 0 0; padding-left: 1.25em; }
.toc li { margin: 0.35em 0; font-size: 0.95rem; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.entry-tags { margin: 36px 0 0; font-size: 0.9rem; color: var(--muted); }
.entry-tags a { color: var(--text-2); text-decoration: none; margin-right: 14px; }
.entry-tags a:hover { color: var(--accent); }

.author-box {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px;
  margin: 44px 0 0; padding: 28px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.author-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.author-box strong { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -0.01em; }
.author-box strong a { color: inherit; text-decoration: none; }
.author-box p { margin: 6px 0 0; color: var(--text-2); font-size: 0.95rem; }
.author-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 0.9rem; }

.related { padding: 44px 0 0; }
.related .section-title { font-size: 1.35rem; margin-bottom: 8px; }
.related .post-row:first-of-type { border-top: 0; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.post-nav a { color: var(--text); text-decoration: none; }
.post-nav a:hover { color: var(--accent); }
.post-nav span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.post-nav .next { text-align: right; }
@media (max-width: 560px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
}

/* Pages ----------------------------------------------------------------- */


/* Pagination ------------------------------------------------------------ */

.pagination { margin: 32px 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
  display: inline-block; min-width: 40px; padding: 8px 12px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-size: 0.9rem;
}
.pagination a.page-numbers:hover { background: var(--surface-2); color: var(--text); }
.pagination .page-numbers.current { background: var(--text); color: var(--bg); border-color: var(--text); }
.pagination .page-numbers.dots { border: 0; }

/* Forms ----------------------------------------------------------------- */

input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="tel"], input[type="number"], textarea, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px 12px; width: 100%; max-width: 100%;
  caret-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 140px; resize: vertical; }
label { font-weight: 500; }

.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form input { flex: 1; }

.fluentform .ff-el-form-control { font: inherit; }
.fluentform .ff-el-input--label label { font-weight: 500; color: var(--text); }
.fluentform .ff-btn-submit,
.fluentform .ff-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px !important; font-weight: 500; font-size: 0.95rem !important;
  color: var(--on-accent) !important; background: var(--accent) !important;
  border: 1px solid transparent !important; border-radius: var(--radius) !important;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.fluentform .ff-btn-submit:hover { background: var(--accent-ink) !important; }
.fluentform .ff-btn-submit:active { transform: scale(0.97); }
.fluentform .ff-message-success { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.fluentform .ff-el-is-error .text-danger { color: #b42318; font-size: 0.85rem; }

/* Comments -------------------------------------------------------------- */

.comments-area { margin-top: 48px; }
.comments-title { font-size: 1.35rem; margin: 0 0 20px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { padding: 20px 0; border-top: 1px solid var(--line); }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.comment-author img { width: 32px; height: 32px; border-radius: 50%; }
.comment-metadata { font-size: 0.85rem; color: var(--muted); margin: 4px 0 10px; }
.comment-metadata a { color: var(--muted); text-decoration: none; }
.comment-content p { margin: 0 0 1em; }
.comment-reply-link { font-size: 0.85rem; }
.comment-form p { margin: 0 0 16px; }
.comment-form label { display: block; margin-bottom: 6px; }
.comment-form .submit { display: inline-flex; padding: 11px 18px; font-weight: 500; color: var(--on-accent); background: var(--accent); border: 0; border-radius: var(--radius); cursor: pointer; }
.comment-form .submit:hover { background: var(--accent-ink); }

/* Footer ---------------------------------------------------------------- */

.site-footer {
  margin-top: 64px; padding: 40px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem;
}
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: start; }
.footer-wordmark {
  grid-column: 1 / -1; margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.75rem, 1rem + 7.5vw, 6rem); line-height: 0.95; letter-spacing: -0.04em;
  color: var(--text); text-wrap: balance;
}
.footer-brand strong { color: var(--text); font-family: var(--font-display); font-size: 1.05rem; }
.footer-brand p { margin: 6px 0 0; max-width: 52ch; }
.footer-social { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.footer-social a { color: var(--text-2); text-decoration: none; }
.footer-social a:hover { color: var(--accent); }
.footer-nav ul { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.footer-nav a { color: var(--text-2); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-meta {
  grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
.footer-meta a { color: var(--muted); text-decoration: none; }
.footer-meta a:hover { color: var(--text); }
.footer-meta .lang a { padding: 2px 6px; }

@media (max-width: 640px) {
  .site-footer .wrap { grid-template-columns: 1fr; }
}

/* TranslatePress floater is replaced by the header switcher */
.trp-language-switcher-container, #trp-floater-ls { display: none !important; }

/* Motion preferences ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .hero-copy, .hero .hero-portrait { animation: none; }
  .btn, .icon-btn, .fluentform .ff-btn-submit { transition: none; }
}

/* Print ----------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .toc, .related, .post-nav, .author-links, .nav-tools { display: none !important; }
  body { font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
}
