:root {
  --bg: #f4f7fb;
  --bg-soft: #eaf0f7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-soft: rgba(255, 255, 255, 0.52);
  --ink: #111827;
  --ink-soft: #263244;
  --muted: #667085;
  --faint: #98a2b3;
  --line: rgba(148, 163, 184, 0.28);
  --line-strong: rgba(100, 116, 139, 0.34);
  --accent: #0a84ff;
  --accent-deep: #0064d2;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --gold: #ff9f0a;
  --rust: #ff453a;
  --accent-ink: #ffffff;
  --warn: #d92d20;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --glass-border: rgba(255, 255, 255, 0.72);
  --shadow: 0 20px 60px rgba(30, 41, 59, 0.12);
  --shadow-hover: 0 28px 80px rgba(30, 41, 59, 0.18);
  --content-width: 1120px;
  --reading-width: 780px;
  --pointer-x: 50%;
  --pointer-y: 18%;
  --scroll-shift: 0px;
  --scroll-shift-soft: 0px;
  --scroll-shift-mid: 0px;
  --scroll-shift-back: 0px;
  --glow-rotate: 0deg;
  --glow-drift-x: 0px;
  --glow-drift-y: 0px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at var(--pointer-x) calc(var(--pointer-y) + var(--scroll-shift)), rgba(69, 151, 171, 0.12), transparent 46vw),
    radial-gradient(ellipse at calc(100% - var(--pointer-x)) 14%, rgba(93, 166, 141, 0.1), transparent 44vw),
    radial-gradient(ellipse at 72% calc(74% - var(--scroll-shift)), rgba(235, 177, 97, 0.08), transparent 42vw),
    linear-gradient(120deg, rgba(255, 255, 255, 0.46), rgba(80, 151, 171, 0.05), rgba(82, 151, 122, 0.06), rgba(235, 177, 97, 0.04)),
    linear-gradient(180deg, rgba(250, 252, 251, 0.86), rgba(244, 247, 246, 0.74) 360px),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  isolation: isolate;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.24) 28%, rgba(244, 248, 247, 0.62) 100%),
    radial-gradient(ellipse at 52% 8%, rgba(255, 255, 255, 0.54), transparent 38%);
  opacity: 0.52;
  content: "";
}

body::after {
  position: fixed;
  inset: -24vmax;
  z-index: -1;
  pointer-events: none;
  background:
    conic-gradient(from var(--glow-rotate) at 50% 50%, rgba(10, 132, 255, 0.08), rgba(52, 199, 89, 0.075), rgba(255, 159, 10, 0.07), rgba(191, 90, 242, 0.05), rgba(10, 132, 255, 0.08)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent 48%, rgba(10, 132, 255, 0.045));
  filter: blur(64px) saturate(118%);
  opacity: 0.62;
  transform: translate3d(var(--glow-drift-x), var(--glow-drift-y), 0) rotate(var(--glow-rotate));
  transition: opacity 200ms ease;
  content: "";
}

html[data-theme="glass"] {
  --panel: rgba(255, 255, 255, 0.62);
  --panel-soft: rgba(255, 255, 255, 0.42);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --shadow: 0 20px 60px rgba(30, 41, 59, 0.12);
  --shadow-hover: 0 28px 80px rgba(30, 41, 59, 0.18);
}

html[data-theme="glass"] body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 247, 251, 0.72) 360px),
    var(--bg);
}

html[data-theme="glass"] body::before {
  background:
    radial-gradient(circle at 12% calc(-8% + var(--scroll-shift)), rgba(10, 132, 255, 0.2), transparent 34vw),
    radial-gradient(circle at 88% calc(8% + var(--scroll-shift-soft)), rgba(52, 199, 89, 0.13), transparent 30vw),
    radial-gradient(circle at 76% calc(76% - var(--scroll-shift-mid)), rgba(255, 159, 10, 0.11), transparent 30vw),
    radial-gradient(ellipse at 38% calc(38% - var(--scroll-shift-back)), rgba(191, 90, 242, 0.08), transparent 36vw);
  opacity: 0.86;
}

html[data-theme="glass"] body::after {
  display: block;
  inset: -30vmax;
  background:
    conic-gradient(from var(--glow-rotate) at 50% 50%, rgba(10, 132, 255, 0.12), rgba(52, 199, 89, 0.1), rgba(255, 159, 10, 0.09), rgba(191, 90, 242, 0.08), rgba(10, 132, 255, 0.12)),
    radial-gradient(ellipse at 28% 38%, rgba(255, 255, 255, 0.58), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 46%, rgba(10, 132, 255, 0.06));
  background-size: 170% 170%, 130% 130%, 100% 100%;
  filter: blur(58px) saturate(128%);
  opacity: 0.64;
  transform: translate3d(0, var(--scroll-shift-back), 0) rotate(var(--glow-rotate));
  animation: glassGradientFloat 18s ease-in-out infinite alternate;
}

html[data-theme="monument"] {
  --bg: #d7d0c2;
  --bg-soft: #c9c0b0;
  --panel: rgba(239, 233, 219, 0.84);
  --panel-soft: rgba(232, 224, 208, 0.68);
  --ink: #17130f;
  --ink-soft: #2c251e;
  --muted: #6a6257;
  --faint: #8a8174;
  --line: rgba(55, 47, 38, 0.24);
  --line-strong: rgba(45, 38, 30, 0.42);
  --accent: #8b1f17;
  --accent-deep: #5f1712;
  --accent-soft: rgba(139, 31, 23, 0.12);
  --gold: #b08a3b;
  --glass: rgba(241, 235, 221, 0.76);
  --glass-strong: rgba(247, 241, 228, 0.9);
  --glass-border: rgba(49, 42, 34, 0.26);
  --shadow: 0 24px 70px rgba(31, 26, 20, 0.18);
  --shadow-hover: 0 30px 88px rgba(31, 26, 20, 0.24);
}

html[data-theme="monument"] body {
  background:
    radial-gradient(ellipse at 50% -16%, rgba(255, 246, 221, 0.5), transparent 30vw),
    linear-gradient(90deg, rgba(42, 34, 27, 0.12), transparent 14%, transparent 86%, rgba(42, 34, 27, 0.12)),
    linear-gradient(180deg, rgba(242, 235, 219, 0.96), rgba(213, 204, 188, 0.9) 46%, rgba(184, 174, 156, 0.82)),
    var(--bg);
}

