:root {
  --bg: #f4efe7;
  --bg-elevated: rgba(255, 250, 243, 0.74);
  --surface: rgba(255, 250, 243, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #161616;
  --muted: #5e564d;
  --border: rgba(22, 22, 22, 0.12);
  --accent: #ff8a3d;
  --accent-strong: #e45d14;
  --shadow: 0 20px 60px rgba(31, 23, 17, 0.12);
}

[data-theme="dark"] {
  --bg: #111111;
  --bg-elevated: rgba(18, 18, 18, 0.72);
  --surface: rgba(24, 24, 24, 0.8);
  --surface-strong: rgba(31, 31, 31, 0.94);
  --text: #f4efe7;
  --muted: #b8aa9a;
  --border: rgba(244, 239, 231, 0.12);
  --accent: #ffb067;
  --accent-strong: #ff8a3d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 138, 61, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 22%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  line-height: 1.65;
  transition: background 0.25s ease, color 0.25s ease;
}

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

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scene-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
  z-index: 0;
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: 86px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 6px rgba(255, 138, 61, 0.12);
}

.main-nav {
  display: inline-flex;
  justify-content: center;
  gap: 22px;
}

.main-nav a,
.text-link {
  color: var(--muted);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"],
.text-link:hover {
  color: var(--text);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  position: relative;
  width: min(320px, 42vw);
}

#searchBox {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#searchBox:focus {
  outline: 2px solid rgba(255, 138, 61, 0.25);
  outline-offset: 2px;
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-result-link {
  display: block;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.search-result-link:last-child {
  border-bottom: 0;
}

.search-result-link:hover {
  background: rgba(255, 138, 61, 0.08);
}

.search-result-link strong {
  display: block;
  margin-bottom: 6px;
}

.search-result-link span,
.search-empty {
  color: var(--muted);
  font-size: 0.94rem;
}

.search-empty {
  padding: 18px;
}

.language-switcher {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.language-switcher a {
  min-width: 40px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.language-switcher a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 138, 61, 0.16);
}

.theme-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.theme-toggle-track {
  display: flex;
  align-items: center;
  width: 58px;
  height: 32px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.theme-toggle-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  transition: transform 0.2s ease;
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(26px);
}

.site-main {
  padding-bottom: 48px;
}

.hero-section {
  padding: 52px 0 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.featured-post,
.post-card,
.post-row,
.term-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  border-radius: 36px;
  padding: 52px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}

.hero-copy h1,
.page-hero h1,
.article-header h1,
.section-heading h2,
.empty-state h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(3rem, 6vw, 5.8rem);
  max-width: 12ch;
}

.hero-text,
.page-hero-copy,
.article-summary,
.featured-summary,
.post-card p,
.post-row p,
.footer-copy,
.hero-panel p,
.empty-state p {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
}

.button-primary {
  background: var(--text);
  color: var(--bg);
}

.button-secondary {
  border: 1px solid var(--border);
}

.hero-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.hero-highlights li {
  padding-left: 18px;
  position: relative;
}

.hero-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-panel {
  border-radius: 32px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.26), transparent 65%);
}

.panel-kicker,
.footer-title {
  margin: 0 0 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.hero-panel h2 {
  margin: 0 0 12px;
  font-family: "Newsreader", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.stat-grid div {
  padding: 16px;
  background: var(--surface-strong);
  border-radius: 22px;
  border: 1px solid var(--border);
}

.stat-grid strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.stat-grid span,
.featured-meta,
.post-card-meta,
.post-row-meta,
.article-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.section-block {
  padding-top: 28px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.featured-post,
.empty-state {
  padding: 30px;
  border-radius: 30px;
}

.featured-meta,
.post-card-meta,
.post-row-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.featured-summary {
  margin: 0;
  font-size: 1.18rem;
  max-width: 58ch;
}

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

.post-card {
  border-radius: 28px;
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.post-card:hover,
.post-row:hover,
.term-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 138, 61, 0.32);
}

.post-card h3,
.post-row h2 {
  margin: 0 0 12px;
  font-family: "Newsreader", serif;
  font-size: 2rem;
  line-height: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent-strong);
  background: rgba(255, 138, 61, 0.08);
  font-size: 0.92rem;
}

.page-hero {
  padding-top: 50px;
}

.page-hero h1,
.article-header h1,
.empty-state h2 {
  font-size: clamp(3rem, 6vw, 5rem);
  max-width: 12ch;
}

.post-list {
  display: grid;
  gap: 18px;
}

.post-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  border-radius: 28px;
  padding: 26px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.article-shell {
  padding-top: 50px;
}

.article-header {
  max-width: 760px;
  margin-bottom: 28px;
}

.article-body {
  max-width: 760px;
  font-size: 1.08rem;
}

.article-body h2,
.article-body h3 {
  margin: 2.4em 0 0.6em;
  font-family: "Newsreader", serif;
  line-height: 1;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote {
  margin: 0 0 1.25em;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 18px;
  color: var(--muted);
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(255, 138, 61, 0.12);
  padding: 0.15em 0.4em;
  border-radius: 8px;
}

.article-body pre {
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background: #1b1b1b;
  color: #f8f8f2;
}

.article-body pre code {
  background: transparent;
  padding: 0;
}

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

.term-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 24px;
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.term-card span {
  color: var(--muted);
}

.site-footer {
  padding: 38px 0 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

mark {
  background: rgba(255, 138, 61, 0.22);
  color: inherit;
}

@media (max-width: 980px) {
  .header-inner,
  .hero-grid,
  .post-row,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .header-inner {
    padding: 18px 0;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .header-tools {
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
  }

  .post-grid,
  .terms-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .hero-copy,
  .hero-panel,
  .featured-post,
  .post-card,
  .post-row,
  .term-card,
  .empty-state {
    border-radius: 24px;
  }

  .hero-copy {
    padding: 32px 24px;
  }

  .hero-panel,
  .featured-post,
  .post-card,
  .post-row,
  .term-card,
  .empty-state {
    padding: 22px;
  }

  .post-grid,
  .terms-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}
