/* CSS Variables */
:root {
  --color-tomato: #E63946;
  --color-crust: #F4A261;
  --color-cheese: #E9C46A;
  --color-brown: #6B3A2A;
  --color-basil: #2A9D8F;
  --color-cream: #FFF8F0;
  --color-dough: #FDEBD0;
  --color-charcoal: #264653;

  --font-headline: 'Pacifico', cursive;
  --font-body: 'Nunito', sans-serif;
  --font-label: 'Fredoka One', sans-serif;

  --transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--color-cream) 0%, #f5e6d3 100%);
  color: var(--color-charcoal);
  line-height: 1.6;
  min-height: 100vh;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 248, 240, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--color-crust);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  gap: 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  font-family: var(--font-headline);
  color: var(--color-charcoal);
  text-decoration: none;
  white-space: nowrap;
}

.nav-pizza {
  margin-right: 0.5rem;
}

.nav-sections {
  display: flex;
  gap: 1rem;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--color-crust);
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot:hover {
  transform: scale(1.3);
  background: var(--color-cheese);
}

.nav-dot.active {
  background: var(--color-tomato);
  border-color: var(--color-brown);
  transform: scale(1.4);
}

.nav-controls {
  display: flex;
  gap: 1rem;
}

.sound-toggle,
.narrator-toggle {
  padding: 0.5rem 1rem;
  background: var(--color-cheese);
  border: 2px solid var(--color-brown);
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-label);
}

.sound-toggle:hover,
.narrator-toggle:hover {
  background: var(--color-tomato);
  color: white;
  transform: scale(1.1);
}

.narrator-toggle.active {
  background: var(--color-tomato);
  color: white;
}

/* Mobile: Hide nav dots by default */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  .nav-brand {
    font-size: 1.2rem;
  }

  .nav-sections {
    display: none;
  }

  .nav-dot {
    width: 10px;
    height: 10px;
  }
}

/* Hero Section */
.hero {
  padding-top: 120px;
  padding-bottom: 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-cream) 0%, rgba(233, 196, 106, 0.1) 100%);
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-title {
  font-size: 4rem;
  font-family: var(--font-headline);
  color: var(--color-tomato);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  animation: bounceIn 0.8s ease-out;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--color-charcoal);
  margin-bottom: 3rem;
  font-weight: 600;
}

.hero-pizza {
  margin-bottom: 2rem;
  filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

.hero-pizza path {
  transition: all 0.3s ease;
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
}

.hero-pizza path:hover {
  opacity: 0.8;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.3));
}

