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

:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface2: #242836;
  --border: #2e3344;
  --text: #e2e4ea;
  --subtext: #9ba1b0;
  --accent: #6c8aff;
  --accent-dim: #4a6ae0;
  --green: #6bdfb8;
  --peach: #f0a77b;
  --max-w: 1080px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── Typography ─── */
h1 { font-size: 2.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; line-height: 1.4; font-weight: 600; }
p  { font-size: 1.125rem; color: var(--subtext); }

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

/* ─── Section (normal mode) ─── */
.section {
  padding: 5rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

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

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

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

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}

/* ─── Code blocks ─── */
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  font-size: 0.875em;
}

/* ─── Nav ─── */
.site-nav {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 23, 0.72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

[data-mode="present"] .site-nav { position: static; }

.site-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-nav a { color: var(--subtext); font-size: 1.05rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

.nav-brand {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text) !important;
  letter-spacing: -0.01em;
}

.nav-links { display: flex; gap: 1.5rem; }

/* ─── Footer ─── */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p { font-size: 0.85rem; color: var(--subtext); }

/* ─── Utilities ─── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.gap-1 { gap: 0.75rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ─── Present Mode ─── */
html[data-mode="present"] {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

html[data-mode="present"] body {
  overflow-x: hidden;
}

[data-mode="present"] .section {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border-top: none;
}

[data-mode="present"] .section > .container {
  max-width: var(--max-w);
  width: 100%;
}

/* Bump type in present mode for recording readability */
[data-mode="present"] h1 { font-size: 3.5rem; }
[data-mode="present"] h2 { font-size: 2.25rem; }
[data-mode="present"] h3 { font-size: 1.5rem; }
[data-mode="present"] p  { font-size: 1.35rem; }
[data-mode="present"] pre { font-size: 1.05rem; }

/* Hide nav/footer in present mode */
[data-mode="present"] .site-nav,
[data-mode="present"] .site-footer { display: none; }

/* ─── Scroll-reveal ─── */
/* Paired with shared/reveal.js: adds .is-visible via IntersectionObserver. */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
[data-mode="present"] .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Lead form status ─── */
.lead-form-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.lead-form-status {
  max-width: 640px;
  margin: 1.25rem auto 0;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}
.lead-form-status--success {
  background: rgba(107, 223, 184, 0.08);
  border: 1px solid rgba(107, 223, 184, 0.35);
  color: var(--green);
}
.lead-form-status--error {
  background: rgba(240, 167, 123, 0.08);
  border: 1px solid rgba(240, 167, 123, 0.4);
  color: var(--peach);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 0 1.25rem; }
  .section { padding: 3rem 0; }
}
