/* ============================================================
   WEBELOS BUILDER'S GUIDE — PLUMB SQUARE LEVEL
   ============================================================ */

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

:root {
  --plumb: #e63946;
  --plumb-light: #fff0f0;
  --plumb-dark: #c1121f;
  --square: #2a9d8f;
  --square-light: #e8f7f5;
  --square-dark: #1a7a6e;
  --level: #e9c46a;
  --level-dark: #d4a017;
  --level-light: #fdf7e3;
  --bg: #f8f4ed;
  --text: #2d2d2d;
  --card-bg: #fff;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }

/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, #1d2b4e 0%, #2d4a8a 50%, #1d2b4e 100%);
  color: #fff;
  text-align: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 0.4rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(4rem, 15vw, 9rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffd700, #ff6b35, #f72585);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  margin-bottom: 1rem;
  position: relative;
}

.hero-sub {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  opacity: 0.9;
  font-weight: 600;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-tools {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.tool-icon {
  font-size: 2.5rem;
  display: inline-block;
  animation: bounce 1.5s infinite ease-in-out;
}

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

.hero-btn {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ff6b35);
  color: #1d2b4e;
  font-family: 'Bangers', cursive;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  padding: 0.8rem 2.5rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}
.hero-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 30px rgba(255,107,53,0.5); }

/* ============ INTRO BAND ============ */
.intro-band {
  background: #1d2b4e;
  color: #e8e8e8;
  padding: 2rem 1.5rem;
  text-align: center;
}
.intro-band p { font-size: 1.1rem; line-height: 1.8; max-width: 700px; margin: 0 auto; }
.intro-band strong { color: #ffd700; }

/* ============ SECTIONS ============ */
.section { padding: 5rem 0; }
.section-plumb { background: #fff; }
.section-square { background: #f0faf9; }
.section-level { background: #fff; }
.section-together { background: #1d2b4e; color: #fff; }
.section-failures { background: #2d1b1b; color: #fff; }
.section-tryit { background: #fff7e6; }
.section-quiz { background: #1d2b4e; color: #fff; }

/* ============ SECTION HEADER ============ */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.section-header h2 {
  font-family: 'Bangers', cursive;
  font-size: clamp(3.5rem, 10vw, 6rem);
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.plumb-color h2 { color: var(--plumb); }
.square-color h2 { color: var(--square); }
.level-color h2 { color: var(--level-dark); }
.section-tagline { font-size: 1.15rem; font-weight: 700; opacity: 0.8; }

/* ============ TWO COL ============ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
}
.two-col.reverse { direction: rtl; }
.two-col.reverse > * { direction: ltr; }

@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col.reverse { direction: ltr; }
}

/* ============ TEXT BLOCK ============ */
.text-block h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.text-block p { margin-bottom: 1rem; font-size: 1.05rem; }

/* ============ FUN FACT ============ */
.fun-fact {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: linear-gradient(135deg, #fff9c4, #fff3cd);
  border-left: 4px solid #ffc107;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}
.fun-fact-icon { font-size: 1.8rem; flex-shrink: 0; }

/* ============ IMAGE BLOCK ============ */
.card-img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  height: 220px;
  box-shadow: var(--shadow);
  margin-bottom: 0.5rem;
}
.img-caption {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* ============ TOOL CARDS ============ */
.tool-card {
  border-radius: var(--radius);
  padding: 1.25rem;
  color: #fff;
  margin-top: 0.5rem;
}
.plumb-bg { background: linear-gradient(135deg, var(--plumb), var(--plumb-dark)); }
.square-bg { background: linear-gradient(135deg, var(--square), var(--square-dark)); }
.level-bg { background: linear-gradient(135deg, var(--level-dark), #b8860b); }

.tool-card-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.5rem; }
.tool-card p { font-size: 0.9rem; margin-bottom: 0.75rem; }
.tool-img {
  width: 100%;
  border-radius: 8px;
  height: 130px;
  object-fit: cover;
  opacity: 0.85;
}

/* ============ HISTORY TIMELINE ============ */
.history-block {
  border-left: 4px solid;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--card-bg);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}
.plumb-border { border-color: var(--plumb); }
.square-border { border-color: var(--square); }
.level-border { border-color: var(--level-dark); }

.history-block h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1.25rem; }
.timeline { display: flex; flex-direction: column; gap: 1.25rem; }
.timeline-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  font-size: 0.95rem;
}
.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.plumb-bg-dot { background: var(--plumb); }
.square-bg-dot { background: var(--square); }
.level-bg-dot { background: var(--level-dark); }

/* ============ WHY MATTERS ============ */
.why-matters {
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1rem;
}
.plumb-bg-light { background: var(--plumb-light); }
.square-bg-light { background: var(--square-light); }
.level-bg-light { background: var(--level-light); }

.why-matters h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1.25rem; }

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 600px) { .reasons-grid { grid-template-columns: 1fr; } }

.reason-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.reason-icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.reason-card strong { display: block; margin-bottom: 0.4rem; font-size: 0.95rem; }
.reason-card p { font-size: 0.85rem; color: #555; }

/* ============ MATH BOX ============ */
.math-box {
  background: var(--card-bg);
  border: 3px solid var(--square);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}
.math-box h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1.25rem; }
.math-visual {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.triangle-demo {
  background: var(--square-light);
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 200px;
  text-align: center;
  font-weight: 700;
  position: relative;
}
.tri-right-angle {
  font-size: 2rem;
  color: var(--square);
  margin: 0.5rem 0;
}
.tri-side { color: var(--square-dark); font-size: 1.1rem; }
.tri-hyp { color: var(--plumb); margin-top: 0.5rem; font-size: 1.1rem; }
.math-explain { flex: 1; min-width: 200px; }
.math-explain p { margin-bottom: 0.75rem; font-size: 0.95rem; }
code {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.9rem;
  display: block;
  margin: 0.25rem 0;
  font-family: monospace;
}

/* ============ TOGETHER SECTION ============ */
.together-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 8vw, 4rem);
  text-align: center;
  color: #ffd700;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.together-sub { text-align: center; font-size: 1.1rem; opacity: 0.8; margin-bottom: 3rem; }

.triangle-three {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.tri-card {
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  min-width: 130px;
  max-width: 160px;
  color: #fff;
  font-size: 0.9rem;
}
.tri-card strong { display: block; font-size: 1.1rem; margin: 0.4rem 0; }
.tri-emoji { font-size: 2.5rem; margin-bottom: 0.25rem; }
.plumb-bg-card { background: linear-gradient(135deg, var(--plumb), var(--plumb-dark)); }
.square-bg-card { background: linear-gradient(135deg, var(--square), var(--square-dark)); }
.level-bg-card { background: linear-gradient(135deg, var(--level-dark), #b8860b); }
.result-card { background: linear-gradient(135deg, #6a0dad, #9b59b6); }
.tri-plus { font-size: 2.5rem; color: #ffd700; font-weight: 900; }
.tri-equals { font-size: 2.5rem; color: #ffd700; font-weight: 900; }

/* ============ EXAMPLES ============ */
.examples-box {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 2rem;
}
.examples-box h3 { text-align: center; font-size: 1.4rem; font-weight: 800; margin-bottom: 1.5rem; color: #ffd700; }
.examples-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 700px) { .examples-grid { grid-template-columns: repeat(2, 1fr); } }

.example-item { text-align: center; }
.example-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}
.example-item strong { display: block; font-size: 0.95rem; margin-bottom: 0.25rem; }
.example-item p { font-size: 0.8rem; opacity: 0.8; }

/* ============ FAILURES ============ */
.failures-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.8rem, 7vw, 3.5rem);
  text-align: center;
  color: #ff6b6b;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.failures-sub { text-align: center; font-size: 1rem; opacity: 0.8; margin-bottom: 2.5rem; }
.failures-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 700px) { .failures-grid { grid-template-columns: 1fr; } }

.failure-card {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.failure-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.failure-card h3 { font-size: 1rem; font-weight: 800; padding: 1rem 1rem 0.4rem; }
.failure-card p { font-size: 0.85rem; padding: 0 1rem 1rem; opacity: 0.85; }
.failure-badge {
  display: inline-block;
  background: #e63946;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  margin: 0 1rem 1rem;
  letter-spacing: 0.05em;
}

/* ============ TRY IT ============ */
.tryit-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 8vw, 3.5rem);
  text-align: center;
  color: #d97706;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.tryit-sub { text-align: center; font-size: 1.1rem; margin-bottom: 2.5rem; color: #555; }
.tryit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (max-width: 600px) { .tryit-grid { grid-template-columns: 1fr; } }

.tryit-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  border-top: 4px solid #d97706;
}
.tryit-number {
  position: absolute;
  top: -18px;
  left: 1.5rem;
  width: 36px;
  height: 36px;
  background: #d97706;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
}
.tryit-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.6rem; margin-top: 0.5rem; }
.tryit-card p { font-size: 0.9rem; color: #444; }
.tryit-emoji { font-size: 2rem; margin-top: 1rem; text-align: right; }

/* ============ QUIZ ============ */
.quiz-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(2.5rem, 8vw, 4rem);
  text-align: center;
  color: #ffd700;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.quiz-sub { text-align: center; font-size: 1.1rem; opacity: 0.8; margin-bottom: 2.5rem; }
.question-box {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.options-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto 1rem;
}
@media (max-width: 500px) { .options-box { grid-template-columns: 1fr; } }

.option-btn {
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.option-btn:hover { background: rgba(255,255,255,0.22); transform: scale(1.02); }
.option-btn.correct { background: #2a9d8f; border-color: #2a9d8f; }
.option-btn.wrong { background: #e63946; border-color: #e63946; }

.feedback-box {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 0.5rem;
}
.feedback-box.correct-fb { background: rgba(42, 157, 143, 0.3); color: #7fffd4; }
.feedback-box.wrong-fb { background: rgba(230, 57, 70, 0.3); color: #ffb3b3; }

.quiz-btn {
  background: linear-gradient(135deg, #ffd700, #ff6b35);
  color: #1d2b4e;
  border: none;
  font-family: 'Bangers', cursive;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s;
}
.quiz-btn:hover { transform: scale(1.05); }

.score-box {
  text-align: center;
  padding: 2rem;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  font-size: 1.3rem;
  font-weight: 800;
}
.score-box .score-emoji { font-size: 4rem; display: block; margin-bottom: 0.5rem; }
.score-box .restart-btn {
  display: inline-block;
  margin-top: 1rem;
  background: linear-gradient(135deg, #ffd700, #ff6b35);
  color: #1d2b4e;
  border: none;
  font-family: 'Bangers', cursive;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  padding: 0.7rem 2rem;
  border-radius: 50px;
  cursor: pointer;
}

.hidden { display: none !important; }

/* ============ FOOTER ============ */
.footer {
  background: #0d1a36;
  color: #fff;
  text-align: center;
  padding: 3rem 1.5rem;
}
.footer-badge {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-bottom: 0.75rem;
}
.footer p { opacity: 0.8; font-size: 1rem; }
.footer-icons { font-size: 2rem; margin: 1.25rem 0 0.5rem; letter-spacing: 0.1em; }

/* ============ SMOOTH ENTRANCE ============ */
.section-header, .two-col, .history-block, .why-matters, .math-box {
  animation: fadeUp 0.6s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