html[data-theme="monument"] body::before {
  background:
    radial-gradient(ellipse at 50% 4%, rgba(255, 252, 238, 0.5), transparent 34%),
    linear-gradient(180deg, rgba(38, 31, 25, 0.1), transparent 36%, rgba(255, 255, 255, 0.12));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.18) 62%, transparent 100%);
  opacity: 0.7;
}

html[data-theme="monument"] body::after {
  inset: 0;
  background:
    radial-gradient(circle at 50% 104px, rgba(124, 28, 20, 0.22) 0 42px, rgba(174, 135, 63, 0.32) 43px 48px, transparent 49px),
    linear-gradient(180deg, rgba(49, 39, 31, 0.22) 0 72px, rgba(255, 248, 228, 0.22) 73px 94px, transparent 95px),
    linear-gradient(90deg, rgba(64, 45, 35, 0.18) 0 12%, transparent 12% 88%, rgba(64, 45, 35, 0.18) 88% 100%),
    radial-gradient(ellipse at 50% 0%, rgba(139, 31, 23, 0.12), transparent 42%);
  filter: none;
  opacity: 0.9;
  transform: none;
}

html[data-theme="monument"] .three-water-canvas,
html[data-theme="monument"] .ambient-water-canvas,
html[data-theme="monument"] .ambient-lake-canvas {
  display: none;
}

html[data-theme="monument"] button,
html[data-theme="monument"] .button-link,
html[data-theme="monument"] .primary-action,
html[data-theme="monument"] .filter-tabs a,
html[data-theme="monument"] .archive-row,
html[data-theme="monument"] .search-result,
html[data-theme="monument"] .article-card,
html[data-theme="monument"] .auth-panel,
html[data-theme="monument"] .editor,
html[data-theme="monument"] .comment,
html[data-theme="monument"] .admin-row,
html[data-theme="monument"] .empty,
html[data-theme="monument"] input,
html[data-theme="monument"] textarea,
html[data-theme="monument"] select {
  border-radius: 2px;
}

html[data-theme="monument"] button,
html[data-theme="monument"] .button-link {
  border-color: rgba(39, 33, 27, 0.34);
  background: linear-gradient(180deg, rgba(249, 244, 230, 0.9), rgba(222, 212, 193, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56), 0 10px 24px rgba(35, 28, 21, 0.1);
}

html[data-theme="monument"] button:hover,
html[data-theme="monument"] .button-link:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 249, 233, 0.96), rgba(226, 214, 192, 0.94));
  color: var(--accent-deep);
}

html[data-theme="monument"] .primary-action,
html[data-theme="monument"] .filter-tabs a.active {
  border-color: #4f1712;
  background: linear-gradient(180deg, #9a261c, #661812);
  color: #fff4df;
  box-shadow: 0 14px 34px rgba(72, 21, 16, 0.22);
}

html[data-theme="monument"] .site-header {
  border-bottom: 2px solid rgba(43, 35, 27, 0.34);
  background: rgba(229, 220, 203, 0.82);
  box-shadow: 0 14px 34px rgba(37, 30, 22, 0.12);
  backdrop-filter: blur(16px) saturate(112%);
}

html[data-theme="monument"] .brand {
  font-weight: 900;
}

html[data-theme="monument"] .brand::before {
  width: 8px;
  border-radius: 1px;
  background: linear-gradient(180deg, #211b16, var(--accent), var(--gold));
  box-shadow: none;
}

html[data-theme="monument"] nav a.active {
  background: rgba(139, 31, 23, 0.12);
  color: var(--accent-deep);
}

html[data-theme="monument"] main::before,
html[data-theme="monument"] main::after {
  position: fixed;
  top: 84px;
  bottom: 5vh;
  z-index: -1;
  width: min(150px, 10.8vw);
  min-width: 86px;
  background:
    linear-gradient(90deg, rgba(255, 232, 188, 0.12), transparent 22%, rgba(33, 12, 10, 0.26) 84%),
    linear-gradient(180deg, #7d1e17, #4f1511 72%, #32100d);
  box-shadow: 0 18px 42px rgba(43, 24, 18, 0.24), inset 1px 0 0 rgba(255, 236, 194, 0.16), inset -1px 0 0 rgba(28, 10, 8, 0.28);
  content: "";
  pointer-events: none;
}

html[data-theme="monument"] main::before {
  left: 24px;
  clip-path: polygon(0 0, 70% 0, 70% 35%, 100% 46%, 70% 57%, 70% 91%, 35% 100%, 0 91%);
}

html[data-theme="monument"] main::after {
  right: 24px;
  clip-path: polygon(30% 0, 100% 0, 100% 91%, 65% 100%, 30% 91%, 30% 57%, 0 46%, 30% 35%);
}

html[data-theme="monument"] .hero {
  min-height: 390px;
  align-items: center;
  text-align: center;
}

html[data-theme="monument"] .hero::before {
  position: absolute;
  top: 16px;
  left: 50%;
  width: min(210px, 32vw);
  height: 8px;
  background: linear-gradient(90deg, transparent, rgba(87, 31, 24, 0.58), rgba(176, 138, 59, 0.62), rgba(87, 31, 24, 0.58), transparent);
  transform: translateX(-50%);
  content: "";
}

html[data-theme="monument"] .hero::after {
  display: none;
}

html[data-theme="monument"] .hero h1 {
  max-width: 1040px;
  margin-inline: auto;
  font-size: clamp(42px, 5.6vw, 74px);
  font-weight: 920;
  line-height: 0.98;
  text-shadow: 0 1px 0 rgba(255, 248, 230, 0.5), 0 22px 42px rgba(42, 34, 26, 0.2);
}

html[data-theme="monument"] .hero p,
html[data-theme="monument"] .eyebrow {
  margin-inline: auto;
}

html[data-theme="monument"] .hero-stats {
  justify-content: center;
}

html[data-theme="monument"] .hero-stats div {
  border-top: 4px solid var(--accent-deep);
  background: linear-gradient(180deg, rgba(240, 232, 214, 0.92), rgba(217, 205, 184, 0.86));
  box-shadow: 0 18px 42px rgba(39, 31, 24, 0.18);
}

html[data-theme="monument"] .article-card::before {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), rgba(43, 35, 27, 0.74));
}

html[data-theme="monument"] .article-card:hover,
html[data-theme="monument"] .archive-row:hover,
html[data-theme="monument"] .search-result:hover {
  border-color: rgba(95, 23, 18, 0.48);
  background: var(--glass-strong);
  transform: translateY(-1px);
}

html[data-theme="glass"] .three-water-canvas,
html[data-theme="glass"] .ambient-water-canvas,
html[data-theme="glass"] .ambient-lake-canvas {
  display: none;
}

@keyframes glassGradientFloat {
  0% {
    background-position: 0% 18%, 12% 8%, 0 0;
  }
  50% {
    background-position: 78% 42%, 58% 62%, 0 0;
  }
  100% {
    background-position: 26% 86%, 88% 28%, 0 0;
  }
}

html[data-theme="liberal"] {
  --bg: #e1d9c9;
  --bg-soft: #d3c9b8;
  --panel: rgba(244, 238, 224, 0.84);
  --panel-soft: rgba(236, 228, 210, 0.68);
  --ink: #171814;
  --ink-soft: #2a2d2f;
  --muted: #626b71;
  --faint: #899096;
  --line: rgba(45, 65, 84, 0.24);
  --line-strong: rgba(34, 52, 70, 0.42);
  --accent: #2360a6;
  --accent-deep: #153d72;
  --accent-soft: rgba(35, 96, 166, 0.12);
  --gold: #c39b3f;
  --glass: rgba(244, 238, 224, 0.76);
  --glass-strong: rgba(249, 244, 232, 0.9);
  --glass-border: rgba(43, 62, 80, 0.24);
  --shadow: 0 24px 70px rgba(24, 35, 46, 0.16);
  --shadow-hover: 0 30px 88px rgba(24, 35, 46, 0.22);
}

html[data-theme="liberal"] body {
  background:
    radial-gradient(ellipse at 50% -16%, rgba(255, 247, 212, 0.56), transparent 30vw),
    linear-gradient(90deg, rgba(32, 55, 78, 0.1), transparent 13%, transparent 87%, rgba(32, 55, 78, 0.1)),
    linear-gradient(180deg, rgba(246, 240, 225, 0.96), rgba(222, 214, 197, 0.9) 46%, rgba(194, 185, 168, 0.82)),
    var(--bg);
}

html[data-theme="liberal"] body::before {
  background:
    radial-gradient(ellipse at 50% 4%, rgba(255, 252, 232, 0.58), transparent 34%),
    linear-gradient(180deg, rgba(38, 52, 67, 0.08), transparent 36%, rgba(255, 255, 255, 0.12));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.18) 62%, transparent 100%);
  opacity: 0.7;
}

