/* ==========================================================================
   World of Empires III — site styles
   ========================================================================== */

/* Tokens ------------------------------------------------------------------- */
:root {
  --bg: #0b0907;
  --bg-glow: #1d1710;
  --stripe-a: #15110c;
  --stripe-b: #110e0a;

  --text: #e9e1d3;
  --heading: #f1e6cf;
  --body: #cfc4b0;
  --muted: #b9a47c;
  --dim: #8a7a5e;
  --gold: #d9b46a;
  --gold-light: #f3d9a0;

  --line: rgba(217, 180, 106, 0.14);
  --line-2: rgba(217, 180, 106, 0.18);
  --line-3: rgba(217, 180, 106, 0.25);
  --line-4: rgba(217, 180, 106, 0.35);

  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Spectral", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --content: 1120px;
  --section-y: clamp(48px, 8vw, 112px);
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg) radial-gradient(ellipse 80% 60% at 50% 0%, var(--bg-glow) 0%, var(--bg) 70%) no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: var(--gold-light);
}

:focus-visible {
  outline: 1px solid var(--gold-light);
  outline-offset: 4px;
}

h1,
h2,
p {
  margin: 0;
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gold);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--bg);
}

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  background: rgba(11, 9, 7, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  white-space: nowrap;
  color: var(--gold);
}

.site-nav {
  display: flex;
  gap: clamp(16px, 3vw, 40px);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.site-nav a {
  padding: 6px 0;
  white-space: nowrap;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--gold-light);
}

.site-nav a[aria-current="page"] {
  border-color: var(--gold);
}

@media (max-width: 420px) {
  .site-header {
    gap: 12px;
  }

  .site-nav {
    gap: 14px;
    font-size: 11px;
    letter-spacing: 0.14em;
  }
}

/* Layout ------------------------------------------------------------------- */
main {
  flex: 1;
}

.page {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
}

.page__intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
  color: var(--heading);
  text-wrap: balance;
}

.lead {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.6;
  font-weight: 300;
  color: var(--body);
  text-wrap: pretty;
}

/* Placeholder (striped frame used until real art is dropped in) ------------ */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  background: repeating-linear-gradient(135deg, var(--stripe-a) 0 14px, var(--stripe-b) 14px 28px);
}

/* Media frame: holds either a .placeholder or an <img> --------------------- */
.frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-3);
  background: var(--stripe-b);
}

.frame > img,
.frame > .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Home: hero --------------------------------------------------------------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(24px, 4vw, 40px);
  padding: clamp(32px, 6vw, 72px) var(--gutter) 40px;
}

.hero__logo {
  width: min(920px, 100%);
  margin: 0;
}

.hero__logo img {
  width: 100%;
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.3vw, 16px);
  letter-spacing: 0.42em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--muted);
}

.hero__status {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero > :nth-child(2) { animation-delay: 0.12s; }
  .hero > :nth-child(3) { animation-delay: 0.24s; }
  .hero > :nth-child(4) { animation-delay: 0.36s; }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }
}

/* Home: trailer ------------------------------------------------------------ */
.trailer {
  position: relative;
  width: min(var(--content), 100%);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-4);
  background: repeating-linear-gradient(135deg, var(--stripe-a) 0 14px, var(--stripe-b) 14px 28px);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 6px rgba(217, 180, 106, 0.05), 0 40px 120px rgba(0, 0, 0, 0.7);
}

.trailer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.trailer__play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
}

.trailer__play:disabled {
  cursor: default;
}

.trailer__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(64px, 8vw, 96px);
  height: clamp(64px, 8vw, 96px);
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(11, 9, 7, 0.6);
  transition: background 0.2s, transform 0.2s;
}

.trailer__icon::before {
  content: "";
  margin-left: 6px;
  border-left: 22px solid var(--gold);
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
}

.trailer__play:not(:disabled):hover .trailer__icon,
.trailer__play:focus-visible .trailer__icon {
  background: rgba(217, 180, 106, 0.15);
  transform: scale(1.04);
}

.trailer__play:focus-visible {
  outline-offset: -8px;
}

.trailer__label {
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.trailer.has-video .trailer__label {
  color: var(--text);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

/* Home: stats -------------------------------------------------------------- */
.stats-wrap {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  /* The 1px gaps reveal this colour, drawing the dividers. */
  background: var(--line-2);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 24px;
  text-align: center;
  background: var(--bg);
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  color: var(--gold);
}

.stat__label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The Game: features ------------------------------------------------------- */
.features {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 7vw, 96px);
  margin-top: clamp(48px, 7vw, 96px);
}

.feature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-top: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line-2);
}

.feature__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature__number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 1;
  color: var(--gold);
}

.feature__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0.06em;
  color: var(--heading);
}

.feature__body {
  font-size: 19px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--body);
  text-wrap: pretty;
}

.feature__media {
  aspect-ratio: 16 / 10;
  margin: 0;
}

/* Media: gallery ----------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.gallery .frame {
  display: block;
  aspect-ratio: 16 / 9;
  border-color: var(--line-2);
}

.gallery a.frame > img {
  transition: transform 0.4s ease, opacity 0.2s;
}

.gallery a.frame:hover > img {
  transform: scale(1.03);
}

/* Lightbox ----------------------------------------------------------------- */
.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 4vw, 56px);
  border: 0;
  color: var(--text);
  background: transparent;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(11, 9, 7, 0.94);
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid var(--line-4);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}

.lightbox__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line-4);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--gold);
  background: rgba(11, 9, 7, 0.7);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lightbox__btn:hover {
  color: var(--gold-light);
  background: rgba(217, 180, 106, 0.15);
}

.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 16px; top: 50%; transform: translateY(-50%); }

.lightbox__btn[hidden] {
  display: none;
}

/* Footer ------------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
