/* ============================================================
   vanilla.waves — docs skin
   A p5.waves family member: same typography + layout system
   (Oswald titles, Inter body, the sibling component set), with
   vanilla.waves' own accent — a coffeehouse-vanilla palette
   (cream · sand · taupe · espresso + a teal pop) used across the
   site and in the canvasless animations. The way p5.waves leans
   on lime, vanilla leans on teal-on-cream. No red anywhere.
   License: MIT · seb@prjcts
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500&display=swap');

:root {
  /* coffeehouse vanilla palette */
  --bg:          #f5f5f5;   /* neutral, same as p5.waves */
  --bg2:         #eeeeee;   /* raised panel            */
  --bg3:         #e4e4e4;   /* recessed strip          */
  --surface:     #ffffff;   /* cards, stages           */
  --ink:         #453020;   /* espresso — text + lines */
  --text:        #453020;
  --text-muted:  #6f5c3d;   /* dark taupe              */
  --text-faint:  #b39c7d;   /* taupe                   */
  --accent:      #72bab8;   /* teal — the pop          */
  --accent-deep: #3f8f8c;   /* deep teal (text/hover)  */

  --border:      rgba(69, 48, 32, 0.14);
  --border-mid:  rgba(69, 48, 32, 0.26);
  --border-hard: rgba(69, 48, 32, 0.50);

  --code-bg:     #ececec;
  --code-inl:    #e4e4e4;
  --mono:        'Consolas', 'Courier New', monospace;

  /* animation tones: espresso · taupe · teal · sand · brown */
  --c1: #453020;
  --c2: #b39c7d;
  --c3: #72bab8;
  --c4: #dbcdad;
  --c5: #8a6f4a;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .nav-logo, .stat-num, .cta-btn, .hero-badge, .section-tag { font-family: 'Oswald', sans-serif; }

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

.accent, h1 b, h2 b, h3 b { color: var(--accent-deep); font-weight: inherit; }

/* ── NAV ─────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2.5rem;
  background: rgba(245, 245, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-mid);
}
.nav-logo { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-logo a { color: var(--ink); text-decoration: none; }
.nav-logo b { color: var(--ink); border-bottom: 2px solid var(--accent); font-weight: 700; }

.nav-links { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

#hero, .section, footer { position: relative; z-index: 1; }

/* ── HERO ────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 2rem 3rem;
}
/* the animated wave band sits under the name, showing the coffee spectrum */
.hero-wave { position: absolute; left: 0; right: 0; bottom: 0; top: auto; height: 58%; z-index: 0; pointer-events: none; }
.hero-wave svg { display: block; width: 100%; height: 100%; }
.hero-wave .wv-trace { fill: none; stroke: var(--ink); stroke-width: 1.3; vector-effect: non-scaling-stroke; opacity: 0.92; }
/* fade the top of the band into the cream so the lines emerge under the title */
#hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to bottom,
    var(--bg) 0%,
    var(--bg) 34%,
    rgba(245, 245, 245, 0.55) 48%,
    rgba(245, 245, 245, 0) 74%);
}

.hero-text { position: relative; z-index: 1; text-align: center; max-width: 780px; }
.hero-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  border: 1px solid var(--border-hard);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.hero-text h1 {
  font-size: clamp(3.5rem, 11vw, 8rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.hero-text h1 b { border: none; font-weight: 400; color: var(--accent-deep); }
.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 auto 2.4rem;
  max-width: 580px;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-stats { display: flex; justify-content: center; gap: 3.2rem; margin-bottom: 2.4rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.stat-num { font-size: 2.3rem; font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }
.stat-label { font-family: 'Inter', sans-serif; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }

.cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cta-btn {
  display: inline-block;
  padding: 0.8rem 2.4rem;
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.cta-btn:hover { background: var(--accent); color: var(--ink); }
.cta-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-hard); }
.cta-btn.ghost:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }

/* ── SECTIONS ────────────────────────────────────────────── */
.section { padding: 6rem 2rem; }
.section-alt { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-header { max-width: 680px; margin: 0 auto 3rem; text-align: center; }
.section-tag {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--border-mid);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.section-header h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-bottom: 1rem;
}
.section-header p { color: var(--text-muted); line-height: 1.7; font-size: 0.97rem; }
.section-header p.fine { font-size: 0.8rem; margin-top: 0.9rem; font-style: italic; }

/* ── DEMO STAGE ──────────────────────────────────────────── */
.demo {
  border: 1px solid var(--border-mid);
  background: var(--surface);
  padding: 26px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  min-height: 150px;
}

.wv-eq { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.wv-eq span { width: 8px; height: 100%; background: var(--ink); transform-origin: bottom; display: block; }

.wv-line { display: flex; align-items: center; gap: 2px; height: 96px; }
.wv-line span { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); display: block; }

.wv-load { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); width: 96px; height: 96px; font-family: var(--mono); }
.wv-load span { display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; color: var(--ink); }

.wv-ascii { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.05; letter-spacing: 0.12em; color: var(--ink); white-space: pre; user-select: none; }

