/* CodeKidz design tokens — paper, ink, one accent pair (violet + gold).
   Typefaces are named explicitly: Fredoka (display), Quicksand (text),
   IBM Plex Mono (codes). No Inter, no glassmorphism, no gradient blobs. */

:root {
  --paper: #fffdf9;
  --paper-alt: #f7f4ee;
  --ink: #191434;
  --ink-soft: #4a4468;
  --ink-faint: #7d7796;
  --rule: #e7e1d6;
  --rule-strong: #191434;

  --violet: #7c5cfc;
  --violet-deep: #5a3fd6;
  --violet-wash: #efeaff;
  --gold: #ffc738;
  --gold-wash: #fff4d6;
  --rose: #ff6584;
  --teal: #0f9e8e;

  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-text: "Quicksand", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --dur-1: 150ms;
  --dur-2: 280ms;
  --dur-3: 520ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  --shadow-block: 4px 4px 0 var(--ink);
  --shadow-block-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --max: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Kicker + section headers ---------- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold-wash);
  border: 1.5px solid var(--gold);
  padding: 5px 14px;
  border-radius: 999px;
}

.kicker--violet {
  background: var(--violet-wash);
  border-color: var(--violet);
  color: var(--violet-deep);
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 44px;
}

.section-head--center {
  align-items: center;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  max-width: 20ch;
}

.section-head p {
  color: var(--ink-soft);
  max-width: 58ch;
  font-size: 18px;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  padding: 13px 26px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-block-sm);
  transition: transform var(--dur-1) var(--ease-out),
              box-shadow var(--dur-1) var(--ease-out),
              background-color var(--dur-1) var(--ease-out);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn--primary { background: var(--violet); color: #fff; }
.btn--primary:hover { background: var(--violet-deep); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #ffd75e; }
.btn--ghost { box-shadow: none; border-color: var(--rule); background: transparent; }
.btn--ghost:hover { box-shadow: none; border-color: var(--ink); transform: none; }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-1) var(--ease-out),
              border-color var(--dur-1) var(--ease-out);
}

.nav-links a:hover { color: var(--ink); border-bottom-color: var(--violet); }

.nav-actions { display: flex; gap: 10px; align-items: center; }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--ink);
  border-radius: 9px;
  padding: 7px 11px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #b9b3d4;
  padding: 44px 0 36px;
  margin-top: 0;
  border-top: 4px solid var(--gold);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.site-footer strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 19px;
  display: block;
  margin-bottom: 6px;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.footer-links a {
  color: #b9b3d4;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.footer-links a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.footer-note { font-size: 13px; color: #857ea8; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links, .nav-actions { display: none; }
  .site-nav.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    padding: 18px 20px 22px;
    gap: 16px;
  }
  .site-nav.open .nav-actions {
    display: flex;
    position: absolute;
    top: calc(100% + 190px);
    left: 0;
    right: 0;
    padding: 0 20px 20px;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
  }
}
