/* Runback Games — one page, one stylesheet. */

:root {
  /* Colour */
  --ink:         #0C0A1E;   /* page base, deep indigo not black */
  --panel:       #15122E;   /* cards, header on scroll */
  --panel-2:     #1D1938;   /* raised elements, tag chips */
  --line:        rgba(242, 239, 230, 0.10);
  --marquee:     #FFB020;   /* primary accent, cabinet amber */
  --marquee-dim: #8A5F13;
  --marquee-40:  rgba(255, 176, 32, 0.40);
  --marquee-12:  rgba(255, 176, 32, 0.12);
  --mint:        #14F195;   /* reserved: onchain and live indicators only */
  --bone:        #F2EFE6;   /* primary text */
  --muted:       #8A86A8;   /* secondary text */
  --scanline:    rgba(12, 10, 30, 0.04);
  --bloom:       rgba(242, 239, 230, 0.05);
  --bloom-hover: rgba(242, 239, 230, 0.09);
  --screen-well: #080614;
  --capy-hint:   #3D5872;   /* Capy Siege slate, from its own palette */
  --bull-hint:   #E5343A;   /* Bull Rush crimson, from its own palette */

  /* Type */
  --display: 'Archivo', system-ui, sans-serif;      /* 800 weight, width 125 */
  --body:    'Inter Tight', system-ui, sans-serif;  /* 400 and 500 */
  --mono:    'DM Mono', ui-monospace, monospace;    /* 400 and 500, labels and ticker */

  --step-hero:  clamp(2.75rem, 7vw, 5.5rem);
  --step-h2:    clamp(1.875rem, 3.5vw, 2.75rem);
  --step-h3:    clamp(1.375rem, 2vw, 1.75rem);
  --step-body:  1.0625rem;
  --step-small: 0.875rem;
  --step-label: 0.75rem;

  /* Layout */
  --max:       1180px;
  --gutter:    clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 8rem);
  --radius:    18px;
  --radius-sm: 10px;
  --header-h:  68px;
}

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-weight: 400;
  font-size: var(--step-body);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0;
}

h2 {
  font-size: var(--step-h2);
  text-transform: uppercase;
}

h3 {
  font-size: var(--step-h3);
  text-transform: uppercase;
}

p {
  margin: 0;
  max-width: 54ch;
}

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--marquee);
  margin-bottom: 1rem;
}

:is(a, button, summary):focus-visible {
  outline: 2px solid var(--marquee);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  transform: translate(-50%, -300%);
  z-index: 100;
  background: var(--marquee);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: transform 160ms ease;
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-weight: 500;
  font-size: var(--step-small);
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-primary {
  background: var(--marquee);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--bone);
}

.btn-ghost {
  background: transparent;
  color: var(--bone);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--marquee-40);
}

.btn-small {
  padding: 0.5rem 1rem;
}

.btn-mono {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--marquee);
  font-weight: 500;
  font-size: var(--step-small);
  text-decoration: none;
}

.text-link:hover {
  color: var(--bone);
}

.text-link .arrow {
  font-size: var(--step-label);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.site-header.is-scrolled {
  background: var(--panel);
  border-bottom-color: var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--bone);
  text-decoration: none;
}

.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.02em;
  font-size: 1.0625rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
}

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

/* ---------- Ticker ---------- */

.ticker {
  height: 34px;
  background: var(--marquee);
  color: var(--ink);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 32s linear infinite;
}

.ticker-run {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tick-sep {
  padding-inline: 0.9em;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

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

.hero {
  position: relative;
  padding-block: calc(var(--section-y) * 1.15) var(--section-y);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 88% 0%, var(--marquee-12), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
  -webkit-mask-image: linear-gradient(var(--bone) 0%, transparent 60vh);
  mask-image: linear-gradient(var(--bone) 0%, transparent 60vh);
}

.hero .wrap {
  position: relative;
}

.hero h1 {
  font-size: var(--step-hero);
  max-width: 14ch;
}

.hero-copy {
  color: var(--muted);
  max-width: 46ch;
  margin-top: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

/* ---------- Games ---------- */

.cabinet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 3rem;
}

.cabinet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 160ms ease;
}

.cabinet:hover {
  border-color: var(--marquee-40);
}

.cabinet-marquee {
  height: 40px;
  background: var(--marquee);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1.1rem;
}

.cabinet-name,
.cabinet-live {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cabinet-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
}

.cabinet-screen {
  position: relative;
  margin: 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--screen-well);
  aspect-ratio: 16 / 10;
}

.cabinet-capy-siege .cabinet-screen {
  border-color: color-mix(in srgb, var(--capy-hint) 45%, var(--line));
}

.cabinet-bull-rush .cabinet-screen {
  border-color: color-mix(in srgb, var(--bull-hint) 35%, var(--line));
}

.cabinet-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* CRT treatment: scanlines plus a soft bloom, CSS only. */
.cabinet-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 75% 60% at 50% 38%, var(--bloom), transparent 75%),
    repeating-linear-gradient(0deg, var(--scanline) 0 1px, transparent 1px 4px);
  transition: opacity 160ms ease;
}

.cabinet:hover .cabinet-screen::after {
  background:
    radial-gradient(ellipse 75% 60% at 50% 38%, var(--bloom-hover), transparent 75%),
    repeating-linear-gradient(0deg, var(--scanline) 0 1px, transparent 1px 4px);
}

.cabinet-body {
  padding: 1.5rem 1.6rem 1.75rem;
}

.cabinet-body p {
  color: var(--muted);
  font-size: var(--step-small);
  max-width: 34ch;
  margin-top: 0.9rem;
}

.tag-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 1.25rem 0 0;
}

.tag-row li {
  font-family: var(--mono);
  font-weight: 400;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.4rem;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: 3rem;
  align-items: start;
}

.about-copy p {
  color: var(--muted);
  max-width: 54ch;
}

.about-copy p + p {
  margin-top: 1.25rem;
}

.fact-list {
  margin: 0;
}

.fact-row {
  display: grid;
  gap: 0.35rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.fact-row:first-child {
  border-top: 1px solid var(--line);
}

.fact-row dt {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact-row dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.02em;
  font-size: var(--step-h3);
  line-height: 1;
}

/* ---------- Onchain ---------- */

.onchain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-top: 3rem;
}

.onchain-num {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-small);
  letter-spacing: 0.14em;
  color: var(--mint);
  margin-bottom: 1rem;
}

.onchain-col h3 {
  margin-bottom: 0.9rem;
}

.onchain-col p:last-child {
  color: var(--muted);
  font-size: var(--step-small);
  max-width: 34ch;
}

/* ---------- Contact ---------- */

.contact-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

.contact-panel .eyebrow {
  margin-bottom: 0.9rem;
}

.contact-copy {
  color: var(--muted);
  max-width: 54ch;
  margin: 1.4rem auto 0;
}

.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

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

.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-tag {
  color: var(--muted);
  font-size: var(--step-small);
  margin-top: 1rem;
}

.footer-heading {
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.footer-link {
  color: var(--bone);
  font-size: var(--step-small);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--marquee);
}

.footer-bottom {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.footer-bottom p {
  font-family: var(--mono);
  font-weight: 400;
  font-size: var(--step-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: none;
}

/* ---------- Reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms ease var(--delay, 0ms), transform 420ms ease var(--delay, 0ms);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 880px) {
  .cabinet-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .onchain-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 720px) {
  .nav-link {
    display: none;
  }
}

@media (max-width: 620px) {
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 420px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
    width: 100%;
    justify-content: center;
  }

  .ticker-track .ticker-run:last-child {
    display: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
