/* ============================================================
   DocumentForge Docs — Swiss International Style
   Inspired by Josef Müller-Brockmann: red accent, gray text,
   white space, strong typographic hierarchy, asymmetric grid.
   ============================================================ */

:root {
  --red: #d90429;
  --red-muted: #ef233c;
  --ink: #0a0a0a;
  --text: #1a1a1a;
  --gray-900: #2b2d42;
  --gray-500: #6c757d;
  --gray-200: #e6e6e6;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  --mono: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  --sans: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--white);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
}

/* ----------- Nav ----------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.1;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .brand-icon {
  width: 16px;
  height: 16px;
  color: var(--red);
  flex-shrink: 0;
}
.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-900);
  text-decoration: none;
  letter-spacing: 0.02em;
  opacity: 0.65;
  padding-left: 24px; /* align with the brand text after the 16px icon + 8px gap */
  transition: color 120ms, opacity 120ms;
}
.brand-sub:hover { color: var(--red); opacity: 1; }
.nav-links { display: flex; gap: 24px; flex-wrap: wrap; }
.nav-links a {
  color: var(--gray-900);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding: 2px 0;
  transition: border-color 0.15s, color 0.15s;
}
.nav-links a:hover { color: var(--red); border-bottom-color: var(--red); }
.nav-links a.active { color: var(--red); border-bottom-color: var(--red); }

/* ----------- Layout ----------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.narrow { max-width: 820px; }

/* ----------- Hero ----------- */
.hero {
  padding: 96px 32px 64px;
  border-bottom: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
}
.hero .container { position: relative; z-index: 2; }
.hero-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 48px;
  align-items: end;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 24px;
}
.eyebrow::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background: var(--red);
}
.hero h1 {
  font-size: clamp(48px, 9vw, 120px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 28px;
  font-weight: 800;
  color: var(--ink);
}
.hero h1 .em { color: var(--red); }
.hero p.lede {
  font-size: 22px;
  line-height: 1.4;
  max-width: 640px;
  color: var(--gray-900);
  margin: 0 0 32px;
  font-weight: 400;
}
.hero-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  text-transform: uppercase;
  line-height: 1.8;
}
.hero-meta strong { color: var(--ink); font-weight: 600; }

/* Big background red bar - classic Swiss */
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: 0;
  bottom: 0;
  width: 120px;
  background: var(--red);
  transform: skewX(-8deg);
  opacity: 0.08;
}

/* ----------- CTA ----------- */
.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  letter-spacing: -0.01em;
}
.btn:hover { background: var(--red); border-color: var(--red); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--white); }
.btn .arrow { font-weight: 400; }

/* ----------- Stats strip ----------- */
.stats {
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  padding: 48px 0;
  background: var(--gray-100);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat {
  border-left: 2px solid var(--red);
  padding-left: 18px;
}
.stat .num {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 8px;
}
.stat .label {
  font-size: 13px;
  color: var(--gray-500);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ----------- Sections ----------- */
section.section {
  padding: 80px 0;
  border-bottom: 1px solid var(--gray-200);
}
section.section h2 {
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
section.section h3 {
  font-size: 22px;
  margin: 40px 0 12px;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--ink);
}
section.section h4 {
  font-size: 17px;
  margin: 24px 0 8px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
section.section p { margin: 12px 0; color: var(--gray-900); }

/* ----------- Feature grid ----------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}
.feature {
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  transition: border-color 0.15s, transform 0.15s;
}
.feature:hover { border-color: var(--red); transform: translateY(-2px); }
.feature .num {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 16px;
}
.feature h4 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.feature p {
  margin: 0;
  font-size: 15px;
  color: var(--gray-900);
  line-height: 1.5;
}

/* ----------- Code blocks ----------- */
pre, code {
  font-family: var(--mono);
  font-feature-settings: "calt";
}
pre {
  background: var(--ink);
  color: #e8e8e8;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  border-left: 3px solid var(--red);
  margin: 20px 0;
}
p code, li code {
  background: var(--gray-100);
  color: var(--ink);
  padding: 2px 6px;
  font-size: 0.9em;
  border: 1px solid var(--gray-200);
}
.hl-kw { color: #ff6b6b; font-weight: 600; }
.hl-str { color: #98c379; }
.hl-com { color: #787878; font-style: italic; }
.hl-num { color: #e5c07b; }

/* ----------- Tables ----------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}
th {
  background: var(--gray-100);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
  border-bottom: 2px solid var(--ink);
}

/* ----------- Callout ----------- */
.callout {
  padding: 20px 24px;
  border-left: 3px solid var(--red);
  background: var(--gray-100);
  margin: 24px 0;
}
.callout strong { color: var(--red); }

/* ----------- Footer ----------- */
footer {
  padding: 48px 32px;
  background: var(--ink);
  color: var(--gray-200);
}
footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
footer p { margin: 0; font-size: 14px; }
footer .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ----------- Article content ----------- */
article ul { margin: 12px 0; padding-left: 24px; }
article li { margin: 8px 0; }
article a { color: var(--red); text-decoration: none; border-bottom: 1px solid currentColor; }
article a:hover { color: var(--ink); }

/* ----------- Page title ----------- */
.page-title {
  padding: 96px 32px 48px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
}
.page-title .eyebrow { margin-bottom: 16px; }
.page-title h1 {
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.page-title p {
  font-size: 20px;
  margin: 0;
  color: var(--gray-900);
  max-width: 700px;
}

/* ----------- TOC sidebar ----------- */
.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  padding: 48px 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.toc {
  position: sticky;
  top: 80px;
  align-self: start;
  font-size: 13px;
}
.toc h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin: 0 0 16px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 8px;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 8px 0; }
.toc a {
  color: var(--gray-900);
  text-decoration: none;
  font-weight: 500;
  border: none;
}
.toc a:hover { color: var(--red); }

/* ----------- Responsive ----------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; padding: 32px 20px; }
  .toc { position: static; margin-bottom: 32px; }
  .nav-inner { padding: 14px 20px; }
  .hero { padding: 64px 20px 48px; }
}
