:root {
  --bg: #dedede;
  --bg-elev: #e3e3e3;
  --bg-elev-2: #e8e8e8;
  --text: #1a1a1a;
  --text-soft: #404040;
  --text-muted: #595959;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --radius: 18px;
  --transition: 180ms ease;
}

html[data-theme="dark"] {
  --bg: #181818;
  --bg-elev: #1c1c1c;
  --bg-elev-2: #212121;
  --text: #cccccc;
  --text-soft: #a8a8a8;
  --text-muted: #7d7d7d;
  --line: #2b2b2b;
  --line-strong: #3c3c3c;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  position: relative;
}

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

.text-muted {
  color: var(--text-muted);
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.site-shell {
  min-height: 100vh;
}

/* Dynamic Layout Containers */
.container-wide {
  width: min(1200px, 90vw);
  margin: 0 auto;
}

.container-medium {
  width: min(960px, 90vw);
  margin: 0 auto;
}

.container-narrow {
  width: min(720px, 90vw);
  margin: 0 auto;
}

/* Top Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
}

/* Brand Logo Styling */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: opacity var(--transition);
}

.brand:hover {
  opacity: 0.8;
}

.brand__mark {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--text);
}

.brand__text {
  font-size: 0.98rem;
}

/* Icon Buttons */
.icon-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  font: inherit;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--text-muted);
}

/* Landing Page Specifics */
.landing-layout {
  padding: 40px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* This perfectly balances the empty space above and below */
}

.intro-block {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 3rem;
  letter-spacing: -0.01em;
}

.intro-block p {
  margin-bottom: 1.2rem;
}

.links-container {
  display: grid;
  gap: 2rem;
}

.links-group__title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

/* Text Hyperlinks (Replaces Buttons) */
.text-link {
  color: var(--text);
  font-weight: 500;
  font-size: 1.05rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 2px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  transition: text-decoration-color var(--transition), color var(--transition);
}

.text-link:hover {
  text-decoration-color: var(--text);
}

/* Policy Page Specifics */
.policy-layout {
  padding: 40px 0 80px;
  flex: 1;
}

.article-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 6vw, 50px);
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text);
}

.article-content {
  font-size: clamp(1rem, 2.5vw, 1.0625rem);
  line-height: 1.7;
  color: var(--text-soft);
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
}

.article-content h2 {
  color: var(--text);
  margin-top: 2.3em;
  margin-bottom: 0.7em;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  letter-spacing: -0.02em;
}

.article-content p, .article-content ul {
  margin-bottom: 1.2em;
}

.article-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  text-align: center;
  font-size: 0.9rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

.footer-link {
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Utilities */
.reveal {
  opacity: 0;
  transform: translateY(15px);
  animation: revealUp 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}