/* ═══════════════════════════════════════════════════
   TCBB CREATIVE AGENCY — CHALKBOARD THEME
   Shared styles for all 8 lessons
   ═══════════════════════════════════════════════════ */

/* ── Reset + base ─────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Palette ──────────────────────────────────────── */
:root {
  --board:       #2a3428;
  --board-dark:  #1e2a1c;
  --board-mid:   #334231;
  --chalk:       #f0ece0;
  --chalk-dim:   rgba(240,236,224,0.55);
  --chalk-faint: rgba(240,236,224,0.16);
  --yellow:      #f5d56a;
  --coral:       #e8856e;
  --sky:         #7ab8d4;
  --mint:        #8ecfb0;
  --lavender:    #b8a4d4;
  --gap: 20px;
}

/* ── Body ─────────────────────────────────────────── */
body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background: var(--board);
  color: var(--chalk);
  min-height: 100vh;
  overflow-x: hidden;
  transition: opacity 0.32s ease, filter 0.32s ease, transform 0.32s ease;
}
body.erasing {
  opacity: 0;
  filter: blur(4px);
  transform: scale(0.98);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* ── Chalk ruled lines ────────────────────────────── */
.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 47px,
    rgba(240,236,224,0.055) 47px,
    rgba(240,236,224,0.055) 48.5px
  );
}
/* Chalk dust at corners */
.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 35% at 0% 0%,   rgba(240,236,224,0.04) 0%, transparent 100%),
    radial-gradient(ellipse 45% 35% at 100% 0%,  rgba(240,236,224,0.03) 0%, transparent 100%),
    radial-gradient(ellipse 70% 20% at 50% 100%, rgba(240,236,224,0.04) 0%, transparent 100%);
}

/* ── Top banner ───────────────────────────────────── */
.cb-banner {
  background: var(--board-dark);
  border-bottom: 1.5px solid rgba(240,236,224,0.12);
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 4px;
}
.cb-banner-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(15px, 2.5vw, 20px);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--chalk);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cb-banner-chapter {
  font-family: 'Caveat', cursive;
  font-size: clamp(13px, 2vw, 16px);
  color: var(--chalk-dim);
  letter-spacing: 0.04em;
}
.cb-banner-loc {
  font-family: 'Caveat', cursive;
  font-size: clamp(11px, 1.8vw, 14px);
  color: rgba(240,236,224,0.3);
  white-space: nowrap;
}

/* ── Page layout ──────────────────────────────────── */
.page-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 90px;
  position: relative;
  z-index: 1;
}

/* ── Page header ──────────────────────────────────── */
.page-header {
  padding-bottom: 28px;
  border-bottom: 1.5px solid rgba(240,236,224,0.1);
  margin-bottom: 36px;
}

/* ── Typography ───────────────────────────────────── */
.ch-eyebrow {
  font-family: 'Caveat', cursive;
  font-size: clamp(13px, 2vw, 16px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin-bottom: 8px;
  display: block;
}
.ch-heading {
  font-family: 'Caveat', cursive;
  font-size: clamp(38px, 7vw, 72px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--chalk);
}
.ch-subhead {
  font-family: 'Caveat', cursive;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 600;
  color: var(--chalk-dim);
  line-height: 1.2;
}
.ch-body {
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.8;
  color: rgba(240,236,224,0.78);
}
.ch-small {
  font-family: 'Caveat', cursive;
  font-size: clamp(13px, 1.8vw, 15px);
  color: var(--chalk-dim);
  letter-spacing: 0.06em;
}

/* Chalk underline */
.ch-underline {
  display: inline;
  background: linear-gradient(var(--yellow), var(--yellow)) no-repeat 0 95%;
  background-size: 100% 3px;
  padding-bottom: 2px;
}

/* ── Cards ────────────────────────────────────────── */
.chalk-card {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(240,236,224,0.12);
  border-radius: 4px;
  padding: 28px;
  position: relative;
}
.chalk-card.yellow-accent { border-color: rgba(245,213,106,0.25); }
.chalk-card.coral-accent  { border-color: rgba(232,133,110,0.25); }
.chalk-card.sky-accent    { border-color: rgba(122,184,212,0.25); }
.chalk-card.mint-accent   { border-color: rgba(142,207,176,0.25); }
.chalk-card.lav-accent    { border-color: rgba(184,164,212,0.25); }

/* ── Chalk list ───────────────────────────────────── */
.chalk-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chalk-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: clamp(14px, 1.9vw, 16px);
  color: rgba(240,236,224,0.82);
  line-height: 1.65;
}
.chalk-list li::before {
  content: '✓';
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: var(--mint);
  flex-shrink: 0;
  margin-top: 1px;
}
.chalk-list.yellow li::before { color: var(--yellow); content: '★'; }
.chalk-list.coral  li::before { color: var(--coral);  content: '→'; }
.chalk-list.sky    li::before { color: var(--sky);    content: '◇'; }

/* ── Pills ────────────────────────────────────────── */
.chalk-pill {
  display: inline-block;
  font-family: 'Caveat', cursive;
  font-size: clamp(13px, 1.8vw, 15px);
  padding: 3px 13px;
  border: 1.5px solid rgba(240,236,224,0.22);
  border-radius: 100px;
  color: var(--chalk-dim);
}
.chalk-pill.yellow { border-color: rgba(245,213,106,0.4); color: var(--yellow); }
.chalk-pill.coral  { border-color: rgba(232,133,110,0.4); color: var(--coral);  }
.chalk-pill.sky    { border-color: rgba(122,184,212,0.4); color: var(--sky);    }
.chalk-pill.mint   { border-color: rgba(142,207,176,0.4); color: var(--mint);   }
.chalk-pill.lav    { border-color: rgba(184,164,212,0.4); color: var(--lavender);}