html[data-theme="liberal"] body::after {
  inset: 0;
  background:
    radial-gradient(circle at 50% 104px, rgba(255, 247, 211, 0.72) 0 28px, rgba(35, 96, 166, 0.24) 29px 38px, rgba(195, 155, 63, 0.34) 39px 46px, transparent 47px),
    conic-gradient(from -26deg at 50% 102px, transparent 0 34deg, rgba(195, 155, 63, 0.18) 35deg 39deg, transparent 40deg 74deg, rgba(35, 96, 166, 0.12) 75deg 79deg, transparent 80deg 114deg, rgba(195, 155, 63, 0.18) 115deg 119deg, transparent 120deg 360deg),
    linear-gradient(180deg, rgba(44, 58, 72, 0.18) 0 68px, rgba(255, 248, 228, 0.26) 69px 92px, transparent 93px),
    linear-gradient(90deg, rgba(45, 68, 91, 0.14) 0 10.5%, transparent 10.5% 89.5%, rgba(45, 68, 91, 0.14) 89.5% 100%),
    radial-gradient(ellipse at 50% 0%, rgba(35, 96, 166, 0.1), transparent 42%);
  filter: none;
  opacity: 0.9;
  transform: none;
}

html[data-theme="liberal"] .three-water-canvas,
html[data-theme="liberal"] .ambient-water-canvas,
html[data-theme="liberal"] .ambient-lake-canvas {
  display: none;
}

.three-water-canvas,
.ambient-water-canvas,
.ambient-lake-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.three-water-canvas {
  opacity: 0.66;
  mix-blend-mode: normal;
}

.ambient-water-canvas {
  opacity: 1;
  mix-blend-mode: normal;
}

.ambient-lake-canvas {
  opacity: 0.34;
  mix-blend-mode: normal;
}

