/* Theme tokens */
:root {
  --color-bg: #2b1a11;
  --color-surface: rgba(104, 70, 45, 0.72);
  --color-surface-strong: rgba(79, 52, 33, 0.9);
  --color-glass: rgba(128, 90, 57, 0.58);
  --color-primary: #edd2aa;
  --color-primary-strong: #d9a460;
  --color-accent: #b3773a;
  --color-highlight: #8f5324;
  --color-text: #fbf3e5;
  --color-muted: #dbc3a6;
  --color-border: rgba(220, 180, 134, 0.3);
  --shadow-soft: 0 32px 60px -30px rgba(143, 83, 36, 0.35);
  --shadow-card: 0 24px 40px -28px rgba(0, 0, 0, 0.6);
  --radius-lg: 24px;
  --radius-md: 18px;
  --content-max: 1120px;
  --transition: 240ms cubic-bezier(0.24, 0.82, 0.25, 1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 10% 10%, #5f3b23, transparent 55%),
    radial-gradient(circle at 90% 15%, #a56f3b, transparent 60%), var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text);
}

p {
  margin: 0;
  color: rgba(251, 243, 229, 0.82);
}

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

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

.no-js-warning {
  background: #ffbf69;
  color: #201100;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 600;
  z-index: 999;
  position: relative;
}

/* Background canvas */
.background-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.background-canvas .gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.65;
  mix-blend-mode: screen;
  animation: drift 22s infinite alternate ease-in-out;
}

.background-canvas .gradient-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(237, 210, 170, 0.9), transparent 70%);
}

.background-canvas .gradient-2 {
  width: 520px;
  height: 520px;
  top: 40%;
  left: 70%;
  background: radial-gradient(circle, rgba(179, 119, 58, 0.8), transparent 70%);
  animation-duration: 28s;
}

.background-canvas .gradient-3 {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: 30%;
  background: radial-gradient(circle, rgba(143, 83, 36, 0.8), transparent 70%);
  animation-duration: 19s;
}

.background-canvas .grid-overlay {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.25;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(40px, 30px, 0) scale(1.08);
  }
}

/* Header & navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  backdrop-filter: blur(18px);
  background: rgba(58, 36, 21, 0.78);
  border-bottom: 1px solid rgba(237, 210, 170, 0.25);
  box-shadow: 0 10px 30px -25px rgba(0, 0, 0, 0.7);
  gap: 1.5rem;
}

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

.brand-glow {
  width: 48px;
  height: 48px;
  border-radius: 18px 18px 8px 18px;
  background: linear-gradient(140deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 22px rgba(237, 210, 170, 0.6);
}

.brand-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-tagline {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-muted);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  border: none;
  background: transparent;
  padding: 0.4rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition);
}

.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li {
  list-style: none;
  margin: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  background: rgba(237, 210, 170, 0.06);
  color: var(--color-muted);
  transition: var(--transition);
}

.nav-links a.is-active {
  color: var(--color-text);
  border-color: rgba(237, 210, 170, 0.48);
  background: rgba(237, 210, 170, 0.12);
  box-shadow: 0 12px 28px -20px rgba(237, 210, 170, 0.7);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-text);
  border-color: rgba(237, 210, 170, 0.4);
  box-shadow: 0 10px 22px -16px rgba(237, 210, 170, 0.7);
}

.search-panel {
  position: relative;
  width: 220px;
  flex-shrink: 0;
}

.search-panel input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(237, 210, 170, 0.4);
  background: rgba(0, 0, 0, 0.15);
  padding: 0.55rem 1rem;
  color: var(--color-text);
  font-size: 0.9rem;
}

.search-panel input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(237, 210, 170, 0.25);
}

.search-results {
  position: absolute;
  inset: auto 0 0;
  transform: translateY(calc(100% + 0.35rem));
  list-style: none;
  padding: 0;
  margin: 0;
  background: rgba(32, 20, 12, 0.98);
  border: 1px solid rgba(237, 210, 170, 0.2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-height: 320px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 10;
}

.search-results[aria-expanded='true'] {
  opacity: 1;
  pointer-events: auto;
}

.search-results li {
  border-bottom: 1px solid rgba(237, 210, 170, 0.1);
}

.search-results li:last-child {
  border-bottom: none;
}

.search-results button {
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.9rem;
}

.search-results button span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-muted);
  margin-bottom: 0.2rem;
}

.search-results button p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text);
  opacity: 0.9;
}

.search-results .empty-state {
  border: none;
  background: transparent;
  color: var(--color-muted);
  text-align: center;
  padding: 1rem;
}

.search-panel[data-search-enabled='false'] {
  display: none;
}

/* Layout */
#app {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 6vw, 3rem) 4rem;
  position: relative;
}

.site-section {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-top: 1px solid rgba(237, 210, 170, 0.15);
}

.site-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section-header {
  margin-bottom: 2.3rem;
  max-width: 680px;
}

