:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f5;
  --ink: #17231b;
  --ink-2: #4a5a4f;
  --ink-3: #6c7a70;
  --line: rgba(23, 35, 27, 0.1);
  --accent: #2f5a3c;
  --accent-ink: #f4f6f2;
  --accent-soft: #eef3e8;
  --shadow: 0 30px 60px -30px rgba(22, 40, 29, 0.35);
  --r: 18px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-w: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: Outfit, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.doc-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px) saturate(160%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.doc-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo img { width: 30px; height: 30px; }
.doc-nav .links { display: flex; gap: 24px; font-size: 0.95rem; color: var(--ink-2); }
.doc-nav .links a { color: inherit; text-decoration: none; }
.doc-nav .links a:hover { color: var(--ink); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 500;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -12px rgba(47, 90, 60, 0.6); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; }

/* Layout */
.doc-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 48px; padding: 48px 0 100px; max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.doc-sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  padding-right: 8px;
}
.doc-sidebar h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 16px;
  font-weight: 500;
}
.doc-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.doc-sidebar a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 0.92rem;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.doc-sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.doc-sidebar a.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 500; }

.doc-main { min-width: 0; max-width: 720px; }

.doc-hero {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.doc-hero .eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
}
.doc-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.doc-hero .lead { color: var(--ink-2); font-size: 1.12rem; max-width: 52ch; }

section.doc-section { margin-bottom: 56px; scroll-margin-top: 96px; }
section.doc-section h2 {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  padding-top: 8px;
}
section.doc-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--ink);
}
section.doc-section p { color: var(--ink-2); margin-bottom: 14px; }
section.doc-section ul, section.doc-section ol {
  margin: 0 0 16px 1.25rem;
  color: var(--ink-2);
}
section.doc-section li { margin-bottom: 8px; }

.path {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--ink);
  margin: 8px 0 16px;
}

.guides {
  margin: 20px 0 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.95rem;
}
.guides strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 600; }
.guides ul { margin: 0; padding-left: 18px; }
.guides li { margin: 4px 0; }

.callout {
  border-radius: var(--r-sm);
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 0.95rem;
  border: 1px solid var(--line);
}
.callout strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 600; }
.callout p:last-child { margin-bottom: 0; }
.callout-tip { background: var(--accent-soft); border-color: rgba(47, 90, 60, 0.2); }
.callout-pro { background: #f0f4ff; border-color: rgba(47, 90, 140, 0.2); }
.callout-warn { background: #fff8ed; border-color: rgba(180, 120, 0, 0.25); }

.steps { counter-reset: step; list-style: none; margin: 16px 0 0; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 20px;
  color: var(--ink-2);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.card-grid a.card {
  display: block;
  padding: 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card-grid a.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(47, 90, 60, 0.08);
  text-decoration: none;
}
.card-grid a.card i { font-size: 1.5rem; color: var(--accent); margin-bottom: 10px; display: block; }
.card-grid a.card strong { display: block; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.card-grid a.card span { font-size: 0.88rem; color: var(--ink-3); }

.doc-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  font-size: 0.92rem;
  color: var(--ink-3);
}
.doc-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

@media (max-width: 960px) {
  .doc-shell { grid-template-columns: 1fr; }
  .doc-sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--line);
    padding-bottom: 24px;
    margin-bottom: 8px;
  }
  .doc-sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .doc-nav .links { display: none; }
}

/* Language switcher: discreet segmented pill */
.lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.74rem; font-weight: 500; letter-spacing: 0.08em; line-height: 1; }
.lang a.lang-opt { display: inline-block; padding: 5px 9px; border-radius: 999px; color: var(--ink-3); text-decoration: none; transition: color 0.2s, background 0.2s; }
.lang a.lang-opt:hover { color: var(--ink); }
.lang a.lang-opt[aria-current] { background: var(--accent-soft); color: var(--accent); }
.lang a.lang-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) { .lang a.lang-opt[aria-current] { display: none; } }
