/* charliebehan.com */

:root {
  --bg:       #0c0c0e;
  --surface:  #111114;
  --border:   rgba(255, 255, 255, 0.08);
  --text:     #ececf0;
  --text-2:   #888898;
  --text-3:   #3e3e52;
  --red:      #c82020;
  --red-up:   #e02828;
  --nav-h:    58px;
  --pad:      clamp(1.5rem, 5vw, 3rem);
  --t:        0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

/* ── Nav ── */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background var(--t), border-color var(--t), backdrop-filter var(--t);
}

.nav--scrolled {
  background: rgba(12, 12, 14, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--pad);
  max-width: 1400px;
  margin: 0 auto;
}

.nav__brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.nav__logo {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: opacity var(--t);
}
.nav__logo:hover { opacity: 0.6; }

.nav__tagline {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 500;
}

.nav__links { display: flex; gap: 1.5rem; align-items: center; }

.nav__link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t);
}
.nav__link:hover { color: var(--text); }

/* ── Game sections ── */

main {
  padding-top: var(--nav-h);
}

.game {
  display: flex;
  min-height: 520px;
  border-bottom: 1px solid var(--border);
}

/* Alternate: even-indexed games flip cover/info sides */
.game--flip { flex-direction: row-reverse; }

/* ── Cover ── */

.game__cover {
  flex: 3;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

/* Real cover image */
.game__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.game--active .game__img { transform: scale(1.03); }

/* Gradient placeholder (used until real art is set) */
.game__gradient {
  position: absolute;
  inset: 0;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.game--active .game__gradient { transform: scale(1.03); }

/* Colour gradient overlay — fades out when section is scroll-focused */
.game__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cover-gradient);
  opacity: 1;
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}
.game--active .game__cover::after {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Subtle noise texture over placeholder */
.game__gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.04;
  pointer-events: none;
}

/* ── Info panel ── */

.game__info {
  flex: 2;
  display: flex;
  align-items: center;
  padding: var(--pad);
  border-left: 1px solid var(--border);
}

.game--flip .game__info {
  border-left: none;
  border-right: 1px solid var(--border);
}

.game__info-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 340px;
}

.game__title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.game__desc {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── Platform icons ── */

.game__platforms-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game__platforms-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.game__platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.platform-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-3);
  transition: background var(--t), border-color var(--t), color var(--t);
}
.platform-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
}
.platform-link img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.4;
  transition: opacity var(--t);
}
.platform-link:hover img { opacity: 0.9; }
.platform-link svg { width: 14px; height: 14px; color: #fff; opacity: 0.4; transition: opacity var(--t); }
.platform-link:hover svg { opacity: 0.9; }

/* ── CTA button ── */

.btn {
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t), transform var(--t), box-shadow var(--t);
  align-self: flex-start;
}

.btn--primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn--primary:hover {
  background: var(--red-up);
  border-color: var(--red-up);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200, 32, 32, 0.35);
}

/* Nav play button */
.btn--sm {
  font-size: 0.75rem;
  padding: 0.45rem 0.9rem;
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn--sm:hover { background: var(--red-up); }

/* ── Footer ── */

.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem var(--pad);
}

.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--text-3);
}

.footer__socials {
  display: flex;
  gap: 0.25rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-3);
  transition: color var(--t), background var(--t);
}
.social-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Responsive ── */

@media (max-width: 680px) {
  .game,
  .game--flip {
    flex-direction: column;
    min-height: auto;
  }

  .game__cover { min-height: 240px; }

  .game__info { border-left: none !important; border-right: none !important; border-top: 1px solid var(--border); }

  .game__info-inner { max-width: 100%; }

  .nav__links { gap: 1rem; }
}
