/* Default look = what the page looked like at 200% browser zoom.
   Every size below is in rem, so scaling the root scales the whole page
   while the browser itself stays at 100% zoom. */
html {
  font-size: 200%;
}

/* Phones / small windows keep normal 1x sizing */
@media (max-width: 1023px) {
  html {
    font-size: 100%;
  }
}

:root {
  --paper: #df8237;
  --ink: #111111;
  --card-red: #c93d27;
  --card-blue: #1d62a3;
  --card-green: #2B5A4D;
  --card-dark: #18191e;
  --lamp: #F2A93B;
  --white: #F8F5F0;
}

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

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  padding: 2.5rem 1.25rem;
  position: relative;
  min-height: 100vh;
}

/* Drifting checkerboard background.
   The layer is oversized by two tiles and slides exactly one tile (2.5rem)
   diagonally per cycle, so the loop is seamless. */
body::before {
  content: "";
  position: fixed;
  inset: -5rem;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(45deg, rgba(0,0,0,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.06) 75%);
  background-size: 2.5rem 2.5rem;
  background-position: 0 0, 0 1.25rem, 1.25rem -1.25rem, -1.25rem 0;
  animation: checkerDrift 6s linear infinite;
}

@keyframes checkerDrift {
  from { transform: translate(0, 0); }
  to   { transform: translate(2.5rem, 2.5rem); }
}

/* Ensure content sits above background */
header, main, footer, .modal-backdrop {
  position: relative;
  z-index: 2;
}

/* Comic Film Strip Header Border */
.film-banner {
  background: var(--ink);
  color: var(--white);
  padding: 1.5rem 2rem;
  border: 0.25rem solid var(--ink);
  box-shadow: 0.5rem 0.5rem 0 rgba(0,0,0,0.8);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.film-banner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 0.5rem;
  background: repeating-linear-gradient(90deg, var(--paper), var(--paper) 1.25rem, var(--ink) 1.25rem, var(--ink) 2.1875rem);
}

.film-banner::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 0.5rem;
  background: repeating-linear-gradient(90deg, var(--paper), var(--paper) 1.25rem, var(--ink) 1.25rem, var(--ink) 2.1875rem);
}

.film-banner h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
  font-style: italic;
}

/* Ultra Smooth Line Boil (Persona Style, smooth easing) */
@keyframes smoothBoil {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-0.046875rem, 0.046875rem) rotate(-0.1deg); }
  66% { transform: translate(0.046875rem, -0.046875rem) rotate(0.1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.boil {
  animation: smoothBoil 4s ease-in-out infinite;
}

/* Main Container Layout */
.comic-grid {
  max-width: 68.75rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2rem;
}

/* Comic Panel Base */
.comic-panel {
  grid-column: span 12;
  min-width: 0;
  background: var(--card-dark);
  border: 0.25rem solid var(--ink);
  box-shadow: 0.625rem 0.625rem 0 rgba(0, 0, 0, 0.9);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 1536px) {
  .col-span-7 { grid-column: span 7; }
  .col-span-5 { grid-column: span 5; }
  .col-span-12 { grid-column: span 12; }
}

/* Halftone dots: evenly tiled (no rotation/scaling, so every dot renders
   identically), oversized by two tiles and drifting one tile (1.25rem)
   diagonally per cycle, slower than the checkerboard. */
.halftone-bg {
  position: absolute;
  inset: -2.5rem;
  background-image: radial-gradient(circle at center, rgba(0,0,0,0.35) 0.2375rem, transparent 0.2875rem);
  background-size: 1.25rem 1.25rem;
  background-position: 0 0;
  pointer-events: none;
  z-index: 1;
  animation: halftoneDrift 10s linear infinite;
}

@keyframes halftoneDrift {
  from { transform: translate(0, 0); }
  to   { transform: translate(1.25rem, 1.25rem); }
}

.panel-inner-content {
  position: relative;
  z-index: 2;
}

/* Profile / 4 Games Square Frame */
.profile-box {
  background: var(--card-red);
  border: 0.25rem solid var(--ink);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  box-shadow: 0.375rem 0.375rem 0 var(--ink);
  position: relative;
  overflow: hidden;
}

.profile-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0.1875rem solid var(--ink);
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
}

/* Panel Titles & Typography */
h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--white);
  margin: 0 0 1rem 0;
  letter-spacing: -0.01em;
  font-style: italic;
}

p {
  color: #d1d5db;
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
  font-weight: 600;
}

/* Game Cards Layout */
.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  background: rgba(24, 25, 30, 0.95);
  border: 0.1875rem solid var(--ink);
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0.3125rem 0.3125rem 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

@media (min-width: 1280px) {
  .game-card {
    grid-template-columns: 13.75rem 1fr;
  }
}

.game-card:hover {
  transform: translate(-0.1875rem, -0.1875rem);
  box-shadow: 0.5rem 0.5rem 0 var(--ink);
}

.game-cover {
  aspect-ratio: 16 / 9;
  border: 0.1875rem solid var(--ink);
  overflow: hidden;
  background: var(--ink);
}

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

.game-details h3 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--white);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  font-style: italic;
}

.game-details p {
  font-size: 0.95rem;
  margin: 0 0 0.75rem 0;
  color: #9ca3af;
}

