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

:root {
  --cream: #FAF9F5;
  --cream-2: #F0EEE6;
  --cream-3: #E8E5DA;
  --ink: #161614;
  --muted: #63615C;
  --faint: #8A877D;
  --line: #E5E2D9;
  --terra: #C15F3C;
  --terra-dark: #9E4B2D;
  --terra-soft: #F3E5DD;
  --sage: #7D9B76;
  --radius: 12px;
  --max-w: 960px;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--terra-soft); color: var(--terra-dark); }

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

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 249, 245, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 28px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-mark { width: 28px; height: 28px; }

.nav-links {
  display: flex; align-items: center; gap: 28px;
  font-size: 0.88rem; font-weight: 500;
}

.nav-links a { color: var(--muted); transition: color .15s; text-decoration: none; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

.nav-gh {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border: 1px solid var(--line);
  border-radius: 100px; color: var(--ink) !important;
  transition: border-color .15s, background .15s;
}
.nav-gh:hover { border-color: var(--ink); background: var(--cream-2); }
.nav-gh svg { width: 15px; height: 15px; }

/* Hero */
.hero {
  padding: 104px 0 88px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 720px 420px at 50% -10%, rgba(193, 95, 60, 0.07), transparent 70%);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--terra-dark);
  background: var(--terra-soft);
  padding: 6px 16px; border-radius: 100px;
  margin-bottom: 30px;
}

.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--terra);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.022em;
  max-width: 780px;
  margin: 0 auto 26px;
}

.hero h1 em { font-style: italic; color: var(--terra); }

.hero .sub {
  font-size: 1.05rem; color: var(--muted);
  max-width: 620px; margin: 0 auto;
  line-height: 1.6;
}

/* Sections */
section { padding: 72px 0; }

section.alt {
  background: var(--cream-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sec-head { max-width: 640px; margin-bottom: 36px; }

.kicker {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--terra);
  margin-bottom: 10px;
}

.sec-head h2, .heuristic-head h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15; letter-spacing: -0.018em;
}

/* Summary grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 40px;
}

.summary-card {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}

.summary-num {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--terra);
  line-height: 1;
}

.summary-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

/* Heuristic header */
.heuristic-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 36px;
}

.heuristic-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--terra);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Prose */
.prose h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  margin-bottom: 8px;
  margin-top: 20px;
}

.prose h3:first-child { margin-top: 0; }

.prose p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 12px;
}

.prose ul {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-left: 20px;
  margin-bottom: 12px;
}

.prose li { margin-bottom: 4px; }

.prose code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--cream-3);
  padding: 2px 6px;
  border-radius: 4px;
}

.prose strong { color: var(--ink); font-weight: 600; }

/* Code box */
.code-box {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
}

.code-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: #8A877D;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.code-title:not(:first-child) {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #2a2a28;
}

.code-box pre {
  margin: 0;
}

.code-box code {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #E8E5DA;
  white-space: pre;
}

.code-note {
  font-size: 0.78rem;
  color: #8A877D;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #2a2a28;
  line-height: 1.5;
}

/* Param table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.param-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  padding: 10px 14px;
  border-bottom: 2px solid var(--line);
}

.param-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.param-table td:first-child {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--terra-dark);
  white-space: nowrap;
}

.param-table td:nth-child(2) {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* Source list */
.source-list {
  list-style: none;
}

.source-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--muted);
}

.source-list li:last-child { border-bottom: none; }

.source-list a {
  font-weight: 600;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.82rem;
}

footer a { color: var(--faint); }
footer a:hover { color: var(--ink); }
footer p { margin-bottom: 4px; }

/* Mobile */
@media (max-width: 768px) {
  .hero { padding: 72px 0 56px; }
  .two-col { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .heuristic-num { width: 42px; height: 42px; font-size: 1.3rem; }
  section { padding: 56px 0; }
  .nav-links a:not(.nav-gh) { display: none; }
}

@media (max-width: 400px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
}
