/* Kubernetes School — Chapter 1
   Picture-book site: sky, grass, chalk, cream paper.
   Fonts: Fredoka (headings) + Nunito (body)
*/

:root {
  --sky: #8ecae6;
  --sky-deep: #4fa3c8;
  --sky-wash: #d7f0fa;
  --grass: #7cb342;
  --grass-deep: #5a9a2e;
  --grass-wash: #eaf6c9;
  --sun: #ffd54f;
  --sun-deep: #f0b429;
  --chalk: #1a365d;
  --chalk-soft: #2c4a72;
  --cream: #fff8ee;
  --paper: #fffdf8;
  --white: #ffffff;
  --yellow: #ffe082;
  --yellow-deep: #f5c542;
  --coral: #e05a4f;
  --open: #2e9b6a;
  --helm: #326ce5;
  --shadow: rgba(26, 54, 93, 0.14);
  --shadow-lg: rgba(26, 54, 93, 0.2);
  --radius: 1.25rem;
  --wrap: 72rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--chalk);
  background: var(--cream);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, .brand-name, .eyebrow, .chapter-pill {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p { margin: 0 0 0.85rem; }
p:last-child { margin-bottom: 0; }

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  background: var(--chalk);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 0.6rem;
  z-index: 100;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid #f0e4c8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--chalk);
  min-height: 44px;
}

.brand-mark {
  display: grid;
  place-items: center;
  animation: float 4.5s ease-in-out infinite;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.chapter-pill {
  background: var(--sun);
  color: var(--chalk);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid #e8b84a;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, #9ad7ef 0%, #c5ebf7 55%, #eaf7c4 100%);
  overflow: hidden;
  padding: 3.5rem 1rem 0;
  text-align: center;
  min-height: 28rem;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(100% - 1rem, 46rem);
  margin-inline: auto;
  padding-bottom: 4rem;
}

.eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.7);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--chalk-soft);
  margin-bottom: 0.8rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: var(--chalk);
  text-shadow: 0 2px 0 rgba(255,255,255,0.5);
}

.lead {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--chalk);
  background: var(--white);
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 1.4rem 1.4rem 1.4rem 0.4rem;
  box-shadow: 0 8px 0 rgba(26, 54, 93, 0.08), 0 12px 28px var(--shadow);
}

/* sky decorations */
.sky-deco { pointer-events: none; }
.sun {
  position: absolute;
  top: 1.4rem; right: 8%;
  width: 4.2rem; height: 4.2rem;
  background: radial-gradient(circle at 35% 35%, #fff6c2, var(--sun) 55%, var(--sun-deep));
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(255, 213, 79, 0.28), 0 0 40px rgba(255, 213, 79, 0.5);
}
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 2rem;
  opacity: 0.92;
  animation: drift 18s ease-in-out infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud-a { width: 7rem; height: 2.2rem; top: 2.2rem; left: 6%; animation-duration: 22s; }
.cloud-a::before { width: 2.6rem; height: 2.6rem; top: -1.3rem; left: 1.1rem; }
.cloud-a::after { width: 3.4rem; height: 3.4rem; top: -1.8rem; left: 2.8rem; }
.cloud-b { width: 5.5rem; height: 1.8rem; top: 5.5rem; right: 18%; animation-duration: 16s; animation-delay: -4s; }
.cloud-b::before { width: 2.2rem; height: 2.2rem; top: -1.1rem; left: 0.8rem; }
.cloud-b::after { width: 2.8rem; height: 2.8rem; top: -1.5rem; left: 2.2rem; }
.cloud-c { width: 4.2rem; height: 1.5rem; top: 1.6rem; left: 42%; animation-duration: 26s; animation-delay: -8s; opacity: 0.75; }
.cloud-c::before { width: 1.8rem; height: 1.8rem; top: -0.9rem; left: 0.6rem; }
.cloud-c::after { width: 2.2rem; height: 2.2rem; top: -1.2rem; left: 1.6rem; }

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(18px); }
}