.wv-field { display: grid; gap: 2px; width: 100%; max-width: 360px; }
.wv-field span { display: block; aspect-ratio: 1 / 1; background: var(--ink); }

.wv-svg { display: block; width: 100%; height: 100%; }
.wv-svg .wv-trace { fill: none; stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }

/* ── SHOWCASE / EXAMPLES LIST ────────────────────────────── */
.ex-list { max-width: 900px; margin: 0 auto; }
.ex-block { margin-bottom: 4rem; padding-bottom: 3rem; border-bottom: 1px solid var(--border); }
.ex-block:last-child { border-bottom: none; margin-bottom: 0; }
.ex-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.ex-head h3 { font-family: 'Oswald', sans-serif; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 0.03em; }
.ex-tag { font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint); border: 1px solid var(--border-mid); padding: 0.1rem 0.4rem; }
.ex-block p.lead { color: var(--text-muted); line-height: 1.7; margin-bottom: 1.1rem; max-width: 720px; font-size: 0.95rem; }
.ex-grid { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 1.4rem; align-items: stretch; }
.ex-stage { border: 1px solid var(--border-mid); background: var(--surface); min-height: 200px; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; }
.ex-links { margin-top: 1rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.ex-links a { font-family: 'Oswald', sans-serif; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 1px; }
.ex-links a:hover { color: var(--accent-deep); border-color: var(--accent-deep); }

/* ── CODE (light, on cream) ──────────────────────────────── */
pre.code, .code-block {
  background: var(--code-bg);
  color: var(--ink);
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre;
}
.ex-grid .code-block { margin: 0; }
pre .c, .code-block .c { color: var(--text-faint); font-style: italic; }   /* comment */
pre .k, .code-block .k { color: var(--accent-deep); }                      /* keyword */
pre .s, .code-block .s { color: #5f7a48; }                                 /* string  */
code.inl { font-family: var(--mono); font-size: 0.88em; background: var(--code-inl); padding: 0.1em 0.35em; }

/* ── GUIDE / PROSE WRAP ──────────────────────────────────── */
.wrap { max-width: 900px; margin: 0 auto; padding: 7rem 2rem 5rem; }
.wrap h1 { font-family: 'Oswald', sans-serif; font-size: 2.8rem; margin-bottom: 0.3rem; color: var(--ink); }
.wrap .intro { font-size: 1.1rem; color: var(--ink); margin-bottom: 2rem; line-height: 1.7; }
.wrap h2 { font-family: 'Oswald', sans-serif; font-size: 1.5rem; margin: 3rem 0 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--ink); padding-bottom: 0.3rem; color: var(--ink); }
.wrap h3 { font-family: 'Oswald', sans-serif; font-size: 1.1rem; margin: 1.8rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.wrap p { line-height: 1.7; margin-bottom: 0.8rem; color: var(--text-muted); }
.wrap p strong, .wrap li strong { color: var(--ink); }
.wrap a { color: var(--accent-deep); text-decoration: underline; }
.wrap a:hover { color: var(--ink); }
.wrap ul, .wrap ol { color: var(--text-muted); line-height: 1.7; margin: 0 0 1rem 1.2rem; }
.wrap li { margin-bottom: 0.4rem; }

.quicklinks { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.3rem 0 0.4rem; }
.chip {
  display: inline-flex; align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border-mid);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); text-decoration: none; }

.callout { border-left: 3px solid var(--accent); background: var(--surface); padding: 0.9rem 1.2rem; margin: 1.2rem 0; }
.callout p { margin: 0; color: var(--ink); }
.callout code, .callout .inl { background: var(--code-inl); }
.note {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent); color: var(--ink);
  padding: 0.15em 0.5em;
  margin-right: 0.4rem;
  vertical-align: middle;
}

/* ── TABLES ──────────────────────────────────────────────── */
.opts-table { width: 100%; border-collapse: collapse; margin: 0.8rem 0 1.4rem; font-size: 0.84rem; }
.opts-table th { text-align: left; font-family: 'Oswald', sans-serif; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.4rem 0.8rem; background: var(--ink); color: var(--surface); }
.opts-table td { padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--border); color: var(--ink); vertical-align: top; }
.opts-table tr:last-child td { border-bottom: none; }
.opts-table td:first-child { font-family: var(--mono); white-space: nowrap; color: var(--accent-deep); }
.opts-table td.desc { color: var(--text-muted); }

/* ── WAVE INDEX GRID (guide list) ────────────────────────── */
.wave-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.4rem; margin: 0.8rem 0 1.4rem; }
.wave-item { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.4rem 0.7rem; background: var(--bg2); font-size: 0.84rem; color: var(--ink); }
.wave-item .wi { color: var(--text-faint); font-family: var(--mono); min-width: 1.6rem; }

/* ── STEP LIST ───────────────────────────────────────────── */
.step-list { list-style: none; padding: 0; margin: 0.5rem 0 1.4rem; counter-reset: steps; }
.step-list li { counter-increment: steps; display: flex; gap: 1rem; margin-bottom: 0.9rem; }
.step-list li::before {
  content: counter(steps, decimal-leading-zero);
  font-family: 'Oswald', sans-serif; font-size: 0.95rem;
  background: var(--ink); color: var(--surface);
  min-width: 2rem; height: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 0.1rem;
}
.step-list li > div { flex: 1; }
.step-list li p { margin: 0; line-height: 1.6; }

