:root,
:root[data-theme="light"] {
  --bg: #eef2f6;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --accent: #0369a1;
  --accent-soft: rgba(2, 132, 199, 0.12);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #090d14;
  --surface: #111722;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: #1e293b;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
}

:root[data-theme-mode="psychedelic"] {
  --bg: #070316;
  --surface: rgba(16, 7, 36, 0.94);
  --text: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(192, 132, 252, 0.28);
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.15);
  --shadow-sm: 0 2px 10px rgba(34, 211, 238, 0.20);
}

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

html {
  font-size: clamp(12px, min(1.25vw, 2.6vh), 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 73.75rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem 5rem;
}

/* TOP BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.8rem;
  line-height: 1.25;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: -0.04em;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon:hover,
.brand-icon:focus,
.brand-icon:active,
.brand-icon:visited {
  color: var(--accent);
  text-decoration: none;
  outline: none;
}

.brand-text h1,
.brand-text .brand-heading {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.brand-title-link:hover,
.brand-title-link:focus,
.brand-title-link:active,
.brand-title-link:visited {
  color: inherit;
  text-decoration: none;
  outline: none;
}

.brand-author {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: normal;
  margin-left: 0.15rem;
}

.brand-text p {
  margin: 0.12rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.nav-link,
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.38rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s;
}

.nav-link:hover,
.home-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tldr-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.tldr-box strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.95rem;
}

.tldr-box ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
}

.tldr-box li {
  margin-bottom: 0.3rem;
}

.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.entry h2 {
  margin: 0 0 0.65rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text);
}

.entry p {
  margin: 0.45rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.entry ul {
  margin: 0.45rem 0;
  padding-left: 1.3rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.entry li {
  margin-bottom: 0.35rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
}

a:hover {
  opacity: 0.85;
}

code {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* THEME DOCK */
.bottom-dock {
  position: fixed;
  bottom: 0.75rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  z-index: 20;
}

.dock-pill {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.18rem;
  box-shadow: var(--shadow-sm);
}

.dock-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 0.45rem;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dock-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.lang-flag {
  width: 15px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.28);
}

.dock-btn[data-theme-val="psychedelic"] {
  color: #a21caf;
}

:root[data-theme="dark"] .dock-btn[data-theme-val="psychedelic"] {
  color: #e879f9;
}

.dock-btn[data-theme-val="psychedelic"].active {
  background: linear-gradient(135deg, #ec4899, #8b5cf6, #06b6d4);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.priv-tldr-p { margin: 0; }
