/* ==========================================================================
   Leuan — design tokens
   Base: near-black, warm and matte (not a flat #000)
   Accents: Ferrari rosso (deep red glow) + Gucci ottone (muted antique gold)
   Type: Fraunces (display serif, wordmark/headers) + Space Grotesk (UI/mono chrome)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,400&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg: #0a0908;
  --bg-elev: #131110;
  --line: #2b2621;
  --line-soft: #1c1917;
  --gold: #c9a45c;
  --gold-dim: #8a713f;
  --red: #7d1220;
  --text: #ece7dd;
  --text-dim: #948d80;
  --text-faint: #605a4f;

  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', serif;
  --sans: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* Subtle matte texture: fine diagonal grain, barely perceptible */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.012) 0px,
    rgba(255, 255, 255, 0.012) 1px,
    transparent 1px,
    transparent 3px
  );
}

a { color: inherit; text-decoration: none; }

::selection {
  background: var(--gold-dim);
  color: var(--bg);
}

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Home / hero ---------- */

.scene {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8vh 6vw;
  z-index: 1;
}

.glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70vw, 900px);
  height: min(70vw, 900px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(125, 18, 32, 0.24) 0%, rgba(125, 18, 32, 0.08) 35%, transparent 68%);
  pointer-events: none;
  z-index: 0;
  animation: breathe 9s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(3.6rem, 13vw, 8.5rem);
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0;
  background: linear-gradient(180deg, #f6f0e4 0%, var(--gold) 55%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  animation: rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.divider {
  width: 46px;
  height: 1px;
  background: var(--gold-dim);
  margin: 2rem 0 2.6rem;
  opacity: 0;
  animation: widen 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

@keyframes widen {
  from { opacity: 0; width: 0; }
  to { opacity: 1; width: 46px; }
}

.game-select {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadein 0.9s ease 0.85s forwards;
}

@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-btn {
  position: relative;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 1rem 1.9rem;
  border: 1px solid var(--line);
  min-width: 168px;
  text-align: center;
  transition: color 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.game-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.game-btn:hover,
.game-btn:focus-visible {
  color: var(--text);
  border-color: var(--gold-dim);
  background: rgba(201, 164, 92, 0.05);
}

.game-btn:hover::after,
.game-btn:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.mark {
  position: relative;
  z-index: 1;
  margin-top: 4.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-faint);
  opacity: 0;
  animation: fadein 1s ease 1.1s forwards;
}

/* ---------- Game / mods pages ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: 5vh 7vw 8vh;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  max-width: 760px;
  margin: 0 auto 4.5rem;
}

.back-link {
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  align-self: flex-start;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.page-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4rem);
  color: var(--text);
  margin: 0;
}

.page-sub {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 52ch;
  line-height: 1.6;
  margin: 0;
}

.mod-list {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.mod {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 2rem;
  padding: 2.1rem 0;
  border-bottom: 1px solid var(--line);
}

.mod-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--text);
  margin: 0;
}

.mod-meta {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--gold-dim);
  align-self: start;
  justify-self: end;
  white-space: nowrap;
  padding-top: 0.35rem;
}

.mod-desc {
  grid-column: 1 / -1;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 62ch;
  margin: 0.4rem 0 0;
}

.mod-note {
  max-width: 760px;
  margin: 2.4rem auto 0;
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.6;
}

@media (max-width: 560px) {
  .mod {
    grid-template-columns: 1fr;
  }
  .mod-meta {
    justify-self: start;
  }
}
