/* Polite Retry documentation — layout & theme */
:root {
  --ink: #0f172a;
  --ink-muted: #475569;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: #e2e8f0;
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-glow: #14b8a6;
  --accent-2: #0284c7;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow: 0 4px 6px -1px rgb(15 23 42 / 0.07), 0 2px 4px -2px rgb(15 23 42 / 0.05);
  --shadow-lg: 0 14px 30px -12px rgb(15 23 42 / 0.18);
  --max-read: 72ch;
}

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface-subtle);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
  max-width: var(--max-read);
}

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

a:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgb(15 23 42 / 0.06);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  border: 1px solid rgb(15 23 42 / 0.06);
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Top strip */
.site-strip {
  background: var(--ink);
  color: #e2e8f0;
  font-size: 0.8125rem;
  text-align: center;
  padding: 0.45rem 1rem;
  letter-spacing: 0.02em;
}

.site-strip a {
  color: #5eead4;
  font-weight: 500;
  text-decoration: none;
}

.site-strip a:hover {
  color: #99f6e4;
  text-decoration: underline;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.nav-brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--accent-deep);
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent-glow), var(--accent-2));
  box-shadow: 0 2px 8px rgb(13 148 136 / 0.35);
  position: relative;
}

.logo-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgb(255 255 255 / 0.85);
  border-radius: 4px;
  opacity: 0.9;
}

.nav-logo-text strong {
  font-weight: 700;
}

.nav-version {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.15rem;
}

.nav-links > a {
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links > a:hover {
  color: var(--ink);
  text-decoration: none;
  border-bottom-color: rgb(13 148 136 / 0.35);
}

.nav-links > a.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.nav-external {
  font-size: 0.875rem;
  font-weight: 600;
  color: #cb3837 !important;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink) !important;
  font-weight: 600;
  font-size: 0.9375rem;
}

.github-link:hover {
  color: var(--accent-deep) !important;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: #f8fafc;
  padding: clamp(3.5rem, 10vw, 5.5rem) 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 42%, #0e7490 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgb(20 184 166 / 0.25), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 60%, rgb(14 165 233 / 0.2), transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  color: #fff;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 24px rgb(0 0 0 / 0.25);
}

.hero-subtitle {
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.05rem;
  opacity: 0.88;
  max-width: 540px;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.install-command {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgb(0 0 0 / 0.28);
  border: 1px solid rgb(255 255 255 / 0.12);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.install-command code {
  background: none;
  border: none;
  color: #ecfdf5;
}

.copy-btn {
  background: rgb(255 255 255 / 0.15);
  border: 1px solid rgb(255 255 255 / 0.2);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: rgb(255 255 255 / 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.975rem;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: #fff;
  color: var(--accent-deep);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: #ecfdf5;
  color: #115e59;
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgb(255 255 255 / 0.45);
}

.btn-secondary:hover {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

/* Sections */
.features {
  padding: clamp(3.5rem, 8vw, 5rem) 0;
}

.features h2 {
  text-align: center;
  margin-bottom: 2.5rem;
}

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

.feature-card {
  background: var(--surface);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgb(13 148 136 / 0.25);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--ink-muted);
  margin-bottom: 0;
  font-size: 0.98rem;
}

.problem-section {
  padding: clamp(3.5rem, 8vw, 5rem) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.problem-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.problem-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.problem-text ol {
  margin: 1rem 0;
  padding-left: 1.35rem;
}

.problem-text li {
  margin-bottom: 0.45rem;
}

.problem-diagram {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  overflow-x: auto;
  border: 1px solid rgb(255 255 255 / 0.08);
}

.diagram {
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin: 0;
  white-space: pre;
  line-height: 1.5;
}

.solution-section {
  padding: clamp(3.5rem, 8vw, 5rem) 0;
}

.solution-section h2 {
  text-align: center;
  margin-bottom: 0.75rem;
}

.solution-section > p {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2rem;
  color: var(--ink-muted);
}

.comparison-section {
  padding: clamp(3.5rem, 8vw, 5rem) 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.comparison-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.comparison-table {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  background: var(--surface-subtle);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.risk-verylow {
  color: var(--success);
  font-weight: 600;
}

.risk-low {
  color: #16a34a;
  font-weight: 600;
}

.risk-medium {
  color: var(--warning);
  font-weight: 600;
}

.code-example {
  background: #0c1117;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.08);
  box-shadow: var(--shadow-lg);
}

.code-example pre {
  margin: 0;
  padding: 1.35rem;
  overflow-x: auto;
}

.code-example code {
  font-size: 0.84rem;
  line-height: 1.65;
}

.quickstart-section {
  padding: clamp(3.5rem, 8vw, 5rem) 0;
}

.quickstart-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.cta-buttons .btn-primary {
  background: var(--accent);
  color: #fff;
}

.cta-buttons .btn-primary:hover {
  background: var(--accent-deep);
  color: #fff;
}

.cta-buttons .btn-secondary {
  background: var(--surface);
  color: var(--accent-deep);
  border: 2px solid var(--accent);
}

.cta-buttons .btn-secondary:hover {
  background: var(--surface-subtle);
}

/* Footer */
.footer {
  background: var(--ink);
  color: #94a3b8;
  padding: 2.75rem 1.5rem;
  text-align: center;
  border-top: 1px solid rgb(255 255 255 / 0.06);
}

.footer-inner {
  max-width: 640px;
  margin: 0 auto;
}

.footer-lead {
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  max-width: none;
}

.footer-meta {
  font-size: 0.875rem;
  margin-bottom: 0;
  max-width: none;
}

.footer-meta a {
  color: #5eead4;
}

.footer-meta a:hover {
  color: #99f6e4;
}

.footer-dot {
  margin: 0 0.35rem;
  opacity: 0.5;
}

/* Guide / inner docs */
.guide-content {
  padding: 2.5rem 0 4rem;
}

.guide-content h1 {
  margin-bottom: 1.5rem;
}

.guide-content h2 {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.guide-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

.guide-content ul,
.guide-content ol {
  margin-bottom: 1rem;
  padding-left: 1.35rem;
}

.guide-content li {
  margin-bottom: 0.4rem;
}

.guide-content .code-example {
  margin: 1.5rem 0;
}

.api-content {
  padding: 2.5rem 0 4rem;
}

.api-content > h1 {
  margin-bottom: 0.35rem;
}

.api-content > p {
  color: var(--ink-muted);
  margin-bottom: 2rem;
  max-width: 50ch;
}

.api-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
}

.api-section h3 {
  color: var(--accent-deep);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.api-section h4 {
  margin-top: 1.35rem;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.param-table th,
.param-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.param-table th {
  background: var(--surface-subtle);
  font-weight: 600;
}

.param-table code {
  font-size: 0.85em;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 2rem;
  padding: 1.5rem 0 3rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 72px;
  height: fit-content;
}

.sidebar-nav {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.sidebar-nav h4 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.5rem;
  font-weight: 700;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.sidebar-nav li a {
  display: block;
  padding: 0.45rem 0.5rem;
  color: var(--ink-muted);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: var(--surface-subtle);
  color: var(--accent-deep);
  text-decoration: none;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: 0.98rem;
}

.alert-info {
  background: #eff6ff;
  border-left: 4px solid var(--accent-2);
  color: #1e3a5f;
}

.alert-warning {
  background: #fffbeb;
  border-left: 4px solid var(--warning);
  color: #78350f;
}

.alert-success {
  background: #ecfdf5;
  border-left: 4px solid var(--success);
  color: #064e3b;
}

@media (max-width: 900px) {
  .problem-content {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 520px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
  }
}