.three-water-ready .ambient-water-canvas {
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.button-link,
.primary-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  padding: 8px 15px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(30, 41, 59, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(150%);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button:hover,
.button-link:hover {
  border-color: rgba(10, 132, 255, 0.42);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  box-shadow: 0 14px 34px rgba(30, 41, 59, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

button:active,
.button-link:active,
.primary-action:active {
  transform: translateY(1px);
}

.primary-action {
  border-color: rgba(10, 132, 255, 0.36);
  background: linear-gradient(180deg, #2aa1ff, var(--accent));
  color: var(--accent-ink);
  font-weight: 750;
}

.primary-action:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: var(--accent-ink);
}

.theme-toggle {
  min-height: 38px;
  gap: 8px;
  padding-inline: 13px;
}

.theme-toggle::before {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.9), transparent 32%),
    linear-gradient(135deg, var(--accent), var(--gold));
  box-shadow: 0 0 0 3px var(--accent-soft);
  content: "";
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 12px max(24px, calc((100vw - var(--content-width)) / 2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(246, 249, 252, 0.58);
  box-shadow: 0 10px 32px rgba(30, 41, 59, 0.06);
  backdrop-filter: blur(26px) saturate(170%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand::before {
  width: 10px;
  height: 30px;
  border-radius: 99px;
  background: linear-gradient(180deg, #34c759, var(--accent), var(--gold));
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.22);
  content: "";
}

nav,
.account,
.row-actions,
.admin-head > div:last-child {
  display: flex;
  gap: 8px;
  align-items: center;
}

nav a,
.account > a,
.account > span {
  border-radius: 999px;
  color: var(--muted);
  padding: 8px 12px;
}

nav a:hover,
.account > a:hover {
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
}

nav a.active {
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent-deep);
  font-weight: 800;
}

html[data-theme="liberal"] button,
html[data-theme="liberal"] .button-link,
html[data-theme="liberal"] .primary-action,
html[data-theme="liberal"] .filter-tabs a,
html[data-theme="liberal"] .archive-row,
html[data-theme="liberal"] .search-result,
html[data-theme="liberal"] .article-card,
html[data-theme="liberal"] .auth-panel,
html[data-theme="liberal"] .editor,
html[data-theme="liberal"] .comment,
html[data-theme="liberal"] .admin-row,
html[data-theme="liberal"] .empty,
html[data-theme="liberal"] input,
html[data-theme="liberal"] textarea,
html[data-theme="liberal"] select {
  border-radius: 2px;
}

html[data-theme="liberal"] button,
html[data-theme="liberal"] .button-link {
  border-color: rgba(39, 33, 27, 0.34);
  background: linear-gradient(180deg, rgba(249, 244, 230, 0.9), rgba(222, 212, 193, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56), 0 10px 24px rgba(35, 28, 21, 0.1);
}

html[data-theme="liberal"] button:hover,
html[data-theme="liberal"] .button-link:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 249, 233, 0.96), rgba(226, 214, 192, 0.94));
  color: var(--accent-deep);
}

html[data-theme="liberal"] .primary-action,
html[data-theme="liberal"] .filter-tabs a.active {
  border-color: #153d72;
  background: linear-gradient(180deg, #2f73bd, #174878);
  color: #fff8df;
  box-shadow: 0 14px 34px rgba(24, 65, 112, 0.22);
}

html[data-theme="liberal"] .site-header {
  border-bottom: 2px solid rgba(43, 35, 27, 0.34);
  background: rgba(229, 220, 203, 0.82);
  box-shadow: 0 14px 34px rgba(37, 30, 22, 0.12);
  backdrop-filter: blur(16px) saturate(112%);
}

html[data-theme="liberal"] .brand {
  font-weight: 900;
}

html[data-theme="liberal"] .brand::before {
  width: 8px;
  border-radius: 1px;
  background: linear-gradient(180deg, #153d72, var(--accent), var(--gold));
  box-shadow: none;
}

html[data-theme="liberal"] nav a.active {
  background: rgba(35, 96, 166, 0.12);
  color: var(--accent-deep);
}

.account form,
.row-actions form,
.comment form {
  margin: 0;
}

main {
  position: relative;
  z-index: 1;
  width: min(var(--content-width), calc(100% - 44px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

html[data-theme="liberal"] main::before,
html[data-theme="liberal"] main::after {
  position: fixed;
  top: 84px;
  bottom: 5vh;
  z-index: -1;
  width: min(132px, 9.4vw);
  min-width: 72px;
  background:
    linear-gradient(90deg, rgba(255, 243, 204, 0.22), transparent 22%, rgba(14, 39, 72, 0.2) 84%),
    linear-gradient(180deg, #2e6fad, #1d4c7c 62%, #15365e);
  box-shadow: 0 18px 42px rgba(28, 45, 65, 0.22), inset 1px 0 0 rgba(255, 243, 204, 0.22), inset -1px 0 0 rgba(9, 28, 54, 0.28);
  content: "";
  pointer-events: none;
}

html[data-theme="liberal"] main::before {
  left: 24px;
  clip-path: polygon(0 0, 100% 0, 100% 11%, 78% 11%, 78% 88%, 100% 88%, 100% 100%, 0 100%, 0 88%, 18% 88%, 18% 11%, 0 11%);
}

html[data-theme="liberal"] main::after {
  right: 24px;
  clip-path: polygon(0 0, 100% 0, 100% 11%, 82% 11%, 82% 88%, 100% 88%, 100% 100%, 0 100%, 0 88%, 22% 88%, 22% 11%, 0 11%);
}

.hero {
  position: relative;
  display: grid;
  min-height: 330px;
  align-items: end;
  padding: 54px 0 48px;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 34px;
  width: min(360px, 36vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 132, 255, 0.42), transparent);
  content: "";
}

html[data-theme="liberal"] .hero {
  min-height: 390px;
  align-items: center;
  text-align: center;
}

html[data-theme="liberal"] .hero::before {
  position: absolute;
  top: 16px;
  left: 50%;
  width: min(210px, 32vw);
  height: 8px;
  background: linear-gradient(90deg, transparent, rgba(35, 96, 166, 0.58), rgba(195, 155, 63, 0.62), rgba(35, 96, 166, 0.58), transparent);
  transform: translateX(-50%);
  content: "";
}

html[data-theme="liberal"] .hero::after {
  display: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl {
  margin-top: 0;
}

.hero h1,
.page-heading h1,
.admin-head h1,
.editor h1,
.auth-panel h1 {
  max-width: 920px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: clamp(38px, 6vw, 76px);
  font-weight: 820;
  line-height: 1.03;
  letter-spacing: 0;
}

.hero h1 {
  max-width: none;
  color: var(--ink);
  font-size: clamp(38px, 5vw, 60px);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55), 0 18px 42px rgba(20, 61, 76, 0.12);
  white-space: nowrap;
}

html[data-theme="liberal"] .hero h1 {
  max-width: 1040px;
  margin-inline: auto;
  font-size: clamp(42px, 5.6vw, 74px);
  font-weight: 920;
  line-height: 0.98;
  text-shadow: 0 1px 0 rgba(255, 248, 230, 0.5), 0 22px 42px rgba(42, 34, 26, 0.2);
}

.hero p {
  max-width: 700px;
  color: var(--muted);
  font-size: 20px;
}

html[data-theme="liberal"] .hero p,
html[data-theme="liberal"] .eyebrow {
  margin-inline: auto;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 0;
}

.hero-stats div {
  min-width: 126px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass);
  padding: 14px 16px;
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(155%);
}

html[data-theme="liberal"] .hero-stats {
  justify-content: center;
}

html[data-theme="liberal"] .hero-stats div {
  border-top: 4px solid var(--accent-deep);
  background: linear-gradient(180deg, rgba(244, 238, 222, 0.92), rgba(221, 213, 196, 0.86));
  box-shadow: 0 18px 42px rgba(24, 35, 46, 0.16);
}

.hero-stats dt {
  color: var(--ink);
  font-size: 26px;
  font-weight: 850;
  line-height: 1;
}

.hero-stats dd {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.64);
  padding-top: 24px;
}

.section-head h2 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 850;
}

.section-head a {
  color: var(--accent);
  font-weight: 800;
}

.section-head a:hover,
.source-link:hover {
  color: var(--accent-deep);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feed-sentinel {
  min-height: 58px;
  padding: 28px 0 0;
  color: var(--faint);
  font-size: 14px;
  text-align: center;
}

.article-card,
.auth-panel,
.editor,
.comment,
.admin-row,
.empty {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(160%);
}

.article-card {
  position: relative;
  display: flex;
  min-height: 244px;
  flex-direction: column;
  padding: 25px;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.article-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #34c759, var(--accent), var(--gold), transparent);
  opacity: 0.82;
  content: "";
}

html[data-theme="liberal"] .article-card::before {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold), rgba(45, 68, 91, 0.74));
}

.article-card:hover,
.archive-row:hover,
.search-result:hover {
  border-color: rgba(10, 132, 255, 0.48);
  background: var(--glass-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

html[data-theme="liberal"] .article-card:hover,
html[data-theme="liberal"] .archive-row:hover,
html[data-theme="liberal"] .search-result:hover {
  border-color: rgba(35, 96, 166, 0.46);
  background: var(--glass-strong);
  transform: translateY(-1px);
}

time,
.muted,
.admin-row span,
.article header p {
  color: var(--muted);
}

.article-card time {
  color: var(--faint);
  font-size: 13px;
}

.article-card h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0;
  font-size: 24px;
  line-height: 1.24;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.article-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  margin-bottom: 0;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.page-heading,
.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.page-heading p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.archive-list,
.admin-list {
  display: grid;
  gap: 10px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 24px;
}

.filter-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  padding: 8px 15px;
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.filter-tabs a:hover {
  border-color: rgba(10, 132, 255, 0.42);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
}

.filter-tabs a.active {
  border-color: rgba(10, 132, 255, 0.38);
  background: linear-gradient(180deg, rgba(55, 154, 255, 0.94), rgba(10, 132, 255, 0.94));
  color: var(--accent-ink);
  box-shadow: 0 14px 34px rgba(10, 132, 255, 0.24);
}

.filter-tabs span {
  color: inherit;
  font-size: 13px;
  opacity: 0.72;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin: -8px 0 22px;
}

.search-form input {
  min-height: 50px;
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-summary {
  margin: 2px 0 4px;
  color: var(--muted);
}

.search-result {
  display: grid;
  gap: 9px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--panel);
  padding: 19px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(160%);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-result div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.search-result small {
  color: var(--accent);
  font-weight: 850;
}

.search-result h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 24px;
  line-height: 1.28;
}

.search-result p {
  margin: 0;
  color: var(--muted);
}

.search-result p:not(.search-result-source) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.search-result .search-result-source {
  color: var(--accent);
  font-weight: 760;
}

mark {
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 1px 4px;
}

.archive-row,
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--panel);
  padding: 17px 19px;
  box-shadow: 0 12px 34px rgba(30, 41, 59, 0.08);
  backdrop-filter: blur(22px) saturate(155%);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.archive-row span {
  overflow: hidden;
  min-width: 0;
  font-size: 17px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-row small {
  display: inline-flex;
  min-width: 40px;
  margin-right: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.archive-row time {
  white-space: nowrap;
}

.article {
  width: min(var(--reading-width), 100%);
  margin: 0 auto;
}

.article header {
  margin-bottom: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.66);
}

.article header h1 {
  margin: 12px 0 0;
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 880;
  line-height: 1.08;
  letter-spacing: 0;
}

.article header time {
  color: var(--faint);
  font-size: 15px;
}

.source-link {
  color: var(--accent);
  font-weight: 800;
}

.article-footer {
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.66);
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.66);
}

.article-nav a,
.article-nav .disabled {
  min-height: 92px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 12px 34px rgba(30, 41, 59, 0.08);
  backdrop-filter: blur(22px) saturate(155%);
}

.article-nav a {
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease;
}

.article-nav a:hover {
  border-color: rgba(10, 132, 255, 0.48);
  background: var(--glass-strong);
}

.article-nav span span,
.article-nav a span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.article-nav strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 16px;
  line-height: 1.45;
}

.article-nav .disabled {
  color: var(--muted);
  opacity: 0.58;
}

.prose {
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.88;
}

.prose h2,
.prose h3 {
  color: var(--ink);
  line-height: 1.28;
}

.prose h2 {
  margin: 34px 0 16px;
  font-size: 29px;
}

.prose h3 {
  margin: 28px 0 14px;
  font-size: 22px;
}

.prose p,
.prose ul {
  margin-bottom: 22px;
}

.prose ul {
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 8px;
}

.prose a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: rgba(10, 132, 255, 0.35);
  text-underline-offset: 4px;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 26px auto;
  border-radius: 8px;
  cursor: zoom-in;
  box-shadow: 0 18px 46px rgba(30, 41, 59, 0.14);
}

.prose blockquote {
  margin: 28px 0;
  border-left: 4px solid var(--accent);
  background: rgba(255, 255, 255, 0.5);
  padding: 14px 18px;
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(145%);
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(16, 16, 14, 0.88);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox-img {
  max-width: min(100%, 1500px);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
  cursor: zoom-out;
}

.image-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.comments {
  width: min(var(--reading-width), 100%);
  margin: 58px auto 0;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.66);
}

.comments h2 {
  margin-bottom: 18px;
  font-size: 28px;
}

.comment {
  margin-bottom: 12px;
  padding: 18px;
  box-shadow: 0 12px 34px rgba(30, 41, 59, 0.08);
}

.comment > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.comment-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.comment p {
  margin-bottom: 0;
}

.external-comment {
  background: rgba(255, 255, 255, 0.46);
  box-shadow: none;
}

.comment-replies {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-left: 2px solid rgba(10, 132, 255, 0.2);
  padding-left: 14px;
}

.comment-replies .comment {
  margin-bottom: 0;
}

.comment-form {
  margin-top: 22px;
}

.auth-panel,
.editor,
.narrow {
  width: min(720px, 100%);
  margin: 0 auto;
}

.auth-panel,
.editor,
.empty {
  padding: 28px;
}

.auth-panel p,
.narrow p {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(145%);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(10, 132, 255, 0.58);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

textarea {
  resize: vertical;
}

.content-editor {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

code {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  padding: 2px 6px;
}

/* Theme polish */
html[data-theme="lake"] {
  --bg: #edf6f2;
  --bg-soft: #dfeee9;
  --panel: rgba(250, 255, 252, 0.72);
  --panel-soft: rgba(244, 251, 248, 0.52);
  --ink: #101c1e;
  --ink-soft: #253e43;
  --muted: #607174;
  --faint: #8ba0a0;
  --line: rgba(87, 130, 135, 0.22);
  --accent: #0d7c8a;
  --accent-deep: #075b65;
  --accent-soft: rgba(13, 124, 138, 0.12);
  --gold: #c99a3c;
  --glass: rgba(250, 255, 252, 0.66);
  --glass-strong: rgba(255, 255, 252, 0.84);
  --glass-border: rgba(255, 255, 255, 0.72);
  --shadow: 0 22px 70px rgba(34, 76, 82, 0.12);
  --shadow-hover: 0 30px 86px rgba(34, 76, 82, 0.18);
}

html[data-theme="lake"] body {
  background:
    radial-gradient(ellipse at var(--pointer-x) calc(var(--pointer-y) + var(--scroll-shift)), rgba(140, 214, 214, 0.18), transparent 42vw),
    radial-gradient(ellipse at 74% calc(18% + var(--scroll-shift-soft)), rgba(248, 221, 151, 0.14), transparent 34vw),
    radial-gradient(ellipse at 24% calc(86% - var(--scroll-shift-mid)), rgba(93, 166, 141, 0.12), transparent 40vw),
    linear-gradient(180deg, rgba(247, 253, 249, 0.86), rgba(230, 242, 238, 0.62) 380px, rgba(219, 233, 230, 0.54)),
    var(--bg);
}

html[data-theme="lake"] body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.2) 30%, rgba(238, 248, 244, 0.42)),
    radial-gradient(ellipse at 52% 10%, rgba(255, 250, 225, 0.48), transparent 34%),
    repeating-linear-gradient(103deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 42px);
  opacity: 0.58;
}

html[data-theme="lake"] .three-water-canvas {
  opacity: 0.58;
}

html[data-theme="lake"] .ambient-lake-canvas {
  opacity: 0.28;
}

html[data-theme="lake"] .site-header {
  border-bottom-color: rgba(255, 255, 255, 0.72);
  background: rgba(241, 250, 248, 0.62);
  box-shadow: 0 12px 42px rgba(28, 82, 88, 0.08);
}

html[data-theme="lake"] .article-card,
html[data-theme="lake"] .archive-row,
html[data-theme="lake"] .search-result,
html[data-theme="lake"] .auth-panel,
html[data-theme="lake"] .editor,
html[data-theme="lake"] .comment,
html[data-theme="lake"] .admin-row,
html[data-theme="lake"] .empty {
  border-color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(145deg, rgba(255, 255, 252, 0.76), rgba(236, 247, 244, 0.62));
  box-shadow: 0 22px 70px rgba(28, 82, 88, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

html[data-theme="lake"] .article-card::before {
  background: linear-gradient(90deg, rgba(13, 124, 138, 0.78), rgba(111, 178, 148, 0.7), rgba(201, 154, 60, 0.62), transparent);
}

html[data-theme="lake"] .filter-tabs a.active,
html[data-theme="lake"] .primary-action {
  background: linear-gradient(180deg, #1997a4, #0d6f7b);
  box-shadow: 0 16px 36px rgba(13, 124, 138, 0.24);
}

html[data-theme="glass"] {
  --bg: #f7f8fb;
  --bg-soft: #eef2f7;
  --panel: rgba(255, 255, 255, 0.56);
  --panel-soft: rgba(255, 255, 255, 0.36);
  --ink: #111827;
  --ink-soft: #263244;
  --muted: #667085;
  --faint: #98a2b3;
  --line: rgba(148, 163, 184, 0.2);
  --accent: #0a84ff;
  --accent-deep: #0067d8;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --gold: #ffb340;
  --glass: rgba(255, 255, 255, 0.56);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.74);
  --shadow: 0 24px 70px rgba(30, 41, 59, 0.1);
  --shadow-hover: 0 32px 92px rgba(30, 41, 59, 0.16);
}

html[data-theme="glass"] body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 249, 253, 0.7) 360px),
    radial-gradient(ellipse at 18% 16%, rgba(10, 132, 255, 0.12), transparent 34vw),
    radial-gradient(ellipse at 88% 20%, rgba(52, 199, 89, 0.08), transparent 28vw),
    var(--bg);
}