/* ── Divider ──────────────────────────────────────── */
.chalk-rule {
  border: none;
  border-top: 1.5px solid rgba(240,236,224,0.1);
  margin: 28px 0;
}

/* ── Chalk number circle ──────────────────────────── */
.chalk-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(240,236,224,0.28);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 700;
  color: var(--chalk);
  flex-shrink: 0;
}

/* ── Grid helpers ─────────────────────────────────── */
.cb-grid { display: grid; gap: var(--gap); }
.cb-2    { grid-template-columns: 1fr 1fr; }
.cb-3    { grid-template-columns: 1fr 1fr 1fr; }
.cb-7-5  { grid-template-columns: 7fr 5fr; }
.cb-5-7  { grid-template-columns: 5fr 7fr; }

/* ── Accent text colors ───────────────────────────── */
.c-yellow { color: var(--yellow); }
.c-coral  { color: var(--coral);  }
.c-sky    { color: var(--sky);    }
.c-mint   { color: var(--mint);   }
.c-lav    { color: var(--lavender);}
.c-dim    { color: var(--chalk-dim); }

/* ── Chalk button ─────────────────────────────────── */
.chalk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Caveat', cursive;
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--board);
  background: var(--chalk);
  border: none;
  padding: 10px 28px;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.chalk-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.chalk-btn.outline {
  background: transparent;
  color: var(--chalk);
  border: 1.5px solid rgba(240,236,224,0.35);
}
.chalk-btn.outline:hover { border-color: var(--chalk); background: rgba(240,236,224,0.06); }

/* ── Reveal animations ────────────────────────────── */
@keyframes chalkReveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0.5; }
  to   { clip-path: inset(0 -8px 0 0); opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes chalkPop {
  0%   { opacity: 0; transform: scale(0.85); }
  60%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

.reveal-draw { animation: chalkReveal 0.9s cubic-bezier(0.16,1,0.3,1) forwards; opacity: 0; }
.reveal-up   { animation: fadeUp 0.7s cubic-bezier(0.16,1,0.3,1) forwards; opacity: 0; }
.reveal-fade { animation: fadeIn 0.6s ease forwards; opacity: 0; }
.reveal-pop  { animation: chalkPop 0.55s cubic-bezier(0.16,1,0.3,1) forwards; opacity: 0; }

.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.25s; }
.d3 { animation-delay: 0.45s; }
.d4 { animation-delay: 0.65s; }
.d5 { animation-delay: 0.85s; }
.d6 { animation-delay: 1.0s; }
.d7 { animation-delay: 1.15s; }

/* ── Bottom navigation ────────────────────────────── */
.cb-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--board-dark);
  border-top: 1.5px solid rgba(240,236,224,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  z-index: 100;
  gap: 8px;
}
.cb-nav-btn {
  font-family: 'Caveat', cursive;
  font-size: clamp(14px, 2vw, 17px);
  color: var(--chalk-dim);
  padding: 6px 14px;
  border: 1.5px solid rgba(240,236,224,0.15);
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
  cursor: pointer;
}
.cb-nav-btn:hover { color: var(--chalk); border-color: rgba(240,236,224,0.38); background: rgba(240,236,224,0.04); }
.cb-nav-counter {
  font-family: 'Caveat', cursive;
  font-size: clamp(12px, 1.6vw, 14px);
  color: rgba(240,236,224,0.3);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── All themes link ──────────────────────────────── */
#all-themes-btn {
  position: fixed;
  top: 56px;
  right: 14px;
  font-family: 'Caveat', cursive;
  font-size: 14px;
  color: rgba(240,236,224,0.28);
  border: 1px solid rgba(240,236,224,0.1);
  padding: 4px 10px;
  border-radius: 3px;
  z-index: 200;
  background: var(--board-dark);
  transition: color 0.2s, border-color 0.2s;
}
#all-themes-btn:hover { color: var(--chalk); border-color: rgba(240,236,224,0.32); }

/* ── Contact form ─────────────────────────────────── */
.chalk-input,
.chalk-textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(240,236,224,0.2);
  border-radius: 3px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  color: var(--chalk);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.chalk-input:focus,
.chalk-textarea:focus {
  border-color: rgba(240,236,224,0.45);
  background: rgba(255,255,255,0.07);
}
.chalk-input::placeholder,
.chalk-textarea::placeholder { color: rgba(240,236,224,0.3); }
.chalk-textarea { resize: vertical; min-height: 110px; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 740px) {
  .page-wrap { padding: 20px 16px 90px; }
  .cb-2, .cb-3, .cb-7-5, .cb-5-7 { grid-template-columns: 1fr; }
  .cb-nav { padding: 8px 12px; }
  .cb-nav-btn { font-size: 14px; padding: 5px 10px; }
  .chalk-card { padding: 20px; }
}
@media (max-width: 480px) {
  .page-wrap { padding: 14px 12px 90px; }
  .ch-heading { font-size: clamp(32px, 10vw, 50px); }

  /* Banner: single line on small screens — hide location, truncate chapter */
  .cb-banner { flex-wrap: nowrap; align-items: center; }
  .cb-banner-loc { display: none; }
  .cb-banner-chapter {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
  }

  /* All themes btn: tuck it into the banner row, not overlapping */
  #all-themes-btn {
    top: 7px;
    right: 10px;
    font-size: 12px;
    padding: 3px 8px;
  }

  /* Nav counter too long on small screens — hide it, banner already shows context */
  .cb-nav-counter { display: none; }
  .cb-nav { justify-content: space-between; }
}
