:root {
  color-scheme: dark;
  --bg: #10140f;
  --panel: #172018;
  --panel-soft: #1f2b22;
  --text: #f3f0e8;
  --muted: #b9c0af;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #e0b85a;
  --accent-2: #66b884;
  --danger: #cf7359;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 56px);
  background: rgba(16, 20, 15, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(224, 184, 90, 0.55);
  background: #263322;
  color: var(--accent);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.top-nav a {
  padding: 8px 11px;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--text);
}

.hero {
  position: relative;
  min-height: min(720px, calc(100vh - 72px));
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(16, 20, 15, 0.94), rgba(16, 20, 15, 0.6) 44%, rgba(16, 20, 15, 0.18)),
    linear-gradient(0deg, rgba(16, 20, 15, 0.76), rgba(16, 20, 15, 0.05) 45%);
}

.hero-character {
  position: absolute;
  right: clamp(8px, 7vw, 118px);
  bottom: -38px;
  z-index: 1;
  width: min(42vw, 520px);
  max-height: 88%;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(0 28px 42px rgba(0, 0, 0, 0.48));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 32px));
  margin-left: clamp(16px, 6vw, 84px);
  padding: 76px 0 116px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.hero-copy {
  max-width: 590px;
  color: var(--muted);
  font-size: 1.18rem;
}

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

.button,
.bind-row button,
.filter-button {
  border: 1px solid transparent;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  font-weight: 800;
}

.button.primary {
  background: var(--accent);
  color: #16130a;
}

.button.ghost {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.quick-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.quick-strip article {
  min-height: 164px;
  padding: 26px clamp(18px, 3vw, 32px);
  background: #131a13;
}

.quick-strip span {
  display: block;
  margin-bottom: 20px;
  color: var(--accent-2);
  font-weight: 800;
}

.quick-strip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.quick-strip p,
.section-heading p,
.split > div > p,
.guide-card p,
.site-footer span {
  color: var(--muted);
}

.section {
  padding: clamp(58px, 8vw, 104px) clamp(16px, 4vw, 56px);
}

.section-heading {
  max-width: 860px;
  margin-bottom: 32px;
}

.tools {
  background: #10140f;
}

.guide-controls {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 40px;
  padding: 8px 13px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

.filter-button.active,
.filter-button:hover {
  border-color: rgba(224, 184, 90, 0.55);
  color: var(--text);
}

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

.guide-card {
  min-height: 238px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.guide-card[hidden] {
  display: none;
}

.tag {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-card a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: start;
  background: #172018;
}

.bind-list {
  display: grid;
  gap: 10px;
}

.bind-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: #10140f;
}

.bind-row strong,
.bind-row code {
  display: block;
}

.bind-row code {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: #d6e4c8;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.92rem;
}

.bind-row button {
  min-height: 40px;
  padding: 8px 12px;
  background: var(--accent);
  color: #171308;
  font-weight: 800;
}

.plan {
  background: #151915;
}

.article-plan {
  display: grid;
  gap: 10px;
  max-width: 1020px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: articles;
}

.article-plan li {
  counter-increment: articles;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 82px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.article-plan li::before {
  content: counter(articles, decimal-leading-zero);
  color: var(--accent-2);
  font-weight: 900;
}

.article-plan a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.article-plan a:hover strong {
  color: var(--accent);
}

.article-plan strong,
.article-plan span {
  display: block;
}

.article-plan span {
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 26px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #0d110d;
}

.article-page {
  background: #10140f;
}

.article-hero {
  padding: clamp(42px, 7vw, 86px) clamp(16px, 4vw, 56px) clamp(28px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #121812;
}

.article-back {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.article-hero h1 {
  max-width: 980px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 5.6vw, 5.4rem);
  line-height: 0.98;
}

.article-lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.article-hero img {
  display: block;
  width: 100%;
  max-width: 1380px;
  margin-top: 32px;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 780px);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  padding: clamp(42px, 7vw, 82px) clamp(16px, 4vw, 56px);
}

.article-toc {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.article-toc strong {
  margin-bottom: 8px;
}

.article-toc a {
  color: var(--muted);
  text-decoration: none;
}

.article-toc a:hover {
  color: var(--accent);
}

.article-content {
  color: #ece9df;
  font-size: 1.06rem;
}

.article-content section {
  margin-top: 42px;
}

.article-content h2 {
  margin-bottom: 16px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.article-content h3 {
  margin-top: 26px;
  color: var(--accent);
}

.article-content p,
.article-content li {
  color: var(--muted);
}

.article-content ul,
.article-content ol {
  display: grid;
  gap: 8px;
  padding-left: 24px;
}

.article-content strong {
  color: var(--text);
}

.placeholder-page {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
  padding: clamp(42px, 8vw, 96px) clamp(16px, 4vw, 56px);
  background:
    linear-gradient(90deg, rgba(16, 20, 15, 0.94), rgba(16, 20, 15, 0.74)),
    url("assets/hero-rust-base.png") center / cover;
}

.placeholder-card {
  width: min(760px, 100%);
}

.placeholder-card h1 {
  margin-bottom: 18px;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 1;
}

.placeholder-card p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.1rem;
}

.placeholder-card .button {
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(22px);
  padding: 12px 14px;
  background: var(--accent);
  color: #151006;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 960px) {
  .quick-strip,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-controls,
  .split,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero {
    min-height: 650px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(16, 20, 15, 0.96), rgba(16, 20, 15, 0.82)),
      linear-gradient(0deg, rgba(16, 20, 15, 0.8), rgba(16, 20, 15, 0.16));
  }

  .hero-character {
    right: -86px;
    bottom: -26px;
    width: min(78vw, 380px);
    opacity: 0.48;
  }

  .hero-content {
    margin-left: 16px;
    padding: 64px 0 96px;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .quick-strip,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .bind-row {
    grid-template-columns: 1fr;
  }

  .bind-row button {
    width: 100%;
  }

  .article-plan li {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