html[data-theme="glass"] .site-header,
html[data-theme="glass"] button,
html[data-theme="glass"] .button-link,
html[data-theme="glass"] .primary-action,
html[data-theme="glass"] .filter-tabs a,
html[data-theme="glass"] .article-card,
html[data-theme="glass"] .archive-row,
html[data-theme="glass"] .search-result,
html[data-theme="glass"] .auth-panel,
html[data-theme="glass"] .editor,
html[data-theme="glass"] .comment,
html[data-theme="glass"] .admin-row,
html[data-theme="glass"] .empty,
html[data-theme="glass"] input,
html[data-theme="glass"] textarea,
html[data-theme="glass"] select {
  border-color: rgba(255, 255, 255, 0.78);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38));
  box-shadow: 0 24px 70px rgba(30, 41, 59, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="glass"] .site-header {
  background-color: rgba(246, 249, 252, 0.5);
}

html[data-theme="glass"] .hero h1 {
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72), 0 20px 60px rgba(10, 132, 255, 0.1);
}

html[data-theme="glass"] .article-card::before {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(10, 132, 255, 0.72), rgba(255, 255, 255, 0.9), rgba(52, 199, 89, 0.48), transparent);
}

html[data-theme="liberal"] {
  --bg: #e7e0d2;
  --bg-soft: #d9cfbd;
  --panel: rgba(246, 240, 225, 0.82);
  --panel-soft: rgba(238, 230, 212, 0.64);
  --ink: #141a1f;
  --ink-soft: #293642;
  --muted: #61707a;
  --faint: #8996a0;
  --line: rgba(45, 74, 103, 0.22);
  --line-strong: rgba(31, 54, 78, 0.36);
  --accent: #276aa8;
  --accent-deep: #173f6f;
  --accent-soft: rgba(39, 106, 168, 0.12);
  --gold: #c59b43;
  --glass: rgba(246, 240, 225, 0.78);
  --glass-strong: rgba(252, 246, 232, 0.92);
  --glass-border: rgba(55, 78, 98, 0.22);
  --shadow: 0 22px 64px rgba(29, 46, 62, 0.13);
  --shadow-hover: 0 30px 82px rgba(29, 46, 62, 0.19);
}