/* ── WAVE CATALOG (waves.html) ───────────────────────────── */
.waves-page { max-width: 1200px; margin: 0 auto; padding: 6.5rem 2rem 4rem; }
.waves-page h1 { font-family: 'Oswald', sans-serif; font-size: 2.8rem; text-align: center; margin-bottom: 0.5rem; color: var(--ink); }
.waves-intro { max-width: 720px; margin: 0 auto 1.2rem; text-align: center; color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }
.waves-legend { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 0.8rem 0 2.4rem; font-family: var(--mono); font-size: 0.76rem; color: var(--text-muted); }
.waves-legend span { display: inline-block; padding: 0.2rem 0.55rem; border: 1px solid var(--border-mid); background: var(--surface); }

.waves-family { margin: 3rem 0 0.9rem; }
.waves-family h2 { font-family: 'Oswald', sans-serif; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--ink); padding-bottom: 0.35rem; margin-bottom: 0.35rem; color: var(--ink); }
.waves-family > p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1rem; }

.wave-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0; border: 1px solid var(--border-mid); background: var(--surface); }
.wave-card { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.wave-canvas { width: 100%; height: 120px; background: var(--surface); border-bottom: 1px solid var(--border); }
.wave-meta { padding: 0.85rem 1rem 1rem; }
.wave-meta .idx { font-family: var(--mono); font-size: 0.7rem; color: var(--text-faint); letter-spacing: 0.05em; }
.wave-meta .name { font-family: 'Oswald', sans-serif; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0.1rem 0 0.4rem; color: var(--ink); }
.wave-meta .formula { font-family: var(--mono); font-size: 0.78rem; background: var(--code-inl); padding: 0.25em 0.5em; color: var(--ink); display: inline-block; margin-bottom: 0.55rem; }
.wave-meta .tags { display: flex; gap: 0.35rem; flex-wrap: wrap; font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); }
.wave-meta .tag { padding: 0.1rem 0.45rem; border: 1px solid var(--border-mid); }
.wave-meta .tag.harsh { border-color: var(--accent-deep); color: var(--accent-deep); }
.wave-meta .tag.closing { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.wave-meta .tag.period { border-style: dashed; color: var(--text-muted); }

.period-section { max-width: 860px; margin: 4rem auto 0; }
.period-section h2 { font-family: 'Oswald', sans-serif; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--ink); padding-bottom: 0.35rem; margin-bottom: 0.8rem; color: var(--ink); }
.period-section h3 { font-family: 'Oswald', sans-serif; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 1.8rem 0 0.5rem; color: var(--ink); }
.period-section p, .period-section li { color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; margin-bottom: 0.8rem; }
.period-section ul { margin: 0 0 1rem 1.2rem; }
.period-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.82rem; margin: 1rem 0 1.5rem; }
.period-table th, .period-table td { border: 1px solid var(--border-mid); padding: 0.45rem 0.65rem; text-align: left; }
.period-table th { background: var(--ink); color: var(--surface); font-family: 'Oswald', sans-serif; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72rem; }
.period-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.period-table tr:nth-child(even) td { background: var(--surface); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer { text-align: center; padding: 3rem 2rem; border-top: 1px solid var(--border-mid); color: var(--text-muted); font-size: 0.85rem; line-height: 1.9; }
footer a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
footer a:hover { color: var(--accent-deep); }
.footer-sub { font-size: 0.75rem; color: var(--text-faint); }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-faint); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

section[id], h2[id] { scroll-margin-top: 62px; }

/* ── HAMBURGER ───────────────────────────────────────────── */
.nav-hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; z-index: 101; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
#navbar.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#navbar.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
#navbar.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  #navbar { padding: 0.85rem 1.5rem; }
  .ex-grid { grid-template-columns: 1fr; }
  .opts-table, .period-table { display: block; max-width: 100%; overflow-x: auto; }
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 52px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(245, 245, 245, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-mid);
    padding: 0.5rem 0 1rem;
  }
  #navbar.nav-open .nav-links { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.75rem 2rem; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Pager: vorige/volgende pagina, in dezelfde volgorde als het menu ─────── */
.page-nav {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1.5rem; flex-wrap: wrap;
  margin: 4rem auto 0; max-width: 900px;
  padding: 1.4rem 2rem 0; border-top: 1px solid var(--border-mid);
}
.page-nav a { text-decoration: none; display: block; }
.page-nav .lbl {
  display: block; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 0.25rem;
}
.page-nav .ttl {
  font-family: 'Oswald', sans-serif; font-size: 1rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink);
  border-bottom: 1px solid var(--ink); padding-bottom: 2px;
}
.page-nav a:hover .ttl { color: var(--accent-deep); border-color: var(--accent-deep); }
.page-nav .next { margin-left: auto; text-align: right; }
