/* Themes */
:root,
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #c41e3a;
  --accent-2: #0039a6;
  --border: rgba(15, 23, 42, 0.08);
  --glow: rgba(196, 30, 58, 0.15);
  --orb-1: rgba(0, 57, 166, 0.12);
  --orb-2: rgba(196, 30, 58, 0.1);
  --header-bg: rgba(255, 255, 255, 0.72);
  --card-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.15);
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-elevated: #1a222d;
  --text: #e8eef5;
  --text-muted: #94a3b8;
  --accent: #ff6b7a;
  --accent-2: #6b9fff;
  --border: rgba(255, 255, 255, 0.08);
  --glow: rgba(255, 107, 122, 0.2);
  --orb-1: rgba(107, 159, 255, 0.15);
  --orb-2: rgba(255, 107, 122, 0.12);
  --header-bg: rgba(15, 20, 25, 0.85);
  --card-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.5);
}

[data-theme="black"] {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --text: #fafafa;
  --text-muted: #737373;
  --accent: #ef4444;
  --accent-2: #3b82f6;
  --border: rgba(255, 255, 255, 0.06);
  --glow: rgba(239, 68, 68, 0.18);
  --orb-1: rgba(59, 130, 246, 0.08);
  --orb-2: rgba(239, 68, 68, 0.06);
  --header-bg: rgba(0, 0, 0, 0.92);
  --card-shadow: 0 0 0 1px var(--border), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.35s ease, color 0.25s ease;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bg-animated {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-mesh {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(ellipse 45% 35% at 20% 30%, var(--orb-1), transparent 55%),
    radial-gradient(ellipse 40% 38% at 85% 20%, var(--orb-2), transparent 50%),
    radial-gradient(ellipse 35% 40% at 50% 90%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 45%);
  animation: mesh-drift 28s ease-in-out infinite alternate;
  opacity: 0.95;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: grid-scroll 80s linear infinite;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 75%);
  opacity: 0.45;
}

.bg-orbs {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 20%, var(--orb-1), transparent),
    radial-gradient(ellipse 60% 40% at 90% 80%, var(--orb-2), transparent);
  animation: orbs-pulse 12s ease-in-out infinite;
}

.bg-shimmer {
  position: absolute;
  inset: -50% -50%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    color-mix(in srgb, var(--text) 6%, transparent) 48%,
    color-mix(in srgb, var(--accent) 12%, transparent) 50%,
    color-mix(in srgb, var(--text) 6%, transparent) 52%,
    transparent 60%
  );
  animation: shimmer-sweep 14s ease-in-out infinite;
  mix-blend-mode: overlay;
  opacity: 0.35;
}

@keyframes mesh-drift {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    transform: translate(-4%, 3%) rotate(4deg) scale(1.06);
  }
}

@keyframes grid-scroll {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 48px 48px, 48px 48px;
  }
}

@keyframes orbs-pulse {
  0%,
  100% {
    opacity: 1;
    filter: saturate(1);
  }
  50% {
    opacity: 0.88;
    filter: saturate(1.15);
  }
}

@keyframes shimmer-sweep {
  0% {
    transform: translateX(-35%) translateY(-10%) rotate(12deg);
  }
  50% {
    transform: translateX(25%) translateY(5%) rotate(12deg);
  }
  100% {
    transform: translateX(-35%) translateY(-10%) rotate(12deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-mesh,
  .bg-grid,
  .bg-orbs,
  .bg-shimmer {
    animation: none;
  }

  .globe__ring {
    animation: none;
  }

  .globe__core {
    animation: none;
  }
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
}

.logo__mark {
  color: var(--accent);
  font-size: 1rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: color 0.2s;
}

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

.theme-switcher {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.theme-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.15s, background 0.2s;
}

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

.theme-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px var(--glow);
}

main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.section {
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.section--card {
  background: var(--bg-elevated);
  margin: 0 -1rem;
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.section__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section__subtitle {
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 52ch;
  line-height: 1.6;
}

.section__subtitle a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.section__subtitle a:hover {
  color: var(--accent);
}

.section__subtitle code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 6%, var(--bg-elevated));
  border: 1px solid var(--border);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  min-height: min(70vh, 640px);
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 48ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #9f1239);
  color: #fff;
  box-shadow: 0 8px 28px var(--glow);
}

.btn--primary:hover {
  box-shadow: 0 12px 36px var(--glow);
}

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.globe {
  position: relative;
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

.globe__core {
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px var(--glow);
  animation: pulse-core 4s ease-in-out infinite;
}

.globe__ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--border);
  animation: spin 18s linear infinite;
}

.globe__ring--1 {
  width: 100%;
  height: 100%;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.globe__ring--2 {
  width: 78%;
  height: 78%;
  animation-duration: 12s;
  animation-direction: reverse;
  border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-core {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Timeline */
.timeline {
  display: grid;
  gap: 1.25rem;
}

.timeline__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  padding: 1.25rem;
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}

.timeline__item:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  transform: translateX(4px);
}

.timeline__year {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

.timeline__item p {
  margin: 0;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Stats */
.grid--stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border-radius: 18px;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s;
}

.stat-card:hover {
  box-shadow: var(--card-shadow);
}

.stat-card__value {
  display: block;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card__label {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.party-block p {
  margin: 0;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 65ch;
}

.product-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.chip {
  padding: 0.55rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

.chip:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
}

/* Navigator */
.section--navigator {
  padding-bottom: 2rem;
}

.search-wrap {
  margin-bottom: 1.25rem;
}

.svc-search {
  width: 100%;
  max-width: 420px;
  padding: 0.85rem 1.1rem;
  font: inherit;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.svc-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--card-shadow);
}

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

.service-card__icon {
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

.service-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.service-card__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.service-card.is-hidden {
  display: none;
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer__copy {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
}

.footer__note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Gallery (Wikimedia) */
.section--gallery .photo-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  grid-auto-rows: minmax(220px, auto);
}

.photo-card {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--card-shadow);
  min-height: 220px;
}

@media (min-width: 720px) {
  .section--gallery .photo-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(200px, 1fr);
  }

  .photo-card--wide {
    grid-column: 1 / -1;
  }

  .photo-card--lg {
    grid-column: 1 / -1;
    min-height: 320px;
  }

  .photo-card--tall {
    grid-row: span 1;
    min-height: 280px;
  }
}

@media (min-width: 960px) {
  .section--gallery .photo-bento {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(160px, 1fr);
  }

  .photo-card--moscow {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    min-height: 0;
  }

  .photo-card--spb {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
  }

  .photo-card--kazan {
    grid-column: 3 / 5;
    grid-row: 2 / 3;
  }

  .photo-card--baikal {
    grid-column: 1 / 3;
    grid-row: 3 / 5;
    min-height: 0;
  }

  .photo-card--vlad {
    grid-column: 3 / 5;
    grid-row: 3 / 5;
  }

  .photo-card--sochi {
    grid-column: 1 / -1;
    grid-row: 5 / 6;
    min-height: 260px;
  }
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-card:hover img {
  transform: scale(1.06);
}

.photo-card figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.1rem 0.9rem;
  background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 92%, transparent));
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.photo-card figcaption a {
  color: var(--text);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
}

.photo-card figcaption a:hover {
  color: var(--accent);
}

.photo-card__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Video block */
.video-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--card-shadow);
  aspect-ratio: 16 / 9;
}

.video-player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-attrib {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.video-attrib a {
  color: var(--accent-2);
  font-weight: 600;
}

.video-attrib a:hover {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .photo-card img {
    transition: none;
  }

  .photo-card:hover img {
    transform: none;
  }
}