.hill { position: relative; height: 7rem; margin-top: -1rem; }
.hill-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tiny-campus {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
}
.tiny-house {
  width: 2.1rem; height: 1.6rem;
  background: #ffe082;
  border: 2px solid #d4a017;
  border-radius: 0.15rem 0.15rem 0 0;
  position: relative;
}
.tiny-house::before {
  content: "";
  position: absolute;
  left: -0.35rem; right: -0.35rem; top: -0.85rem;
  height: 0; border-left: 1.4rem solid transparent; border-right: 1.4rem solid transparent;
  border-bottom: 0.95rem solid #e05a4f;
}
.tiny-house.h2 { height: 2rem; width: 2.4rem; }
.tiny-house.h3 { height: 1.8rem; }

/* ---------- Growing school ---------- */
.scene { padding: 3.25rem 0; }
.scene-grow { background: var(--cream); }

.grow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.story-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 10px 0 #f0e4c8, 0 16px 32px var(--shadow);
  border: 3px solid #f4ead4;
}

.story-card p {
  font-size: 1.12rem;
}

.doodle {
  height: 7.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #d7f0fa 60%, #c8e6a0 60%);
  border-radius: 0.9rem;
  position: relative;
  overflow: hidden;
}

.schoolhouse {
  position: relative;
  width: 3.6rem; height: 2.4rem;
  background: #ffe082;
  border: 2.5px solid #c9920e;
  border-radius: 0.15rem;
  z-index: 1;
}
.schoolhouse .roof {
  position: absolute;
  left: -0.55rem; right: -0.55rem; top: -1.15rem;
  height: 0;
  border-left: 2.35rem solid transparent;
  border-right: 2.35rem solid transparent;
  border-bottom: 1.25rem solid #e05a4f;
}
.schoolhouse .door {
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 0.7rem; height: 1rem;
  background: #8d5a2b;
  border-radius: 0.3rem 0.3rem 0 0;
}
.schoolhouse .win {
  position: absolute;
  top: 0.35rem; left: 0.3rem;
  width: 0.55rem; height: 0.55rem;
  background: #4fa3c8;
  border: 1.5px solid #1a365d;
}
.schoolhouse.small { transform: scale(0.85); }
.schoolhouse.tiny { width: 2.2rem; height: 1.5rem; }
.schoolhouse.tiny .roof {
  left: -0.35rem; right: -0.35rem; top: -0.75rem;
  border-left-width: 1.45rem; border-right-width: 1.45rem;
  border-bottom-width: 0.85rem;
}

.row-houses {
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 0.55rem;
  padding-bottom: 0.8rem;
}

