/* ========================================
   Design tokens
   ======================================== */
:root,
html[data-theme="deep-forest"] {
  color-scheme: dark;
  --bg: #010503;
  --bg-2: #04110a;
  --panel: #07160d;
  --panel-2: #0a1d12;
  --panel-3: #0e2417;
  --text: #e7f2e8;
  --muted: #8fa293;
  --muted-2: #b9cbbb;
  --accent: #86a879;
  --accent-2: #406f4e;
  --accent-3: #b7d3ad;
  --accent-4: #e7a083;
  --accent-rgb: 134, 168, 121;
  --accent-2-rgb: 64, 111, 78;
  --accent-3-rgb: 183, 211, 173;
  --accent-soft: rgba(86, 130, 79, 0.2);
  --border: rgba(145, 177, 135, 0.2);
  --border-strong: rgba(166, 196, 156, 0.34);
  --glass-bg: rgba(183, 211, 173, 0.05);
  --glass-bg-strong: rgba(121, 158, 111, 0.16);
  --card-bg: rgba(4, 14, 8, 0.96);
  --nav-bg: rgba(1, 5, 3, 0.9);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.64);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --max-width: 980px;
}

/* ========================================
   Reset and document defaults
   ======================================== */
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at 12% 8%,
      rgba(var(--accent-2-rgb), 0.2),
      transparent 25%
    ),
    radial-gradient(
      circle at 86% 18%,
      rgba(var(--accent-rgb), 0.11),
      transparent 30%
    ),
    radial-gradient(
      circle at 48% 96%,
      rgba(var(--accent-2-rgb), 0.15),
      transparent 32%
    ),
    linear-gradient(135deg, #010201, var(--bg-2) 46%, #010201);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
}

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

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid rgba(var(--accent-3-rgb), 0.76);
  outline-offset: 3px;
}

[aria-disabled="true"] {
  cursor: not-allowed;
}

/* ========================================
   Page transition states
   ======================================== */
body.page-enter {
  animation: enter-from-right 0.3s ease both;
}

body.leaving-left {
  animation: leave-to-left 0.3s ease both;
}

body.leaving-right {
  animation: leave-to-right 0.3s ease both;
}

@keyframes enter-from-right {
  from {
    opacity: 0;
    transform: translateX(38px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes leave-to-left {
  to {
    opacity: 0;
    transform: translateX(-54px);
  }
}

@keyframes leave-to-right {
  to {
    opacity: 0;
    transform: translateX(54px);
  }
}

/* ========================================
   Main navigation
   ======================================== */
.site-nav {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 6px;
  width: min(430px, calc(100% - 28px));
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--nav-bg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
  transform: translateX(-50%);
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  flex: 1 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  white-space: nowrap;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.18);
}

.nav-link:active {
  transform: scale(0.97);
}

/* ========================================
   Page shell and shared sections
   ======================================== */
.page-shell {
  width: min(var(--max-width), calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 92px 0 50px;
}

.content-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      135deg,
      rgba(var(--accent-2-rgb), 0.075),
      rgba(var(--accent-rgb), 0.028)
    ),
    linear-gradient(
      180deg,
      rgba(230, 244, 229, 0.018),
      rgba(230, 244, 229, 0.006)
    ),
    var(--card-bg);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.82fr;
  gap: 20px;
  align-items: center;
  padding: clamp(22px, 4vw, 44px);
}

.section {
  padding: clamp(22px, 3.4vw, 38px) clamp(22px, 4vw, 44px);
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 18px;
}

/* ========================================
   Typography and inline content
   ======================================== */
h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.045em;
}

h1 {
  max-width: 700px;
  margin-bottom: 16px;
  font-size: clamp(2.15rem, 6vw, 4.7rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.65rem, 4vw, 3.15rem);
  line-height: 1;
}

h3 {
  margin-bottom: 7px;
  font-size: clamp(1.05rem, 1.65vw, 1.36rem);
  line-height: 1.15;
}

p {
  max-width: 900px;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.25vw, 1rem);
  line-height: 1.62;
}

.lead {
  color: var(--muted-2);
  font-size: clamp(0.98rem, 1.45vw, 1.13rem);
  line-height: 1.58;
}

.eyebrow,
.eyebrow2 {
  margin-bottom: 10px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent-3);
}

.eyebrow2 {
  color: var(--accent-4);
}

.inline-link {
  color: var(--accent-3);
  border-bottom: 1px solid rgba(var(--accent-3-rgb), 0.34);
  transition:
    color 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.inline-link:hover,
.inline-link:focus-visible {
  color: var(--text);
  border-color: var(--accent-3);
  background: rgba(var(--accent-rgb), 0.1);
}

.mono {
  font-family:
    "DM Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

code {
  padding: 0.15em 0.38em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(1, 5, 3, 0.44);
  color: var(--accent-3);
}

/* ========================================
   Shared pills, buttons, and tags
   ======================================== */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.pill-link,
.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--text);
}

.pill-link {
  padding: 9px 13px;
  font-size: 0.88rem;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.pill-link:hover,
.pill-link:focus-visible {
  border-color: var(--border-strong);
  background: var(--glass-bg-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.tag {
  padding: 6px 10px;
  color: var(--muted-2);
  font-size: 0.78rem;
}

/* ========================================
   Page controls
   ======================================== */
.page-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 15;
  display: flex;
  gap: 8px;
}

.control-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--nav-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease;
}

.control-button:hover:not([aria-disabled="true"]) {
  border-color: var(--border-strong);
  background: var(--glass-bg-strong);
  transform: translateY(-2px);
}

.control-button[aria-disabled="true"] {
  opacity: 0.42;
  cursor: default;
}

.scroll-hint {
  position: fixed;
  bottom: 24px;
  left: 18px;
  z-index: 15;
  max-width: calc(100% - 130px);
  color: var(--muted);
  font-size: 0.78rem;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 20px clamp(22px, 4vw, 44px) 26px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: left;
}

.site-footer span {
  display: block;
}

/* ========================================
   Responsive shared rules
   ======================================== */
@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: calc(100% - 24px);
    padding-top: 84px;
  }

  .content-card {
    border-radius: 20px;
  }

  .section,
  .hero {
    padding: 20px;
  }

  .scroll-hint {
    display: none;
  }
}
