* { box-sizing: border-box; }

:root {
  --bg: #071b34;
  --bg2: #0a2647;
  --ink: #eaf6ff;
  --muted: #a9c7e4;
  --accent: #37e0ff;
  --accent2: #ffd166;
  --card: rgba(255, 255, 255, 0.06);
  --radius: 20px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, #12406f 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 60%, #06203c 100%);
  overflow-x: hidden;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.8rem 1.4rem;
  background: rgba(4, 18, 36, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.logo { color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.nav { display: flex; gap: 1.1rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; transition: color 0.2s, transform 0.2s; }
.nav a:hover { color: var(--accent); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 72vh;
  display: grid; place-items: center; text-align: center;
  padding: 4rem 1.25rem 5rem; overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; max-width: 46rem; }
.hero__kicker {
  display: inline-block; margin: 0 0 0.8rem; padding: 0.3rem 0.9rem;
  border: 1px solid rgba(55, 224, 255, 0.5); border-radius: 999px;
  color: var(--accent); font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase;
}
.hero__title { margin: 0; font-size: clamp(2.4rem, 8vw, 4.6rem); line-height: 1.05; letter-spacing: -1px; }
.accent {
  background: linear-gradient(90deg, var(--accent), #7ef7c6, var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shine 4s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero__lead { color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.15rem); line-height: 1.65; }
.hero__lead b { color: #dff3ff; }
.btn {
  display: inline-block; margin-top: 1.2rem; padding: 0.85rem 1.7rem; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #2a9df4);
  color: #04203b; font-weight: 800; text-decoration: none;
  box-shadow: 0 10px 30px rgba(55, 224, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 40px rgba(55, 224, 255, 0.5); }
.hero__hint { position: absolute; bottom: 1.2rem; z-index: 2; color: #7fa8cf; font-size: 0.85rem; }

.hero__water { position: absolute; inset: auto 0 0 0; height: 40%; z-index: 1; }
.wave {
  position: absolute; left: -50%; width: 200%; height: 200px; bottom: -60px;
  background-repeat: repeat-x; background-size: 50% 200px; opacity: 0.5;
}
.wave--1 { background-image: radial-gradient(circle at 50% 0, rgba(55, 224, 255, 0.35) 60%, transparent 61%); animation: slide 9s linear infinite; }
.wave--2 { background-image: radial-gradient(circle at 50% 0, rgba(42, 157, 244, 0.35) 60%, transparent 61%); bottom: -80px; animation: slide 14s linear infinite reverse; }
.wave--3 { background-image: radial-gradient(circle at 50% 0, rgba(126, 247, 198, 0.22) 60%, transparent 61%); bottom: -100px; animation: slide 20s linear infinite; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 4rem 1.25rem; }
.section--alt {
  max-width: none; background: rgba(4, 20, 40, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.section--alt > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.section__title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 0.5rem; }
.section__sub { color: var(--muted); margin: 0 0 2rem; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}
.card:hover, .card:focus-visible {
  border-color: rgba(55, 224, 255, 0.55);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(55, 224, 255, 0.2);
  outline: none;
}
.card__scene { position: relative; }
.scene {
  display: block; width: 100%; height: auto;
  background: #06203c; cursor: crosshair;
}
.scene__hint {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  background: rgba(4, 20, 40, 0.62);
  border: 1px dashed rgba(255, 255, 255, 0.55);
  color: #dff3ff; font-size: 0.72rem; letter-spacing: 0.3px;
  transition: opacity 0.25s ease; pointer-events: none;
}
.card:hover .scene__hint, .card.is-hover .scene__hint { opacity: 0; }

/* слои двигаются ТОЛЬКО пока курсор на карточке */
.layer {
  transform: translate(calc(var(--mx, 0) * 1px), calc(var(--my, 0) * 1px));
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.card__body { padding: 1.1rem 1.2rem 1.4rem; }
.card__body h3 { margin: 0.5rem 0 0.5rem; font-size: 1.22rem; }
.card__intro { margin: 0; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 0.25rem 0.7rem; border-radius: 999px;
}
.badge--fast { background: rgba(55, 224, 255, 0.18); color: var(--accent); }
.badge--calm { background: rgba(126, 247, 198, 0.18); color: #7ef7c6; }
.badge--hard { background: rgba(255, 120, 160, 0.2); color: #ff9dbb; }
.badge--easy { background: rgba(255, 209, 102, 0.18); color: var(--accent2); }

/* ---------- stats / specs ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 0.5rem; margin: 0.9rem 0 0;
}
.stat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 0.5rem 0.6rem;
}
.stat dt { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.7px; color: #8fb3d6; }
.stat dd { margin: 0.15rem 0 0; font-size: 0.85rem; font-weight: 700; color: #eaf6ff; line-height: 1.3; }

.specs {
  list-style: none; margin: 0.95rem 0 0; padding: 0.85rem 0 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  display: grid; gap: 0.55rem;
  font-size: 0.86rem; line-height: 1.55; color: var(--muted);
}
.specs b { color: #dff3ff; }

/* ---------- SVG подписи ---------- */
.scene__label { fill: rgba(255, 255, 255, 0.94); font-size: 15px; font-weight: 700; }
.scene__note { fill: rgba(255, 255, 255, 0.72); font-size: 12px; }
.scene__mini { fill: #eaf6ff; font-size: 13px; font-weight: 600; }

/* ---------- анимация пловцов: только при наведении ----------
   Анимации назначены, но стоят на pause (.paused). Запуск — под курсором. */
.swimmer, .a-front, .a-back, .legs, .body, .splash, .chain-move {
  transform-box: fill-box; transform-origin: center;
}
.swimmer { animation: bob 3.2s ease-in-out infinite paused; }
.a-front { animation: armFront 1.7s ease-in-out infinite paused; }
.a-back { animation: armBack 1.7s ease-in-out infinite paused; }
.legs { animation: kick 0.75s ease-in-out infinite paused; }
.body { animation: waveBody 2.4s ease-in-out infinite paused; }
.splash { animation: splashPulse 1.3s ease-in-out infinite paused; }
.chain-move { animation: chainNudge 1.6s ease-in-out infinite paused; }

@keyframes armFront { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(26deg); } }
@keyframes armBack { 0%, 100% { transform: rotate(20deg); } 50% { transform: rotate(-18deg); } }
@keyframes kick { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
@keyframes waveBody { 0%, 100% { transform: translateY(-4px) rotate(-2deg); } 50% { transform: translateY(5px) rotate(2deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes splashPulse { 0%, 100% { opacity: 0.4; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.14); } }
@keyframes chainNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

/* запуск строго под курсором (или тапом на тач-устройствах) */
.card:is(:hover, .is-hover) :is(.swimmer, .a-front, .a-back, .legs, .body, .splash, .chain-move) {
  animation-play-state: running;
}
/* без наведения — полная тишина даже у wave/label */
.scene { --paused: 1; }

@media (prefers-reduced-motion: reduce) {
  .swimmer, .a-front, .a-back, .legs, .body, .splash, .chain-move, .wave, .accent { animation: none !important; }
  .layer { transition: none !important; }
}

/* ---------- breathing ---------- */
.breath { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.breath__btn {
  cursor: pointer; border: 1px solid rgba(55, 224, 255, 0.35);
  background: rgba(55, 224, 255, 0.08); color: var(--ink);
  border-radius: 14px; padding: 0.65rem 1rem; font-size: 0.92rem;
  transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
}
.breath__btn:hover { transform: translateY(-4px); background: rgba(55, 224, 255, 0.2); box-shadow: 0 10px 24px rgba(55, 224, 255, 0.25); }
.breath__btn.is-active { background: var(--accent); color: #04203b; font-weight: 700; border-color: var(--accent); }
.breath__out {
  min-height: 3em; margin-top: 1.1rem; padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent2); border-radius: 0 14px 14px 0;
  color: #ffe9b0; font-size: 1rem; line-height: 1.55; font-weight: 600;
}

.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 2rem; }
.tip {
  background: var(--card); border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px; padding: 1rem; line-height: 1.5; color: var(--muted);
  transition: transform 0.2s, border-color 0.2s;
}
.tip:hover { transform: translateY(-5px) rotate(-0.5deg); border-color: rgba(126, 247, 198, 0.5); }
.tip b { color: var(--ink); }

/* ---------- quiz ---------- */
.quiz { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.quiz__btn {
  cursor: pointer; text-align: left; padding: 1.1rem 1.2rem;
  font-size: 0.98rem; color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.quiz__btn:hover { transform: translateY(-5px); background: rgba(55, 224, 255, 0.12); border-color: rgba(55, 224, 255, 0.5); }
.quiz__btn.is-picked { background: linear-gradient(90deg, rgba(55, 224, 255, 0.25), rgba(126, 247, 198, 0.18)); border-color: var(--accent); }
.quiz__result { margin-top: 1.4rem; font-size: 1.05rem; font-weight: 700; color: var(--accent2); min-height: 1.5em; line-height: 1.5; }

/* ---------- footer / bubbles ---------- */
.footer { text-align: center; padding: 2.5rem 1rem 3rem; color: #7fa8cf; font-size: 0.9rem; }
.bubble {
  position: fixed; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(120, 220, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.5);
  pointer-events: none; z-index: 50;
  animation: rise 1.4s ease-out forwards;
}
@keyframes rise {
  from { transform: translateY(0) scale(0.6); opacity: 0.9; }
  to { transform: translateY(-120px) scale(1.3); opacity: 0; }
}

@media (max-width: 640px) {
  .nav { display: none; }
}