.hero-hint {
  color: var(--color-brown);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 2rem;
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* Sections */
.section {
  padding: 100px 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(30px);
  animation: sectionEnter 0.5s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .section {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

@keyframes sectionEnter {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#section-1 { background: linear-gradient(135deg, #fff3e0 0%, var(--color-cream) 100%); animation-delay: 0s; }
#section-2 { background: linear-gradient(135deg, var(--color-cream) 0%, #e8f5e9 100%); animation-delay: 0.1s; }
#section-3 { background: linear-gradient(135deg, #fce4ec 0%, var(--color-cream) 100%); animation-delay: 0.2s; }
#section-4 { background: linear-gradient(135deg, var(--color-cream) 0%, #f3e5f5 100%); animation-delay: 0.3s; }
#section-5 { background: linear-gradient(135deg, #fff9e6 0%, var(--color-cream) 100%); animation-delay: 0.4s; }
#section-6 { background: linear-gradient(135deg, var(--color-cream) 0%, #e0f2f1 100%); animation-delay: 0.5s; }
#section-7 { background: linear-gradient(135deg, #fef5e7 0%, var(--color-cream) 100%); animation-delay: 0.6s; }
#section-8 { background: linear-gradient(135deg, var(--color-cream) 0%, #f1e9dc 100%); animation-delay: 0.7s; }

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  margin-bottom: 3rem;
  text-align: center;
}

.section-header h2 {
  font-family: var(--font-headline);
  font-size: 2.5rem;
  color: var(--color-charcoal);
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.section-header p {
  font-size: 1.2rem;
  color: var(--color-brown);
  font-weight: 500;
}

.section-summary {
  margin-top: 4rem;
  padding: 2rem;
  background: var(--color-dough);
  border-radius: 15px;
  border: 2px dashed var(--color-crust);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.section-summary h4 {
  font-family: var(--font-label);
  font-size: 1.2rem;
  color: var(--color-brown);
  margin-bottom: 1rem;
}

.section-summary p {
  color: var(--color-charcoal);
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 768px) {
  .section {
    padding: 60px 1rem;
    min-height: auto;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .section-header p {
    font-size: 1rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }
}

/* Interactive Elements */
button {
  font-family: var(--font-label);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

button:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-tomato);
  color: white;
}

.btn-primary:hover {
  background: #c1303a;
}

.btn-secondary {
  background: var(--color-basil);
  color: white;
}

.btn-secondary:hover {
  background: #207d73;
}

.btn-success {
  background: var(--color-cheese);
  color: var(--color-charcoal);
}

.btn-success:hover {
  background: #d4a844;
}

/* Sliders */
input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--color-tomato), var(--color-cheese), var(--color-basil));
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-charcoal);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-charcoal);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Labels and Text */
label {
  display: block;
  font-family: var(--font-label);
  color: var(--color-brown);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.value-display {
  font-family: var(--font-label);
  color: var(--color-tomato);
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* Cards and Containers */
.card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 2px solid var(--color-crust);
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}

/* Utility Classes */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.text-center {
  text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Success and Error Animations */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-pulse { animation: pulse 0.6s ease-in-out; }
.animate-shake { animation: shake 0.4s ease-in-out; }
.animate-wobble { animation: wobble 0.5s ease-in-out; }
.animate-slideInLeft { animation: slideInLeft 0.5s ease-out; }
.animate-slideInRight { animation: slideInRight 0.5s ease-out; }
.animate-fadeIn { animation: fadeIn 0.3s ease-out; }

/* Accessibility */
:focus-visible {
  outline: 3px solid var(--color-tomato);
  outline-offset: 2px;
}

button:focus-visible {
  outline-offset: 4px;
}

/* ============ SECTION 1: INGREDIENTS ============ */
.ingredients-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.ingredient-tile {
  background: white;
  border: 2px dashed var(--color-crust);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: grab;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ingredient-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: var(--color-tomato);
}

.ingredient-tile:active {
  cursor: grabbing;
}

.ingredient-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.ingredient-name {
  font-family: var(--font-label);
  font-size: 0.85rem;
  color: var(--color-brown);
  font-weight: bold;
}

.ingredient-tile[data-type="bad"] {
  border-color: var(--color-tomato);
  background: #fff5f5;
}

.ingredient-tile[data-type="bad"] .ingredient-name {
  color: var(--color-tomato);
}

.bowl-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.bowl-container {
  position: relative;
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1;
  border: 3px dashed var(--color-charcoal);
  border-radius: 20px;
  padding: 2rem;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: all 0.3s ease;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.05);
}

.bowl-container:hover {
  border-color: var(--color-tomato);
  box-shadow: inset 0 4px 10px rgba(230, 57, 70, 0.1);
}

.bowl-svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.bowl-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(to top, var(--color-cheese) 0%, var(--color-tomato) 50%, var(--color-basil) 100%);
  border-radius: 0 0 17px 17px;
  transition: height 0.4s ease;
  opacity: 0.3;
  pointer-events: none;
}

.counter {
  font-family: var(--font-label);
  font-size: 1.3rem;
  color: var(--color-charcoal);
  text-align: center;
  background: var(--color-dough);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  border: 2px solid var(--color-crust);
  width: 100%;
  max-width: 250px;
}

.milestones {
  width: 100%;
  max-width: 250px;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.milestone-message {
  background: var(--color-cheese);
  color: var(--color-brown);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-label);
  font-weight: bold;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  animation: slideInUp 0.5s ease-out;
  transition: opacity 0.3s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .ingredients-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .ingredients-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* ============ SECTION 2: ASSEMBLY LINE ============ */
.assembly-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.assembly-controls {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.speed-control label {
  margin: 0;
  font-size: 0.95rem;
}

.speed-control input {
  width: 150px;
}

.assembly-visualization {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 2rem;
  overflow-x: auto;
  padding: 2rem;
  position: relative;
  z-index: 0;
  background: rgba(255,255,255,0.5);
  border-radius: 15px;
}

.layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.layer-title {
  font-family: var(--font-label);
  font-weight: bold;
  color: var(--color-brown);
  text-align: center;
  font-size: 0.9rem;
  max-width: 100px;
}

.nodes-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.node {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--color-crust);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-charcoal);
}

.node:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.node.active {
  background: var(--color-tomato);
  border-color: var(--color-brown);
  color: white;
  box-shadow: 0 0 15px rgba(230, 57, 70, 0.5);
}

.assembly-canvas-area {
  position: relative;
  min-height: 300px;
  margin-bottom: 2rem;
}

.assembly-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 15px;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.assembly-output {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: var(--color-dough);
  border-radius: 15px;
  border: 2px dashed var(--color-crust);
}

.pizza-output {
  font-size: 6rem;
  animation: pulse 0.6s ease-in-out;
}

.conveyor-label {
  font-family: var(--font-label);
  color: var(--color-brown);
  text-align: center;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ============ SECTION 3: JUDGE ============ */
.judge-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.judge-pizza {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.pizza-svg {
  width: 100%;
  max-width: 200px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
}

.judge-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  justify-content: center;
  min-height: 400px;
}

.judge-character {
  width: 120px;
  height: 120px;
  position: relative;
  margin-bottom: 1rem;
}

.judge-face {
  width: 100%;
  height: 100%;
  background: var(--color-cheese);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.judge-face.happy {
  background: var(--color-basil);
  animation: wobble 0.5s ease-in-out;
}

.judge-face.sad {
  background: var(--color-tomato);
  animation: shake 0.4s ease-in-out;
}

.eyes {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
}

.eye {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  position: relative;
}

.pupil {
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
}

.mouth {
  position: absolute;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 20px;
  border: 3px solid white;
  border-top: none;
  border-radius: 0 0 40px 40px;
}

.mouth.sad {
  border-radius: 40px 40px 0 0;
  bottom: 35%;
}

.mustache {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 8px;
  background: white;
  border-radius: 4px;
}

.judge-score {
  font-family: var(--font-label);
  font-size: 2.5rem;
  color: var(--color-tomato);
  text-align: center;
}

.judge-paddle {
  font-size: 4rem;
  animation: paddleSpin 0.6s ease-in-out;
}

@keyframes paddleSpin {
  0% { transform: rotateZ(0deg); }
  50% { transform: rotateZ(-30deg); }
  100% { transform: rotateZ(0deg); }
}

.judge-controls {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-group label {
  margin: 0;
}

.slider-value {
  font-family: var(--font-label);
  text-align: center;
  color: var(--color-brown);
  font-size: 0.95rem;
}

@media (max-width: 1024px) {
  .judge-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .judge-center {
    min-height: 300px;
  }

  .judge-character {
    width: 100px;
    height: 100px;
  }
}

/* ============ SECTION 4: GRADIENT DESCENT ============ */
.gradient-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.gradient-canvas {
  width: 100%;
  min-height: 500px;
  background: white;
  border-radius: 15px;
  border: 2px solid var(--color-crust);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: block;
}

.gradient-controls {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  align-items: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.control-group label {
  margin: 0;
}

.control-group input {
  width: 200px;
}

.stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: var(--color-dough);
  border-radius: 12px;
}

.stat {
  text-align: center;
}

.stat-label {
  font-family: var(--font-label);
  color: var(--color-brown);
  font-size: 0.9rem;
}

.stat-value {
  font-family: var(--font-label);
  font-size: 1.8rem;
  color: var(--color-tomato);
}

/* ============ SECTION 5: OVERFITTING ============ */
.overfitting-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.chef-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chef-header {
  font-family: var(--font-label);
  font-size: 1.3rem;
  text-align: center;
  color: var(--color-charcoal);
}

.chef-illustration {
  display: flex;
  justify-content: center;
  min-height: 250px;
  background: white;
  border-radius: 15px;
  border: 2px dashed var(--color-crust);
  align-items: center;
  font-size: 4rem;
}

.chef-sweating {
  animation: sweat 0.8s ease-in-out infinite;
}

@keyframes sweat {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(230, 57, 70, 0)); }
  50% { filter: drop-shadow(0 2px 5px rgba(230, 57, 70, 0.6)); }
}

.toggle-switch {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--color-dough);
  border-radius: 15px;
  border: 2px solid var(--color-crust);
  margin: 2rem 0;
}

.switch-btn {
  padding: 0.7rem 1.5rem;
  background: white;
  border: 2px solid var(--color-crust);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-label);
  font-size: 0.95rem;
}

