/* CODEBREAKERS site styles. White header per the reference, black brand pages below. */

:root {
  color-scheme: dark;

  --bg: #050507;
  --panel: #0d0d11;
  --line: #26262e;
  --text: #f4f4f6;
  --muted: #a8a8b3;

  --purple: #7a12c4;      /* Watch Live, from the reference */
  --ink: #111114;         /* header text on white */

  --league: #ff3b5f;
  --esports: #b27cf0;
  --rising: #d6d1a6;
  --creators: #00e1ff;

  --accent: var(--purple);
  --accent-text: var(--esports);

  --header-h: 92px;
  --gutter: clamp(16px, 4vw, 56px);
  --wrap: 1320px;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-x: clip;
}
img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-inline: clamp(16px, 2.2vw, 44px);
  background: #fff;
  color: var(--ink);
  font-size: clamp(.875rem, .55rem + .42vw, 1rem);
}
.logo { display: block; justify-self: center; }
.logo img { width: clamp(190px, 15vw, 300px); height: auto; }

.nav-main { display: flex; align-items: center; gap: clamp(12px, calc(2.6vw - 20px), 26px); }
.nav-main a, .nav-main button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 0;
  background: none; border: 0;
  border-bottom: 2px solid transparent;
  color: inherit; font: inherit; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.nav-main > a:hover, .nav-main button:hover { border-bottom-color: #b9b9c2; }
.nav-main .is-active { border-bottom-color: var(--ink); }
.caret { width: 9px; height: 9px; transition: transform .15s; }

.nav-drop { position: relative; }
.nav-drop__menu {
  position: absolute; top: 100%; left: -16px;
  display: none; min-width: 210px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgb(0 0 0 / .22);
}
.nav-drop__menu a { display: block; padding: 9px 10px; border: 0; }
.nav-drop__menu a:hover, .nav-drop__menu a.is-current { background: #f0f0f4; }
.nav-drop.is-open .nav-drop__menu { display: block; }
.nav-drop.is-open .caret { transform: rotate(180deg); }
@media (hover: hover) {
  .nav-drop:hover .nav-drop__menu { display: block; }
}

.header-right { display: flex; align-items: stretch; justify-content: flex-end; gap: clamp(12px, 1.6vw, 28px); height: 100%; }
.header-login {
  align-self: center;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  color: inherit; white-space: nowrap; text-decoration: none;
}
.header-login:hover { border-bottom-color: #b9b9c2; }
.header-login.is-active { border-bottom-color: var(--ink); }
.socials { display: flex; align-items: center; gap: 4px; }
.socials a {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  color: inherit;
  transition: color .15s, transform .15s;
}
.socials a:hover { color: var(--purple); transform: translateY(-1px); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.socials svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; }

.watch-live {
  display: flex; align-items: center; justify-content: center;
  align-self: center;
  height: calc(var(--header-h) - 30px);
  padding-inline: clamp(18px, 2.6vw, 44px);
  border-bottom: 3px solid var(--purple);
  color: var(--purple);
  font-weight: 700; white-space: nowrap; text-decoration: none;
  transition: background .15s, color .15s;
}
.watch-live:hover { background: var(--purple); color: #fff; }

.menu-toggle { display: none; }

/* Below this width the nav folds into a menu; the logo stays centred. */
@media (max-width: 1279px) {
  :root { --header-h: 72px; }
  .site-header { gap: 12px; font-size: 1rem; }
  .header-login { display: none; }
  .menu-toggle {
    display: grid; place-items: center;
    width: 44px; height: 44px; margin-left: -8px;
    background: none; border: 0; color: inherit; cursor: pointer;
    justify-self: start;
  }
  .menu-toggle svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; }
  .logo img { width: clamp(150px, 34vw, 240px); }
  .header-right .socials { display: none; }
  .watch-live { height: 44px; padding-inline: 10px; }

  .nav-main {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px;
    max-height: calc(100svh - var(--header-h)); overflow-y: auto;
    background: #fff;
    box-shadow: 0 16px 30px rgb(0 0 0 / .3);
    font-size: 1.125rem;
  }
  .nav-main.is-open { display: flex; }
  .nav-main > a, .nav-drop > button { width: 100%; padding: 12px 0; border-bottom: 1px solid #e6e6ec; }
  .nav-main .is-active { border-bottom-color: #e6e6ec; color: var(--purple); font-weight: 600; }
  .nav-drop__menu { position: static; min-width: 0; padding: 4px 0 8px 14px; box-shadow: none; }
  .nav-drop:hover .nav-drop__menu { display: none; }
  .nav-drop.is-open .nav-drop__menu { display: block; }
  .nav-main .socials { display: flex; flex-wrap: wrap; padding-top: 14px; }
}
@media (min-width: 1280px) {
  .nav-main .nav-login, .nav-main .socials { display: none; }
  .header-right .socials { display: flex; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: calc(100svh - var(--header-h));
  width: 100%;
  overflow: hidden;
}
.hero video { width: 100%; height: 100%; object-fit: cover; }
.hero__pause {
  position: absolute; right: 16px; bottom: 16px;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  background: rgb(0 0 0 / .55); border: 1px solid rgb(255 255 255 / .35);
  color: #fff; cursor: pointer;
}
.hero__pause:hover { background: rgb(0 0 0 / .8); }
.hero__pause svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Layout ---------- */

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { position: relative; padding-block: clamp(56px, 8vw, 112px); }
.section + .section { border-top: 1px solid var(--line); }
.section--shards { isolation: isolate; }
.section--shards::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url(shards.svg) center / cover no-repeat;
  opacity: .85;
}
.theme-league   { --accent: #d3163a; --accent-text: var(--league); }
.theme-esports  { --accent: var(--purple); --accent-text: var(--esports); }
.theme-rising   { --accent: #8d8960; --accent-text: var(--rising); }
.theme-creators { --accent: #008ea3; --accent-text: var(--creators); }

.display {
  font-family: var(--display);
  font-style: italic; font-weight: 800;
  line-height: .95; letter-spacing: -.005em;
  text-transform: uppercase;
}
.display--xl { font-size: clamp(3rem, 8vw, 6.75rem); }
.display--lg { font-size: clamp(2.5rem, 5.5vw, 4.75rem); }
.display--md { font-size: clamp(1.75rem, 3vw, 2.5rem); }

.lede { max-width: 62ch; color: #d9d9e0; }
.lede + .lede { margin-top: 1em; }
.meta { font: 500 .8125rem/1.5 var(--mono); color: var(--muted); }
.accent { color: var(--accent-text); }

.sec-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(24px, 3.4vw, 44px);
}
.wordmark { width: min(100%, var(--w, 720px)); }

.split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.split > * { min-width: 0; }
.stack > * + * { margin-top: 1.25rem; }
.split--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 860px) { .split, .split--flip { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: .55em 1.5em;
  background: var(--accent); color: #fff;
  border: 2px solid var(--accent);
  font: italic 800 1.3125rem/1.1 var(--display);
  letter-spacing: .01em; text-transform: uppercase; text-decoration: none;
  transform: skewX(-10deg);
  transition: background .15s, border-color .15s, color .15s;
}
.btn > span { display: block; transform: skewX(10deg); }
.btn:hover { background: #fff; border-color: #fff; color: #000; }
.btn--ghost { background: transparent; border-color: rgb(255 255 255 / .45); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px 14px; }

.text-link {
  font: 500 .875rem/1.4 var(--mono); color: var(--accent-text);
  text-decoration: none; white-space: nowrap;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Status band ---------- */

.status { background: #d3163a; color: #fff; }
.status__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 32px; padding-block: 18px;
}
.status p { font: italic 700 clamp(1.1875rem, 2vw, 1.625rem)/1.15 var(--display); text-transform: uppercase; }
.status a {
  flex: none;
  font: 500 .875rem/1.4 var(--mono); color: #fff;
  text-underline-offset: 3px;
}

/* ---------- Stats ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stats > div { padding: clamp(20px, 3vw, 36px) var(--gutter); background: var(--bg); }
.stats b { display: block; font: italic 800 clamp(2.25rem, 5vw, 4rem)/1 var(--display); }
.stats span { display: block; margin-top: 8px; font: 500 .8125rem/1.4 var(--mono); color: var(--muted); }
@media (max-width: 640px) { .stats { grid-template-columns: minmax(0, 1fr); } }

/* ---------- League cards ---------- */

.leagues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
@media (max-width: 720px) { .leagues { grid-template-columns: minmax(0, 1fr); } }
.league-card { display: block; background: var(--panel); color: inherit; text-decoration: none; }
.league-card img.banner { width: 100%; aspect-ratio: 25 / 8; object-fit: cover; }
.league-card__body { padding: 18px 20px 22px; }
.league-card .wordmark { --w: 320px; }
a.league-card:hover .banner { filter: brightness(1.2); }

/* ---------- Results ---------- */

.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.results--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1040px) { .results--four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .results, .results--four { grid-template-columns: minmax(0, 1fr); } }
.result { background: var(--panel); min-width: 0; }
.result img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #111; }
.result__body { padding: 12px 16px 16px; }
.result__body h3 { font: italic 800 1.625rem/1.1 var(--display); text-transform: uppercase; }
.result__body .code { color: var(--accent-text); font: 600 .8125rem/1.4 var(--mono); }
.result--wide {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 40px;
  padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 40px);
  background: url(shards.svg) center / cover no-repeat, #0a0a0d;
}
.result--wide .result__body { padding: 0; }

.results--three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) { .results--three { grid-template-columns: minmax(0, 1fr); max-width: 640px; } }
.placing { margin-top: 12px; }
.placing img { aspect-ratio: 1920 / 531; margin-top: 4px; }

/* ---------- Video links ---------- */

.video-link { position: relative; display: block; background: #000; color: #fff; text-decoration: none; }
.video-link img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .82; transition: opacity .15s; }
.video-link:hover img { opacity: 1; }
.video-link::before {
  content: ""; position: absolute; z-index: 1; left: 50%; top: 50%;
  width: 60px; height: 60px; margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: rgb(0 0 0 / .68);
  transition: background .15s;
}
.video-link:hover::before { background: var(--accent); }
.video-link::after {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 24px; height: 26px; margin: -13px 0 0 -9px;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.video-label { margin-bottom: 8px; }
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .video-grid { grid-template-columns: minmax(0, 1fr); } }
.video-grid--single { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.video-caption { margin-top: 8px; }

/* ---------- Embeds ---------- */

.embed { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed__fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; }
.bracket-frame { width: 100%; height: calc(100svh - var(--header-h) - 88px); min-height: 620px; border: 1px solid var(--line); background: #08090c; }

/* ---------- Rosters ---------- */

.roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 20px); }
.roster--three { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 75%); margin-inline: auto; }
@media (max-width: 860px) {
  .roster, .roster--three { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}
.roster img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #111; transition: transform .2s; }
.roster figure:hover img { transform: translateY(-4px); }
.team-banner { width: min(100%, 780px); margin-bottom: clamp(20px, 3vw, 36px); }

/* ---------- People rows (creators and staff) ---------- */

.person {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(20px, 4vw, 56px); align-items: start;
}
.person + .person { margin-top: clamp(40px, 6vw, 72px); padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.person__card { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #111; }
.person__role { margin-top: 6px; color: var(--accent-text); font: 500 .875rem/1.5 var(--mono); }
.person__links { margin-block: 14px 20px; padding-block: 12px; border-block: 1px solid var(--line); font: 500 .8125rem/1.9 var(--mono); }
.person__links a { text-decoration: none; }
.person__links a:hover { color: var(--accent-text); }
.person__links .sep { padding-inline: .55em; color: #5c5c66; }
@media (max-width: 720px) {
  .person { grid-template-columns: minmax(0, 1fr); }
  .person__card { max-width: 420px; }
}

.staff-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px) clamp(14px, 2vw, 24px); }
@media (max-width: 1100px) { .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .staff-grid { grid-template-columns: minmax(0, 1fr); } }
.staff-card img.card { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #111; }
.staff-card h3 { margin-top: 14px; }
.staff-card .person__links { margin-block: 10px 14px; }

/* ---------- Page heads and CTA ---------- */

.page-banner { background: #000; }
.page-banner img { width: 100%; aspect-ratio: 25 / 8; object-fit: cover; }
.page-head { padding-block: clamp(44px, 7vw, 88px) clamp(28px, 4vw, 48px); }
.section--fill { display: grid; align-content: center; min-height: calc(100svh - var(--header-h) - 190px); }

.cta { text-align: center; }
.cta .btn-row { justify-content: center; margin-top: 24px; }

.contact-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 18px;
  background: var(--panel); border: 1px solid var(--line);
  font: italic 800 1.375rem/1 var(--display); text-transform: uppercase; text-decoration: none;
  transition: border-color .15s, color .15s;
}
.contact-list a:hover { border-color: var(--accent-text); color: var(--accent-text); }
.contact-list svg { flex: none; width: 22px; height: 22px; fill: currentColor; }
.contact-list svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: #000; }
.site-footer__inner {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px 48px; align-items: center;
  padding-block: 36px;
}
.site-footer img { width: 118px; margin: -12px 0 -12px -10px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .9375rem; }
.site-footer nav a { text-decoration: none; color: #d9d9e0; }
.site-footer nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer .socials a:hover { color: var(--esports); }
.site-footer__line {
  grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line);
  font: 500 .75rem/1.5 var(--mono); color: var(--muted);
}
@media (max-width: 820px) {
  .site-footer__inner { grid-template-columns: minmax(0, 1fr); }
  .site-footer .socials { flex-wrap: wrap; margin-left: -8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
