/* =============================================
   ROOT & DESIGN TOKENS
============================================= */
:root {
  --bg: #0b0d14;
  --bg-card: #13151f;
  --bg-card2: #181b27;
  --border: #22263a;
  --border-light: #2e3248;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #4a5568;
  --blue: #3b82f6;
  --blue-glow: rgba(59,130,246,0.15);
  --purple: #8b5cf6;
  --purple-glow: rgba(139,92,246,0.15);
  --green: #10b981;
  --green-glow: rgba(16,185,129,0.15);
  --orange: #f97316;
  --orange-glow: rgba(249,115,22,0.15);
  --yellow: #eab308;
  --yellow-glow: rgba(234,179,8,0.15);
  --red: #ef4444;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'Fira Code', monospace;
  --radius: 14px;
  --shadow: 0 4px 32px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 64px;
}

code {
  font-family: var(--mono);
  background: rgba(255,255,255,0.07);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.88em;
  color: #93c5fd;
}

a { text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }

/* TOP NAV */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1.5rem;
  background: rgba(11,13,20,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.topnav__logo { font-weight: 700; font-size: 0.9rem; color: var(--text); margin-right: auto; }
.topnav__links { display: flex; gap: 0.25rem; }
.topnav__links a { padding: 6px 14px; border-radius: 8px; font-size: 0.82rem; font-weight: 500; color: var(--text-muted); transition: all 0.2s; }
.topnav__links a:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.topnav__timer { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--text); min-width: 58px; text-align: right; }
.topnav__timerbtn { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; width: 32px; height: 32px; border-radius: 8px; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; padding: 0; }

/* HERO */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; text-align: center; padding: 4rem 2rem; }
.hero__bg-anim { position: absolute; inset: 0; pointer-events: none; }
.hero__orb { position: absolute; border-radius: 50%; filter: blur(80px); }
.hero__orb--1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(139,92,246,0.2), transparent 70%); top: -100px; left: -100px; animation: orbFloat1 8s ease-in-out infinite alternate; }
.hero__orb--2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(59,130,246,0.18), transparent 70%); bottom: -80px; right: -80px; animation: orbFloat2 10s ease-in-out infinite alternate; }
.hero__orb--3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(16,185,129,0.12), transparent 70%); top: 50%; left: 50%; transform: translate(-50%,-50%); animation: orbFloat3 6s ease-in-out infinite alternate; }
@keyframes orbFloat1 { from { transform: translate(0,0); } to { transform: translate(60px, 40px); } }
@keyframes orbFloat2 { from { transform: translate(0,0); } to { transform: translate(-40px, -60px); } }
@keyframes orbFloat3 { from { transform: translate(-50%,-50%) scale(1); } to { transform: translate(-50%,-50%) scale(1.3); } }

.hero__content { position: relative; z-index: 1; max-width: 700px; }
.hero__week { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--purple); background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.25); padding: 5px 16px; border-radius: 100px; margin-bottom: 1.5rem; }
.hero__title { font-size: clamp(4rem, 10vw, 7rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1; background: linear-gradient(135deg, #fff 30%, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.25rem; }
.hero__subtitle { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(135deg, var(--purple), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 1.5rem; }
.hero__desc { font-size: 1.1rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 2.5rem; }
.hero__agenda { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.agenda-item { display: flex; align-items: center; gap: 0.5rem; background: rgba(255,255,255,0.05); border: 1px solid var(--border-light); padding: 10px 18px; border-radius: 100px; font-size: 0.88rem; font-weight: 500; }
.agenda-num { font-family: var(--mono); font-size: 0.75rem; color: var(--purple); font-weight: 600; }

/* MAIN & SECTIONS */
main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.section { margin-bottom: 6rem; }
.section__header { display: flex; align-items: center; gap: 1.5rem; padding: 2rem 2.5rem; border-radius: 20px; margin-bottom: 2.5rem; border: 1px solid; }
.section__header--blue   { background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(37,99,235,0.05)); border-color: rgba(59,130,246,0.2); }
.section__header--purple { background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(109,40,217,0.05)); border-color: rgba(139,92,246,0.2); }
.section__header--green  { background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(5,150,105,0.05)); border-color: rgba(16,185,129,0.2); }
.section__header--orange { background: linear-gradient(135deg, rgba(249,115,22,0.1), rgba(234,88,12,0.05)); border-color: rgba(249,115,22,0.2); }
.section__header--yellow { background: linear-gradient(135deg, rgba(234,179,8,0.1), rgba(202,138,4,0.05)); border-color: rgba(234,179,8,0.2); }
.section__number { font-family: var(--mono); font-size: 2.5rem; font-weight: 900; opacity: 0.25; }
.section__title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
.section__desc { color: var(--text-muted); font-size: 1rem; }

/* LESSON BLOCKS */
.lesson-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem; }
.lesson-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.75rem; }
.lesson-text { color: var(--text-muted); line-height: 1.75; margin-bottom: 1.25rem; font-size: 0.95rem; }

