/* ============================================================
   TAKEOVER STUDIOS — website v5
   Dark · solid · mature. Archivo + DM Mono. Solid purple, no gradients.
   Games: drag / edge-arrows to scroll (no scrollbar, no auto-rotate),
   ordered by CCU. Capabilities ticker for "what we do".
   ============================================================ */

:root {
  --bg: #0B0C10;
  --surface: #15161D;
  --surface-2: #1E1F29;
  --text: #F3F2EE;
  --muted: #9A9AA6;
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);

  --purple: #7C3AED;
  --purple-deep: #6D28D9;
  --live: #22C55E;

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1320px;
  --gut: clamp(1.25rem, 5.5vw, 6rem);
  --sec-y: clamp(4rem, 10vh, 8rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: clamp(1rem, 0.9vw + 0.7rem, 1.16rem); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 800; }
.mono { font-family: var(--mono); font-weight: 400; letter-spacing: 0.02em; font-feature-settings: "tnum" 1; }
.accent { color: var(--purple); }

.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.06; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.live-dot {
  display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--live);
  margin-right: 0.45em; vertical-align: 0.04em;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 70%, transparent); animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 70% { box-shadow: 0 0 0 0.5em transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gut); background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.4s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.wordmark { font-family: var(--mono); font-weight: 500; font-size: 1.15rem; letter-spacing: 0.05em; text-transform: uppercase; }
.wordmark .slash { color: var(--purple); }
.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
.nav-links a { font-size: 0.82rem; text-transform: uppercase; color: var(--muted); position: relative; padding: 0.2rem 0; transition: color 0.25s var(--ease); }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 1.5px; background: var(--purple); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

/* HERO (compact) */
.hero { position: relative; padding: clamp(2.4rem, 7vh, 4.5rem) var(--gut) clamp(2rem, 5vh, 3.2rem); overflow: hidden; }
.hero-inner { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.hero-glow {
  position: absolute; z-index: 1; top: -20%; right: -10%; width: 60%; height: 130%;
  pointer-events: none; filter: blur(90px); opacity: 0.45;
  background: radial-gradient(45% 50% at 65% 40%, color-mix(in srgb, var(--purple) 55%, transparent), transparent 72%);
}
.tag { font-size: clamp(0.7rem, 1.3vw, 0.82rem); letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin: 0 0 clamp(1rem, 2.5vw, 1.6rem); }
.hero-title { font-weight: 900; font-size: clamp(2.6rem, 9vw, 7rem); line-height: 0.96; letter-spacing: -0.03em; }
.hero-title .line { display: block; }
.hero-kicker { margin: clamp(1.3rem, 3vw, 1.9rem) 0 0; max-width: 40ch; font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.45; color: var(--muted); }

.stats-strip { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(0.9rem, 2.5vw, 2rem); margin-top: clamp(1.6rem, 4vw, 2.4rem); }
.sstat { display: flex; align-items: baseline; gap: 0.5rem; }
.sstat b { font-weight: 800; font-size: clamp(1.5rem, 3.2vw, 2.2rem); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.sstat:first-child b { color: var(--purple); }
.sstat span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.sdiv { width: 1px; height: 1.6rem; background: var(--line-2); }

/* BLOCKS */
.block { max-width: var(--maxw); margin: 0 auto; padding: var(--sec-y) var(--gut); }
.marker { font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0; }
.marker .num { color: var(--text); }
.big { font-weight: 800; font-size: clamp(2rem, 5.5vw, 3.8rem); line-height: 1.04; letter-spacing: -0.025em; margin-top: clamp(1.2rem, 3vw, 2rem); max-width: 18ch; }

/* 01 — GAMES */
.games-sec { max-width: var(--maxw); margin: 0 auto; padding: clamp(1.5rem, 4vh, 3rem) 0 var(--sec-y); }
.games-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0 var(--gut); margin-bottom: clamp(1.4rem, 3.5vw, 2.2rem); }
.games-sub { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

.carousel-wrap { position: relative; }
.carousel {
  overflow-x: auto; overflow-y: hidden; cursor: grab; overscroll-behavior-x: contain;
  padding: 0.4rem var(--gut) 0.6rem; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel.dragging { cursor: grabbing; }
.carousel.dragging a { pointer-events: none; }
.carousel-track { display: flex; gap: clamp(1rem, 2vw, 1.4rem); width: max-content; }

.gcard { flex: 0 0 auto; width: clamp(280px, 80vw, 340px); }
.gcard a {
  display: flex; flex-direction: column; height: 100%; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.gcard a:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--purple) 70%, transparent); box-shadow: 0 22px 50px -26px color-mix(in srgb, var(--purple) 80%, transparent); }
.gcard-banner { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.gcard-banner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); user-select: none; }
.gcard a:hover .gcard-banner img { transform: scale(1.06); }
.gcard-body { padding: clamp(1rem, 2vw, 1.3rem); display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.gcard-name { font-weight: 700; font-size: 1.35rem; line-height: 1.1; letter-spacing: -0.01em; }
.gcard-stat { font-size: 0.82rem; color: var(--muted); }
.gcard-stat b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.gcard-play {
  margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem; border-radius: 999px; background: var(--purple); color: #fff;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; transition: background 0.3s var(--ease);
}
.gcard a:hover .gcard-play { background: var(--purple-deep); }
.gcard-play .arr { transition: transform 0.3s var(--ease); }
.gcard a:hover .gcard-play .arr { transform: translate(2px, -2px); }

/* edge scroll affordances (transparent fade + chevron) */
.edge {
  position: absolute; top: 0; bottom: 0; width: clamp(66px, 13vw, 150px);
  display: flex; align-items: center; border: 0; background: transparent; cursor: pointer;
  padding: 0 clamp(0.6rem, 2vw, 1.5rem); z-index: 6; opacity: 1; transition: opacity 0.35s var(--ease);
}
.edge-right { right: 0; justify-content: flex-end; background: linear-gradient(to right, transparent, var(--bg) 72%); }
.edge-left  { left: 0;  justify-content: flex-start; background: linear-gradient(to left, transparent, var(--bg) 72%); }
.edge .chev {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 78%, transparent); border: 1px solid var(--line-2);
  color: var(--text); font-size: 1.5rem; line-height: 1; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.edge:hover .chev { background: var(--purple); border-color: var(--purple); transform: scale(1.07); }
.carousel-wrap.at-start .edge-left { opacity: 0; pointer-events: none; }
.carousel-wrap.at-end .edge-right { opacity: 0; pointer-events: none; }

/* 02 — WHAT WE DO (capabilities ticker) */
.work { border-top: 1px solid var(--line); padding: var(--sec-y) 0; }
.work-head { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut) clamp(2rem, 5vw, 3rem); }
.cap-marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(1rem, 2.5vw, 1.5rem) 0; white-space: nowrap; }
.cap-track { display: inline-flex; align-items: center; animation: capscroll 34s linear infinite; }
.cap { font-weight: 800; font-size: clamp(1.4rem, 3.4vw, 2.4rem); letter-spacing: -0.01em; padding: 0 clamp(1rem, 2.5vw, 1.8rem); color: var(--text); }
.dia { color: var(--purple); font-size: clamp(0.7rem, 1.4vw, 0.95rem); }
@keyframes capscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 03 — PARTNERS (real brand logos on brand-tinted cards) */
.partners { border-top: 1px solid var(--line); }
.partner-logos {
  margin-top: clamp(2rem, 5vw, 3rem); display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.7rem, 1.5vw, 1.1rem);
}
.partner-logos li { --brand: var(--purple); display: grid; }
.plogo {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: clamp(104px, 13vw, 140px); padding: 1.6rem 1.4rem; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 16px;
  background:
    radial-gradient(135% 120% at 50% -10%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 68%),
    var(--surface);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease),
              box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
