/* ═══════════════════════════════════════════════════════════
   Montreal Games Week
   ───────────────────────────────────────────────────────────
   Fonts:
     Barlow Condensed  →  substitute for Bernoru SemiCondensed
     Montserrat        →  substitute for Gotham
   Replace with @font-face once web font licenses are obtained.
═══════════════════════════════════════════════════════════ */

/* ── Design tokens ───────────────────────────────────── */
:root {
  --red:        #EB4141;
  --beige:      #F8EFDE;
  --blue:       #4D8DC4;
  --green:      #4F9F93;
  --yellow:     #F1C268;
  --light-blue: #AACDDD;
  --coral:      #DF8A82;
  --black:      #312F2E;
  --white:      #F7F5F0;

  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body:    'Montserrat', sans-serif;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-padding-top: 82px; } /* sticky navbar (66px) + breathing room */

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--black);
  background: var(--white);
}

a { color: inherit; text-decoration: none; }
img { display: block; }
ul { list-style: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navbar ──────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--light-blue);
  border-bottom: 2px solid #93B8CC;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  gap: 24px;
}

.nav-logo img {
  height: 44px;
  width: auto;
  /* Render on a white chip so the logo always looks clean */
  background: var(--white);
  padding: 4px 10px;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--black);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--red); }

.nav-lang {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--red);
  background: none;
  color: var(--red);
  padding: 4px 14px;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-lang:hover {
  background: var(--red);
  color: var(--white);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--black);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Navbar: mobile ──────────────────────────────────── */
@media (max-width: 700px) {
  .navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
  }

  .nav-toggle {
    display: flex;
    grid-column: 1;
    justify-self: start;
  }

  .nav-logo {
    grid-column: 2;
    justify-self: center;
  }

  .nav-lang {
    grid-column: 3;
    justify-self: end;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--light-blue);
    border-bottom: 2px solid #93B8CC;
    box-shadow: 0 8px 16px rgba(49, 47, 46, 0.12);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li {
    border-top: 1px solid rgba(49, 47, 46, 0.12);
  }
  .nav-links a {
    display: block;
    padding: 16px 24px;
  }
}

/* ── Hero (physics canvas) ───────────────────────────── */
.hero {
  position: relative;
  background: var(--beige);
  height: 52vh;
  overflow: hidden;
  padding: 0; /* override general section padding */
}

/* Canvas injected by Matter.js */
.hero canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* ── Hero strip: dates + CTA below the canvas ────────── */
.hero-strip {
  background: #D9CCAF;
  border-top: 3px solid rgba(49,47,46,0.28);
  padding: 20px 24px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  border-bottom: 2px solid rgba(49,47,46,0.08);
}

.hero-dates {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--black);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: 4px;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-event {
  display: inline-block;
  background: var(--accent, var(--red));
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 22px;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.btn-event:hover { opacity: 0.8; }

/* Yellow accent needs dark text for readability */
.btn-event[style*="F1C268"] { color: var(--black); }

.btn-submit {
  display: inline-block;
  background: var(--white);
  color: var(--green);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: 4px;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-submit:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Submit + Newsletter side by side ───────────────── */
.duo-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Override section padding and container inside duo columns */
.duo-sections > section {
  padding: 48px 0;
}

.duo-sections .container {
  max-width: none;
  padding: 0 48px;
}

/* Newsletter form stacks vertically in the narrower column */
.duo-sections .newsletter-form {
  flex-direction: column;
  align-items: center;
}

.duo-sections .newsletter-form input[type="email"] {
  width: 100%;
}

/* Mobile: stack vertically */
@media (max-width: 700px) {
  .duo-sections {
    display: block;
  }
  .duo-sections .container {
    padding: 0 24px;
  }
}

/* ── Newsletter ──────────────────────────────────────── */
.newsletter {
  background: var(--yellow);
  color: var(--black);
  padding: 44px 24px;
  text-align: center;
}

.newsletter .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.newsletter p {
  font-size: 0.95rem;
  font-weight: 500;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  padding: 11px 18px;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 240px;
  color: var(--black);
  background: var(--white);
}
.newsletter-form input::placeholder { color: #999; }

.newsletter-form button {
  padding: 14px 36px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s;
}
.newsletter-form button:hover { opacity: 0.8; }

.newsletter-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(49, 47, 46, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.newsletter-modal-overlay.visible { display: flex; }

.newsletter-modal {
  position: relative;
  background: var(--white);
  border-radius: 8px;
  padding: 36px 16px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.newsletter-modal-close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--black);
  cursor: pointer;
  padding: 4px 8px;
}

.newsletter-modal-caption {
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--black);
}

.newsletter-target-frame {
  display: block;
  width: 320px;
  height: 420px;
  max-width: 80vw;
  max-height: 70vh;
  border: none;
}

/* ── Sections (shared) ───────────────────────────────── */
section { padding: 60px 0; }

h2 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red);
  margin-bottom: 10px;
  line-height: 1;
}