.section-header h1,
.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.section-header p {
  color: var(--color-muted);
}

.section-note {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 6vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(2.5rem, 6vw, 3.8rem);
}

.hero .eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--color-primary);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  margin: 0.7rem 0 1rem;
}

.hero p {
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin: 1.6rem 0 1.2rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.button.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-highlight));
  color: #3a2415;
  box-shadow: var(--shadow-soft);
}

.button.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}

.hero-badges span {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(104, 70, 45, 0.8);
  border: 1px solid rgba(237, 210, 170, 0.35);
  color: var(--color-muted);
}

.marquee {
  overflow: hidden;
  background: rgba(39, 24, 14, 0.8);
  border: 1px solid rgba(237, 210, 170, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.marquee-track {
  display: flex;
  gap: 2.5rem;
  padding: 0.85rem 1.5rem;
  animation: marquee 26s linear infinite;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.marquee-track span {
  white-space: nowrap;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

.feature-grid article {
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: rgba(64, 40, 24, 0.85);
  border: 1px solid rgba(237, 210, 170, 0.18);
  box-shadow: var(--shadow-card);
}

.feature-grid h2 {
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.list-block {
  background: rgba(64, 40, 24, 0.75);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(237, 210, 170, 0.15);
  padding: 1.8rem;
}

.list-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-block li {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(237, 210, 170, 0.3);
}

.empty-state {
  margin: 0;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  color: var(--color-muted);
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.placeholder-card {
  border: 1px dashed rgba(237, 210, 170, 0.3);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  color: var(--color-muted);
  text-align: center;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.pillars-grid article {
  background: rgba(64, 40, 24, 0.82);
  border-radius: var(--radius-md);
  border: 1px solid rgba(237, 210, 170, 0.18);
  padding: 1.6rem;
}

.pillars-grid ul {
  margin: 0.9rem 0 0;
  padding-left: 1.2rem;
  color: var(--color-muted);
}

.milestone-list {
  display: grid;
  gap: 1.2rem;
  margin: 2.2rem 0 0;
}

.milestone-list article {
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(64, 40, 24, 0.85);
  border: 1px solid rgba(237, 210, 170, 0.2);
  box-shadow: 0 18px 28px -26px rgba(0, 0, 0, 0.8);
}

.links-list {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.links-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(237, 210, 170, 0.3);
  font-size: 0.9rem;
  color: var(--color-primary);
}

.tutorial-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(46, 28, 17, 0.9);
  border: 1px solid rgba(237, 210, 170, 0.22);
  box-shadow: var(--shadow-card);
}

.tutorial-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.4rem, 4vw, 2rem);
  align-items: start;
}

.tutorial-media {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0f0805;
  border: 1px solid rgba(237, 210, 170, 0.2);
  box-shadow: 0 16px 32px -24px rgba(0, 0, 0, 0.8);
}

.tutorial-media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.tutorial-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.tutorial-content p {
  margin-bottom: 0.9rem;
}

.tutorial-highlights {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--color-muted);
}

.tutorial-meta {
  margin: 0.4rem 0 1.2rem;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.tutorial-commands {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(18, 10, 6, 0.5);
  border: 1px solid rgba(237, 210, 170, 0.15);
}

.tutorial-commands h4,
.tutorial-commands h5 {
  margin: 0 0 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-size: 0.95rem;
}

.tutorial-commands h5 {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.tutorial-commands pre {
  margin: 0 0 0.9rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(237, 210, 170, 0.12);
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.tutorial-citations {
  margin-top: 1rem;
}

.tutorial-citations h4 {
  margin: 0 0 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-size: 0.95rem;
}

.tutorial-citations ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-muted);
  display: grid;
  gap: 0.5rem;
}

.tutorial-citations strong {
  color: var(--color-text);
}

.team-placeholder {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(237, 210, 170, 0.3);
  color: var(--color-muted);
}

.search-hit {
  outline: 2px solid var(--color-primary);
  outline-offset: 6px;
  border-radius: var(--radius-md);
  transition: outline 0.2s ease;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem clamp(1.25rem, 6vw, 3rem) 3rem;
  border-top: 1px solid rgba(237, 210, 170, 0.16);
  background: rgba(32, 20, 12, 0.72);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

.footer-links a {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.external-link {
  color: var(--color-primary);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 960px) {
  .site-nav {
    position: fixed;
    top: 74px;
    right: 1rem;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: rgba(34, 22, 14, 0.96);
    border: 1px solid rgba(237, 210, 170, 0.2);
    box-shadow: var(--shadow-card);
    min-width: min(320px, calc(100% - 2rem));
    transform-origin: top right;
    transform: scale(0.96);
    opacity: 0;
    pointer-events: none;
  }

  .site-nav[data-open='true'] {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
  }

  .nav-links a {
    width: 100%;
    justify-content: flex-start;
  }

  .search-panel {
    width: 100%;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: 2.1rem;
  }

  .hero-actions {
    flex-direction: column;
  }
}
