@font-face {
  font-family: "Berlin";
  src: url("../assets/berlin.ttf") format("truetype");
  font-display: swap;
}

/* martinez.sh brand: everything is built for black */
:root {
  --bg: #000000;
  --bg-2: #0a0a0d;
  --line: #1c1c22;
  --text: #f4ffe4;
  --muted: #9ba596;
  --red: #ff3b10;
  --amber: #ffb300;
  --green: #2bff5e;
  --cyan: #22e0ff;
  --sun: linear-gradient(to bottom, #fff07a, #ffb300 40%, #ff5a00 70%, #ff1e5a);
  --radius: 18px;
  --max: 1180px;
  --display: "Berlin", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Lexend", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.05; margin: 0; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 40px);
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(0,0,0,.82); backdrop-filter: blur(12px); border-color: var(--line); }
.nav__brand img { height: 28px; width: auto; }
.nav__links { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav__links a {
  text-decoration: none; font-weight: 600; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase;
  opacity: .75; transition: opacity .2s, color .2s;
}
.nav__links a:hover, .nav__links a.is-current { opacity: 1; }
.nav__links a.is-current { color: var(--amber); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--red); }
.nav__toggle { display: none; }

/* Hero: the key art sinks into black, an outrun grid streams out of the horizon */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  overflow: hidden; text-align: center; padding: 120px 16px 120px;
}
.hero__bg { position: absolute; inset: 0; }
.hero__bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: drift 18s ease-out both;
}
@keyframes drift { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center 40%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.8) 60%, var(--bg) 100%),
              linear-gradient(to bottom, rgba(0,0,0,.35), var(--bg) 92%);
}
.hero__grid {
  position: absolute; left: -50%; right: -50%; bottom: 0; height: 38%;
  background-image:
    linear-gradient(to right, rgba(34,224,255,.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34,224,255,.45) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(320px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  animation: stream 2.4s linear infinite;
  opacity: .55;
}
.hero__grid::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--text); box-shadow: 0 0 18px var(--text);
}
@keyframes stream { to { background-position: 0 64px; } }
.hero__content { position: relative; max-width: 760px; }
.hero__logo { width: min(620px, 86vw); height: auto; margin: 0 auto; filter: drop-shadow(0 0 32px rgba(255,90,0,.35)); }
.hero__tagline { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--text); opacity: .9; margin: 28px 0 32px; }
.hero__ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
/* The trailer, under the hero's buttons: click to play; nothing but the poster loads until then */
.hero__trailer {
  width: min(880px, 100%); margin: clamp(28px, 5vw, 48px) auto 0;
  position: relative;
  border-radius: var(--radius); overflow: hidden; background: #000;
  border: 1px solid var(--line); aspect-ratio: 16 / 9;
  box-shadow: 0 0 80px rgba(255,90,0,.18);
}
.hero__trailer video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero__play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: clamp(64px, 11vw, 96px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--sun); box-shadow: 0 0 40px rgba(255,90,0,.55);
  display: grid; place-items: center; transition: transform .2s ease, box-shadow .2s ease;
}
.hero__play span {
  width: 0; height: 0; margin-left: 12%;
  border-style: solid; border-width: 14px 0 14px 24px; border-color: transparent transparent transparent var(--bg);
  scale: clamp(1, 1.2vw, 1.4);
}
.hero__play:hover, .hero__play:focus-visible { transform: scale(1.08); box-shadow: 0 0 60px rgba(255,90,0,.8); outline: none; }
.hero__play[hidden] { display: none; }
.hero__scroll {
  position: absolute; bottom: 24px; left: 50%; translate: -50% 0;
  text-decoration: none; font-size: 1.5rem; color: var(--cyan); opacity: .8; animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(8px); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--body); font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: transform .15s ease, background .2s, color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.btn--light { background: var(--text); color: var(--bg); }