html[data-theme="liberal"] body {
  background:
    radial-gradient(ellipse at 50% -14%, rgba(255, 248, 217, 0.64), transparent 30vw),
    radial-gradient(ellipse at 22% 20%, rgba(39, 106, 168, 0.1), transparent 34vw),
    linear-gradient(90deg, rgba(36, 67, 96, 0.08), transparent 15%, transparent 85%, rgba(36, 67, 96, 0.08)),
    linear-gradient(180deg, rgba(248, 241, 225, 0.98), rgba(224, 216, 198, 0.9) 52%, rgba(203, 194, 176, 0.82)),
    var(--bg);
  background-attachment: fixed;
}

html[data-theme="liberal"] body::after {
  background:
    radial-gradient(circle at 50% 104px, rgba(255, 250, 226, 0.78) 0 29px, rgba(39, 106, 168, 0.22) 30px 39px, rgba(197, 155, 67, 0.34) 40px 47px, transparent 48px),
    conic-gradient(from -28deg at 50% 102px, transparent 0 33deg, rgba(197, 155, 67, 0.16) 34deg 39deg, transparent 40deg 74deg, rgba(39, 106, 168, 0.1) 75deg 80deg, transparent 81deg 114deg, rgba(197, 155, 67, 0.16) 115deg 120deg, transparent 121deg 360deg),
    linear-gradient(90deg, rgba(45, 76, 106, 0.1) 0 8.5%, transparent 8.5% 91.5%, rgba(45, 76, 106, 0.1) 91.5% 100%),
    radial-gradient(ellipse at 50% 0%, rgba(39, 106, 168, 0.08), transparent 42%);
  transform: none;
  transition: none;
}

