/*
 * Viktoriia — event landing page (business card destination)
 * Uses ../css/tokens.css. This file: page reset + hero.
 * Sections beyond the hero are added incrementally — see index.html.
 */

:root {
  /* This page's accent: mutekigroup.com's real button/link color, read live
     off the site (rgb(91,79,232)) — not tokens.css's brand-doc blue, which
     doesn't match production. #5B4FE8 is ~5.6:1 both as text-on-white and
     white-on-fill, so it works directly for buttons, links, eyebrows and
     the active tab state without a separate accessibility step-down. */
  --color-purple: #5B4FE8;

  /* On the page's DARK sections (hero/About), #5B4FE8 itself drops to
     ~3.3:1 against #111111 — fine for large text (stat numbers) but not
     for small text (eyebrows), which need 4.5:1. This lighter tint covers
     those small-on-dark spots; keep --color-purple everywhere else so the
     page reads as one consistent accent, not two different purples. */
  --color-purple-bright: #9B8FFF; /* ~6.9:1 on #111111 */

  /* Local override of tokens.css's shared quad-line gradient — its third
     segment was brand blue; swapped to this page's purple accent so the
     bar, the small logo mark and the buttons all agree. Scoped to this
     page only; tokens.css itself is shared with the main site build. */
  --quad-line-gradient: linear-gradient(
    to right,
    #E53935 0% 25%,
    #FDD835 25% 50%,
    #5B4FE8 50% 75%,
    #111111 75% 100%
  );
}

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

html {
  font-family: var(--font-primary);
  background: var(--color-bg-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Hero ────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--color-bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Base utility — referenced (but never defined) on the hero's bar until
   now, so it rendered invisible; also used by the CTA band below. */
.quad-line {
  width: 100%;
  height: 4px;
  background: var(--quad-line-gradient);
  flex-shrink: 0;
}

.hero-quad-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Bottom-anchors the now-nested .hero-content (video/scrim/sound-toggle
     are all position:absolute, so hero-content is the only normal-flow
     child) — this used to be .hero's job when hero-content was its
     direct sibling; now it belongs to whichever element IS the visible
     video box, so it still works once that box shrinks to a card on
     desktop instead of staying full-bleed. */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-video {
  /* Out of flow (like the scrim) so it fills the wrap independently of
     flex sizing — it must NOT be a flex item alongside .hero-content, or
     the two compete for the column's main-axis space and the video
     overflows/clips (found while making the wrap a flex container for
     the desktop card: video came out sized to 100% height as intended,
     but so did it PLUS content's own height, and justify-content:
     flex-end pushed the combined overflow off the top edge, clipping
     most of the video). */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--color-bg-dark);
}

/* Build-time placeholder: shows only while assets/video/hero-*.mp4 are
   missing, so the hero never ships as a silent black box. Remove concern
   once real footage is in place — the video element then paints over it. */
.hero--no-video .hero-video-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(91, 79, 232, 0.35), transparent 55%),
    radial-gradient(circle at 75% 75%, rgba(229, 57, 53, 0.25), transparent 50%),
    #111111;
}

.hero--no-video .hero-video-wrap::after {
  content: "Drop hero-vertical.mp4 / hero-landscape.mp4 into assets/video/";
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.55);
}

.hero--no-video .hero-video { visibility: hidden; }

/* Bottom scrim: guarantees AA contrast for overlaid text regardless of footage */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(17, 17, 17, 0) 0%,
    rgba(17, 17, 17, 0) 40%,
    rgba(17, 17, 17, 0.55) 68%,
    rgba(17, 17, 17, 0.92) 100%
  );
  pointer-events: none;
}

/* Sound toggle — top-right, always reachable, thumb-safe on mobile too */
.sound-toggle {
  position: absolute;
  top: max(var(--space-4), env(safe-area-inset-top));
  right: var(--space-4);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-3);
  background: rgba(17, 17, 17, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--color-text-inverse);
  transition: background var(--transition);
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  background: rgba(17, 17, 17, 0.7);
}