/* COMPARE BOXES */
.compare-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.compare-box { flex: 1; min-width: 180px; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1.5rem; background: rgba(255,255,255,0.02); border-radius: 10px; border: 1px solid var(--border); }
.compare-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }
.btn-no-transition, .btn-yes-transition { padding: 12px 28px; border-radius: 10px; border: none; background: var(--blue); color: white; font-weight: 600; font-size: 0.95rem; }
.btn-no-transition:hover { background: #1e40af; transform: translateY(-5px) scale(1.08); }
.btn-yes-transition { transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1); }
.btn-yes-transition:hover { background: #1e40af; transform: translateY(-5px) scale(1.08); box-shadow: 0 10px 30px rgba(59,130,246,0.35); }

/* SYNTAX VISUAL */
.syntax-visual { background: #090b10; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-bottom: 1rem; }
.syntax-line { font-family: var(--mono); font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.syn-prop { color: #f0883e; }
.syn-colon, .syn-semi { color: #e6edf3; }
.syn-part { padding: 4px 12px; border-radius: 6px; border: 2px solid; cursor: pointer; user-select: none; font-size: 1rem; }
.syn-part--1 { color: #7ee787; border-color: #7ee787; background: rgba(126,231,135,0.08); }
.syn-part--2 { color: #a5d6ff; border-color: #a5d6ff; background: rgba(165,214,255,0.08); }
.syn-part--3 { color: #ffd700; border-color: #ffd700; background: rgba(255,215,0,0.08); }
.syn-part--4 { color: #f0883e; border-color: #f0883e; background: rgba(240,136,62,0.08); }
.syntax-labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.syn-label { padding: 0.75rem; border-radius: 8px; font-size: 0.82rem; line-height: 1.5; border: 1px solid; opacity: 0.6; }
.syn-label.active { opacity: 1; transform: scale(1.03); }

/* TIMING DEMO */
.timing-demo { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.timing-row { display: grid; grid-template-columns: 180px 1fr auto; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.timing-name { font-family: var(--mono); font-size: 0.88rem; }
.timing-desc { font-size: 0.8rem; color: var(--text-muted); text-align: right; }
.timing-track { height: 32px; background: rgba(255,255,255,0.04); border-radius: 100px; position: relative; overflow: hidden; }
.timing-ball { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--purple); }
.timing-row.running .timing-ball { left: calc(100% - 28px); }
.demo-trigger-btn { background: var(--purple); color: white; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; }

/* STAGGER DEMO */
.stagger-menu { display: inline-flex; flex-direction: column; background: var(--bg-card2); border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
.stagger-item { padding: 12px 32px; font-weight: 500; font-size: 0.95rem; border-bottom: 1px solid var(--border); transform: translateX(-20px); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
.stagger-menu:hover .stagger-item { transform: translateX(0); opacity: 1; }

/* PERFORMANCE VISUAL */
.perf-visual { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.perf-path { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.perf-step { padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; background: rgba(255,255,255,0.06); border: 1px solid var(--border-light); }
.perf-step--skip { opacity: 0.3; text-decoration: line-through; }
.perf-step--active { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }
.perf-verdict { font-size: 0.82rem; font-weight: 600; }
.perf-verdict--bad { color: #f87171; } .perf-verdict--good { color: #6ee7b7; }

/* TRANSFORM PLAYGROUND */
.transform-playground { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; }
.transform-controls { display: flex; flex-direction: column; gap: 0.85rem; }
.ctrl-group { display: flex; flex-direction: column; gap: 0.3rem; }
.ctrl-group label { font-size: 0.82rem; color: var(--text-muted); }
.ctrl-group input[type="range"] { accent-color: var(--purple); }
.reset-btn { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #f87171; padding: 8px; border-radius: 8px; }
.transform-stage { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; min-height: 180px; position: relative; }
.transform-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 30px 30px; }
.transform-target { width: 80px; height: 80px; background: linear-gradient(135deg, var(--purple), var(--blue)); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; color: white; position: relative; z-index: 1; }
.transform-output { grid-column: 1 / -1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #090b10; }
.transform-output pre { padding: 1rem; font-family: var(--mono); font-size: 0.85rem; color: #a5d6ff; }

/* ORIGIN DEMO */
.origin-demo { display: flex; flex-direction: column; gap: 1rem; }
.origin-options { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.origin-btn { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border-light); background: rgba(255,255,255,0.04); color: var(--text-muted); font-size: 0.82rem; font-family: var(--mono); }
.origin-btn.active { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.4); color: #c4b5fd; }
.origin-stage { height: 140px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: center; position: relative; }
.origin-target { width: 100px; height: 50px; background: linear-gradient(135deg, var(--purple), var(--blue)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-family: var(--mono); color: white; transform: rotate(45deg); }
.origin-dot { position: absolute; width: 10px; height: 10px; background: var(--red); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* KEYFRAME FILMSTRIP */
.keyframe-visual { margin-bottom: 1rem; }
.kf-strip { display: flex; align-items: center; justify-content: center; }
.kf-frame { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; font-size: 0.88rem; font-family: var(--mono); }
.kf-frame__box { width: 50px; height: 50px; border-radius: 12px; }
.kf-connector { flex: 1; height: 2px; background: linear-gradient(90deg, var(--purple), var(--blue)); min-width: 40px; margin: 0 0.5rem 1.5rem; }

/* ANIMATION PROPS GRID */
.anim-props-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.anim-prop-card { background: var(--bg-card2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.anim-prop-name { font-size: 0.8rem; color: #f0883e; background: none; padding: 0; display: block; margin-bottom: 0.3rem; }
.anim-prop-card p { font-size: 0.8rem; color: var(--text-muted); }

/* PRODUCT CARD */
.rw-demo--center { display: flex; justify-content: center; }
.product-card { width: 220px; border-radius: 14px; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-light); }
.product-card__img-wrap { position: relative; overflow: hidden; height: 140px; }
.product-card__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.product-card__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.product-card__btn { background: white; color: #0b0d14; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; transform: translateY(20px); transition: transform 0.3s ease 0.1s; }
.product-card:hover .product-card__img { transform: scale(1.1); }
.product-card:hover .product-card__overlay { opacity: 1; }
.product-card:hover .product-card__btn { transform: translateY(0); }
.product-card__body { padding: 0.85rem; }
.product-card__body h4 { font-size: 0.9rem; font-weight: 700; }
.product-card__price { color: var(--green); font-weight: 700; font-size: 0.85rem; }

/* EXERCISE STYLES */
.exercise-section {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.exercise-section-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--text); letter-spacing: -0.01em; }

.exercise-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.exercise-card:last-child { margin-bottom: 0; }

.exercise-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }

.ex-badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 100px; }
.ex-badge--basic { background: rgba(59,130,246,0.2); color: #93c5fd; border: 1px solid rgba(59,130,246,0.4); }
.ex-badge--mid   { background: rgba(139,92,246,0.2); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.4); }

.exercise-header h4 { font-size: 1.05rem; font-weight: 700; }

.ex-instructions {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--purple);
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.ex-instructions strong { color: var(--text); display: block; margin-bottom: 0.3rem; }
.ex-instructions ol { padding-left: 1.25rem; margin-top: 0.25rem; }
.ex-instructions li { margin-bottom: 0.2rem; }

.ex-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 700px) { .ex-workspace { grid-template-columns: 1fr; } }

.ex-editor { display: flex; flex-direction: column; gap: 0.5rem; }
.ex-editor label, .ex-preview label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.ex-editor textarea {
  width: 100%;
  background: #090b10;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: #93c5fd;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}
.ex-editor textarea:focus { border-color: var(--purple); }

.ex-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.ex-btn { padding: 8px 16px; border-radius: 8px; font-size: 0.82rem; font-weight: 600; border: none; transition: all 0.2s; }
.ex-btn--run { background: var(--green); color: white; }
.ex-btn--run:hover { filter: brightness(0.9); transform: translateY(-1px); }
.ex-btn--sol { background: rgba(139,92,246,0.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.3); }
.ex-btn--sol:hover { background: rgba(139,92,246,0.25); color: white; }

.ex-preview { display: flex; flex-direction: column; gap: 0.5rem; }
.ex-stage { background: rgba(0,0,0,0.3); border: 1px dashed var(--border-light); border-radius: 8px; min-height: 140px; display: flex; align-items: center; justify-content: center; padding: 1rem; position: relative; overflow: hidden; }
.ex-feedback { font-size: 0.8rem; color: var(--text-dim); font-family: var(--mono); }

.ex-solution {
  display: none;
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.65;
}
.ex-solution.show { display: block; animation: fadeUp 0.3s ease; }
.ex-solution h5 { color: #6ee7b7; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ex-solution pre { background: #090b10; border: 1px solid rgba(16,185,129,0.2); padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 0.75rem; overflow-x: auto; }
.ex-solution code { color: #93c5fd; background: none; padding: 0; }
.ex-solution p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* EXERCISE TARGET ELEMENTS INITIAL STYLES */
.ex1-btn { padding: 10px 24px; border-radius: 6px; border: none; background-color: #3b82f6; color: white; font-weight: 600; font-size: 0.9rem; }
.ex2-container { display: flex; gap: 0.75rem; width: 100%; }
.ex2-item { flex: 1; padding: 1rem 0.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: 0.8rem; font-weight: 600; }
.ex3-card { width: 120px; height: 70px; background: linear-gradient(135deg, var(--blue), var(--purple)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: white; }
.ex4-door { width: 110px; height: 70px; background: linear-gradient(135deg, var(--purple), var(--orange)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: white; }
.ex5-ball { width: 60px; height: 60px; border-radius: 50%; background: var(--purple); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: white; }
.ex6-track { width: 80%; height: 24px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; position: relative; }
.ex6-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), var(--green)); }
.ex7-fab { width: 50px; height: 50px; border-radius: 50%; border: none; background-color: #3b82f6; color: white; font-size: 1.5rem; font-weight: 400; display: flex; align-items: center; justify-content: center; }
.ex8-skeleton { width: 80%; height: 30px; border-radius: 8px; }

/* QUIZ & FOOTER */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.quiz-card { border-radius: 12px; cursor: pointer; }
.quiz-front, .quiz-back { padding: 1.25rem; border-radius: 12px; border: 1px solid var(--border); font-size: 0.9rem; line-height: 1.55; }
.quiz-front { background: var(--bg-card); font-weight: 600; }
.quiz-back { display: none; background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3); color: #6ee7b7; }
.quiz-card.revealed .quiz-front { display: none; }
.quiz-card.revealed .quiz-back { display: block; }
.footer { text-align: center; padding: 2rem; color: var(--text-dim); font-size: 0.82rem; border-top: 1px solid var(--border); margin-top: 4rem; }