.btn--sun { background: linear-gradient(to right, #ffb300, #ff5a00, #ff1e5a); color: #140400; }
.btn--sun:hover { box-shadow: 0 8px 32px rgba(255,90,0,.45); }
.btn--ghost { border-color: rgba(244,255,228,.55); }
.btn--ghost:hover { background: rgba(244,255,228,.1); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { box-shadow: 0 8px 32px color-mix(in srgb, var(--accent) 45%, transparent); }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 128px) clamp(16px, 4vw, 40px); }
.section + .section { border-top: 1px solid var(--line); }
.section__head { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
.section__head h2, .contact h2 {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  background: var(--sun); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: .08em;
}
/* the logotype's speed rules: two red lines either side of a line of amber caps */
.rules {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 16px 0 0; color: var(--amber); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; font-size: .95rem;
}
.rules::before, .rules::after {
  content: ""; flex: 0 1 90px; height: 9px;
  border-top: 3px solid var(--red); border-bottom: 3px solid var(--red);
}

/* Game */
.game {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 8px);
  padding: clamp(16px, 3vw, 32px);
  position: relative; overflow: hidden;
}
.game::before {
  content: ""; position: absolute; inset: -40% auto auto -20%; width: 70%; aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%);
  pointer-events: none;
}
.game::after {
  content: ""; position: absolute; inset: auto -20% -30% auto; width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,30,90,.14), transparent 65%);
  pointer-events: none;
}
.game > * { position: relative; z-index: 1; }
.game__capsule {
  width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 70%; border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.6); transition: transform .4s ease;
}
.game:hover .game__capsule { transform: rotate(-1deg) scale(1.02); }
.game__logo { width: min(400px, 90%); height: auto; margin: -24px 0 4px -12px; }
.game__meta {
  display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  font-weight: 600; font-size: .85rem; letter-spacing: .03em;
}
.game__info > p:not(.game__meta) { color: #d8e0d0; margin: 0 0 18px; }
.game__platforms { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.game__platforms li {
  font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted);
}
.game__ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.game__gallery {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1232fr 590fr; gap: 12px; /* capsule and poster at equal heights */
}
.shot {
  padding: 0; border: 0; background: #000; cursor: zoom-in;
  border-radius: 12px; overflow: hidden;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.shot:hover img { transform: scale(1.04); }
.shot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.shot--wide { aspect-ratio: 1232 / 706; }
.shot--tall { aspect-ratio: 748 / 896; }

/* Gameplay screenshots */
.game__shots {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.game__shots .shot { aspect-ratio: 16 / 9; }

.feats {
  grid-column: 1 / -1; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.feat {
  border-radius: 14px; overflow: hidden; background: #000;
  border: 1px solid var(--line); transition: transform .3s, border-color .3s;
}
.feat:hover { transform: translateY(-4px); border-color: var(--tile); }
.feat img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.feat h3 { font-size: 1.35rem; padding: 16px 16px 0; color: var(--text); }
.feat p { margin: 6px 0 0; padding: 0 16px 18px; color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* Secret endings: nothing to see but a question mark, so the bosses stay a surprise */
.feat__vault {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #1a1712 0%, var(--bg-2) 70%);
}
.feat__lock {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display); font-size: clamp(5rem, 12vw, 8rem); line-height: 1;
  color: var(--amber); text-shadow: 0 0 24px rgba(255,179,0,.5);
  transition: text-shadow .5s ease, transform .5s ease;
}
.feat--secret:hover .feat__lock, .feat--secret:focus-visible .feat__lock {
  text-shadow: 0 0 40px rgba(255,179,0,.8); transform: scale(1.06);
}
.feat--secret:focus-visible { outline: 3px solid var(--tile); outline-offset: 2px; }

/* Studio */
.studio { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.studio__film {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #000;
  border: 1px solid var(--line); aspect-ratio: 16 / 9;
  box-shadow: 0 0 80px rgba(255,90,0,.12);
}
.studio__film video { width: 100%; height: 100%; object-fit: cover; }
.studio__replay {
  position: absolute; right: 14px; bottom: 14px;
  background: rgba(0,0,0,.6); color: var(--cyan); border: 1px solid rgba(34,224,255,.5); border-radius: 999px;
  padding: 6px 14px; font: 600 .85rem var(--body); cursor: pointer;
}
.studio__replay:hover { background: rgba(34,224,255,.15); }
.studio__mark { width: 120px; height: auto; margin-bottom: 20px; }
.studio__text p { color: #d8e0d0; margin: 0 0 16px; font-size: 1.05rem; }
.studio__text strong { font-weight: 600; color: var(--text); }
.studio__more a { color: var(--cyan); text-decoration: none; font-weight: 600; }
.studio__more a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Team: round portraits wearing the monogram's contour rings, as on martinez.sh's own circles */
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; gap: clamp(32px, 6vw, 88px); }
.member { margin: 0; text-align: center; }
.member__ring {
  border-radius: 50%; aspect-ratio: 1; margin: 12px;
  box-shadow: 0 0 0 4px var(--green), 0 0 0 8px var(--amber), 0 0 0 12px var(--red), 0 0 60px rgba(255,90,0,.3);
  transition: transform .3s, box-shadow .3s;
}
.member__ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.member:hover .member__ring {
  transform: translateY(-4px);
  box-shadow: 0 0 0 4px var(--green), 0 0 0 8px var(--amber), 0 0 0 12px var(--red), 0 0 80px rgba(255,90,0,.5);
}
.member h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 28px; }
.member p { margin: 6px 0 0; color: var(--amber); text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; font-weight: 600; }

/* Contact */
.contact { text-align: center; }
.contact p { color: var(--muted); font-size: 1.1rem; margin: 12px 0 28px; }

/* Footer */
.footer {
  border-top: 1px solid var(--line); padding: 40px 16px; text-align: center; color: var(--muted); font-size: .9rem;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.footer img { height: 44px; width: auto; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--cyan); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.94);
  display: grid; place-items: center; padding: 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 12px; }
.lightbox img { max-height: 84vh; width: auto; border-radius: 12px; }
.lightbox figcaption { color: var(--muted); font-size: .95rem; text-align: center; }
.lightbox figcaption:empty { display: none; }
.lightbox__nav {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 1px solid rgba(34,224,255,.45); color: var(--cyan);
  font-size: 2rem; line-height: 1; cursor: pointer; transition: background .2s;
}
.lightbox__nav:hover { background: rgba(34,224,255,.15); }
.lightbox__nav--prev { left: clamp(8px, 2vw, 24px); }
.lightbox__nav--next { right: clamp(8px, 2vw, 24px); }
.lightbox__close {
  position: absolute; top: 16px; right: 20px; background: none; border: 0; color: var(--text);
  font-size: 2.4rem; line-height: 1; cursor: pointer;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Mobile */
@media (max-width: 860px) {
  .game, .studio { grid-template-columns: 1fr; }
  .game__logo { margin: -12px auto 0; }
  .game__info { text-align: center; }
  .game__platforms, .game__ctas { justify-content: center; }
  .game__gallery { grid-template-columns: 1fr; }
  .shot--tall { display: none; }
  .game__shots { grid-template-columns: repeat(2, 1fr); }
  .feats { grid-template-columns: 1fr 1fr; }
  .studio__text { text-align: center; }
  .studio__mark { margin-inline: auto; }
}
@media (max-width: 640px) {
  .nav__brand img { height: 22px; }
  .nav__toggle {
    display: grid; gap: 6px; background: none; border: 0; padding: 10px; cursor: pointer;
  }
  .nav__toggle span { display: block; width: 26px; height: 2px; background: var(--text); transition: transform .2s; }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: rgba(0,0,0,.96); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav__links.is-open { max-height: 300px; }
  .nav__links a { padding: 16px 20px; border-top: 1px solid var(--line); }
  .rules::before, .rules::after { flex-basis: 36px; }
  .team { grid-template-columns: minmax(0, 260px); }
  .feat h3 { font-size: 1.1rem; padding: 12px 12px 0; }
  .feat p { padding: 0 12px 14px; font-size: .82rem; }
  .lightbox__nav { width: 40px; height: 40px; font-size: 1.6rem; }
}
@media (max-width: 340px) {
  .feats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
