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

:root {
  --c-bg:        #f7f6f2;
  --c-white:     #ffffff;
  --c-text:      #1a1a1a;
  --c-muted:     #6b7280;
  --c-border:    #e5e7eb;
  --c-bad:       #ef4444;
  --c-good:      #22c55e;

  --c-contrast:   #e63946;
  --c-repetition: #2a9d8f;
  --c-alignment:  #d4a017;
  --c-proximity:  #6c63ff;

  --radius: 12px;
  --shadow: 0 2px 20px rgba(0,0,0,0.07);
}

html { scroll-behavior: smooth; }

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

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  padding: 0 2rem;
  display: flex; align-items: center; gap: 1.5rem;
  height: 56px;
}
.nav-logo {
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.5px;
  text-decoration: none; color: var(--c-text);
}
nav a {
  text-decoration: none; color: var(--c-muted); font-size: 0.88rem;
  font-weight: 500; transition: color 0.2s; white-space: nowrap;
}
nav a:hover, nav a.active { color: var(--c-text); }
nav a.active { font-weight: 700; }
.nav-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}

/* ── Page hero ── */
.page-hero {
  padding: 3.5rem 2rem 2.5rem;
  max-width: 860px; margin: 0 auto;
}
.page-hero .eyebrow {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--c-muted); margin-bottom: 0.6rem;
}
.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900; line-height: 1.1; letter-spacing: -1px;
  margin-bottom: 0.8rem;
}
.page-hero .subtitle {
  font-size: 1.05rem; color: var(--c-muted); max-width: 560px;
}
.page-hero .key-rule {
  display: inline-block; margin-top: 1.2rem;
  padding: 0.6rem 1.2rem; border-radius: 99px;
  background: var(--c-text); color: var(--c-white);
  font-size: 0.85rem; font-weight: 600;
}

/* ── Content wrapper ── */
.content {
  max-width: 860px; margin: 0 auto; padding: 0 2rem 6rem;
}

/* ── Section header ── */
.section-number {
  display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem;
}
.section-number .num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900; color: var(--c-white); flex-shrink: 0;
}
.section-number h2 { font-size: 1.3rem; font-weight: 800; }

/* ── Example block ── */
.example-block {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 2.5rem;
}
.example-header {
  padding: 1.2rem 1.6rem 1rem;
  border-bottom: 1px solid var(--c-border);
}
.example-header .ex-tag {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--c-muted); margin-bottom: 0.25rem;
}
.example-header h3 { font-size: 1.1rem; font-weight: 800; }
.example-header p  { font-size: 0.88rem; color: var(--c-muted); margin-top: 0.2rem; }

.example-body {
  padding: 1.6rem;
}

/* Before/After layout */
.ba-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem;
}
@media (max-width: 600px) { .ba-grid { grid-template-columns: 1fr; } }

.ba-col { display: flex; flex-direction: column; }
.ba-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.4rem;
}
.ba-label.bad  { color: var(--c-bad); }
.ba-label.good { color: var(--c-good); }

.ba-mock {
  border-radius: 8px; flex: 1;
  padding: 1.2rem; background: #f9f9f9; border: 1px solid var(--c-border);
}
.ba-mock.dark { background: #1a1a1a; border-color: #333; }
.ba-mock.accent-bg { border: none; }

/* Explanation strip */
.example-note {
  background: #f9f9f9; border-top: 1px solid var(--c-border);
  padding: 1rem 1.6rem; font-size: 0.88rem; color: var(--c-muted);
  display: flex; align-items: flex-start; gap: 0.6rem;
}
.example-note strong { color: var(--c-text); }
.example-note .note-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Insight ── */
.insight-bar {
  border-radius: var(--radius); padding: 1.2rem 1.6rem;
  margin-bottom: 2rem; display: flex; align-items: flex-start; gap: 0.8rem;
  font-size: 0.92rem;
}
.insight-bar .ib-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ── Challenge ── */
.challenge-block {
  border: 2px dashed var(--c-border); border-radius: var(--radius);
  padding: 1.5rem 1.6rem; margin-top: 1rem;
}
.challenge-block h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; }
.challenge-block p  { font-size: 0.9rem; color: var(--c-muted); line-height: 1.7; }

/* ── Next/Prev nav ── */
.page-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; flex-wrap: wrap;
}
.page-nav-btn {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.4rem; border-radius: var(--radius);
  background: var(--c-white); border: 1px solid var(--c-border);
  text-decoration: none; color: var(--c-text);
  box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}
.page-nav-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 24px rgba(0,0,0,0.1); }
.page-nav-btn .pnb-label { font-size: 0.7rem; font-weight: 500; color: var(--c-muted); display: block; }
.page-nav-btn .pnb-title { font-size: 0.95rem; font-weight: 700; }

/* ── Footer ── */
footer {
  text-align: center; padding: 2.5rem 1rem;
  font-size: 0.82rem; color: var(--c-muted);
  border-top: 1px solid var(--c-border);
}
footer strong { color: var(--c-text); }

/* ── Toggle ── */
.toggle-row { display: flex; align-items: center; gap: 0.8rem; margin: 0.8rem 0; }
.toggle-row label.tl { font-size: 0.88rem; font-weight: 600; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.t-slider {
  position: absolute; inset: 0; border-radius: 99px;
  background: #ccc; cursor: pointer; transition: background 0.3s;
}
.t-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: transform 0.3s;
}
.toggle input:checked + .t-slider::before { transform: translateX(20px); }
