/* ============================================================
   Media Buyer Quiz — performance-desk dark theme
   Fonts: Unbounded (display) · Golos Text (body) · IBM Plex Mono
   ============================================================ */

:root {
  --bg: #0b0d08;
  --bg-soft: #11140c;
  --card: #14180e;
  --card-edge: #1d2313;
  --line: rgba(198, 255, 74, 0.16);
  --line-soft: rgba(198, 255, 74, 0.08);
  --text: #edf2e2;
  --muted: #9aa68a;
  --accent: #c6ff4a;
  --accent-soft: rgba(198, 255, 74, 0.12);
  --danger: #ff7a5c;
  --radius: 18px;
  --font-display: "Unbounded", sans-serif;
  --font-body: "Golos Text", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

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

[hidden] { display: none !important; }

/* швидший відгук на тап (прибирає 300ms-затримку) */
a, button, label, input, textarea { touch-action: manipulation; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.accent { color: var(--accent); }

.container {
  width: min(100%, 980px);
  margin-inline: auto;
  padding-inline: 20px;
}

/* grain overlay */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────── Header ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 13, 8, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-block: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  white-space: nowrap;
}

/* language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 2px;
}

.lang-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-btn:hover { color: var(--text); }

.lang-btn.is-active {
  background: var(--accent);
  color: #0c0f06;
}

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

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(198, 255, 74, 0.5);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 255, 74, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(198, 255, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 255, 74, 0); }
}

/* ───────── Hero ───────── */
.hero {
  position: relative;
  padding: clamp(64px, 11vh, 120px) 0 0;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(198, 255, 74, 0.09), transparent 60%),
    radial-gradient(700px 420px at -15% 30%, rgba(198, 255, 74, 0.05), transparent 60%);
}

.hero-kicker {
  color: var(--accent);
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.3rem, 7.5vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.hero-title .accent {
  text-shadow: 0 0 44px rgba(198, 255, 74, 0.35);
}

.hero-sub {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  margin-bottom: 38px;
}

.hero-perks {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-bottom: 42px;
  max-width: 560px;
}

.hero-perks li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(20, 24, 14, 0.55);
  font-weight: 500;
}

.perk-marker {
  color: var(--accent);
  flex-shrink: 0;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 56px;
}

.hero-cta-note { white-space: nowrap; }

/* load reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.15s; }
.reveal:nth-child(3) { animation-delay: 0.25s; }
.reveal:nth-child(4) { animation-delay: 0.35s; }
.reveal:nth-child(5) { animation-delay: 0.45s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ticker */
.ticker {
  border-block: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
  padding-block: 12px;
}

.ticker-track {
  display: flex;
  gap: 48px;
  width: max-content;
  color: var(--accent);
  font-size: 0.78rem;
  animation: scroll 26s linear infinite;
}

.ticker-track span { white-space: nowrap; }

@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  padding: 17px 30px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0c0f06;
  box-shadow: 0 6px 30px rgba(198, 255, 74, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(198, 255, 74, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
}

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

/* ───────── Quiz ───────── */
.quiz-section {
  padding: clamp(56px, 9vh, 100px) 0 clamp(72px, 11vh, 130px);
  background:
    radial-gradient(800px 500px at 110% 100%, rgba(198, 255, 74, 0.06), transparent 60%);
}

.quiz-card {
  max-width: 680px;
  margin-inline: auto;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 44px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.quiz-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
}

.quiz-step-label {
  color: var(--accent);
  white-space: nowrap;
}

.quiz-progress {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--line-soft);
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(198, 255, 74, 0.55), var(--accent));
  box-shadow: 0 0 14px rgba(198, 255, 74, 0.5);
  transition: width 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.quiz-question {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  line-height: 1.3;
  margin-bottom: 8px;
}

.quiz-hint {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

/* options */
.quiz-options {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(11, 13, 8, 0.5);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.98rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.option:hover {
  border-color: var(--line);
  transform: translateX(3px);
}

/* інпут візуально прихований, але доступний з клавіатури */
.option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.option .box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--muted);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #0c0f06;
  transition: all 0.15s ease;
}

.option .box.round { border-radius: 50%; }

.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option:has(input:checked) .box {
  background: var(--accent);
  border-color: var(--accent);
}

.option:has(input:checked) .box::after { content: "✓"; font-weight: 700; }

/* видимий фокус з клавіатури */
.option:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* text inputs */
.quiz-field { margin-bottom: 16px; }

.quiz-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.quiz-field label .opt {
  color: var(--muted);
  font-weight: 400;
}

