/* ==========================================================================
   Hexagon Games — shared design system
   Loaded on every page via partials/head.html. Page-specific component CSS
   stays inline in each page's own <style> block.
   ========================================================================== */

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

:root {
  --pink:    #F72585;
  --magenta: #B5179E;
  --purple:  #7209B7;
  --violet:  #560BAD;
  --indigo:  #3A0CA3;
  --blue:    #4361EE;
  --sky:     #4895EF;
  --cyan:    #4CC9F0;
  --grad:    linear-gradient(100deg, #F72585, #7209B7 55%, #4361EE);
  --hex:     #0A0A0A;
  --hex2:    #1A1A1A;
  --dark:    #0A0A0A;
  --darker:  #050505;
  --surface: #1A1A1A;
  --border:  #2B2B2B;
  --light:   #D6D6D6;
  --muted:   #969696;
  --white:   #F7F7F7;
}

html { scroll-behavior: smooth; }

h1, h2, h3, h4, h5, h6 { font-family: 'Lexend Deca', 'Manrope', system-ui, sans-serif; }
button, input, select, textarea { font-family: inherit; }
::selection { background: var(--purple); color: #fff; }

body {
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  background: var(--dark);
  color: var(--light);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 12%, rgba(114,9,183,.22) 0%, transparent 50%),
    radial-gradient(circle at 85% 82%, rgba(67,97,238,.16) 0%, transparent 50%),
    radial-gradient(circle at 72% 8%, rgba(247,37,133,.10) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* Base hex pattern is disabled; index.html and blog.html opt in via an inline override. */
.hex-bg {
  position: fixed;
  inset: 0;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50V17L28 0l28 17v33L28 66zm0-6l22-13V23L28 6 6 23v24l22 13z' fill='%237209B7'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; }

/* --------------------------------------------------------------- Navigation */

nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
}

.logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.logo img { height: 34px; display: block; }

nav a.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}

nav a.nav-link:hover { color: var(--cyan); }

.nav-cta {
  background: var(--grad);
  color: #fff !important;
  padding: .5rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .875rem !important;
  transition: background .2s !important;
}

.nav-cta:hover { filter: brightness(1.2); }

.nav-links { display: flex; gap: 2rem; align-items: center; }

/* Hamburger toggle — hidden until JS decides the links no longer fit. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--light);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}

.nav-toggle:hover { color: var(--cyan); border-color: rgba(76,201,240,.4); }
.nav-toggle svg { width: 24px; height: 24px; display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Off-canvas measurement helper — lets JS read the links' natural inline width
   without wrapping or compression, and without a visible flash. */
.nav-links.measuring {
  position: absolute !important;
  visibility: hidden !important;
  display: flex !important;
  flex-direction: row !important;
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
}

/* Collapsed state (JS adds .is-collapsed on <nav> when the links overflow). */
nav.is-collapsed .nav-toggle { display: inline-flex; }

nav.is-collapsed .nav-links {
  position: absolute;
  top: 100%;
  right: 1.25rem;
  margin-top: .5rem;
  flex-direction: column;
  align-items: stretch;
  gap: .25rem;
  min-width: 190px;
  padding: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  z-index: 20;
  display: none;
}

nav.is-collapsed .nav-links.is-open { display: flex; }

nav.is-collapsed .nav-links .nav-link {
  padding: .6rem .75rem;
  border-radius: 8px;
  font-size: .95rem;
}

nav.is-collapsed .nav-links .nav-link:hover { background: rgba(76,201,240,.1); color: var(--cyan); }

/* ------------------------------------------------------------ Page headers */

.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem 2rem;
  gap: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
}

.header-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.7;
}

/* --------------------------------------------------------------- Sections */

.section {
  padding: 4rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 2rem;
  letter-spacing: -.5px;
}

.divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 0 2rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: all .2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(114,9,183,.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(247,37,133,.4);
}

.btn-outline {
  background: transparent;
  color: var(--light);
  border: 1px solid rgba(255,255,255,.4);
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--white);
  background: rgba(76,201,240,.08);
}

/* ------------------------------------------------ Inline email signup form */

.email-form {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.email-form input {
  flex: 1;
  min-width: 220px;
  padding: .75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: var(--white);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}

.email-form input::placeholder { color: var(--muted); }
.email-form input:focus { border-color: var(--sky); }

.email-form button {
  background: var(--grad);
  color: #fff;
  padding: .75rem 1.75rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: all .2s;
}

.email-form button:hover { transform: translateY(-2px); }
.email-form button:disabled { opacity: .6; cursor: not-allowed; }

#form-msg { margin-top: 1rem; font-weight: 600; display: none; }
#form-msg.success { color: #4ade80; }
#form-msg.error { color: #f87171; }

/* -------------------------------------------------- "Coming soon" callout */

.coming-soon {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.coming-soon h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: .75rem;
}

.coming-soon p {
  color: var(--muted);
  margin-bottom: 1.75rem;
  line-height: 1.7;
}

/* ----------------------------------------------------------- Social icons */

.social-icons { display: flex; gap: .75rem; flex-wrap: wrap; }

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  color: var(--light);
  transition: all .2s;
  text-decoration: none;
}

.social-icons a:hover {
  background: rgba(76,201,240,.12);
  border-color: rgba(76,201,240,.55);
  color: var(--cyan);
}

.social-icons svg { width: 18px; height: 18px; }

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

footer {
  border-top: 1px solid rgba(255,255,255,.1);
  color: var(--muted);
  font-size: .85rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 2.5rem 2.5rem 2rem;
  flex-wrap: wrap;
}

.footer-col-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--light);
  margin-bottom: .5rem;
}

.footer-newsletter-sub {
  font-size: .875rem;
  color: var(--muted);
  margin-bottom: 1rem;
  max-width: 380px;
  line-height: 1.6;
}

.footer-email-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.footer-email-row input {
  flex: 1;
  min-width: 200px;
  padding: .6rem .9rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: var(--white);
  font-size: .875rem;
  outline: none;
  transition: border-color .2s;
}

.footer-email-row input::placeholder { color: var(--muted); }
.footer-email-row input:focus { border-color: var(--sky); }

.footer-email-row button {
  background: var(--grad);
  color: #fff;
  padding: .6rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.footer-email-row button:hover { filter: brightness(1.2); }
.footer-email-row button:disabled { opacity: .6; cursor: not-allowed; }

#footer-form-msg { margin-top: .5rem; font-size: .8rem; font-weight: 600; display: none; }
#footer-form-msg.success { color: #4ade80; }
#footer-form-msg.error { color: #f87171; }

.footer-social-col { min-width: 180px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--cyan); }

.footer-links { display: flex; gap: 1.5rem; }

/* --------------------------------------- Legal pages (privacy.html/terms.html) */

.content {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
  line-height: 1.8;
}

.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin: 2.5rem 0 1rem;
}

.content h2:first-of-type { margin-top: 0; }

.content p { color: var(--light); margin-bottom: 1rem; }
.content ul, .content ol { color: var(--light); margin-left: 1.5rem; margin-bottom: 1rem; }
.content li { margin-bottom: .5rem; }
.content a { color: var(--sky); text-decoration: underline; }
.content a:hover { color: var(--cyan); }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 600px) {
  nav { padding: 1rem 1.25rem; }
  .page-header { padding: 3rem 1.25rem 2rem; }
  .content { padding: 2rem 1.25rem; }
  .footer-top { flex-direction: column; padding: 1.5rem 1.25rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; padding: 1rem 1.25rem; }
}