.sound-toggle-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.icon-unmuted { display: none; }
.sound-toggle[aria-pressed="true"] .icon-muted { display: none; }
.sound-toggle[aria-pressed="true"] .icon-unmuted { display: block; }
.sound-toggle[aria-pressed="true"] .sound-toggle-label::after { content: "On"; }
.sound-toggle[aria-pressed="false"] .sound-toggle-label::after { content: "Tap for sound"; }
.sound-toggle .sound-toggle-label { font-size: 0; }
.sound-toggle .sound-toggle-label::after { font-size: var(--text-xs); }

/* Content overlay, bottom-anchored */
.hero-content {
  position: relative;
  z-index: 3;
  padding: var(--space-6) var(--space-5) var(--space-10);
  padding-bottom: max(var(--space-10), calc(var(--space-6) + env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 640px;
}

.event-tag[hidden] { display: none; }

.event-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: fit-content;
  padding: 5px var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.9);
}

.event-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-red);
  flex-shrink: 0;
}

.hero-person {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.logo-mark { margin-bottom: var(--space-2); }

.hero-name {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  color: var(--color-text-inverse);
}

.hero-title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.75);
}

.hero-pitch {
  font-size: var(--text-lg);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: rgba(255, 255, 255, 0.92);
  max-width: 46ch;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--button-height);
  padding: 0 var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--color-purple);
  color: var(--color-text-inverse);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #4638c4; /* darker step of --color-purple */
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-inverse);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  display: none; /* shown on landscape/desktop where content doesn't hug the bottom edge */
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

/* ─── Services ────────────────────────────────────────────────────────── */
/* var(--color-bg-alt) (light grey, not pure white) so this section reads
   as distinct from the Stages section right after it — both are "light"
   but shouldn't blur into one block with no seam. */

.services {
  background: var(--color-bg-alt);
  color: var(--color-text-body);
  padding: var(--space-16) var(--space-5);
}

.services-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.service-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  padding: var(--space-6);
}

.service-num {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.service-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-extrabold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.service-desc {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-body);
}

@media (min-width: 640px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  /* auto-fit, not a fixed repeat(4|5) — with 5 cards, a fixed 4-column
     track would strand the 5th card alone in a mostly-empty row. This
     wraps cleanly at 5-per-row on wide screens and 3/4-per-row narrower,
     and won't need touching again if a service is added or removed. */
  .service-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ─── Stage picker ────────────────────────────────────────────────────── */
/* Light canvas here (vs. the dark hero) — matches the rest of the brand's
   pages, and gives the one interactive moment on this page room to read
   as a real UI, not more overlay-on-video text. */

.stages {
  background: var(--color-bg-page);
  color: var(--color-text-body);
  padding: var(--space-16) var(--space-5);
}

.stages-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-purple);
  margin-bottom: var(--space-2);
}

.section-heading {
  font-size: clamp(1.5rem, 4vw, var(--text-3xl));
  font-weight: var(--weight-extrabold);
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-8);
}

/* Tabs */
.stage-picker {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}

.stage-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}

.stage-tab:hover { border-color: var(--color-purple); }

.stage-tab-num {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.stage-tab-label {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text);
}

.stage-tab[aria-selected="true"] {
  background: var(--color-purple);
  border-color: var(--color-purple);
}

.stage-tab[aria-selected="true"] .stage-tab-num,
.stage-tab[aria-selected="true"] .stage-tab-label {
  color: var(--color-text-inverse);
}

/* Detail: stacked on mobile, two columns on desktop */
.stage-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.stage-hook {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
}

.stage-model {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-base);
  color: var(--color-text-body);
}

.stage-model-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

/* Case study card */
.case-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.case-card-border-accent {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--color-purple);
}