/* always-visible brand glow in the corner so each card reads as that brand */
.plogo::after {
  content: ""; position: absolute; right: -28%; bottom: -64%; width: 66%; height: 128%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 30%, transparent), transparent);
  opacity: 0.32; pointer-events: none; transition: opacity 0.4s var(--ease);
}
.plogo img {
  position: relative; z-index: 1;
  max-height: clamp(30px, 4.6vw, 46px); max-width: 80%; width: auto; height: auto;
  object-fit: contain; opacity: 0.95;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.plogo:hover, .plogo:focus-visible {
  outline: none; transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--brand) 62%, transparent);
  background:
    radial-gradient(135% 120% at 50% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 68%),
    var(--surface);
  box-shadow: 0 24px 54px -26px color-mix(in srgb, var(--brand) 85%, transparent);
}
.plogo:hover img, .plogo:focus-visible img { opacity: 1; transform: scale(1.05); }
.plogo:hover::after, .plogo:focus-visible::after { opacity: 0.6; }

/* FOOTER */
.footer { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.4rem, 6vw, 3.4rem) var(--gut); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.wordmark.sm { font-size: 1rem; }
.foot-links { display: flex; gap: 1.3rem; margin-left: auto; }
.foot-links a { font-size: 0.8rem; text-transform: uppercase; color: var(--muted); transition: color 0.25s var(--ease); }
.foot-links a:hover { color: var(--text); }
.copy { flex-basis: 100%; margin: 0.3rem 0 0; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: color-mix(in srgb, var(--muted) 85%, transparent); }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 760px) { .partner-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.74rem; }
  .foot-links { margin-left: 0; flex-basis: 100%; }
  .edge { width: 56px; }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .live-dot, .cap-track { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