.section-subtitle {
  font-size: 0.92rem;
  color: #777;
  margin-bottom: 44px;
}

/* ── Program ─────────────────────────────────────────── */
.program { background: var(--beige); }
.program h2 { text-align: center; }
.program .section-subtitle { text-align: center; }

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.event-card {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
  border-top: 5px solid var(--accent, var(--red));
  box-shadow: 0 2px 10px rgba(49, 47, 46, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}
.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(49, 47, 46, 0.13);
}

.event-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.event-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.event-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--black);
  line-height: 1.15;
}

.event-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.79rem;
  color: #666;
  font-weight: 500;
}
.event-meta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.event-meta a:hover {
  color: var(--black);
}

.event-description {
  font-size: 0.87rem;
  color: var(--black);
  flex: 1;
  line-height: 1.55;
}

.event-footer {
  margin-top: auto;
  padding-top: 16px;
}

.submit-nudge {
  text-align: center;
  font-size: 0.88rem;
  color: #777;
}
.submit-nudge a { color: var(--red); font-weight: 600; }
.submit-nudge a:hover { text-decoration: underline; }

.state-msg {
  color: #999;
  font-style: italic;
  grid-column: 1 / -1;
}

/* ── About ───────────────────────────────────────────── */
.about { background: #D9CCAF; text-align: center; }

.about p {
  max-width: 700px;
  margin: 0 auto 36px;
  color: var(--black);
  font-size: 0.97rem;
}

.values {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.values span {
  padding: 9px 22px;
  background: var(--c, var(--red));
  color: var(--tc, var(--white));
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Submit ──────────────────────────────────────────── */
.submit {
  background: var(--green);
  color: var(--white);
  text-align: center;
  padding: 40px 0;
}
.submit h2 { color: var(--white); }
.newsletter h2 { color: var(--black); }
.submit p {
  max-width: 480px;
  margin: 12px auto 32px;
  font-size: 0.95rem;
  opacity: 0.92;
}

/* ── Who Are We ──────────────────────────────────────── */
.who { background: var(--black); color: var(--white); text-align: center; }
.who h2 { color: var(--white); }
.who .section-subtitle { color: rgba(247,245,240,0.6); }

.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 32px;
  justify-content: center;
  margin-top: 44px;
}

.team-card {
  text-align: center;
  width: 160px;
}

.team-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 16px;
  border: 4px solid var(--red);
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.team-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  margin-bottom: 4px;
}

.team-org {
  font-size: 0.78rem;
  color: var(--light-blue);
  font-weight: 500;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  background: var(--blue);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-wordmark {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 24px;
}

.footer-links a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.footer-links a:hover { opacity: 1; }

.footer-social {
  display: flex;
  gap: 24px;
}

.footer-social a {
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0.8;
  text-decoration: underline;
  transition: opacity 0.15s;
}
.footer-social a:hover { opacity: 1; }

.footer-contact a {
  font-size: 0.88rem;
  text-decoration: underline;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.footer-contact a:hover { opacity: 1; }

.footer-copy {
  font-size: 0.75rem;
  opacity: 0.45;
}
