/* Game Bridge. Every colour and size decision is a custom property here. */

/* Archivo, self-hosted so no visitor data goes to Google. SIL Open Font License: assets/fonts/OFL.txt */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Brand, sampled from the Game Bridge mark */
  --navy: #2b2f78;
  --berry: #811836;

  --ink: #15172f;
  --berry-dark: #66112a;
  --bg: #ffffff;
  --bg-alt: #f4f4f8;
  --text: #1c1d2b;
  --muted: #5c5e6d;
  --line: #e1e2ea;
  --on-dark: #ffffff;
  --on-dark-muted: #c3c5d9;
  --pink: #ff9db4;           /* berry, lightened until it reads on the dark sections */

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --display-width: 112%;     /* Archivo's width axis: headings set a touch wide */

  --wrap: 1120px;
  --gutter: 20px;
  --radius: 6px;
  --radius-lg: 10px;
  --header-h: 68px;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; --header-h: 76px; }
}

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

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--berry); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg-alt);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
svg { width: 1em; height: 1em; flex: none; }
a { color: inherit; }

h1, h2, h3 {
  font-stretch: var(--display-width);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p, li { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 30;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 10px 14px;
}
.skip:focus { top: 8px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Navy focus ring on light sections, white on dark ones. */
:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}
.site-header :focus-visible,
.hero :focus-visible,
.newsletter-card :focus-visible,
.site-footer :focus-visible,
.lightbox :focus-visible { outline-color: #fff; }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: 650 1rem/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.7; cursor: default; }

.btn-primary { background: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-dark); }

.btn-outline { border-color: var(--ink); background: var(--bg); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }

.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #e6e7f2; }

.btn-outline-light { border-color: rgb(255 255 255 / 45%); background: none; color: var(--on-dark); }
.btn-outline-light:hover { border-color: #fff; background: rgb(255 255 255 / 10%); }

.text-link {
  font-weight: 600;
  color: var(--navy);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.text-link:hover { text-decoration-thickness: 2px; }

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

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  transition: background-color 0.2s;
}
/* script.js pins the header, then marks it once the page has scrolled. */
.site-header.is-fixed { position: fixed; }
.site-header.is-stuck { background: var(--ink); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}
.brand { min-width: 0; }
.brand img { width: 150px; }
@media (min-width: 720px) { .brand img { width: 176px; } }

.header-nav { display: flex; flex: none; align-items: center; gap: 2px; }
.nav-link {
  display: none;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--on-dark);
  font: 500 1rem/1.2 var(--font);
  text-decoration: none;
  text-underline-offset: 6px;
  cursor: pointer;
}
.nav-link:hover { text-decoration: underline; }
@media (min-width: 640px) {
  .nav-link { display: inline-block; }
  .nav-link + .icon-link { margin-left: 8px; }
}

.icon-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--on-dark);
  opacity: 0.8;
  transition: opacity 0.15s;
}
.icon-link:hover { opacity: 1; }
.icon-link svg { width: 19px; height: 19px; }

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

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: min(100svh, 640px);
  padding: calc(var(--header-h) + 48px) 0 48px;
  background: var(--ink);
  color: var(--on-dark);
}
@media (min-width: 720px) {
  .hero { min-height: min(88svh, 720px); padding-bottom: 80px; }
}

.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 45%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, rgb(21 23 47 / 88%) 0%, rgb(21 23 47 / 0%) 55%),
    linear-gradient(90deg, rgb(21 23 47 / 90%) 0%, rgb(21 23 47 / 66%) 50%, rgb(43 47 120 / 38%) 100%);
}
@media (max-width: 719px) {
  .hero::before {
    background: linear-gradient(0deg, rgb(21 23 47 / 96%) 0%, rgb(21 23 47 / 72%) 100%);
  }
}

.hero-inner { width: 100%; }

/* The soonest confirmed date. Hidden until script.js finds one. */
.hero-next {
  margin: 0 0 16px;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--on-dark-muted);
}
.hero-next strong { font-weight: 650; color: var(--on-dark); }

