/* ============================================
   rdbx.studio — Style
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- Theme Variables --- */
html, html[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-surface: #141414;
  --border: rgba(255,255,255,0.06);
  --text: #e4e4e7;
  --text-secondary: #71717a;
  --accent: #e63946;
  --accent-dark: #991b1b;
  --accent-gradient: linear-gradient(135deg, #e63946, #991b1b);
  --glow: rgba(230, 57, 70, 0.15);
  --dot-grid: rgba(255,255,255,0.04);
  --switcher-ring: #ffffff;
}

html[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-surface: #ffffff;
  --border: rgba(0,0,0,0.08);
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --accent: #e63946;
  --accent-dark: #b91c2c;
  --accent-gradient: linear-gradient(135deg, #e63946, #b91c2c);
  --glow: rgba(230, 57, 70, 0.1);
  --dot-grid: rgba(0,0,0,0.04);
  --switcher-ring: #1a1a1a;
}

html[data-theme="red"] {
  --bg: #991b1b;
  --bg-surface: rgba(0,0,0,0.2);
  --border: rgba(255,255,255,0.12);
  --text: #ffffff;
  --text-secondary: rgba(255,255,255,0.7);
  --accent: #ffffff;
  --accent-dark: rgba(255,255,255,0.8);
  --accent-gradient: linear-gradient(135deg, #ffffff, rgba(255,255,255,0.8));
  --glow: rgba(255,255,255,0.1);
  --dot-grid: rgba(255,255,255,0.06);
  --switcher-ring: #ffffff;
}

/* --- Theme Transition --- */
html {
  transition: background-color 0.4s ease, color 0.3s ease;
}

*, *::before, *::after {
  transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Canvas Background --- */
#bg-matrix {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* --- Container --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* --- Links --- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

/* ============================================
   HEADER / NAV
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  padding: 16px 0;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}

.header.scrolled {
  background-color: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-icon {
  height: 26px;
  width: auto;
  margin-right: -2px;
}

.logo .dot {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  opacity: 1;
}

.lang-toggle {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lang-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  opacity: 1;
}

/* --- Burger Menu --- */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Menu --- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  z-index: 105;
  padding: 100px 24px 40px;
  flex-direction: column;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
}

.mobile-menu-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-theme-switcher {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mobile-theme-switcher .theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  font-family: inherit;
}

.mobile-theme-switcher .theme-option .circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
}

.mobile-theme-switcher .theme-option.active .circle {
  border-color: var(--switcher-ring);
}

.mobile-theme-switcher .theme-option[data-theme="dark"] .circle { background: #0a0a0f; }
.mobile-theme-switcher .theme-option[data-theme="light"] .circle { background: #f5f5f5; border: 2px solid rgba(0,0,0,0.15); }
.mobile-theme-switcher .theme-option[data-theme="red"] .circle { background: #e63946; }
.mobile-theme-switcher .theme-option[data-theme="light"].active .circle { border-color: #1a1a1a; }

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}

.hero-content {
  max-width: 720px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 .gradient-word {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 400;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 0;
  border-bottom: 2px solid var(--accent);
  transition: gap 0.2s ease;
}

.cta-link:hover {
  gap: 14px;
  opacity: 1;
}

/* --- Hero fade-in animation --- */
.hero h1,
.hero .subtitle,
.hero .cta-link {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.7s ease forwards;
}

.hero h1 { animation-delay: 0.1s; }
.hero .subtitle { animation-delay: 0.3s; }
.hero .cta-link { animation-delay: 0.5s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   MARQUEE (scrolling keywords)
   ============================================ */
.marquee {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  background: var(--bg-surface);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 20s linear infinite;
}

.marquee-track span {
  flex-shrink: 0;
  padding: 0 32px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.marquee-track span::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 16px;
  vertical-align: middle;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================
   SECTIONS (generic)
   ============================================ */
section {
  padding: 100px 0;
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 56px;
}

.section-subtitle strong {
  color: var(--accent);
  font-weight: 700;
}

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

/* ============================================
   CARDS
   ============================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--glow);
  border-color: var(--accent);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  color: var(--accent);
}

.card-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.65;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-it-works {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  counter-reset: step;
  max-width: 960px;
  margin: 0 auto;
}

.step {
  counter-increment: step;
  position: relative;
  padding: 28px 24px 28px 0;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

html[data-theme="red"] .step-number {
  color: var(--bg);
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.step-timeline {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--glow);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  white-space: nowrap;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  padding-left: 56px;
}

.step-number-repeat {
  font-size: 0;
  color: #fff;
}

html[data-theme="red"] .step-number-repeat {
  color: var(--bg);
}

/* ============================================
   PRICING
   ============================================ */
.pricing-section {
  text-align: center;
}

.pricing-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.pricing-headline {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
}

.pricing-amount {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.pricing-amount small {
  font-size: 0.4em;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.pricing-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

.pricing-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
  margin-bottom: 36px;
}

.pricing-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.pricing-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.pricing-item-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pricing-item-content strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.pricing-item-content span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pricing-note {
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-style: italic;
}

@media (max-width: 540px) {
  .pricing-items {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    padding: 36px 24px;
  }
}

/* ============================================
   WHY US
   ============================================ */
.why-us {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.why-us-content {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
}

.why-us-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
  color: var(--accent);
}

.why-us-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.why-us-text {
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: 48px;
}

.key-points {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.key-point {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.key-point-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* ============================================
   TEAM
   ============================================ */
#team {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
  text-align: center;
}

.team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  position: relative;
}

html[data-theme="red"] .avatar {
  color: var(--bg);
}

.avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
}

.team-member .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.team-member .role {
  color: var(--text-secondary);
  font-size: 0.825rem;
}

.company-info {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.8;
}

.company-info .company-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 4px;
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
  text-align: center;
}

.contact-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: #fff;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

html[data-theme="red"] .btn-primary {
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow);
  opacity: 1;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.footer-inner a {
  color: var(--text-secondary);
}

.footer-inner a:hover {
  color: var(--text);
}

/* ============================================
   THEME SWITCHER (Desktop)
   ============================================ */
.theme-switcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--bg-surface) 70%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 40px;
}

.theme-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  padding: 0;
  background: none;
}

.theme-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 0.7rem;
  font-family: 'Space Grotesk', sans-serif;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 1px solid var(--border);
}

.theme-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.theme-btn .circle-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.theme-btn[data-theme="dark"] .circle-inner { background: #0a0a0f; }
.theme-btn[data-theme="light"] .circle-inner { background: #f5f5f5; border: 1px solid rgba(0,0,0,0.15); }
.theme-btn[data-theme="red"] .circle-inner { background: #e63946; }

.theme-btn.active {
  border-color: var(--switcher-ring);
  transform: scale(1.1);
}

.theme-btn:hover {
  transform: scale(1.15);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger .card:nth-child(1) { transition-delay: 0s; }
.reveal-stagger .card:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger .card:nth-child(3) { transition-delay: 0.2s; }

.reveal-stagger .team-member:nth-child(1) { transition-delay: 0s; }
.reveal-stagger .team-member:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger .team-member:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger .team-member:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger .team-member:nth-child(5) { transition-delay: 0.32s; }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .nav .lang-toggle {
    display: none;
  }

  .burger {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .theme-switcher {
    display: none;
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 100px 24px 60px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  section {
    padding: 72px 0;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .key-points {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .avatar {
    width: 60px;
    height: 60px;
    font-size: 1.05rem;
  }
}

/* --- Focus styles for accessibility --- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 200;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}
