/* =============================================================================
   EVAREN | styles
   Dark, modern game-studio aesthetic with smooth, restrained motion.
============================================================================= */

:root {
  --bg: #08090d;
  --bg-2: #0b0d14;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5fa;
  --muted: #9aa0b4;
  --muted-2: #6b7185;
  --brand: #ff3b3b;
  --brand-dim: #d92626;
  --cyan: #22d3ee;
  --green: #34d399;
  --accent: var(--brand);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1160px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 700px 420px at 18% -6%, rgba(255, 59, 59, 0.10), transparent 65%);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------- nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: background 0.35s var(--ease), backdrop-filter 0.35s var(--ease), border-color 0.35s var(--ease); border-bottom: 1px solid transparent; }
.nav--scrolled { background: rgba(8, 9, 13, 0.72); backdrop-filter: blur(14px) saturate(140%); border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.02em; }
.nav__logo {
  display: block; height: 30px; width: auto;
  transition: transform 0.4s var(--ease);
}
.nav__brand:hover .nav__logo { transform: rotate(-6deg) scale(1.07); }
.nav__word { font-size: 20px; }
.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a { color: var(--muted); font-size: 15px; font-weight: 500; position: relative; }
/* Each link sits in its own box: it fills in on hover and stays filled on the
   section you're looking at. */
.nav__links a:not(.btn) {
  padding: 9px 16px; border-radius: 11px;
  border: 1px solid transparent;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav__links a:not(.btn):hover { color: var(--text); background: var(--panel); border-color: var(--border); }
.nav__links a.is-active { color: var(--text); background: var(--panel-2); border-color: var(--border-strong); }
.nav__cta { color: #0a0b10 !important; margin-left: 16px; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; width: 42px; height: 42px; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.nav__toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn--solid { background: #ffffff; color: #0a0b10; box-shadow: 0 10px 30px -14px rgba(255, 255, 255, 0.55); }
.btn--solid:hover { transform: translateY(-2px); background: #e9eaef; box-shadow: 0 16px 40px -14px rgba(255, 255, 255, 0.7); }
.btn--ghost { background: var(--panel); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--brand); background: var(--panel-2); }

/* --------------------------------------------------------------------- hero */
.hero { position: relative; padding: 168px 0 90px; overflow: hidden; }
.hero__inner { position: relative; z-index: 1; max-width: 1080px; }
.hero__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.7rem, 6.4vw, 5rem); line-height: 1.03; letter-spacing: -0.02em; margin: 0 0 22px; color: var(--text); }
.hero__intro { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted); max-width: 640px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* hero background: the studio's own game thumbnails, packed edge-to-edge and
   tilted as one wall so the seams run on a slight diagonal. The grid is
   oversized so its rotated corners still cover the whole hero. */
.hero__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }
.hero__bg-grid {
  position: absolute; inset: -12%;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-auto-rows: min-content; align-content: start; gap: 10px;
  transform: rotate(-4deg);
  filter: saturate(1.15) brightness(0.62);
}
.hero__bg-tile {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 6px; background: var(--bg-2);
}
.hero__bg-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0; animation: heroBgIn 1s var(--ease) forwards;
}
.hero__bg-tile:nth-child(3n) img { animation-delay: 0.08s; }
.hero__bg-tile:nth-child(3n + 1) img { animation-delay: 0.16s; }
.hero__bg-tile:nth-child(5n) img { animation-delay: 0.24s; }
@keyframes heroBgIn { to { opacity: 1; } }
.hero__bg-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 9, 13, 0.55) 0%, rgba(8, 9, 13, 0.8) 46%, var(--bg) 94%),
    rgba(8, 9, 13, 0.45);
}

/* live stat band */
.stats { margin-top: 56px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(6px); box-shadow: var(--shadow); overflow: hidden; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 26px 22px; text-align: center; border-right: 1px solid var(--border); transition: background 0.3s var(--ease), transform 0.3s var(--ease); }
.stat:last-child { border-right: none; }
.stat:hover { background: var(--panel-2); transform: translateY(-2px); }
.stat__value { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: 8px; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }

/* ----------------------------------------------------------------- sections */
.section { padding: 96px 0; }
.section__eyebrow { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand); }
.section__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.12; letter-spacing: -0.02em; margin-top: 12px; max-width: 20ch; }
.section__title span { color: var(--brand); }
.section__head { margin-bottom: 52px; }

/* -------------------------------------------------------------------- about */
.about__grid { display: grid; grid-template-columns: 1fr; gap: 48px; }
.about__lead { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--text); max-width: 760px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pillar { padding: 26px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease); }
.pillar:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--panel-2); }
.pillar h3 { font-family: var(--font-display); font-size: 1.12rem; margin-bottom: 8px; }
.pillar p { font-size: 0.95rem; color: var(--muted); }

/* -------------------------------------------------------------------- games */
.games__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.game-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.game-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.game-card__media { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #14161f, #0c0e15); overflow: hidden; }
.game-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.game-card:hover .game-card__media img { transform: scale(1.06); }
.game-card__noimg { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.3em; color: var(--muted-2); }
.game-card__body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game-card__title { font-family: var(--font-display); font-size: 1.28rem; font-weight: 600; line-height: 1.2; }
.game-card__creator { font-size: 0.9rem; color: var(--muted); margin-top: -4px; }
.game-card__stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.chip { display: inline-flex; flex-direction: column; gap: 2px; padding: 8px 13px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); min-width: 78px; }
.chip__k { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.chip__v { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.game-card__play { margin-top: 14px; align-self: flex-start; }

/* skeleton / states */
.shimmer, .game-card__media .shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 40%, transparent 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.shimmer-text { color: var(--muted-2); }
@keyframes shimmer { to { background-position: -200% 0; } }
.game-card.is-error { opacity: 0.85; }

/* ------------------------------------------------------------------ contact */
.contact__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
/* No contact form (no email configured): centre the block so the section reads
   as a deliberate call to action instead of a half-empty two-column grid. */
.contact__inner--solo {
  grid-template-columns: 1fr; justify-items: center; text-align: center;
  max-width: 760px;
}
.contact__inner--solo .section__title { max-width: 22ch; margin-inline: auto; }
.contact__inner--solo .contact__intro p { max-width: 52ch; margin-inline: auto; }
.contact__inner--solo .contact__links { justify-content: center; }
.contact__intro p { color: var(--muted); margin-top: 16px; max-width: 40ch; }
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.contact__link { padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease); }
.contact__link:hover { color: var(--text); border-color: var(--brand); transform: translateY(-2px); }
/* The Discord handle copies itself rather than linking anywhere. */
.contact__link[role="button"] { cursor: pointer; user-select: none; }
.contact__form { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 26px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; letter-spacing: 0.02em; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(0, 0, 0, 0.25); color: var(--text); font: inherit; font-size: 15px; transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.18); }
.field textarea { resize: vertical; }
.contact__form .btn { width: 100%; margin-top: 4px; }

/* ------------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 24px; }
.footer__links a { color: var(--muted); font-size: 14px; transition: color 0.25s var(--ease); }
.footer__links a:hover { color: var(--text); }
.footer__copy { color: var(--muted-2); font-size: 14px; }

/* --------------------------------------------------------- reveal animation */
/* Only hide-then-reveal when JS is running; without JS everything stays visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px) scale(0.975);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ------------------------------------------------------------- breakpoints */
@media (max-width: 900px) {
  .contact__inner { grid-template-columns: 1fr; gap: 34px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 4px;
    background: rgba(8, 9, 13, 0.96); backdrop-filter: blur(16px); padding: 18px 24px 26px;
    border-bottom: 1px solid var(--border); transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .nav--open .nav__links { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { width: 100%; font-size: 17px; }
  .nav__links a:not(.btn) { padding: 12px 16px; }
  .nav__cta { margin: 8px 0 0; }
  .hero { padding: 128px 0 70px; }
  .hero__bg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .games__grid { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
}
@media (max-width: 440px) {
  .container { padding-inline: 18px; }
  .pillars { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