.hero h1 {
  max-width: 13ch;
  font-size: clamp(2.5rem, 7.4vw, 4.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* ---------- Events ---------- */

/* The margin keeps the heading clear of the fixed header after a jump to #events. */
.events { padding: 64px 0 0; scroll-margin-top: 16px; }
@media (min-width: 720px) { .events { padding: 104px 0 0; } }

.section-title {
  margin-bottom: 28px;
  font-size: clamp(2rem, 4.6vw, 3rem);
  color: var(--ink);
}
@media (min-width: 720px) { .section-title { margin-bottom: 40px; } }

/* Stacked, both cards take the height of the taller one. */
.event-grid { display: grid; gap: 20px; grid-auto-rows: 1fr; }
@media (min-width: 820px) {
  .event-grid { grid-template-columns: 1fr 1fr; gap: 24px; grid-auto-rows: auto; }
}

.event {
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
@media (min-width: 720px) { .event { padding: 36px 36px 32px; } }

/* Both logos sit in the same slot so the two headings line up. */
.event-logo { display: flex; align-items: center; height: 56px; margin-bottom: 22px; }
.event-logo-gb { height: 56px; width: auto; }
.event-logo-gamayo { height: 30px; width: auto; }

.event h3 { font-size: clamp(1.6rem, 3vw, 1.95rem); color: var(--ink); }
.event-summary { max-width: 46ch; margin: 12px 0 28px; color: var(--muted); }
.event-summary p { margin: 0; }
.event-summary p + p { margin-top: 12px; }

/* The date and the ticket button are all a card carries below its copy. */
.event-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.event-date {
  margin: 0;
  font-stretch: var(--display-width);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.is-confirmed .event-date { font-size: clamp(1.25rem, 2.2vw, 1.45rem); font-weight: 750; color: var(--berry); }

/* Side by side, the cards share one set of rows (logo, heading, copy, foot), so each part is
   the same height in both and the two divider lines sit level however much copy a card has. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 820px) {
    .event { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; }
    .event-foot { margin-top: 0; }
  }
}

/* ---------- Newsletter ---------- */

.newsletter {
  padding: 32px 0 64px;
  scroll-margin-top: var(--header-h);
}
@media (min-width: 720px) { .newsletter { padding: 48px 0 104px; } }

.newsletter-card {
  display: grid;
  gap: 28px;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: var(--on-dark);
}
@media (min-width: 720px) { .newsletter-card { padding: 56px; } }
@media (min-width: 960px) {
  .newsletter-card { grid-template-columns: 4fr 7fr; gap: 56px; align-items: center; }
}

.newsletter h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.newsletter-copy p { max-width: 32ch; margin: 14px 0 0; color: var(--on-dark-muted); }

.signup-row {
  display: grid;
  gap: 14px;
  align-items: end;
}
.signup-row + .signup-row { margin-top: 14px; }
@media (min-width: 560px) {
  .signup-names { grid-template-columns: 1fr 1fr; }
  .signup-submit { grid-template-columns: 1fr auto; }
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}
.optional { font-weight: 400; color: var(--on-dark-muted); }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: 400 1rem var(--font);
}
.field input:focus { outline: 2px solid #fff; outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--pink); }

.field-error {
  margin: 10px 0 0;
  font-weight: 600;
  color: #ffc2d0;
}

.hp { position: absolute; left: -5000px; }

.form-message {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--on-dark-muted);
  border-radius: var(--radius);
  background: rgb(0 0 0 / 18%);
}
.form-message.is-ok { border-color: #7fd6a8; }
.form-message.is-error { border-color: var(--pink); }

.consent {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--on-dark-muted);
}
.consent a { color: var(--on-dark); text-underline-offset: 3px; }

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

.site-footer {
  background: var(--ink);
  color: var(--on-dark-muted);
  padding: 36px 0 28px;
  font-size: 0.95rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.footer-logo { width: 140px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.footer-links a { color: var(--on-dark); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-copy {
  width: 100%;
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 12%);
  font-size: 0.88rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 0.88rem;
}
.footer-legal p { margin: 0; }
.footer-legal a { color: var(--on-dark-muted); }
.footer-legal a:hover { color: var(--on-dark); }

/* ---------- Gallery popup ---------- */

html:has(.lightbox[open]) { overflow: hidden; }

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: rgb(10 11 24 / 96%);
  color: var(--on-dark);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(10 11 24 / 96%); }

.lightbox-img {
  width: auto;
  height: auto;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 148px);
  border-radius: 4px;
}
@media (min-width: 720px) {
  .lightbox-img { max-width: calc(100vw - 184px); max-height: calc(100dvh - 128px); }
}

.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: rgb(21 23 47 / 70%);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.lightbox-btn:hover { background: rgb(255 255 255 / 18%); border-color: rgb(255 255 255 / 60%); }
.lightbox-btn svg { width: 22px; height: 22px; }

.lightbox-close { top: 14px; right: 14px; }
.lightbox-prev,
.lightbox-next { top: calc(50% - 24px); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev svg { transform: rotate(180deg); }
@media (min-width: 720px) {
  .lightbox-close { top: 20px; right: 24px; }
}
/* On a phone the arrows drop below the photo, either side of the count, so they never cover it. */
@media (max-width: 719px) {
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 10px; }
  .lightbox-prev { left: calc(50% - 104px); }
  .lightbox-next { right: calc(50% - 104px); }
}

.lightbox-count {
  position: absolute;
  inset: auto 0 22px;
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  color: var(--on-dark-muted);
}

.lightbox.is-single .lightbox-prev,
.lightbox.is-single .lightbox-next,
.lightbox.is-single .lightbox-count { display: none; }

/* ---------- Inner pages (privacy, 404) ---------- */

.page { background: var(--bg); }
.page .site-header {
  position: sticky;
  top: 0;
  background: var(--ink);
}
/* Only two links here, so they fit beside the logo on a phone too. */
.page .nav-link { display: inline-block; }

.page-main { padding: 56px 0 80px; }
@media (min-width: 720px) { .page-main { padding: 80px 0 104px; } }

.prose { max-width: 68ch; }
.prose h1 { font-size: clamp(2.1rem, 5vw, 3rem); color: var(--ink); margin-bottom: 12px; }
.prose h2 { font-size: 1.35rem; color: var(--ink); margin: 40px 0 10px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--navy); text-underline-offset: 3px; }
.prose .updated { color: var(--muted); margin-bottom: 32px; }

.not-found { padding: 96px 0 120px; }
.not-found h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); color: var(--ink); margin-bottom: 14px; }
.not-found p { color: var(--muted); max-width: 46ch; margin: 0 0 28px; }

.page .site-footer { padding: 28px 0; }

/* ---------- Motion ---------- */

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