.switch-btn.active {
  background: var(--color-tomato);
  color: white;
  border-color: var(--color-brown);
}

.scorecard {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid var(--color-crust);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.score-row:last-child {
  border-bottom: none;
}

.score-label {
  font-weight: 600;
  color: var(--color-charcoal);
}

.score-value {
  font-family: var(--font-label);
  font-size: 1.1rem;
  color: var(--color-tomato);
}

.score-value.success {
  color: var(--color-basil);
}

.customer-animation {
  animation: walkIn 0.6s ease-out;
}

@keyframes walkIn {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1024px) {
  .overfitting-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ============ SECTION 6: EPOCHS ============ */
.epochs-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.epochs-left {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.progress-ring-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.progress-ring {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-ring-circle {
  transition: stroke-dashoffset 0.5s ease;
  stroke: var(--color-tomato);
  fill: transparent;
  stroke-width: 8;
  stroke-linecap: round;
}

.progress-ring-bg {
  stroke: #eee;
  fill: transparent;
  stroke-width: 8;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: var(--font-label);
}

.progress-epoch {
  font-size: 2.5rem;
  color: var(--color-tomato);
}

.progress-label {
  font-size: 0.9rem;
  color: var(--color-brown);
}

.epochs-animation {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: white;
  border-radius: 15px;
  border: 2px dashed var(--color-crust);
  font-size: 3rem;
}

.chef-loop {
  animation: chefLoop 2s linear infinite;
}

@keyframes chefLoop {
  0% { transform: rotateZ(-5deg); }
  25% { transform: rotateZ(5deg); }
  50% { transform: rotateZ(-5deg) scaleY(0.9); }
  75% { transform: rotateZ(5deg); }
  100% { transform: rotateZ(-5deg); }
}

.epochs-speed {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.epochs-speed label {
  margin: 0;
}

.epochs-speed input {
  flex: 1;
  max-width: 200px;
}

.epochs-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pizza-progress {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  border: 2px solid var(--color-crust);
  gap: 1rem;
}

.pizza-stage {
  font-size: 3rem;
  text-align: center;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.pizza-stage.active {
  opacity: 1;
  transform: scale(1.2);
}

.loss-graph {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  border: 2px solid var(--color-crust);
}

.loss-graph-title {
  font-family: var(--font-label);
  color: var(--color-brown);
  text-align: center;
  font-size: 1rem;
}

.loss-graph-canvas {
  width: 100%;
  min-height: 200px;
  display: block;
}

@media (max-width: 1024px) {
  .epochs-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ============ SECTION 7: WEIGHTS ============ */
.weights-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.weights-sliders {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.weight-control {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.weight-label {
  font-family: var(--font-label);
  color: var(--color-brown);
  font-weight: bold;
}

.weight-slider {
  width: 100%;
}

.weight-value {
  font-family: var(--font-label);
  text-align: center;
  color: var(--color-tomato);
  font-size: 1.1rem;
}

.weight-negative {
  color: #999;
}

.weights-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.weights-buttons button {
  flex: 1;
}

.weights-visualization {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.pizza-preview {
  display: flex;
  justify-content: center;
  min-height: 300px;
}

.radar-chart {
  width: 250px;
  height: 250px;
  display: block;
}

@media (max-width: 1024px) {
  .weights-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ============ SECTION 8: BACKPROP ============ */
.backprop-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.backprop-visualization {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.backprop-canvas {
  width: 100%;
  min-height: 400px;
  background: white;
  border-radius: 15px;
  border: 2px solid var(--color-crust);
  display: block;
}

.backprop-controls {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.backprop-controls button {
  min-width: 150px;
}

.backprop-explanation {
  padding: 1.5rem;
  background: var(--color-dough);
  border-radius: 12px;
  border: 2px solid var(--color-crust);
  max-height: 200px;
  overflow-y: auto;
}

.backprop-step {
  padding: 1rem;
  margin-bottom: 1rem;
  background: white;
  border-left: 4px solid var(--color-tomato);
  border-radius: 8px;
}

.backprop-step-title {
  font-family: var(--font-label);
  color: var(--color-brown);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.backprop-step-desc {
  font-size: 0.9rem;
  color: var(--color-charcoal);
}
