/* ==========================================================================
   Pernox Games — Studio Website
   Single shared stylesheet: design system + all pages
   ========================================================================== */

/* ----- Design tokens ----------------------------------------------------- */
:root {
  /* Brand palette (extracted from Pernox game assets) */
  --bg:            #14101E;
  --bg-2:         #100C18;
  --panel:         #1C1526;
  --panel-2:       #241B30;
  --line:          #322542;
  --gold:          #FFB23E;
  --gold-soft:     #FFC976;
  --gold-deep:     #C9923E;
  --bronze:        #7A5A22;
  --text:          #F4F2FA;
  --text-muted:    #B9B2C9;
  --text-dim:      #857D97;

  /* Type */
  --font-head: "Space Grotesk", "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Layout */
  --maxw: 1120px;
  --radius: 18px;
  --radius-lg: 28px;
  --gap: clamp(1rem, 2.5vw, 2rem);

  /* Effects */
  --glow: 0 0 40px rgba(255, 178, 62, 0.35);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 1px var(--line);
}

/* ----- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ----- Cosmic background ------------------------------------------------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(255, 178, 62, 0.14), transparent 60%),
    radial-gradient(700px 500px at 5% 10%, rgba(122, 90, 34, 0.16), transparent 55%),
    radial-gradient(1000px 800px at 50% 110%, rgba(122, 90, 34, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.bg-layer::before {
  /* starfield */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 15% 80%, rgba(255,201,118,.7), transparent),
    radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 33% 45%, rgba(255,201,118,.5), transparent);
  background-repeat: repeat;
  background-size: 100% 100%;
  opacity: .5;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .32; } to { opacity: .62; } }

/* ----- Layout helpers ---------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.center { text-align: center; }
.narrow { max-width: 720px; margin-inline: auto; }

.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gold);
}

/* ----- Typography -------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); }
p  { color: var(--text-muted); }
.lead { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text); }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.gold-text { color: var(--gold); }
strong { color: var(--text); font-weight: 600; }

.section-head { max-width: 680px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { margin: .5rem 0 .8rem; }

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  will-change: transform;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #2A2138;
  box-shadow: var(--glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(255,178,62,.5); }
.btn--ghost {
  background: rgba(255,255,255,.03);
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.btn--sm { padding: .6rem 1.1rem; font-size: .9rem; }

/* ----- Header / nav ------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(20, 16, 30, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-head); font-weight: 700; letter-spacing: .02em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand span { font-size: 1.15rem; }
.brand span b { color: var(--gold); font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: .5rem .85rem;
  border-radius: 10px;
  transition: color .2s ease, background .2s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: rgba(255,255,255,.05); }
.nav-links .btn { margin-left: .4rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 42px; height: 42px;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 70px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
    padding: 1rem clamp(1.1rem, 4vw, 2rem) 1.4rem;
    background: rgba(16, 12, 24, .98);
    border-bottom: 1px solid var(--line);
    transform: translateY(-140%);
    transition: transform .3s ease;
    box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .8rem .9rem; }
  .nav-links .btn { margin: .4rem 0 0; justify-content: center; }
}

/* ----- Hero -------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(3.5rem, 9vw, 7rem); }
.hero-inner { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.1fr .9fr; } }

.hero h1 { margin: 1rem 0 1.1rem; }
.hero .lead { max-width: 42ch; margin-bottom: 1.8rem; }
/* Centered heroes (About, Contact): keep the width-limited lead centered too */
.center .lead { margin-inline: auto; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.wordmark { max-width: 340px; margin-bottom: .5rem; }

.hero-orb {
  position: relative;
  justify-self: center;
  width: min(360px, 80vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.hero-orb img { width: 100%; filter: drop-shadow(0 30px 60px rgba(255,178,62,.25)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-16px) } }

/* ----- Cards / grids ----------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255,178,62,.4); }
.card h3 { margin-bottom: .5rem; }
.card .icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(255,178,62,.12);
  border: 1px solid rgba(255,178,62,.25);
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* ----- Game showcase card ------------------------------------------------ */
.game-showcase {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: var(--shadow);
}
@media (min-width: 820px) { .game-showcase { grid-template-columns: 200px 1fr; } }
.game-showcase .thumb {
  width: 100%; max-width: 200px;
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  justify-self: center;
}
.game-showcase h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .3rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 1.2rem; }
.tag {
  font-size: .78rem;
  font-family: var(--font-head);
  letter-spacing: .04em;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--text-muted);
}

