:root {
  color-scheme: dark;
  --page-bg:
    radial-gradient(circle at top, rgba(240, 194, 67, 0.12), transparent 34%),
    radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.08), transparent 28%),
    #06080c;
  --surface: rgba(15, 21, 32, 0.82);
  --surface-strong: rgba(19, 27, 42, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(240, 194, 67, 0.24);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #f0c243;
  --accent-strong: #f59e0b;
  --accent-contrast: #2b1700;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-glow: 0 0 80px -20px rgba(240, 194, 67, 0.2);
  --body-font: Inter, "Segoe UI", sans-serif;
  --heading-font: Poppins, Inter, "Segoe UI", sans-serif;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --content-width: 1200px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg:
    radial-gradient(circle at top, rgba(114, 118, 125, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(250, 166, 26, 0.08), transparent 28%),
    #36393f;
  --surface: rgba(32, 34, 37, 0.84);
  --surface-strong: rgba(43, 45, 49, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(250, 166, 26, 0.24);
  --text: #dcddde;
  --muted: #b9bbbe;
  --accent: #faa61a;
  --accent-strong: #e59400;
  --accent-contrast: #161819;
  --shadow-glow: 0 0 80px -20px rgba(250, 166, 26, 0.18);
}

html[data-theme="light"] {
  color-scheme: light;
  --page-bg:
    radial-gradient(circle at top, rgba(96, 165, 250, 0.16), transparent 34%),
    radial-gradient(circle at bottom left, rgba(180, 83, 9, 0.1), transparent 24%),
    #f6f8fb;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-soft: rgba(15, 23, 42, 0.03);
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(180, 83, 9, 0.2);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #b45309;
  --accent-strong: #92400e;
  --accent-contrast: #ffffff;
  --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 80px -20px rgba(59, 130, 246, 0.14);
}

html[data-theme="retro"] {
  color-scheme: dark;
  --page-bg:
    radial-gradient(circle at top, rgba(74, 144, 217, 0.18), transparent 34%),
    linear-gradient(180deg, #121826 0%, #0a0e14 100%);
  --surface: rgba(19, 24, 31, 0.92);
  --surface-strong: rgba(26, 32, 48, 0.98);
  --surface-soft: rgba(255, 255, 255, 0.02);
  --border: #3a4a5c;
  --border-strong: #d4a017;
  --text: #e8dcc8;
  --muted: #8a9bb0;
  --accent: #ffc107;
  --accent-strong: #ffe066;
  --accent-contrast: #0a0e14;
  --shadow-card: inset 2px 2px 0 rgba(255, 255, 255, 0.05), inset -2px -2px 0 rgba(0, 0, 0, 0.4), 0 0 0 2px #3a4a5c, 0 10px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(255, 193, 7, 0.1);
  --body-font: "Lucida Console", "Courier New", monospace;
  --heading-font: "Courier New", "Lucida Console", monospace;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
}

html[data-theme="neon"] {
  color-scheme: dark;
  --page-bg:
    radial-gradient(circle at top, rgba(0, 240, 255, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 0, 128, 0.14), transparent 28%),
    #050508;
  --surface: rgba(18, 18, 31, 0.82);
  --surface-strong: rgba(26, 26, 46, 0.94);
  --surface-soft: rgba(0, 240, 255, 0.04);
  --border: rgba(0, 240, 255, 0.16);
  --border-strong: rgba(255, 0, 128, 0.34);
  --text: #e0e0ff;
  --muted: #a0a0c0;
  --accent: #00f0ff;
  --accent-strong: #00ff88;
  --accent-contrast: #050508;
  --shadow-card: 0 0 0 1px rgba(0, 240, 255, 0.12), 0 18px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 80px -10px rgba(0, 240, 255, 0.24);
  --body-font: "Trebuchet MS", "Segoe UI", sans-serif;
  --heading-font: Verdana, "Trebuchet MS", sans-serif;
}

html[data-theme="skeuomorphic"] {
  color-scheme: dark;
  --page-bg:
    radial-gradient(circle at top, rgba(232, 212, 139, 0.14), transparent 36%),
    linear-gradient(180deg, #1a0f0a 0%, #0d0705 100%);
  --surface: rgba(61, 35, 20, 0.84);
  --surface-strong: rgba(92, 58, 33, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(201, 162, 39, 0.28);
  --border-strong: rgba(232, 212, 139, 0.34);
  --text: #f5f0e1;
  --muted: #c9b896;
  --accent: #c9a227;
  --accent-strong: #e8d48b;
  --accent-contrast: #2a1810;
  --shadow-card: inset 0 2px 4px rgba(255, 255, 255, 0.05), inset 0 -5px 12px rgba(0, 0, 0, 0.28), 0 18px 42px rgba(0, 0, 0, 0.44);
  --shadow-glow: 0 0 50px rgba(201, 162, 39, 0.14);
  --body-font: "Palatino Linotype", Georgia, serif;
  --heading-font: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.public-body {
  margin: 0;
  background: var(--page-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.65;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

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

.public-shell {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-card), var(--shadow-glow);
  backdrop-filter: blur(18px);
}

.brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--heading-font);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.25;
  max-width: 34rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.theme-select {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
}

.theme-select:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
}

.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-contrast);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.app-link:hover {
  color: var(--accent-contrast);
  transform: translateY(-1px);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.top-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
}

.top-nav a:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.content-panel,
.hero,
.article-shell,
.sidebar-card,
.post-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.content-panel {
  padding: 28px;
  border-radius: var(--radius-xl);
}

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

h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--heading-font);
  line-height: 1.15;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 4vw, 3.8rem);
}

h2 {
  margin: 30px 0 12px;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
}

p,
li {
  font-size: 1.02rem;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

ul,
ol {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 8px;
}

.card,
.callout {
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.inline-links,
.sidebar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-links a,
.sidebar-links a {
  color: var(--accent);
}

footer {
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 920px) {
  body.public-body {
    background-attachment: scroll;
  }

  .public-shell {
    width: min(var(--content-width), calc(100% - 20px));
    padding-top: 16px;
    padding-bottom: 36px;
  }

  .public-header,
  .content-panel {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .brand-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .theme-control {
    width: 100%;
    justify-content: space-between;
  }

  .theme-select {
    flex: 1;
  }
}
