/* RaGamez. Colours from the studio intro (RaGamezIntro.cs). */
:root {
  --night: #0b0705;
  --night-2: #140d09;
  --night-3: #1d130d;
  --line: rgba(246, 214, 150, 0.12);
  --ink: #f3ebdd;
  --muted: #a99a85;
  --neon: #ff2a3c;          /* RA */
  --gold: #f6d696;          /* GAMEZ */
  --ember: #ff8a1f;
  --cyan: #00e5ff;          /* glitch ghosts */
  --ghost-red: #ff3b5c;
  --marigold: #ff9f1c;      /* Bruja Run */
  --coin: #f6c445;          /* Sit2Earn */
  --accent: var(--neon);

  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 0;
}
h2 { font-size: clamp(2.1rem, 8vw, 3.6rem); }
h3 { font-size: 1.7rem; }
p { margin: 0; }

.kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.lede { color: var(--muted); margin-top: 12px; font-size: 1.05rem; }
.fine { color: var(--muted); font-size: 0.8rem; }

/* --- Wordmark: RA in red neon chrome, GAMEZ in candle-gold chrome ------------------------- */
.wordmark {
  font: italic 800 1.15rem/1 var(--body);
  letter-spacing: 0.16em;
  text-decoration: none;
  display: inline-flex;
}
.wordmark span { background-clip: text; -webkit-background-clip: text; color: transparent; }
.wordmark .ra {
  background-image: linear-gradient(180deg, #ff707c 0%, #ff1e32 52%, #c80a1c 53%, #ff3c4c 100%);
  filter: drop-shadow(0 0 8px rgba(255, 42, 60, 0.55));
}
.wordmark .gamez {
  background-image: linear-gradient(180deg, #fffcf0 0%, #c4a060 52%, #4a3618 53%, #f6deaa 100%);
}

/* --- Buttons: slanted, like the logo ----------------------------------------------------- */
.btn {
  --cut: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border: 0;
  font: 600 0.95rem/1 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
  transition: filter 0.15s, transform 0.15s, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #fff; }
.btn-primary { background: linear-gradient(180deg, #ff4b5a, var(--neon) 55%, #d5192b); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: rgba(246, 214, 150, 0.08); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: rgba(246, 214, 150, 0.14); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* --- Top bar ------------------------------------------------------------------------------ */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(56px + var(--safe-top));
  padding: var(--safe-top) var(--gutter) 0;
  transition: background-color 0.25s, backdrop-filter 0.25s, border-color 0.25s;
  border-bottom: 1px solid transparent;
}
.topbar.is-scrolled {
  background: rgba(11, 7, 5, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a {
  display: none;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.topnav a:hover { color: var(--ink); }
.topnav .pill {
  display: inline-flex;
  color: var(--ink);
  padding: 8px 16px;
  background: rgba(255, 42, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 42, 60, 0.5);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

/* --- Hero --------------------------------------------------------------------------------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  background: #0b0b00;          /* the held logo frame's own black, so the video edge disappears */
  overflow: hidden;
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 42%; }
.hero::after {
  content: '';
  position: absolute;
  inset: 60% 0 0;
  background: linear-gradient(180deg, rgba(11, 7, 5, 0), var(--night) 92%);
  pointer-events: none;
}
.hero-copy {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 0 var(--gutter) calc(40px + var(--safe-bottom));
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 18px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.hero.is-ready .hero-copy { opacity: 1; transform: none; }
.hero-copy .kicker { margin: 0; }
.hero h1 { font-size: clamp(2.2rem, 9.6vw, 4.6rem); max-width: 14ch; }
.hero-meta { font-size: 0.85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .sep { opacity: 0.5; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.dot.live { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.sound-btn {
  position: absolute;
  z-index: 3;
  top: calc(68px + var(--safe-top));
  right: var(--gutter);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(243, 235, 221, 0.1);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s 0.4s;
}
.hero.is-ready .sound-btn { opacity: 1; }
.sound-btn svg { width: 18px; height: 18px; fill: currentColor; }
.sound-btn .wave { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; opacity: 0.4; }
.hero.has-sound .sound-btn .wave { opacity: 1; }

/* Glitch hit: two hard frames of cyan/red ghosts, like the intro's landing. */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.glitch::before { color: var(--cyan); }
.glitch::after { color: var(--ghost-red); }
.glitch.is-glitching::before { animation: ghost-a 0.36s steps(1) 1; }
.glitch.is-glitching::after { animation: ghost-b 0.36s steps(1) 1; }
@keyframes ghost-a {
  0% { opacity: 0.75; transform: translateX(-6px); clip-path: inset(0 0 55% 0); }
  50% { opacity: 0.75; transform: translateX(6px); clip-path: inset(40% 0 0 0); }
  100% { opacity: 0; transform: none; }
}
@keyframes ghost-b {
  0% { opacity: 0.75; transform: translateX(5px); clip-path: inset(45% 0 0 0); }
  50% { opacity: 0.75; transform: translateX(-5px); clip-path: inset(0 0 50% 0); }
  100% { opacity: 0; transform: none; }
}

/* --- Sections ----------------------------------------------------------------------------- */
section { padding: 80px var(--gutter); }
.section-head { max-width: 640px; margin: 0 auto 28px; text-align: center; }

/* --- The Portal World teaser --------------------------------------------------------------- */
.portal { padding-top: 56px; }
.world-teaser {
  position: relative;
  display: block;
  max-width: 1120px;
  margin: 0 auto 48px;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(255, 42, 60, 0.12);
  text-decoration: none;
}
.world-teaser img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.world-teaser .night { animation: day-night 9s ease-in-out infinite alternate; }
@keyframes day-night { 0%, 35% { opacity: 0; } 65%, 100% { opacity: 1; } }
.world-teaser::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(180deg, transparent, rgba(11, 7, 5, 0.85)); }
.world-teaser .btn { position: absolute; z-index: 1; left: 50%; bottom: 22px; transform: translateX(-50%); }
.world-teaser:hover .btn { filter: brightness(1.12); }
.destinations-kicker { text-align: center; }
@media (max-width: 719px) { .world-teaser { aspect-ratio: 4 / 5; margin-inline: calc(var(--gutter) * -1); border-radius: 0; border-inline: 0; } }

/* Destination cards: the plain way in, and the fallback when 3D isn't available. */
.destinations { display: grid; gap: 14px; max-width: 1120px; margin: 0 auto; }
.card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  padding: 12px;
  background: var(--night-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.card-thumb { width: 104px; aspect-ratio: 9 / 16; height: auto; object-fit: cover; border-radius: 4px; background: var(--night-3); }
.card-body { display: grid; align-content: start; gap: 8px; min-width: 0; }
.card-body > p:not(.status) { color: var(--muted); font-size: 0.95rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.card-actions .btn { min-height: 42px; padding: 0 16px; font-size: 0.78rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status.live { color: var(--gold); }
.status.soon { color: var(--marigold); }
.status.sealed { color: var(--cyan); }

/* --- Irela -------------------------------------------------------------------------------- */
.irela { display: grid; gap: 28px; max-width: 1040px; margin: 0 auto; align-items: center; }
.irela-art {
  position: relative;
  height: 440px;
  display: grid;
  justify-items: center;
  overflow: hidden;
}
.irela-art::before {
  content: '';
  position: absolute;
  inset: 12% 8% 0;
  background:
    radial-gradient(closest-side, rgba(255, 42, 60, 0.35), transparent),
    radial-gradient(closest-side at 60% 40%, rgba(0, 229, 255, 0.18), transparent);
  filter: blur(10px);
}
.irela-art img {
  position: relative;
  height: 560px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: top;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 82%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 82%);
}
.irela-copy { display: grid; gap: 14px; text-align: center; justify-items: center; }
.irela-copy .kicker { margin: 0; }
.irela-copy > p:not(.kicker) { color: var(--muted); max-width: 46ch; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* --- Waitlist ----------------------------------------------------------------------------- */
.join { background: linear-gradient(180deg, var(--night), var(--night-2)); border-top: 1px solid var(--line); }
.join-form { max-width: 480px; margin: 0 auto; display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field span, .interests legend {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.field input {
  height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(246, 214, 150, 0.2);
  border-radius: 4px;
  background: var(--night);
  color: var(--ink);
  font: 400 1rem var(--body);     /* 16px keeps iOS from zooming in */
}
.field input::placeholder { color: rgba(169, 154, 133, 0.6); }
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246, 214, 150, 0.15); }
.interests { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.interests legend { margin-bottom: 8px; padding: 0; }
.interests label { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.interests input { width: 20px; height: 20px; accent-color: var(--neon); margin: 0; }
.form-note { min-height: 1.4em; font-size: 0.92rem; text-align: center; }
.form-note.is-ok { color: var(--gold); }
.form-note.is-error { color: #ff8a95; }
.join-form .fine { text-align: center; }

/* --- Footer ------------------------------------------------------------------------------- */
.footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px var(--gutter) calc(36px + var(--safe-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}
.footer a:not(.wordmark) { color: var(--ink); text-decoration-color: rgba(246, 214, 150, 0.4); text-underline-offset: 3px; }

/* --- Destination (where a portal takes you) ---------------------------------------------- */
dialog.dest {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--night);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog.dest[open] { animation: arrive 0.45s ease-out; }
@keyframes arrive { from { opacity: 0; transform: scale(1.04); } }
dialog.dest::backdrop { background: rgba(4, 3, 2, 0.82); backdrop-filter: blur(6px); }
.dest-media { position: relative; height: 58svh; background: #000; }
.dest-media video, .dest-media img { width: 100%; height: 100%; object-fit: cover; }
.dest-media::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, var(--night));
  pointer-events: none;
}
.dest-sound {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  top: calc(14px + var(--safe-top));
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 7, 5, 0.6);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.dest-sound.is-on { background: var(--accent); color: var(--night); }
.dest-body {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 4px var(--gutter) calc(32px + var(--safe-bottom));
  margin-top: -40px;
}
.dest-body h2 { font-size: clamp(2.6rem, 12vw, 3.8rem); display: flex; align-items: center; gap: 12px; }
.dest-icon { width: 44px; height: 44px; border-radius: 10px; }
.dest-hook { font: italic 700 1.3rem/1.2 var(--display); text-transform: uppercase; color: var(--accent); letter-spacing: 0.02em; }
.dest-body > p:not(.status):not(.dest-hook) { color: var(--muted); }
.dest-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.dest-points li { position: relative; padding-left: 20px; }
.dest-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 2px;
  background: var(--accent);
  transform: skewX(-20deg);
}
.dest-banner { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--line); }
.dest-body > .btn-block { position: sticky; bottom: calc(16px + var(--safe-bottom)); z-index: 2; margin-top: 6px; }
.dest-close {
  position: fixed;
  z-index: 5;
  top: calc(10px + var(--safe-top));
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 7, 5, 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.dest-sealed {
  background:
    repeating-linear-gradient(0deg, rgba(0, 229, 255, 0.035) 0 2px, transparent 2px 4px),
    radial-gradient(circle at 50% 35%, rgba(0, 229, 255, 0.16), transparent 60%),
    var(--night) !important;
}
.dest-sealed .dest-body { margin: 0; min-height: 100%; align-content: center; justify-items: center; text-align: center; padding-top: 80px; }
.dest-sealed .dest-body .btn { max-width: 360px; }

/* --- Wider screens ------------------------------------------------------------------------ */
@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .topnav a { display: inline-flex; }
  .destinations { grid-template-columns: repeat(3, 1fr); }
  .card { grid-template-columns: 1fr; padding: 0 0 18px; }
  .card::before { inset: 0 0 auto; width: auto; height: 3px; z-index: 1; }
  .card-thumb { width: 100%; aspect-ratio: 4 / 5; border-radius: 0; }
  .card-body { padding: 0 18px; }
  .irela { grid-template-columns: 1fr 1fr; }
  .irela-art { height: 560px; }
  .irela-art img { height: 700px; }
  .irela-copy { text-align: left; justify-items: start; }
  .socials { justify-content: flex-start; }

  dialog.dest {
    width: min(980px, 92vw);
    height: min(760px, 90vh);
    margin: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
    display: none;
    overflow: hidden;
    box-shadow: 0 0 80px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  dialog.dest[open] { display: grid; grid-template-columns: minmax(0, 420px) 1fr; }
  .dest-media { height: 100%; }
  .dest-media::after { inset: 0 0 0 auto; width: 30%; height: auto; background: linear-gradient(90deg, transparent, var(--night)); }
  .dest-body { margin: 0; padding: 56px 40px 40px 24px; overflow-y: auto; align-content: start; }
  .dest-close { position: absolute; }
  .dest-sound { top: 14px; }
  dialog.dest-sealed[open] { grid-template-columns: 1fr; }
  .dest-sealed .dest-body { padding: 40px; }
}

@media (min-width: 900px) {
  .hero-copy { padding-bottom: 56px; }
}

/* Landscape screens: lift the logo so the headline has its own space below it. */
@media (min-width: 720px) and (min-aspect-ratio: 1/1) {
  .hero-video { inset: 4% 0 auto; height: 64%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