/* ----- Store badges ------------------------------------------------------ */
.store-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  min-width: 175px;
  position: relative;
}
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge .lbl { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge .lbl small { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.store-badge .lbl strong { font-family: var(--font-head); font-size: .98rem; }
.store-badge[data-soon]::after {
  content: "Coming soon";
  position: absolute; top: -9px; right: -6px;
  font-size: .58rem; font-weight: 700; letter-spacing: .06em;
  background: var(--gold); color: #2A2138;
  padding: .12rem .45rem; border-radius: 999px;
  text-transform: uppercase;
}
.store-badge.is-disabled { opacity: .78; cursor: default; }

/* ----- Phone mockup (Shayp) ---------------------------------------------- */
.phone {
  position: relative;
  width: min(300px, 82vw);
  aspect-ratio: 9 / 19;
  border-radius: 40px;
  background: #05030A;
  border: 2px solid #2c2340;
  padding: 12px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), var(--glow);
  justify-self: center;
}
.phone::before {
  content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 20px; background: #05030A; border-radius: 0 0 14px 14px; z-index: 3;
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 30px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #241436, #140F1E 70%);
  position: relative;
}
.phone-screen .p-title {
  font-family: var(--font-head); font-weight: 700;
  text-align: center; padding-top: 42px;
  font-size: 1.9rem; color: #FFF7EC;
  text-shadow: 0 4px 0 rgba(255,115,90,.35);
}
.phone-screen .p-sub { text-align: center; color: #C7D1EA; font-size: .72rem; margin-top: 2px; }
.falling { position: absolute; inset: 0; }
.shape {
  position: absolute; width: 34px; height: 34px;
  animation: fall linear infinite;
}
.shape.circle { border-radius: 50%; }
.shape.square { border-radius: 8px; }
.shape.tri { width: 0; height: 0; background: none !important; border-left: 17px solid transparent; border-right: 17px solid transparent; }
@keyframes fall {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(360px) rotate(160deg); opacity: 0; }
}
.p-buttons { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.p-btn { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 4px 0 rgba(0,0,0,.3); }

/* ----- Screenshot gallery ------------------------------------------------ */
.shot-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-width: 760px;
  margin-inline: auto;
  justify-items: center;
}
.shot { text-align: center; width: 100%; max-width: 240px; }
.shot img {
  width: 100%;
  height: auto;               /* preserve the real aspect ratio */
  aspect-ratio: 722 / 1278;   /* Shayp screen ratio — stable layout while loading */
  object-fit: cover;
  display: block;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease;
}
.shot:hover img { transform: translateY(-4px); border-color: rgba(255,178,62,.45); }
.shot figcaption {
  margin-top: .8rem;
  font-family: var(--font-head);
  font-size: .9rem;
  color: var(--text-muted);
}

/* ----- Feature list (checkmarks) ---------------------------------------- */
.checklist { display: grid; gap: .7rem; }
.checklist li { display: flex; gap: .7rem; align-items: flex-start; color: var(--text-muted); }
.checklist li::before { content: "◆"; color: var(--gold); font-size: .8rem; margin-top: .35rem; flex: none; }

/* ----- Steps (how to play) ---------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: 1.2rem; }
.steps li { counter-increment: step; display: flex; gap: 1rem; align-items: flex-start; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-head); font-weight: 700;
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255,178,62,.12);
  border: 1px solid rgba(255,178,62,.3);
  color: var(--gold);
}
.steps li h4 { margin-bottom: .15rem; }

/* ----- Roadmap timeline -------------------------------------------------- */
.timeline { position: relative; display: grid; gap: 1.6rem; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold), transparent); }
.timeline li { position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -1.6rem; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--gold);
}
.timeline .when { font-family: var(--font-head); color: var(--gold); font-size: .85rem; letter-spacing: .04em; }
.timeline h4 { margin: .15rem 0 .3rem; }

/* ----- CTA band ---------------------------------------------------------- */
.cta-band {
  text-align: center;
  background: linear-gradient(135deg, rgba(255,178,62,.12), rgba(122,90,34,.08));
  border: 1px solid rgba(255,178,62,.28);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
}
.cta-band h2 { margin-bottom: .6rem; }
.cta-band .hero-cta { justify-content: center; margin-top: 1.4rem; }

/* ----- Legal / prose ----------------------------------------------------- */
.prose { max-width: 780px; margin-inline: auto; }
.prose h2 { margin: 2.4rem 0 .8rem; font-size: clamp(1.4rem, 3vw, 1.8rem); }
.prose h3 { margin: 1.6rem 0 .5rem; }
.prose p, .prose li { color: var(--text-muted); margin-bottom: .8rem; }
.prose ul { list-style: disc; padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.note {
  background: rgba(255,178,62,.08);
  border: 1px solid rgba(255,178,62,.3);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-size: .92rem;
}
.note strong { color: var(--gold); }
.updated { font-size: .88rem; color: var(--text-dim); }

/* ----- Contact ----------------------------------------------------------- */
.contact-grid { display: grid; gap: var(--gap); max-width: 620px; margin-inline: auto; }
@media (min-width: 620px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-card { text-align: center; }
.contact-card a { color: var(--gold); font-family: var(--font-head); }
.socials { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; margin-top: 1.2rem; }
.socials a {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--text-muted);
  transition: all .2s ease;
}
.socials a:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-3px); }
.socials svg { width: 22px; height: 22px; }

/* ----- Footer ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(16,12,24,.6);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}
.footer-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-brand p { max-width: 34ch; margin-top: .8rem; font-size: .95rem; }
.footer-brand .powered { margin-top: .7rem; font-size: .82rem; color: var(--text-dim); }
.footer-brand .powered strong { color: var(--gold-deep); font-weight: 600; }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-dim); margin-bottom: .9rem; }
.footer-col a { display: block; color: var(--text-muted); padding: .28rem 0; font-size: .95rem; transition: color .2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: space-between; align-items: center;
  font-size: .85rem; color: var(--text-dim);
}

/* ----- 404 --------------------------------------------------------------- */
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; }
.notfound h1 { font-size: clamp(4rem, 16vw, 9rem); color: var(--gold); }

/* ----- Scroll reveal ----------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ----- Motion / accessibility ------------------------------------------- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

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