/* wawk-website shared styles */
* { font-family: 'Inter', system-ui, sans-serif; }
code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f8;
  --bg-code: #f4f4f5;
  --border: #e4e4e7;
  --border-light: #f0f0f2;
  --text: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --accent: #18181b;
  --accent-blue: #2563eb;
  --accent-blue-light: #dbeafe;
}

body { background: var(--bg); color: var(--text); margin: 0; }

/* Top navigation */
.top-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.top-nav-links { display: flex; align-items: center; gap: 16px; }
.top-nav-link {
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  padding: 4px 0; border-bottom: 2px solid transparent; transition: all 0.15s;
}
.top-nav-link:hover { color: var(--text); }
.top-nav-link.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }

/* Page layout */
.page-layout {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 240px; gap: 0;
}
@media (max-width: 1024px) {
  .page-layout { grid-template-columns: 1fr; }
  .nav-pane { display: none; }
}

/* Side nav pane */
.nav-pane {
  position: sticky; top: 57px; height: calc(100vh - 57px);
  overflow-y: auto; padding: 32px 24px 32px 0;
  border-left: 1px solid var(--border); margin-left: 48px; padding-left: 24px;
}
.nav-pane-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px;
}
.nav-link {
  display: block; padding: 5px 0 5px 12px; font-size: 13px;
  color: var(--text-secondary); text-decoration: none;
  border-left: 2px solid transparent; margin-left: -1px;
  transition: all 0.15s; line-height: 1.4;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); border-left-color: var(--accent); font-weight: 500; }

/* Content area */
.content-area { padding: 48px 0 120px 0; min-width: 0; }
.content-area > section { padding: 0 48px; margin-bottom: 72px; }
@media (max-width: 640px) { .content-area > section { padding: 0 20px; } }

/* Section headings */
.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}
h2.section-title {
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 16px; color: var(--text);
}
h3.subsection-title {
  font-size: 17px; font-weight: 600; margin-bottom: 10px;
  margin-top: 32px; color: var(--text);
}

/* Typography */
p.body-text {
  font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 16px;
}
p.body-text strong { color: var(--text); font-weight: 500; }

/* Code blocks */
.code-block {
  background: var(--bg-code); border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 16px; font-size: 13px; line-height: 1.65;
  overflow-x: auto; margin: 12px 0 20px; white-space: pre-wrap;
}
.cmd-block {
  background: var(--bg-code); border: 1px solid var(--border); border-radius: 6px;
  padding: 16px 18px; font-size: 13px; line-height: 1.8;
  overflow-x: auto; margin: 12px 0 20px; white-space: pre-wrap;
}
.cmd-block .prompt { color: var(--text-muted); user-select: none; }
.cmd-block .cmd { color: var(--text); }
.cmd-block .comment { color: var(--text-muted); font-style: italic; }
.cmd-block .output { color: var(--text-secondary); }

/* Syntax highlighting */
.kw { color: #7c3aed; }
.str { color: #0369a1; }
.num { color: #b45309; }
.cm { color: #a1a1aa; font-style: italic; }
.fn { color: #1d4ed8; }
.var { color: #be185d; }
.re { color: #c2410c; }
.ty { color: #0d9488; }
.attr { color: #7c3aed; }

/* Inline code */
.inline-code {
  font-size: 13px; background: var(--bg-code); padding: 2px 5px;
  border-radius: 3px; font-family: 'JetBrains Mono', monospace;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  transition: all .15s; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn-dark { background: var(--accent); color: #fff; }
.btn-dark:hover { background: #27272a; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-alt); border-color: #d4d4d8; }
.btn-outline:disabled { opacity: .35; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Cards */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }

/* Tables */
.data-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg-alt);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
.data-table tr:last-child td { border-bottom: none; }

/* Playground */
.playground { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.playground-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-alt);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.playground-body { display: grid; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) { .playground-body { grid-template-columns: 1fr; } }
.playground-cell { padding: 12px; border-right: 1px solid var(--border); }
.playground-cell:last-child { border-right: none; }
@media (max-width: 900px) {
  .playground-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .playground-cell:last-child { border-bottom: none; }
}
.playground-footer {
  padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-alt);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* Editor textarea */
.editor {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; line-height: 1.65; color: var(--text);
  padding: 12px 14px; resize: vertical; width: 100%; outline: none;
  transition: border-color .15s; tab-size: 4;
}
.editor:focus { border-color: var(--accent-blue); }

/* Cell labels */
.cell-label {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
}
.cell-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Chapter nav */
.chapter-nav {
  display: flex; align-items: center; gap: 4px; margin-bottom: 16px; flex-wrap: wrap;
}
.chapter-btn {
  padding: 5px 12px; font-size: 12px; border-radius: 4px;
  color: var(--text-secondary); background: transparent;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.chapter-btn:hover { background: var(--bg-alt); }
.chapter-btn.active {
  background: var(--bg-code); border-color: var(--border);
  color: var(--text); font-weight: 500;
}

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500;
  background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
}

/* Sequence steps */
.seq-step {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px;
  border-radius: 6px; margin-bottom: 4px; font-size: 13px; color: var(--text-secondary);
}
.seq-step:hover { background: var(--bg-alt); }
.seq-num {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  min-width: 20px; padding-top: 1px;
}

/* Timeline */
.timeline-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
}
.timeline-dot.current {
  background: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-light);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 3px; }

html { scroll-behavior: smooth; }
.fade-section { scroll-margin-top: 80px; }

/* Spec example layout */
.spec-example {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 24px;
}
@media (max-width: 768px) { .spec-example { grid-template-columns: 1fr; } }
.spec-example-left, .spec-example-right { min-width: 0; }
.spec-example-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 32px 24px;
}
.site-footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