html[data-theme="liberal"] button,
html[data-theme="liberal"] .button-link,
html[data-theme="liberal"] .primary-action,
html[data-theme="liberal"] .filter-tabs a,
html[data-theme="liberal"] .archive-row,
html[data-theme="liberal"] .search-result,
html[data-theme="liberal"] .article-card,
html[data-theme="liberal"] .auth-panel,
html[data-theme="liberal"] .editor,
html[data-theme="liberal"] .comment,
html[data-theme="liberal"] .admin-row,
html[data-theme="liberal"] .empty,
html[data-theme="liberal"] input,
html[data-theme="liberal"] textarea,
html[data-theme="liberal"] select {
  border-radius: 6px;
}

html[data-theme="liberal"] .site-header {
  border-bottom: 1px solid rgba(49, 61, 70, 0.28);
  background: rgba(233, 225, 207, 0.8);
}

html[data-theme="liberal"] main::before,
html[data-theme="liberal"] main::after {
  top: 86px;
  bottom: 6vh;
  width: min(92px, 6.8vw);
  min-width: 48px;
  background:
    linear-gradient(90deg, rgba(255, 246, 210, 0.2), transparent 26%, rgba(20, 58, 92, 0.1) 84%),
    linear-gradient(90deg, rgba(38, 102, 158, 0.58) 0 10%, transparent 10% 35%, rgba(38, 102, 158, 0.48) 35% 45%, transparent 45% 72%, rgba(23, 63, 111, 0.58) 72% 100%),
    linear-gradient(180deg, rgba(93, 154, 201, 0.6), rgba(37, 91, 137, 0.58) 70%, rgba(22, 65, 108, 0.62));
  clip-path: none;
  mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 90%, transparent 100%);
  box-shadow: 0 18px 46px rgba(28, 57, 82, 0.12), inset 1px 0 0 rgba(255, 246, 210, 0.14);
  opacity: 0.62;
}

html[data-theme="liberal"] main::before {
  left: 28px;
}

html[data-theme="liberal"] main::after {
  right: 28px;
}

html[data-theme="liberal"] .hero::before {
  top: 12px;
  height: 10px;
  background: linear-gradient(90deg, transparent, rgba(39, 106, 168, 0.52), rgba(197, 155, 67, 0.58), rgba(255, 248, 222, 0.72), rgba(197, 155, 67, 0.58), rgba(39, 106, 168, 0.52), transparent);
}

html[data-theme="liberal"] .hero h1 {
  font-weight: 880;
  letter-spacing: 0;
}

html[data-theme="liberal"] .hero-stats div {
  border-top: 3px solid var(--accent-deep);
  background: linear-gradient(180deg, rgba(248, 241, 225, 0.94), rgba(226, 216, 195, 0.82));
}

html[data-theme="monument"] {
  --bg: #d4cbbb;
  --bg-soft: #c4b9a7;
  --panel: rgba(238, 230, 214, 0.86);
  --panel-soft: rgba(228, 218, 199, 0.68);
  --ink: #15110e;
  --ink-soft: #2a211a;
  --muted: #675b4d;
  --faint: #887d6d;
  --line: rgba(49, 38, 28, 0.24);
  --line-strong: rgba(42, 31, 22, 0.46);
  --accent: #7b1d16;
  --accent-deep: #4f1511;
  --accent-soft: rgba(123, 29, 22, 0.12);
  --gold: #ad8435;
  --glass: rgba(239, 231, 214, 0.8);
  --glass-strong: rgba(247, 239, 224, 0.92);
  --glass-border: rgba(45, 34, 25, 0.24);
  --shadow: 0 24px 70px rgba(30, 22, 16, 0.18);
  --shadow-hover: 0 32px 88px rgba(30, 22, 16, 0.26);
}

