:root {
  --bg: #e8e1d1;
  --bg-alt: #d7ccb8;
  --surface: rgba(248, 244, 236, 0.96);
  --surface-strong: #f6f0e4;
  --ink: #112722;
  --muted: #4d645d;
  --line: rgba(17, 39, 34, 0.14);
  --accent: #1d5a4e;
  --accent-strong: #163f36;
  --warning: #8b6a21;
  --shadow: 0 18px 60px rgba(19, 38, 34, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(29, 90, 78, 0.14), transparent 32%),
    radial-gradient(circle at bottom right, rgba(139, 106, 33, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
  font-family: "Aptos", "Trebuchet MS", sans-serif;
}

a {
  color: var(--accent-strong);
}

.guide-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(20, 53, 45, 0.96), rgba(29, 90, 78, 0.84));
  box-shadow: var(--shadow);
  color: #f7f2e8;
  padding: 22px;
}

.guide-header img {
  width: min(260px, 58vw);
  height: auto;
  display: block;
}

.guide-header__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #f7f2e8;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
}

.button--light {
  background: rgba(247, 242, 232, 0.12);
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.guide-nav,
.guide-content {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.guide-nav {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
}

.guide-nav h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.guide-nav a {
  display: block;
  border-radius: 10px;
  padding: 8px 10px;
  text-decoration: none;
  line-height: 1.3;
}

.guide-nav a:hover,
.guide-nav a:focus-visible {
  background: rgba(29, 90, 78, 0.1);
  outline: none;
}

.guide-nav__group {
  margin-top: 14px;
}

.guide-nav__group-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.guide-content {
  padding: 28px;
}

.guide-content h1,
.guide-content h2,
.guide-content h3 {
  scroll-margin-top: 22px;
}

.guide-content h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.guide-content h2 {
  margin: 40px 0 12px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.guide-content h2:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.guide-content h3 {
  margin: 26px 0 10px;
  color: var(--accent-strong);
  font-size: 1.1rem;
}

.guide-content p,
.guide-content li {
  color: var(--muted);
  line-height: 1.6;
}

.guide-content code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 2px 6px;
}

.guide-content ul,
.guide-content ol {
  padding-left: 24px;
}

.guide-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  overflow: hidden;
  border-radius: 12px;
}

.guide-content th,
.guide-content td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.guide-content th {
  background: rgba(29, 90, 78, 0.12);
  color: var(--ink);
}

.guide-content > p:nth-of-type(1),
.guide-content > p:nth-of-type(2) {
  border-left: 4px solid var(--warning);
  background: rgba(139, 106, 33, 0.08);
  padding: 12px 14px;
}

.loading,
.error {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 840px) {
  .guide-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .guide-header__actions {
    justify-content: flex-start;
  }

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-nav {
    position: static;
    max-height: none;
  }

  .guide-content {
    padding: 20px;
  }
}