.kids { display: flex; gap: 0.35rem; margin-top: 0.25rem; z-index: 2; }
.kid {
  width: 0.85rem; height: 0.85rem;
  border-radius: 50%;
  background: #f4a261;
  box-shadow: 0 0.7rem 0 -0.18rem #326ce5;
  position: relative;
}
.kid.k-b { background: #e9c46a; box-shadow: 0 0.7rem 0 -0.18rem #e05a4f; }
.kid.k-c { background: #90be6d; box-shadow: 0 0.7rem 0 -0.18rem #2e9b6a; }
.kid.k-d { background: #f4a261; box-shadow: 0 0.7rem 0 -0.18rem #7b2cbf; }
.kid.k-e { background: #e9c46a; box-shadow: 0 0.7rem 0 -0.18rem #4fa3c8; }
.kids.crowd { gap: 0.2rem; }

.problem-line {
  margin-top: 2.2rem;
  text-align: center;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  background: #fff3cd;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 0.85rem 1.5rem;
  border-radius: 1rem;
  border: 3px dashed #f0b429;
}

/* ---------- Questions chorus ---------- */
.scene-questions {
  background:
    repeating-linear-gradient(
      transparent,
      transparent 31px,
      rgba(79, 163, 200, 0.12) 32px
    ),
    #eef8fc;
  border-block: 6px solid #b8dcec;
}

.chorus-heading {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 1.6rem;
}

.chorus {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 46rem;
  margin-inline: auto;
}

.q {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 800;
  font-style: italic;
  padding: 0.95rem 1.2rem 0.95rem 1.4rem;
  border-radius: 1.2rem;
  background: var(--white);
  box-shadow: 0 6px 0 rgba(26,54,93,0.08);
  position: relative;
  line-height: 1.4;
}

.q::before {
  content: "?";
  position: absolute;
  left: -0.15rem; top: -0.55rem;
  font-family: "Fredoka", sans-serif;
  font-style: normal;
  font-size: 1.5rem;
  width: 1.7rem; height: 1.7rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--sun);
  color: var(--chalk);
  box-shadow: 0 2px 0 #e8b84a;
}

.q1 { transform: rotate(-0.6deg); margin-right: 8%; }
.q2 { transform: rotate(0.7deg); margin-left: 6%; background: #fff8e1; }
.q3 { transform: rotate(-0.4deg); margin-right: 4%; background: #ffe8e4; }
.q4 { transform: rotate(0.5deg); margin-left: 10%; background: #eaf6c9; }
.q5 { transform: rotate(-0.3deg); margin-right: 2%; background: #e3f2fd; }

/* ---------- Principal reveal ---------- */
.scene-principal {
  background: linear-gradient(180deg, var(--cream), #fff4d6);
  text-align: center;
}

.principal-wrap {
  max-width: 42rem;
  font-size: 1.22rem;
}

.reveal {
  margin-top: 1.4rem;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}

.k8s-name {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 700;
  color: var(--helm);
  background: var(--white);
  display: inline-block;
  padding: 0.85rem 1.3rem;
  border-radius: 1.2rem;
  border: 4px solid var(--helm);
  box-shadow: 6px 6px 0 var(--sun);
  margin-top: 0.4rem;
}

/* ---------- Illustration ---------- */
.story-figure {
  margin: 0;
  padding: 0.5rem 1rem 3rem;
  background: #fff4d6;
}

.frame {
  width: min(100%, 68rem);
  margin-inline: auto;
  background: var(--white);
  padding: 0.85rem 0.85rem 0.5rem;
  border-radius: 0.4rem 0.4rem 0.2rem 0.2rem;
  box-shadow:
    0 2px 0 #eee,
    0 22px 40px var(--shadow-lg);
  transform: rotate(-0.4deg);
}

.frame img {
  width: 100%;
  border-radius: 0.15rem;
  background: #d7f0fa;
}

.story-figure figcaption {
  width: min(100% - 2rem, 42rem);
  margin: 1.4rem auto 0;
  text-align: center;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--chalk-soft);
}

/* ---------- Meet Kubernetes ---------- */
.scene-meet {
  background: var(--paper);
}

.scene-meet h2 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  margin: 0 0 1.2rem;
  color: var(--helm);
}

.scene-meet .wrap { max-width: 46rem; }

.chalkboard {
  margin: 1.4rem auto 2rem;
  background: #1a365d;
  color: #f4f1e0;
  border-radius: 1.1rem;
  padding: 1.5rem 1.6rem 1.7rem;
  border: 10px solid #8d6e4a;
  box-shadow: 0 14px 0 #6f5538, 0 22px 36px var(--shadow);
  max-width: 36rem;
  position: relative;
}

.chalkboard::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  border: 12px solid transparent;
  border-top-color: #8d6e4a;
}

.chalkboard p {
  margin: 0;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  text-align: center;
  color: #fff8dc;
  line-height: 1.35;
}

.meet-flow {
  background: var(--sky-wash);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 8px solid var(--sky-deep);
}

.meet-flow .but {
  font-weight: 800;
  color: var(--coral);
}

.meet-flow .soon {
  font-weight: 800;
  color: var(--open);
}

.compare-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.6rem;
}

.compare-labels p {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  font-weight: 800;
  text-align: center;
}

.asked {
  background: #eaf6c9;
  border: 3px solid var(--open);
}

.happening {
  background: #ffe8e4;
  border: 3px solid var(--coral);
}

/* ---------- Desired vs actual ---------- */
.scene-state {
  background: linear-gradient(180deg, #eef8fc, var(--cream));
}

.scene-state .wrap { max-width: 52rem; }

.idea-line {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 600;
  text-align: center;
}

.state-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin: 1.3rem 0 1.6rem;
  position: relative;
}

.state-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem 1.4rem;
  box-shadow: 0 10px 24px var(--shadow);
}

.state-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.state-card p { font-size: 1.12rem; }

.state-card.desired {
  border: 4px solid var(--open);
  background: linear-gradient(180deg, #f3fbee, #fff);
}

.state-card.actual {
  border: 4px solid var(--coral);
  background: linear-gradient(180deg, #fff4f2, #fff);
}

.state-card.actual.good {
  border-color: var(--open);
  background: linear-gradient(180deg, #f3fbee, #fff);
}

.rooms {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.room {
  flex: 1;
  aspect-ratio: 1;
  max-width: 3.4rem;
  border-radius: 0.55rem;
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
}

.room.open {
  background: var(--open);
  box-shadow: 0 4px 0 #1f7a52;
}

.room.closed {
  background: #9aa3ad;
  box-shadow: 0 4px 0 #6d767e;
  text-decoration: line-through;
  position: relative;
}

.room.closed::after {
  content: "";
  position: absolute;
  inset: 20%;
  border: 3px solid var(--coral);
  border-radius: 50%;
}

.fix-line, .match-line {
  font-weight: 800;
  text-align: center;
  font-size: 1.25rem;
}

.match-line {
  color: var(--open);
  font-family: "Fredoka", sans-serif;
  font-size: 1.5rem;
}

.important {
  margin-top: 1.4rem;
  text-align: center;
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 600;
  background: var(--sun);
  padding: 1rem 1.3rem;
  border-radius: 1.1rem;
  border: 3px solid #e8b84a;
}

/* ---------- Closing ---------- */
.scene-close {
  background:
    linear-gradient(180deg, var(--cream) 60%, #c5ebf7 100%);
  padding-bottom: 4rem;
}

.close-card {
  max-width: 42rem;
  background: var(--white);
  border-radius: 1.6rem;
  padding: 2rem 1.8rem 2.2rem;
  box-shadow: 0 16px 0 #f0e4c8, 0 24px 40px var(--shadow);
  border: 3px solid #f4ead4;
  text-align: center;
  font-size: 1.22rem;
}

.started {
  margin-top: 1.2rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.next {
  font-weight: 800;
  color: var(--helm);
  background: var(--sky-wash);
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  margin-top: 0.4rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--chalk);
  color: #e8f0ff;
  text-align: center;
  padding: 2rem 1rem 2.4rem;
}

.footer-brand {
  font-family: "Fredoka", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--sun);
}

.footer-hint {
  margin: 0;
  opacity: 0.9;
  font-size: 1.05rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grow-grid,
  .state-pair,
  .compare-labels {
    grid-template-columns: 1fr;
  }
  .q1, .q2, .q3, .q4, .q5 {
    margin-left: 0;
    margin-right: 0;
    transform: none;
  }
  .sun { right: 4%; width: 3.2rem; height: 3.2rem; }
}

@media (max-width: 520px) {
  body { font-size: 1.12rem; }
  .topbar { padding-inline: 0.8rem; }
  .brand-name { font-size: 1.05rem; }
  .hero { padding-top: 2.4rem; min-height: 22rem; }
  .story-card, .close-card { padding: 1.15rem; }
  .chalkboard { border-width: 8px; }
  .scene { padding: 2.4rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-mark, .cloud { animation: none; }
}

@media (prefers-contrast: more) {
  body { background: #fff; }
  .state-card, .story-card, .q { border-width: 3px; }
}