.quiz-field input,
.quiz-field textarea {
  width: 100%;
  background: rgba(11, 13, 8, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

.quiz-field textarea {
  min-height: 120px;
  resize: vertical;
}

.quiz-field input:focus,
.quiz-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.req { color: var(--accent); }

.required-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.required-note .req { font-weight: 600; }

.quiz-field input.invalid,
.quiz-field textarea.invalid {
  border-color: var(--danger);
}

.quiz-field input::placeholder,
.quiz-field textarea::placeholder {
  color: rgba(154, 166, 138, 0.55);
}

/* consent */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-top: 6px;
}

.consent input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.consent .box {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  border: 1.5px solid var(--muted);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #0c0f06;
  transition: all 0.15s ease;
}

.consent:has(input:checked) .box {
  background: var(--accent);
  border-color: var(--accent);
}

.consent:has(input:checked) .box::after { content: "✓"; font-weight: 700; }

.consent:focus-within .box {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.consent.invalid .box { border-color: var(--danger); }

/* honeypot — невидиме для людей */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* error + nav */
.quiz-error {
  color: var(--danger);
  margin-top: 14px;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.quiz-nav .btn-primary { margin-left: auto; }

/* step transition */
.quiz-body { position: relative; }

.quiz-question:focus { outline: none; }

.step-enter { animation: stepIn 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.step-enter-back { animation: stepInBack 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes stepInBack {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}

/* ───────── Thanks ───────── */
.thanks-card {
  text-align: center;
  padding-block: clamp(48px, 8vw, 72px);
}

.thanks-icon {
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 18px;
  animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

.thanks-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.thanks-text {
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 26px;
}

.thanks-text strong { color: var(--text); }

.thanks-note { color: var(--accent); }

/* ───────── Footer ───────── */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 22px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-inner .mono { font-size: 0.64rem; }

/* ───────── Digital Flow Animations ───────── */

/* 1. Floating particles container */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.hero-particle {
  position: absolute;
  width: var(--sz, 2px);
  height: var(--sz, 2px);
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: floatDot var(--dur, 4s) var(--delay, 0s) ease-in-out infinite;
}

@keyframes floatDot {
  0%   { opacity: 0;              transform: translateY(0); }
  20%  { opacity: var(--op, 0.4); }
  80%  { opacity: var(--op, 0.4); }
  100% { opacity: 0;              transform: translateY(-40px); }
}

/* 2. Typewriter cursor */
.tw-cursor {
  color: var(--accent);
  animation: twBlink 1s step-end infinite;
}

.tw-cursor--done {
  animation: twFade 0.4s forwards;
}

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

@keyframes twFade {
  to { opacity: 0; }
}

/* ───────── Ambient Glow + Glitch Core ───────── */

/* keep hero text/ticker above the ambient & scanline layers */
.hero .container,
.hero .ticker { position: relative; z-index: 2; }

/* A · cursor-following / drifting glow */
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle 240px at var(--mx, 50%) var(--my, 35%),
              rgba(198, 255, 74, 0.13), transparent 65%);
  will-change: transform;
}
.hero-glow--drift {
  background: radial-gradient(circle 240px at 50% 40%,
              rgba(198, 255, 74, 0.13), transparent 65%);
  animation: glowDrift 9s ease-in-out infinite;
}
@keyframes glowDrift {
  0%, 100% { transform: translate(-8%, -6%); }
  50%      { transform: translate(8%, 6%); }
}

/* A · pulsing CTA ring (separate layer — won't fight button's own shadow) */
#startBtn { position: relative; }
#startBtn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: ctaPulse 2.6s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(198, 255, 74, 0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(198, 255, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(198, 255, 74, 0); }
}

/* B · scanlines overlay on hero (below text, above background) */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(198, 255, 74, 0.025) 3px,
    rgba(198, 255, 74, 0.025) 4px
  );
}

/* B · glitch burst on the accent word */
.hero-title .accent {
  position: relative;
  display: inline-block;
}
.hero-title .accent::before,
.hero-title .accent::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.hero-title .accent::before {
  color: #5cffd1;
  animation: glitchTop 5s infinite;
}
.hero-title .accent::after {
  color: var(--danger);
  animation: glitchBot 5s infinite;
}
@keyframes glitchTop {
  0%, 88%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 60% 0); }
  90% { opacity: 0.85; transform: translate(-3px, -1px); }
  92% { opacity: 0.85; transform: translate(3px, 1px); }
  94% { opacity: 0; transform: none; }
}
@keyframes glitchBot {
  0%, 88%, 100% { opacity: 0; transform: none; clip-path: inset(55% 0 0 0); }
  91% { opacity: 0.85; transform: translate(3px, 1px); }
  93% { opacity: 0.85; transform: translate(-2px, -1px); }
  95% { opacity: 0; transform: none; }
}

/* B · ripple on quiz option tap */
.option { position: relative; overflow: hidden; }
.option .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(198, 255, 74, 0.30);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: optionRipple 0.55s ease-out forwards;
}
@keyframes optionRipple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ───────── Mobile ───────── */
@media (max-width: 560px) {
  .header-tag { font-size: 0.6rem; }
  .header-status { display: none; } /* поступаємось місцем перемикачу мови */
  .header-right { gap: 0; }
  .lang-btn { padding: 5px 7px; }
  .hero-cta { gap: 14px; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .quiz-nav { flex-direction: row; }
  .quiz-nav .btn { padding: 15px 22px; font-size: 0.82rem; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
