/* =========================================================
   Mr. Zenteno's Classroom — main stylesheet
   Colours are defined once here. Change them and the
   whole site updates.
   ========================================================= */

:root {
  --navy: #1b2a4a;
  --navy-soft: #3a4a6b;
  --sky: #5b9bd5;
  --sky-light: #e3effb;
  --orange: #e8622c;
  --orange-light: #fde9df;
  --sun: #f6b52e;
  --sun-light: #fff3d6;
  --mint: #22a594;
  --mint-light: #dcf4f0;
  --berry: #d0457a;
  --berry-light: #fbe3ec;

  --bg: #fffaf3;
  --surface: #ffffff;
  --text: #1b2a4a;
  --muted: #5d6b86;
  --border: #ebe3d6;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 2px 4px rgba(27, 42, 74, 0.04), 0 10px 30px rgba(27, 42, 74, 0.08);
  --shadow-lift: 0 4px 8px rgba(27, 42, 74, 0.06), 0 18px 40px rgba(27, 42, 74, 0.14);

  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --max: 1160px;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: var(--sky); }
a:hover { color: var(--orange); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 250, 243, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--navy);
}
.brand img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 20%;
  border: 3px solid var(--sun);
}
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.brand-tag { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.nav-toggle {
  display: none; background: none; border: 2px solid var(--border); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; color: var(--navy);
}
.nav-toggle svg { display: block; }

.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--navy); font-weight: 700; font-size: 0.97rem;
  transition: background 0.2s;
}
.site-nav a:hover { background: var(--sky-light); color: var(--navy); }
.site-nav a[aria-current="page"] { background: var(--navy); color: #fff; }

@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    display: none; padding: 10px 20px 18px;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px 16px; }
}

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(232, 98, 44, 0.3); }
.btn-primary:hover { color: #fff; background: #d6541f; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-small { padding: 8px 16px; font-size: 0.9rem; }
.btn[disabled], .btn.is-disabled {
  background: var(--border); color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none;
}

.chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em;
  background: var(--sky-light); color: var(--navy);
}
.chip-new { background: var(--sun); color: var(--navy); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 80px; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; z-index: -1; filter: blur(2px);
}
.hero::before { width: 420px; height: 420px; background: var(--sky-light); top: -120px; right: -80px; }
.hero::after { width: 260px; height: 260px; background: var(--orange-light); bottom: -80px; left: -60px; }
.hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 0.9rem; color: var(--orange);
  margin-bottom: 18px;
}
.hero h1 .hl {
  background: linear-gradient(transparent 62%, var(--sun) 62%, var(--sun) 90%, transparent 90%);
}
.hero-lead { font-size: 1.2rem; color: var(--navy-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-photo { position: relative; justify-self: center; max-width: 380px; width: 100%; }
.hero-photo .frame {
  position: relative; border-radius: 32px; overflow: hidden;
  border: 6px solid #fff; box-shadow: var(--shadow-lift); transform: rotate(2deg);
  aspect-ratio: 4 / 5; background: var(--sky-light);
}
.hero-photo .frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.hero-photo .blob {
  position: absolute; inset: 18px -18px -18px 18px; border-radius: 32px;
  background: repeating-linear-gradient(-45deg, var(--orange) 0 14px, var(--sky) 14px 28px);
  z-index: -1; transform: rotate(2deg);
}
.sticker {
  position: absolute; background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  padding: 10px 14px; font-weight: 800; font-size: 0.9rem; display: flex; align-items: center; gap: 8px;
}
.sticker .dot { font-size: 1.3rem; }
.sticker-1 { top: 22px; left: -34px; transform: rotate(-6deg); }
.sticker-2 { bottom: 36px; right: -30px; transform: rotate(5deg); }

@media (max-width: 860px) {
  .hero { padding: 40px 0 60px; }
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { max-width: 300px; }
  .sticker-1 { left: -12px; }
  .sticker-2 { right: -12px; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 40em; margin: 0; }
.kicker {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem;
  color: var(--orange); margin-bottom: 8px; display: block;
}

/* Page banner on inner pages */
.page-banner { padding: 56px 0 44px; position: relative; overflow: hidden; }
.page-banner .container { position: relative; }
.page-banner .emoji {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  font-size: 2rem; margin-bottom: 18px; background: #fff; box-shadow: var(--shadow);
}
.page-banner p { font-size: 1.15rem; color: var(--navy-soft); max-width: 40em; margin: 0; }
.theme-sky .page-banner { background: var(--sky-light); }
.theme-orange .page-banner { background: var(--orange-light); }
.theme-mint .page-banner { background: var(--mint-light); }
.theme-berry .page-banner { background: var(--berry-light); }
.page-banner::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, 0.55);
}

/* ---------- Quick link tiles (home) ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tile {
  --c: var(--sky); --cl: var(--sky-light);
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-radius: var(--radius); padding: 26px 22px 22px;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  border-top: 6px solid var(--c);
  transition: transform 0.2s, box-shadow 0.2s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); color: var(--text); }
.tile .icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--cl);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 8px;
}
.tile h3 { margin: 0; }
.tile p { color: var(--muted); font-size: 0.95rem; margin: 0; flex: 1; }
.tile .go { font-weight: 800; color: var(--c); margin-top: 10px; }
.tile.orange { --c: var(--orange); --cl: var(--orange-light); }
.tile.mint { --c: var(--mint); --cl: var(--mint-light); }
.tile.berry { --c: var(--berry); --cl: var(--berry-light); }
@media (max-width: 960px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: center; }
.about-card {
  background: var(--navy); color: #fff; border-radius: var(--radius); padding: 32px;
  position: relative; overflow: hidden;
}
.about-card::after {
  content: "“"; position: absolute; right: 18px; bottom: -60px; font-size: 14rem;
  font-family: Georgia, serif; color: rgba(255, 255, 255, 0.08); line-height: 1;
}
.about-card blockquote { margin: 0; font-family: var(--font-head); font-size: 1.4rem; line-height: 1.35; font-weight: 600; }
.about-card cite { display: block; margin-top: 16px; font-style: normal; color: var(--sun); font-weight: 800; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.fact { background: var(--bg); border-radius: var(--radius-sm); padding: 14px; text-align: center; border: 1px solid var(--border); }
.fact strong { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--orange); }
.fact span { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- Toolbar (search + filters) ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 28px; box-shadow: var(--shadow);
}
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 999px; padding: 0 16px; border: 2px solid transparent;
}
.search:focus-within { border-color: var(--sky); }
.search input {
  border: 0; background: transparent; font: inherit; padding: 10px 0; width: 100%; color: var(--text);
}
.search input:focus { outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-btn {
  border: 2px solid var(--border); background: var(--surface); color: var(--navy);
  padding: 6px 14px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.filter-btn:hover { border-color: var(--sky); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Generic cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.card {
  --c: var(--sky); --cl: var(--sky-light);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card-top {
  background: var(--cl); padding: 20px 22px; display: flex; justify-content: space-between; align-items: start; gap: 12px;
}
.card-top .icon { font-size: 2rem; line-height: 1; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: 6px; }
.card-body p { color: var(--muted); font-size: 0.97rem; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.card.orange { --c: var(--orange); --cl: var(--orange-light); }
.card.mint { --c: var(--mint); --cl: var(--mint-light); }
.card.berry { --c: var(--berry); --cl: var(--berry-light); }
.card.sun { --c: var(--sun); --cl: var(--sun-light); }
.card .chip { background: #fff; }
.card-body .chip { background: var(--cl); }

.empty {
  text-align: center; padding: 48px 20px; border: 2px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); background: var(--surface);
}
.empty .big { font-size: 2.6rem; display: block; margin-bottom: 6px; }

/* ---------- Book cards ---------- */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.book {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px;
  background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.book-cover {
  aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 14px 12px 12px 18px;
  color: #fff; box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.18), 0 8px 18px rgba(27, 42, 74, 0.25);
}
.book-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-cover .t { font-family: var(--font-head); font-weight: 800; font-size: 1rem; line-height: 1.1; }
.book-cover .a { font-size: 0.72rem; font-weight: 700; opacity: 0.9; }
.book h3 { margin-bottom: 2px; }
.book .author { color: var(--muted); font-weight: 700; font-size: 0.92rem; margin-bottom: 10px; }
.book p { font-size: 0.95rem; color: var(--navy-soft); }
.book .why { background: var(--mint-light); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.9rem; }
.book .why strong { color: var(--mint); }
@media (max-width: 420px) { .book { grid-template-columns: 1fr; } .book-cover { max-width: 140px; } }

/* ---------- Videos ---------- */
.video-thumb {
  position: relative; aspect-ratio: 16 / 9; background: var(--navy); cursor: pointer; border: 0; padding: 0; width: 100%;
  display: block;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; transition: opacity 0.2s; }
.video-thumb:hover img { opacity: 1; }
.video-thumb .play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%;
  background: var(--orange); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.video-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Games ---------- */
.game-card .card-top { min-height: 120px; align-items: center; justify-content: center; font-size: 3.2rem; }

dialog.game {
  width: min(680px, calc(100% - 24px)); border: 0; border-radius: 24px; padding: 0;
  box-shadow: var(--shadow-lift); color: var(--text); background: var(--surface);
}
dialog.game::backdrop { background: rgba(27, 42, 74, 0.55); backdrop-filter: blur(3px); }
.game-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 22px; background: var(--orange-light);
}
.game-head h3 { margin: 0; }
.close-btn {
  background: #fff; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 1.3rem;
  cursor: pointer; color: var(--navy); flex-shrink: 0;
}
.game-body { padding: 24px 22px 26px; }
.game-stats { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.stat { background: var(--bg); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 0.9rem; }
.progress { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--sky), var(--mint)); transition: width 0.3s; }
.question { font-family: var(--font-head); font-size: 1.45rem; font-weight: 700; margin-bottom: 18px; line-height: 1.3; }
.question .blank { display: inline-block; min-width: 80px; border-bottom: 3px solid var(--orange); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option {
  border: 2px solid var(--border); background: var(--surface); padding: 14px; border-radius: 14px;
  font: inherit; font-weight: 700; cursor: pointer; text-align: left; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.option:hover:not(:disabled) { border-color: var(--sky); background: var(--sky-light); }
.option.correct { border-color: var(--mint); background: var(--mint-light); }
.option.wrong { border-color: var(--berry); background: var(--berry-light); }
.option:disabled { cursor: default; }
@media (max-width: 520px) { .options { grid-template-columns: 1fr; } }

.feedback { margin-top: 16px; padding: 12px 16px; border-radius: 12px; font-weight: 700; display: none; }
.feedback.show { display: block; }
.feedback.good { background: var(--mint-light); color: #13695e; }
.feedback.bad { background: var(--berry-light); color: #8e2552; }
.game-foot { display: flex; justify-content: flex-end; margin-top: 18px; gap: 10px; }

.tray {
  min-height: 64px; border: 2px dashed var(--border); border-radius: 14px; padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; background: var(--bg);
}
.tray.answer { border-color: var(--sky); background: var(--sky-light); }
.word {
  border: 0; background: #fff; box-shadow: 0 2px 0 var(--border), 0 4px 10px rgba(27, 42, 74, 0.08);
  padding: 10px 14px; border-radius: 10px; font: inherit; font-weight: 800; cursor: pointer; color: var(--navy);
}
.word:hover { transform: translateY(-1px); }
.tray.answer .word { background: var(--navy); color: #fff; box-shadow: none; }

.result { text-align: center; padding: 10px 0; }
.result .big { font-size: 3.6rem; }
.result .score { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; color: var(--orange); }

/* ---------- Contact ---------- */
.contact {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px;
  background: linear-gradient(135deg, var(--navy), #2c4170); color: #fff;
  border-radius: 28px; padding: 44px; position: relative; overflow: hidden;
}
.contact::before {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: var(--orange); opacity: 0.25; left: -60px; bottom: -80px;
}
.contact p { color: #cfd9ee; }
.contact form { display: grid; gap: 12px; position: relative; }
.contact label { font-weight: 800; font-size: 0.9rem; }
.contact input, .contact textarea, .contact select {
  width: 100%; margin-top: 4px; padding: 12px 14px; border-radius: 12px; border: 2px solid transparent;
  font: inherit; background: #fff; color: var(--text);
}
.contact input:focus, .contact textarea:focus, .contact select:focus { outline: none; border-color: var(--sun); }
.contact .hidden { display: none; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; padding: 28px; } }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--navy); font-weight: 700; text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: var(--orange); }
.rainbow { height: 6px; background: linear-gradient(90deg, var(--sky), var(--mint), var(--sun), var(--orange), var(--berry)); }

/* ---------- Reveal animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s, transform 0.6s; }
  .reveal.visible { opacity: 1; transform: none; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Compact book card when shown in the home page "Latest additions" grid */
.grid .book { grid-template-columns: 90px 1fr; gap: 16px; }
.grid .book p { display: none; }