.ticket {
  display: inline-block;
  background: var(--lamp);
  color: var(--ink);
  border: 0.125rem solid var(--ink);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.25rem 0.625rem;
  text-transform: uppercase;
  box-shadow: 0.1875rem 0.1875rem 0 var(--ink);
}

/* Crew List */
.crew-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.crew-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  text-decoration: none;
  background: rgba(0,0,0,0.3);
  margin-bottom: 0.875rem;
  border: 0.125rem solid var(--white);
  border-radius: 0;
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.crew-item:hover {
  transform: translate(-0.125rem, -0.125rem);
  box-shadow: 0.375rem 0.375rem 0 var(--ink);
  background: var(--lamp);
  border-color: var(--ink);
  color: var(--ink);
}

.crew-item:hover .crew-name,
.crew-item:hover .crew-role {
  color: var(--ink);
}

.crew-name {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--white);
  text-transform: uppercase;
}

.crew-role {
  font-style: italic;
  font-weight: 700;
  color: #9ca3af;
  font-size: 0.95rem;
}

/* Contact Section & Mail Button */
.contact-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 1536px) {
  .contact-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.mail-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--lamp);
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 900;
  padding: 0.875rem 1.5rem;
  border: 0.1875rem solid var(--ink);
  text-decoration: none;
  box-shadow: 0.3125rem 0.3125rem 0 var(--ink);
  text-transform: uppercase;
  font-style: italic;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  max-width: 100%;
}

.mail-btn:hover {
  transform: translate(-0.125rem, -0.125rem);
  box-shadow: 0.4375rem 0.4375rem 0 var(--ink);
}

.mail-btn .btn-icon {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  flex-shrink: 0;
}

/* POP-OUT MODAL STYLING */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--card-dark);
  border: 0.25rem solid var(--ink);
  box-shadow: 0.75rem 0.75rem 0 rgba(0, 0, 0, 0.9);
  width: 100%;
  max-width: 53.125rem;
  padding: 2.25rem;
  position: relative;
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.active .modal-box {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--card-red);
  color: var(--white);
  border: 0.1875rem solid var(--ink);
  width: 2.5rem;
  height: 2.5rem;
  font-weight: 900;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0.1875rem 0.1875rem 0 var(--ink);
  transition: transform 0.1s ease;
  z-index: 10;
}

.modal-close:hover {
  transform: translate(-0.125rem, -0.125rem);
  box-shadow: 0.3125rem 0.3125rem 0 var(--ink);
}

.modal-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1536px) {
  .modal-content-grid {
    grid-template-columns: 1fr 1.2fr;
  }
}

.modal-thumb {
  aspect-ratio: 16 / 9;
  border: 0.1875rem solid var(--ink);
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0.3125rem 0.3125rem 0 var(--ink);
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--white);
  text-transform: uppercase;
  font-style: italic;
}

.modal-desc {
  color: #d1d5db;
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: justify;
  margin-bottom: 1.5rem;
}

.modal-cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.itch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--lamp);
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  border: 0.1875rem solid var(--ink);
  text-decoration: none;
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
  font-style: italic;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.itch-btn:hover {
  transform: translate(-0.125rem, -0.125rem);
  box-shadow: 0.375rem 0.375rem 0 var(--ink);
}

.itch-icon-box {
  width: 1.75rem;
  height: 1.75rem;
  background: var(--card-red);
  border: 0.125rem solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.1875rem;
  box-shadow: 0.125rem 0.125rem 0 var(--ink);
}

.itch-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

footer {
  text-align: center;
  margin-top: 3.125rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: 0.05em;
}

/* ---------- Phones (iPhone SE and similar) ---------- */
@media (max-width: 640px) {
  body {
    padding: 1rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .film-banner {
    padding: 1.5rem 1rem;
    box-shadow: 0.375rem 0.375rem 0 rgba(0,0,0,0.8);
    margin-bottom: 1.75rem;
    text-align: center;
  }

  .film-banner h1 {
    font-size: clamp(1.75rem, 9vw, 2.5rem);
    overflow-wrap: anywhere;
  }

  .comic-grid { gap: 1.5rem; }

  .comic-panel {
    padding: 1.25rem;
    box-shadow: 0.375rem 0.375rem 0 rgba(0, 0, 0, 0.9);
  }

  .profile-box { padding: 0.75rem; }

  .game-card { padding: 0.75rem; gap: 0.75rem; }

  .crew-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
  }

  /* Contact: centered, button fills the width and the email scales to fit */
  .contact-container {
    align-items: center;
    text-align: center;
  }

  .contact-container > div { width: 100%; }

  .mail-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    font-size: clamp(0.65rem, 3.2vw, 1rem);
    box-shadow: 0.25rem 0.25rem 0 var(--ink);
  }

  .mail-btn span {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .mail-btn .btn-icon { width: 1.25rem; height: 1.25rem; }

  .modal-backdrop { padding: 1rem; }

  .modal-box {
    padding: 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0.5rem 0.5rem 0 rgba(0, 0, 0, 0.9);
  }

  .modal-info h2 { font-size: 1.5rem; }

  footer { margin-top: 2rem; }
}