/* =============================
   IQAM Arcade / The Arcade — Global Styles
   ============================= */

:root{
  --bg:#D2D2D2;
  --ink:#25283B;
  --muted:#6b7280;
  --accent:#8b5cf6; /* violet */
  --panel:#ffffffE6;
  --shadow:0 10px 30px rgba(0,0,0,.1);
}

*{ box-sizing:border-box; margin:0; padding:0; }
html,body{ height:100%; }
body{
  font-family:'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color:var(--ink);
  background:var(--bg);
}

/* Utilities */
.visually-hidden{
  position:absolute !important; width:1px; height:1px; margin:-1px; padding:0; border:0;
  clip:rect(0 0 0 0); overflow:hidden; white-space:nowrap;
}
img, video{ max-width:100%; height:auto; display:block; }
body.menu-open, body.modal-open{ overflow:hidden; }

/* Subtle grid background */
.grid-bg{
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(to right, transparent 0 100px, #25283b22 100px 101px),
    repeating-linear-gradient(to bottom, transparent 0 100px, #25283b22 100px 101px);
}

/* =============================
   Header / Nav
   ============================= */
.site-header{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; padding:1rem 2rem;
  backdrop-filter: blur(8px);
  background: #f9fafb99;
  border-bottom: 1px solid #e5e7eb;
}
.brand{ font-weight:800; text-decoration:none; color:var(--ink); display:flex; align-items:center; gap:.5rem; }
.brand-mark{ filter: drop-shadow(0 6px 10px rgba(0,0,0,.15)); }

.nav ul{ display:flex; align-items:center; gap:1rem; list-style:none; }
.nav a{ text-decoration:none; color:var(--ink); font-weight:600; padding:.5rem .75rem; border-radius:999px; }
.nav a:hover{ background:#00000008; }
.nav a.active{ background:#00000010; }
.nav .btn-primary{ background:var(--accent); color:white; box-shadow: var(--shadow); }
.nav .btn-primary:hover{ filter:brightness(1.05); }

.nav-toggle{ display:none; border:0; background:transparent; width:42px; height:42px; position:relative; }
.nav-toggle span{ position:absolute; left:8px; right:8px; height:2px; background:var(--ink); transition:.2s; }
.nav-toggle span:nth-child(1){ top:12px; }
.nav-toggle span:nth-child(2){ top:20px; }
.nav-toggle span:nth-child(3){ top:28px; }

/* =============================
   Banner / Hero with 3D carousel
   ============================= */
.banner{
  width: 100%;
  height: calc(var(--vh, 1vh) * 100); /* stable mobile viewport */
  text-align: center;
  overflow: hidden;
  position: relative;
}
.banner .slider{
  position: absolute;
  width: 200px;
  height: 250px;
  top: 10%;
  left: calc(50% - 100px);
  transform-style: preserve-3d;
  transform: perspective(1000px);
  animation: autoRun 20s linear infinite;
  z-index: 2;
}
@keyframes autoRun{
  from{ transform: perspective(1000px) rotateX(-16deg) rotateY(0deg); }
  to{   transform: perspective(1000px) rotateX(-16deg) rotateY(360deg); }
}
.banner .slider .item{
  position: absolute; inset: 0;
  transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(550px);
  border-radius: 16px; overflow:hidden; box-shadow: var(--shadow);
}
.banner .slider .item img{ width:100%; height:100%; object-fit:cover; }
.banner .content{
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(1400px, 100vw);
  height: max-content;
  padding-bottom: 120px;
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center;
  z-index: 1;
}
.banner .content h1{
  font-family: 'ICA Rubrik', sans-serif;
  font-size: clamp(3rem, 12vw, 13rem);
  line-height: 1; color: #25283B; position: relative;
  letter-spacing:-.03em;
}
.banner .content h1::after{
  position: absolute; inset: 0;
  content: attr(data-content); z-index: 2;
  -webkit-text-stroke: 2px #d2d2d2; color: transparent;
}
.banner .content .author{ text-align:right; max-width: 280px; }
.banner .content h2{ font-size: clamp(1.5rem, 5vw, 3rem); }
.banner .content .model{
  background-image: url('images/model.png');
  width: 100%; height: 70vh; position: absolute; bottom: 0; left: 0;
  background-size: auto 130%; background-repeat: no-repeat; background-position: top center; z-index: 1;
}

.cta-float{
  position:absolute; bottom: 2rem; right: 2rem;
  text-decoration:none; padding:.9rem 1.2rem; border-radius:14px;
  background: var(--accent); color:white; font-weight:800;
  box-shadow: var(--shadow);
}

/* =============================
   Shared Sections
   ============================= */
.page-hero{ padding: 6rem 2rem 2rem; text-align:center; }
.page-hero h1{ font-size: clamp(2rem, 6vw, 5rem); letter-spacing:-.02em; }
.page-hero p{ color:var(--muted); margin-top:.5rem; }

.features{
  display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap:1rem; padding: 2rem; max-width:1200px; margin:0 auto;
}
.feature-card{ background:var(--panel); padding:1.2rem; border-radius:18px; box-shadow: var(--shadow); }

.cards{
  display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap:1.2rem; padding:2rem; max-width:1200px; margin:0 auto;
}
.card{ background:var(--panel); border-radius:16px; overflow:hidden; box-shadow: var(--shadow); }
.card img{ width:100%; height:200px; object-fit:cover; display:block; }
.card-body{ padding:1rem; display:grid; gap:.5rem; }

/* Buttons */
.btn{ display:inline-block; padding:.6rem 1rem; border-radius:12px; background:#efefef; text-decoration:none; color:var(--ink); font-weight:700; }
.btn:hover{ filter:brightness(0.98); }
.btn-primary{ background: var(--accent); color:white; }
.btn-ghost{ background:transparent; border:1px solid #e5e7eb; color:var(--ink); }
.btn-ghost:hover{ background:#00000006; }

/* =============================
   News list
   ============================= */
.news-list{ max-width:900px; margin: 1rem auto 4rem; padding: 0 1rem; display:grid; gap:2rem; }
.news-list article{ background:var(--panel); padding:1.2rem; border-radius:16px; box-shadow: var(--shadow); }
.news-list .meta{ color:var(--muted); font-size:.9rem; margin:.25rem 0 .5rem; }

/* =============================
   About / Contact
   ============================= */
.about-grid{
  max-width:1000px; margin: 1rem auto 4rem; padding: 0 1rem;
  display:grid; gap:1rem; grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
}
.contact-section{
  max-width:1000px; margin:2rem auto 4rem; padding:0 1rem;
  display:grid; gap:1.5rem; grid-template-columns: 1.2fr .8fr;
}
.contact-form{
  background:var(--panel); padding:1.2rem; border-radius:16px; box-shadow: var(--shadow);
  display:grid; grid-template-columns: repeat(2,1fr); gap:1rem;
}
.contact-form label{ display:grid; gap:.35rem; }
.contact-form label.full{ grid-column:1 / -1; }
.contact-form input, .contact-form textarea, .contact-form select{
  width:100%; padding:.8rem 1rem; border-radius:12px; border:1px solid #e5e7eb; outline:none; background:#fff;
}
.contact-aside{ background:var(--panel); padding:1.2rem; border-radius:16px; box-shadow: var(--shadow); }

.socials{ list-style:none; display:grid; gap:.5rem; }
.socials a{ text-decoration:none; color:var(--ink); }
.socials a:hover{ text-decoration:underline; }

.site-footer{ text-align:center; padding:2rem; color:var(--muted); }

/* =============================
   Games page specific
   ============================= */
.games-toolbar{
  max-width:1200px; margin:1rem auto 2rem; padding:0 1rem;
  display:grid; grid-template-columns: 1fr auto auto; gap:.8rem; align-items:center;
}
.games-toolbar input[type="search"]{
  padding:.8rem 1rem; border:1px solid #e5e7eb; border-radius:12px; outline:none;
  background:#fff; box-shadow: var(--shadow);
}
.chips{ display:flex; gap:.5rem; flex-wrap:wrap; }
.chip{
  border:1px solid #e5e7eb; padding:.45rem .8rem; border-radius:999px;
  background:#fff; cursor:pointer; font-weight:600;
}
.chip.is-active{ background:var(--ink); color:#fff; border-color:transparent; }
.sort select{
  padding:.6rem .9rem; border:1px solid #e5e7eb; border-radius:12px; background:#fff; font-weight:600;
}

.games-grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(260px,1fr));
  gap:1.2rem; padding:0 1rem 2rem; max-width:1200px; margin:0 auto;
}
.game-card{
  display:grid; background:var(--panel); border-radius:16px; overflow:hidden; box-shadow: var(--shadow);
  border:1px solid #e5e7eb;
}
.game-thumb{ position:relative; display:block; aspect-ratio:16/9; overflow:hidden; }
.game-thumb img{ width:100%; height:100%; object-fit:cover; transition: transform .35s ease; display:block; }
.game-thumb:hover img{ transform: scale(1.03); }
.badge,.badge-new{
  position:absolute; left:.75rem; top:.75rem; padding:.25rem .5rem; border-radius:.5rem;
  color:#fff; font-size:.75rem; font-weight:700; box-shadow: var(--shadow);
}
.badge{ background: var(--ink); }
.badge-new{ background: var(--accent); }
.game-meta{ padding:1rem 1rem 1.2rem; display:grid; gap:.5rem; }
.game-meta h3{ margin:0; font-size:1.1rem; }
.tags{ display:flex; gap:.4rem; list-style:none; padding:0; margin:.25rem 0 0; flex-wrap:wrap; }
.tags li{ font-size:.75rem; background:#f3f4f6; color:#111; padding:.2rem .5rem; border-radius:.4rem; }
.game-card .stats{ display:flex; gap:.5rem; align-items:center; margin:.6rem 0; color:var(--muted); font-size:.9rem; }
.game-card .stats .dot{ opacity:.6; }
.game-card .cta{ display:flex; gap:.6rem; }

/* Modal */
.modal{ position:fixed; inset:0; display:none; }
.modal[aria-hidden="false"]{ display:block; }
.modal-backdrop{
  position:absolute; inset:0; background:rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}
.modal-card{
  position:relative; z-index:1; max-width:980px; margin:5vh auto; display:grid;
  grid-template-columns: 1fr 1.2fr; gap:0; background:var(--panel); border-radius:16px; box-shadow: var(--shadow); overflow:hidden;
}
.modal-media img{ width:100%; height:100%; object-fit:cover; display:block; }
.modal-body{ padding:1.2rem; display:grid; gap:.75rem; }
.modal-body .muted{ color:var(--muted); }
.modal-cta{ margin-top:.25rem; }
.modal-close{
  position:absolute; right:.6rem; top:.6rem; border:0; background:#ffffff; width:36px; height:36px; border-radius:999px;
  box-shadow:var(--shadow); cursor:pointer; font-weight:800; color:var(--ink);
}

/* Reveal on scroll */
.reveal{ opacity:0; transform: translateY(16px); }

/* =============================
   Responsive
   ============================= */

/* Mobile nav drawer */
@media (max-width: 900px){
  .site-header{ padding:.75rem 1rem; }

  .nav-toggle{ display:block; }

  .nav ul{
    position:fixed; inset:0; right:0; top:0;
    height:100dvh; max-width:300px; margin-left:auto;
    background:var(--panel);
    padding:1rem;
    border-left:1px solid #e5e7eb;
    box-shadow: var(--shadow);
    display:none; flex-direction:column; gap:.75rem;
  }
  .nav ul.open{ display:flex; }
  .nav ul li a{ padding:.9rem 1rem; width:100%; border-radius:12px; }

  .contact-section{ grid-template-columns: 1fr; }
}

/* Banner / slider depth adjustments */
@media (max-width: 1023px){
  .banner .slider{ width:160px; height:200px; left: calc(50% - 80px); }
  .banner .slider .item{ transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(300px); }
  .banner .content .author{ color:#111; max-width:unset; width:100%; text-align:center; padding: 0 30px; }
}
@media (max-width: 767px){
  .banner .slider{ width:100px; height:150px; left:calc(50% - 50px); }
  .banner .slider .item{ transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(180px); }
}

/* Extra small hero calm motion & text sizing */
@media (max-width: 640px){
  .banner .content{ padding-bottom:80px; }
  .banner .content h1{ font-size:clamp(2.2rem, 12vw, 4.2rem); }
  .banner .slider{ width:90px; height:120px; top:8%; left:calc(50% - 45px); animation-duration:28s; }
  .banner .slider .item{ transform: rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(140px); }
}

/* One-column grids on phones */
@media (max-width: 600px){
  .cards, .games-grid{ grid-template-columns: 1fr; }
  .card img{ height: 180px; }
}

/* Games toolbar stacking + chip scroll */
@media (max-width: 900px){
  .games-toolbar{ grid-template-columns: 1fr; gap:.6rem; align-items:stretch; }
  .chips{
    overflow-x:auto; white-space:nowrap; -webkit-overflow-scrolling:touch;
    padding-bottom:.25rem; scroll-snap-type:x proximity;
  }
  .chip{ display:inline-block; scroll-snap-align:start; }
  .sort{ justify-self:start; }
}

/* Game cards: stack CTAs on tiny screens */
@media (max-width: 480px){
  .game-card .cta{ flex-direction:column; }
  .game-card .cta .btn{ width:100%; text-align:center; }
}

/* Modal on phones */
@media (max-width: 800px){
  .modal-card{ grid-template-columns: 1fr; margin:6vh 1rem; }
}
@media (max-width: 600px){
  .modal-card{ height:92vh; }
  .modal-media{ max-height:40vh; }
}

/* Forms: avoid iOS zoom */
.contact-form input,
.contact-form textarea,
.contact-form select{ font-size:16px; }

/* === Mobile hero tightening (no extra space) === */
@media (max-width: 640px){
  /* Put the content higher (center-ish), remove bottom padding */
  .banner .content{
    top: 44%;
    bottom: auto;
    transform: translate(-50%, -50%);
    padding-bottom: 0;
    position: absolute; /* keep absolute but anchor by top */
  }

  /* Smaller, tighter title so it fits comfortably above the fold */
  .banner .content h1{
    font-size: clamp(2rem, 11vw, 3.8rem);
    letter-spacing: -0.02em;
  }

  /* Lift the 3D slider a bit so there’s less empty space above */
  .banner .slider{
    top: 6%;
  }

  /* Reduce the decorative model height so it doesn't push content visually */
  .banner .content .model{
    height: 42vh;
    background-size: auto 120%;
  }

  /* Pull the floating button up and in */
  .cta-float{
    bottom: 1rem;
    right: 1rem;
  }
}

/* Slightly larger phones/phablets: keep things high as well */
@media (min-width: 641px) and (max-width: 767px){
  .banner .content{
    top: 46%;
    bottom: auto;
    transform: translate(-50%, -50%);
    padding-bottom: 0;
  }
  .cta-float{ bottom: 1.2rem; right: 1.2rem; }
}

/* ==== MOBILE HERO TIGHTENING & CENTERING (no desktop changes) ==== */
@media (max-width: 640px){
  /* Lift the content and center it */
  .banner .content{
    position:absolute;
    top: 50%;                 /* was bottom-aligned; now higher on screen */
    bottom: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, 100%);
    padding: 0 16px;
    justify-content: center;
    text-align: center;
    gap: .6rem;
  }
  .banner .content h1{
    font-size: clamp(2rem, 11vw, 3.6rem);
    letter-spacing: -0.02em;
    line-height: 3.05;
  }
  .banner .content .author{
    max-width: unset;
    width: 100%;
    text-align: center;       /* override desktop right-align */
    padding: 20;
    margin: 0 auto;
  }

  /* Reduce space above; keeps carousel present but not eating height */
  .banner .slider{ top: 15%; }

  /* Center the purple button and pull it up nearer the text */
  .cta-float{
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 13%;              /* was bottom edge; now sits closer to content */
    padding: .85rem 1.15rem;
    border-radius: 14px;
  }

  /* The decorative model shouldn’t push the eye down */
  .banner .content .model{
    height: 40vh;
    background-size: auto 118%;
  }
}

/* Slightly larger phones / small tablets: same idea, a touch more breathing room */
@media (min-width: 641px) and (max-width: 767px){
  .banner .content{
    top: 44%;
    bottom: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
  }
  .cta-float{
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 18%;
  }
}