.case-card-body {
  padding: var(--space-6) var(--space-6) var(--space-6) calc(var(--space-6) + 4px);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Fixed-height box so SRG (square), CodeRed (wide wordmark) and ResquadAI
   (square, solid-color) all sit at the same visual scale regardless of
   their native aspect ratio. */
.case-card-logo {
  height: 32px;
  margin-bottom: var(--space-1);
}

.case-card-logo img {
  height: 100%;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.case-card-eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-purple);
}

.case-card-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-text);
}

.case-card-country {
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}

.case-card-outcome {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-body);
}

.case-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--color-bg-pill);
  border: 1px solid var(--color-border);
  color: var(--color-text-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

@media (min-width: 900px) {
  .stage-detail {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-12);
  }

  .stage-detail-text { flex: 0 0 40%; }
  .case-card { flex: 1; }
}

/* ─── Desktop (≥ 900px): centered portrait card, not a full-bleed crop ── */
/* Only a vertical (9:16) cut exists (see the comment on the <video> in
   index.html). Stretching that to fill a wide viewport via object-fit:
   cover crops it to a tight chin-to-hairline shot — the earlier approach.
   Until a real landscape cut exists, the honest fix is to stop pretending
   it's a wide shot: show the full vertical frame at a sane size, centered
   in the dark viewport, like a phone mockup. Swap this block for a real
   two-column (text left / video right) layout once landscape footage
   lands — that was the original intent, still right for real 16:9 footage. */
@media (min-width: 900px) {
  .hero {
    align-items: center;
    justify-content: center;
    height: 100vh;
  }

  .hero-video-wrap {
    position: relative;
    inset: auto;
    /* Height-driven, not width-driven: caps the card's height and lets
       aspect-ratio derive the width, so it can never distort. (A
       width + aspect-ratio + max-height combo can — max-height clamps
       the height without re-deriving width from it.) */
    width: auto;
    height: min(80vh, 760px);
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  }

  .scroll-cue { display: flex; }
}

/* ─── About ───────────────────────────────────────────────────────────── */
/* Dark canvas again (bookends the light Stages section, echoes the hero) —
   the "CTA section, dark blocks" alternation described in the tokens file. */

.about {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  padding: var(--space-16) var(--space-5);
}

.about-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* --color-purple reads too dark on this section's dark background
   (that's why --color-purple-bright exists — see :root comment); use the
   brighter tint here, which clears 4.5:1 on #111111. */
.about .section-eyebrow {
  color: var(--color-purple-bright);
}

.about-copy {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: var(--space-10);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8) var(--space-4);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-number {
  font-size: clamp(1.75rem, 5vw, var(--text-4xl));
  font-weight: var(--weight-extrabold);
  color: var(--color-purple-bright);
  line-height: var(--leading-tight);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 900px) {
  .about { padding: var(--space-20) var(--space-16); }
  .about-inner { max-width: var(--max-width); }
  .about-copy { font-size: var(--text-xl); max-width: 65ch; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Closing CTA band ───────────────────────────────────────────────── */

.cta-band {
  background: #0a0a0a;
  color: var(--color-text-inverse);
  padding: 0 var(--space-5) var(--space-10);
  text-align: center;
}

/* Sits flush on the section boundary (no padding above it) so it reads as
   a divider BETWEEN sections, not as an element floating inside this one. */
.cta-band .quad-line {
  margin-bottom: var(--space-16);
}

.cta-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-heading {
  font-size: clamp(1.75rem, 5vw, var(--text-4xl));
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

.cta-sub {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--space-8);
}

.cta-band .btn-primary {
  margin-bottom: var(--space-10);
}

.social-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  margin-bottom: var(--space-12);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--transition);
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--color-text-inverse);
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--color-text-inverse);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.brand-wordmark {
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.cta-footer-note {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.02em;
}

@media (min-width: 640px) {
  .social-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-6);
  }
}
