/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #fbfbfd;
  --surface:     #ffffff;
  --border:      #e4e4eb;
  --text:        #18181b;
  --text-mid:    #52525b;
  --text-dim:    #a1a1aa;
  --accent:      #6366f1;
  --accent-hover:#818cf8;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --radius:      14px;
  --radius-sm:   10px;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 40% 60% at 20% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    linear-gradient(90deg, #ffffff 0%, #fdfdfe 25%, #fafafc 50%, #f5f5f9 75%, #f0f0f5 100%);
}

a { color: inherit; text-decoration: none; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--text-mid);
}

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

.nav-cta {
  background: var(--text);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  transition: opacity 0.15s;
}

.nav-cta:hover { opacity: 0.85; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  padding: 120px 24px 60px;
  display: flex;
  justify-content: center;
}

.hero-content {
  max-width: 820px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-mid);
  max-width: 620px;
  margin: 0 auto 40px;
}

/* ── CTA Buttons ──────────────────────────────────────────── */
.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 60px;
}

.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  transform: translateY(-1px);
}

/* ── Value Cards ──────────────────────────────────────────── */
.value-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: left;
  transition: border-color 0.2s;
}

.value-card:hover { border-color: var(--accent); }

.value-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.value-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-soft);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.value-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.value-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
}

.value-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mid);
}

/* ── How It Works ─────────────────────────────────────────── */
.how-section {
  margin-bottom: 60px;
  text-align: left;
}

.how-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step-content p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mid);
}

/* ── Contact Section ──────────────────────────────────────── */
.contact-section {
  text-align: center;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-section h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.contact-section p {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

.contact-section a {
  color: var(--accent);
}

/* ── Docs Layout ──────────────────────────────────────────── */
.docs-layout {
  display: flex;
  padding-top: 56px;
  min-height: 100vh;
}

.docs-sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--bg);
}

.docs-sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding: 0 8px;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-mid);
  border-radius: 6px;
  transition: all 0.15s;
}

.docs-nav-item:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.docs-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.docs-main {
  flex: 1;
  margin-left: 200px;
  padding: 40px 48px;
}

.doc-section {
  display: none;
}

.doc-section.active {
  display: block;
}

.placeholder-text {
  font-size: 14px;
  color: var(--text-dim);
  font-style: italic;
}

/* ── Example steps ────────────────────────────────────────── */
.example-task-header {
  display: flex;
  gap: 12px;
  align-items: baseline;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.example-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.example-step-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
  margin-bottom: 10px;
}

.example-step-rubric {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.example-step-simple {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.example-step-simple:last-of-type {
  border-bottom: none;
}

/* ── Instruction blocks ───────────────────────────────────── */
.doc-section h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.doc-section > p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 28px;
}

.instruction-block {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.instruction-num {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.instruction-body h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.instruction-body p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-mid);
  margin-bottom: 12px;
}

.instruction-body ul {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-mid);
  margin-bottom: 12px;
  padding-left: 20px;
}

.instruction-body li {
  margin-bottom: 6px;
}

.see-example-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
  float: right;
  transition: opacity 0.15s;
}

.see-example-link:hover {
  opacity: 0.7;
}

/* ── Overview split layout ────────────────────────────────── */
.overview-split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.overview-right {
  position: sticky;
  top: 80px;
}

.output-format-sticky {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
}

.output-format-sticky h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fmt-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.fmt-key {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 110px;
  flex-shrink: 0;
}

.fmt-val {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.format-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.fmt-spacer {
  height: 10px;
}

.doc-callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin: 20px 0;
}

.doc-callout.warn {
  background: rgba(239, 68, 68, 0.06);
  border-left-color: #ef4444;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0;
}

.doc-table th, .doc-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.doc-table th {
  font-weight: 600;
  color: var(--text);
}

.doc-table td {
  color: var(--text-mid);
}

.doc-code {
  background: #f4f4f8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  margin: 16px 0;
  overflow-x: auto;
}

.doc-code pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
  white-space: pre;
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.example-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.example-card p {
  font-size: 13px;
  margin-bottom: 4px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .value-cards {
    grid-template-columns: 1fr;
  }
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  .instruction-block {
    flex-direction: column;
    gap: 12px;
  }
}
