/* =========================================================
   Click & Type — Computer Basics Playground
   Design tokens
   ========================================================= */
:root {
  --bg: #EAF4FF;
  --bg-soft: #F6FAFF;
  --ink: #16213E;
  --ink-soft: #4A5878;
  --panel: #10182B;
  --panel-2: #1B2A4A;
  --accent: #FFC93C;
  --accent-2: #FF6B5B;
  --success: #3FCB94;
  --success-soft: #E4FBF2;
  --line: rgba(22, 33, 62, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --shadow-panel: 0 18px 40px rgba(16, 24, 43, 0.28);
  --font-display: 'Baloo 2', 'Segoe UI', sans-serif;
  --font-body: 'Nunito Sans', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.4em 0;
  color: var(--ink);
  line-height: 1.15;
}

p { margin: 0 0 1em 0; }

a { color: inherit; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-soft);
  border-bottom: 3px solid var(--panel);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(255, 107, 91, 0.18);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.topbar nav {
  display: flex;
  gap: 22px;
  font-weight: 700;
  font-size: 0.95rem;
}

.topbar nav a {
  text-decoration: none;
  padding: 6px 4px;
  border-bottom: 3px solid transparent;
}

.topbar nav a:hover { border-color: var(--accent); }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 28px auto;
  max-width: 1080px;
  padding: 10px 24px;
}

.ad-slot__frame {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  min-height: var(--ad-min-h, 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 12px;
}

.ad-slot--leaderboard .ad-slot__frame { --ad-min-h: 90px; }
.ad-slot--native .ad-slot__frame { --ad-min-h: 120px; }
.ad-slot--footer .ad-slot__frame { --ad-min-h: 60px; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero .eyebrow {
  display: inline-block;
  background: var(--accent);
  color: var(--panel);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
}

.hero p.lead {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 800;
  font-size: 1rem;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent-2);
  color: white;
  box-shadow: 0 10px 24px rgba(255, 107, 91, 0.35);
}

.btn-secondary {
  background: white;
  color: var(--ink);
  border: 2px solid var(--panel-2);
}

/* Signature hero illustration */
.hero-rig {
  position: relative;
  aspect-ratio: 4 / 3.2;
}

.hero-rig svg { width: 100%; height: 100%; }

.pulse-key {
  animation: keyPulse 2.6s ease-in-out infinite;
  transform-origin: center;
}

.pulse-key:nth-child(2) { animation-delay: 0.3s; }
.pulse-key:nth-child(3) { animation-delay: 0.6s; }

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

.cursor-glide {
  animation: glide 5s ease-in-out infinite;
}

@keyframes glide {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(40px, -18px); }
  50%  { transform: translate(10px, 24px); }
  75%  { transform: translate(-30px, -6px); }
  100% { transform: translate(0, 0); }
}

/* ---------- Mission strip ---------- */
.mission {
  padding: 20px 0 10px;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.mission-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 2px solid var(--line);
}

.mission-card .tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 6px;
}

.mission-card h3 { font-size: 1.15rem; }
.mission-card p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* ---------- Games section ---------- */
.games {
  padding: 48px 0 10px;
}

.games-intro {
  max-width: 60ch;
  margin-bottom: 30px;
}

.games-intro h2 { font-size: 2rem; }
.games-intro p { color: var(--ink-soft); }

/* Monitor bezel panel — the signature repeating element */
.monitor {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 18px 18px 22px;
  box-shadow: var(--shadow-panel);
  margin-bottom: 34px;
}

.monitor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 14px;
  color: #B9C3E0;
}

.monitor-topbar .led-group {
  display: flex;
  gap: 8px;
}

.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3A4568;
}

.led.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.led.alert.on { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

.monitor-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #E7ECFB;
}

.monitor-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 201, 60, 0.16);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.screen {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 22px;
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.screen-header h3 { font-size: 1.35rem; margin-bottom: 4px; }
.screen-header p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; max-width: 48ch; }

.score-pill {
  background: white;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 0.95rem;
  white-space: nowrap;
}

.score-pill span { color: var(--accent-2); }

.play-area {
  position: relative;
  background: white;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  min-height: 260px;
  overflow: hidden;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.status-msg {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  min-height: 1.4em;
}

.status-msg.win { color: var(--success); }

/* Bubble game */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #FFE49E, var(--accent));
  border: none;
  box-shadow: 0 6px 14px rgba(255, 201, 60, 0.4);
  transition: transform 0.12s ease;
}

.bubble:active { transform: scale(0.85); }

/* Double click door */
.door-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  padding: 20px;
}

.folder {
  width: 130px;
  height: 96px;
  cursor: pointer;
  user-select: none;
}

/* Drag & drop */
.dnd-layout {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  flex-wrap: wrap;
}

.dnd-source, .dnd-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dnd-targets { flex-direction: column; }

.drag-item {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: grab;
}

.drag-item.dragging { opacity: 0.4; }

.drop-bin {
  width: 160px;
  min-height: 66px;
  border-radius: var(--radius-sm);
  border: 3px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.drop-bin.hover { border-color: var(--accent-2); background: #FFF3F1; }
.drop-bin.filled { border-style: solid; border-color: var(--success); background: var(--success-soft); color: var(--ink); }

/* Keyboard ninja */
.type-lane {
  position: relative;
  height: 260px;
  overflow: hidden;
}

.falling-letter {
  position: absolute;
  top: -40px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--panel-2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.type-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-2);
}

/* Scroll explorer */
.scroll-shaft {
  height: 280px;
  overflow-y: scroll;
  padding: 16px;
  scroll-behavior: smooth;
}

.scroll-inner {
  height: 900px;
  position: relative;
  background: linear-gradient(180deg, #EAF4FF 0%, #DCEBFF 50%, #EAF4FF 100%);
  border-radius: var(--radius-sm);
}

.star {
  position: absolute;
  width: 34px;
  height: 34px;
  cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

.star.found { opacity: 0.25; pointer-events: none; }

/* Buttons inside games */
.btn-play {
  background: var(--panel-2);
  color: white;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 800;
  font-family: var(--font-display);
  border: none;
}

.btn-play:hover { background: var(--panel); }

/* ---------- Progress / badges ---------- */
.progress {
  padding: 50px 0 10px;
}

.progress h2 { font-size: 1.8rem; }
.progress > .wrap > p { color: var(--ink-soft); max-width: 55ch; }

.badge-shelf {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.badge {
  width: 108px;
  padding: 14px 10px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: white;
  border: 2px solid var(--line);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.badge .icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
  filter: grayscale(1);
  opacity: 0.4;
}

.badge.earned {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--ink);
}

.badge.earned .icon { filter: none; opacity: 1; }

/* ---------- Footer ---------- */
footer {
  margin-top: 60px;
  background: var(--panel);
  color: #B9C3E0;
  padding: 40px 0;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

footer a { color: var(--accent); text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-rig { order: -1; max-width: 320px; margin: 0 auto; }
  .mission-grid { grid-template-columns: 1fr; }
  .dnd-layout { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
