/*
  Responsibility:
    Global theme tokens and base layout styles shared across the site.
    Applies page-wide background (gradient) to <body>. Surfaces (header, footer, cards)
    use solid colours. Provides utilities for theme-based element swapping.

  Notes:
    - Do not reuse --page-bg on components; it is only for the page backdrop.
    - Components/surfaces should use --bg / --card-bg.
    - --card-border is used by card UIs (see home.css).
    - Fonts: Quantico for headings; Exo 2 for body.
*/

/* ---------- Custom Fonts ---------- */
@font-face {
  font-family: "Quantico";
  src: url("../fonts/Quantico/Quantico-Regular.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
}

@font-face {
  font-family: "Exo 2";
  src: url("../fonts/Exo_2/static/Exo2-Light.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
}

/* ---------- Theme tokens ---------- */
:root {
  /* Light theme */
  --bg: #f6f6f6;                 /* surface (cards, buttons, etc.) */
  --page-bg: linear-gradient(to bottom, #ffffff 0%, #c5d0d9 100%); /* page backdrop */
  --text: #414141;
  --card-bg: #ffffff;
  --border: #d9d9d9;
  --card-border: #001526;        /* light mode card border */
  --link: #0a58ca;

  /* Layout */
  --pad: 14px;
  --max: 1100px;
  --logo-size: 180px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  /* Dark theme */
  --bg: #151515;                 /* surface (cards, buttons, etc.) */
  --page-bg: linear-gradient(to top, #111111 0%, #3a3a3a 100%);   /* page backdrop */
  --text: #eaeaea;
  --card-bg: #151515;
  --border: #333333;
  --card-border: #ffffff;        /* white border in dark mode */
  --link: #7ab0ff;

  color-scheme: dark;
}

/* ---------- Page background spans full document ---------- */
html {
  min-height: 100%;
  background: var(--bg); /* solid fallback beneath body backdrop */
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--page-bg);     /* backdrop lives on body so it grows with content */
  color: var(--text);
  font-family: "Exo 2", system-ui, Arial, sans-serif;
  font-weight: 200;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 2px solid var(--card-border);
  background: var(--card-bg);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  margin: 0;
  font-family: "Quantico", sans-serif;
  font-weight: 400;
  font-size: clamp(24px, 6vw, 48px);
  line-height: 1.1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-socials {
  display: flex;
  gap: 12px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.theme-toggle__icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* ---------- Content ---------- */
.content {
  padding: var(--pad);
  display: grid;
  place-items: center;
}

/* Logo + Tagline */
.hero {
  width: min(100%, var(--max));
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center; 
}

.hero-logos {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tagline {
  margin: 0;
  padding-top: 12px;
  padding-bottom: 30px;
  font-weight: 200;
  font-size: clamp(14px, 3.4vw, 20px);
  line-height: 1.35;
}

/* Logo sizing */
.logo {
  width: var(--logo-size);
  height: var(--logo-size);
  object-fit: contain;
  display: block;
  transform: none !important;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 2px solid var(--card-border);
  margin-top: 30px;
  background: var(--card-bg);
  font-weight: 200;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  text-align: center;
}

.footer-left,
.footer-center,
.footer-right {
  flex: 1;
  display: flex;
  justify-content: center;
}

.contact-label {
  font-weight: 550;
  margin-right: 8px;
  padding-top: 3px;
}

/* ---------- Socials ---------- */
.socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.socials a {
  color: var(--link);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-logo {
  width: 28px;
  height: 28px;
  display: block;
  transition: transform 0.2s ease;
}

.social-logo:hover {
  transform: scale(1.1);
}

@media (max-width: 700px) {
  .footer-inner {
    justify-content: center;
    gap: 12px;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    flex: 0 1 100%;
    justify-content: center;
  }

  .site-title {
    font-size: 1.4rem;
  }

  .header-right { gap: 8px; } 

  /* Hide header socials on mobile */
  .header-socials { 
    display: none; 
  }

  .socials { 
    justify-content: center; 
  }

  .social-logo {
    width: 22px;
    height: 22px;
  }
}

/* extra tight spacing on very narrow screens */
@media (max-width: 420px) {
  .footer-inner { gap: 8px; }
}

/* ---------- Theme swap helpers ---------- */
.theme-dark { display: none; }
:root[data-theme="dark"] .theme-dark { display: block; }
:root[data-theme="dark"] .theme-light { display: none; }

/* Explicit logo theme rules (for hero/logo pairs) */
.logo.theme-dark { display: none; }
:root[data-theme="dark"] .logo.theme-dark { display: block; }
:root[data-theme="dark"] .logo.theme-light { display: none; }


/* ---------- SVG rendering/sizing tweaks ---------- */
svg,
img[src$=".svg"] {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  image-rendering: optimizeQuality;
}

/* Game logos also avoid fractional scaling */
.game-logo { transform: none; }