html[data-theme="monument"] body {
  background:
    radial-gradient(ellipse at 50% -15%, rgba(255, 241, 204, 0.5), transparent 29vw),
    linear-gradient(90deg, rgba(32, 24, 18, 0.16), transparent 13%, transparent 87%, rgba(32, 24, 18, 0.16)),
    linear-gradient(180deg, rgba(238, 230, 213, 0.98), rgba(208, 197, 179, 0.92) 48%, rgba(177, 164, 143, 0.86)),
    var(--bg);
  background-attachment: fixed;
}

html[data-theme="monument"] body::after {
  background:
    radial-gradient(circle at 50% 104px, rgba(63, 20, 16, 0.32) 0 31px, rgba(173, 132, 53, 0.38) 32px 40px, rgba(245, 226, 181, 0.34) 41px 50px, transparent 51px),
    linear-gradient(180deg, rgba(45, 34, 25, 0.24) 0 70px, rgba(255, 246, 223, 0.2) 71px 94px, transparent 95px),
    linear-gradient(90deg, rgba(49, 38, 29, 0.18) 0 11%, transparent 11% 89%, rgba(49, 38, 29, 0.18) 89% 100%),
    radial-gradient(ellipse at 50% 0%, rgba(123, 29, 22, 0.1), transparent 40%);
  transform: none;
  transition: none;
}

html[data-theme="monument"] .section-head {
  border-top: 0;
}

html[data-theme="monument"] main::before,
html[data-theme="monument"] main::after {
  top: 84px;
  bottom: 5vh;
  width: min(104px, 7.6vw);
  min-width: 66px;
  background:
    radial-gradient(circle at 50% 19%, rgba(228, 189, 99, 0.72) 0 11px, rgba(62, 18, 14, 0.9) 12px 24px, rgba(174, 130, 48, 0.7) 25px 29px, transparent 30px),
    linear-gradient(90deg, transparent 0 15%, rgba(31, 13, 11, 0.82) 15% 24%, transparent 24% 76%, rgba(31, 13, 11, 0.78) 76% 85%, transparent 85% 100%),
    linear-gradient(180deg, rgba(168, 44, 30, 0.96), rgba(94, 21, 16, 0.98) 62%, rgba(47, 14, 11, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 232, 174, 0.08) 0 1px, transparent 1px 18px);
  box-shadow: 0 24px 60px rgba(36, 20, 14, 0.28), inset 1px 0 0 rgba(255, 226, 176, 0.16), inset -1px 0 0 rgba(26, 7, 5, 0.42);
  opacity: 0.96;
}

html[data-theme="monument"] main::before {
  left: 16px;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
}

html[data-theme="monument"] main::after {
  right: 16px;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
}

html[data-theme="monument"] .hero::before {
  top: 12px;
  width: min(250px, 34vw);
  height: 10px;
  background:
    linear-gradient(90deg, transparent, rgba(77, 21, 17, 0.72), rgba(173, 132, 53, 0.7), rgba(245, 226, 181, 0.52), rgba(173, 132, 53, 0.7), rgba(77, 21, 17, 0.72), transparent);
  box-shadow: 0 12px 30px rgba(57, 31, 21, 0.12);
}

html[data-theme="monument"] .hero h1 {
  font-weight: 930;
  text-shadow: 0 1px 0 rgba(255, 246, 224, 0.48), 0 24px 48px rgba(37, 28, 21, 0.24);
}

html[data-theme="monument"] .article-card,
html[data-theme="monument"] .archive-row,
html[data-theme="monument"] .search-result,
html[data-theme="monument"] .auth-panel,
html[data-theme="monument"] .editor,
html[data-theme="monument"] .comment,
html[data-theme="monument"] .admin-row,
html[data-theme="monument"] .empty {
  background: linear-gradient(180deg, rgba(240, 232, 214, 0.92), rgba(224, 213, 193, 0.86));
  box-shadow: 0 22px 58px rgba(35, 25, 18, 0.16);
}

html[data-theme="monument"] .article-card::before {
  background: linear-gradient(90deg, #7b1d16, #ad8435, rgba(42, 31, 22, 0.76));
}

@media (max-width: 1040px) {
  html[data-theme="liberal"] main::before,
  html[data-theme="liberal"] main::after,
  html[data-theme="monument"] main::before,
  html[data-theme="monument"] main::after {
    opacity: 0.34;
  }
}

@media (max-width: 800px) {
  html[data-theme="liberal"] main::before,
  html[data-theme="liberal"] main::after,
  html[data-theme="monument"] main::before,
  html[data-theme="monument"] main::after {
    display: none;
  }

  html[data-theme="liberal"] .hero,
  html[data-theme="monument"] .hero {
    min-height: 0;
  }
}

@media (max-width: 960px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .site-header,
  .page-heading,
  .admin-head,
  .archive-row,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .site-header {
    position: static;
    gap: 12px;
  }

  main {
    width: min(100% - 28px, var(--content-width));
    padding-top: 32px;
  }

  .hero {
    min-height: 0;
    padding: 28px 0 34px;
  }

  .hero::after {
    display: none;
  }

  .hero h1,
  .page-heading h1,
  .admin-head h1,
  .editor h1,
  .auth-panel h1 {
    font-size: clamp(32px, 10.8vw, 48px);
  }

  .hero h1 {
    white-space: normal;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  nav,
  .account {
    flex-wrap: wrap;
  }

  .archive-row time {
    justify-self: start;
  }

  .archive-row span {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-inline: 14px;
  }

  .brand {
    font-size: 20px;
  }

  nav a,
  .account > a,
  .account > span {
    padding: 7px 8px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stats div {
    min-width: 0;
  }

  .article-card,
  .search-result,
  .archive-row,
  .admin-row,
  .auth-panel,
  .editor,
  .empty {
    padding: 18px;
  }

  .article header h1 {
    font-size: clamp(32px, 11vw, 46px);
  }

  .prose {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .three-water-canvas,
  .ambient-water-canvas,
  .ambient-lake-canvas {
    display: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
