
/* ============================================================
   THEME — Edit these variables to change colors site-wide
   ============================================================ */
:root {
  --color-bg:         #000000;
  --color-surface:    #000000;
  --color-surface2:   #050505;
  --color-border:     #1a1a1a;
  --color-accent:     #8b1a1a;
  --color-accent2:    #6b1212;
  --color-text:       #ffffff;
  --color-muted:      #aaaaaa;
  --color-text-secondary: #aaaaaa;   /* alias for --color-muted */
  --color-border-tertiary: #1a1a1a;  /* alias for --color-border */
  --font-heading:     'Archivo Narrow', sans-serif;
  --font-body:        'Archivo Narrow', sans-serif;
  --radius:           6px;
  --radius-lg:        12px;

  /* Class colors — from the game's own LCD backgrounds */
  --cl-monster:  #8b1a1a;
  --cl-assault:  #ab2d16;
  --cl-medic:    #387672;
  --cl-support:  #c87a05;
  --cl-trapper:  #807921;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 126.5%; }

body {
  background-color: var(--color-bg);
  background-image: url('https://assets.modded-evolve.com/images/ui/mainbackground.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  font-stretch: semi-condensed;
  line-height: 1.7;
  min-height: 100vh;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--color-accent);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ====== Universal image loader ====== */
.il-relctx { position: relative; }
.il-img { opacity: 0; }
.il-img.il-done { animation: il-fadein 0.35s ease forwards; }
@keyframes il-fadein { to { opacity: 1; } }
.il-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; animation: il-ovin 0.25s ease;
}
.il-overlay.il-hide { opacity: 0; transition: opacity 0.3s ease; }
@keyframes il-ovin { from { opacity: 0; } to { opacity: 1; } }
.il-overlay > img { width: 44%; height: auto; max-width: 64px; min-width: 16px; display: block; }

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
section {
  animation: none;
}

section.active.page-enter {
  animation: pageEnter 0.2s ease forwards;
}

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

/* ============================================================
   SCROLL TO TOP BUTTON
   ============================================================ */
#scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  background: #000;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, border-color 0.2s, color 0.2s;
  z-index: 1000;
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}

#scroll-top:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================================
   CLICKABLE THUMBNAILS IN PATCH HISTORY
   ============================================================ */
.sub-portrait img {
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.sub-portrait img:hover {
  opacity: 0.8;
  box-shadow: 0 0 8px var(--color-accent);
}

/* View Patch History button on character cards */
.char-history-btn {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border: 1px solid var(--cls-color, var(--color-accent));
  background: transparent;
  color: var(--cls-color, var(--color-accent));
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.char-history-btn:hover {
  background: var(--cls-color, var(--color-accent));
  color: #fff;
}

.char-history-strip {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 1.25rem;
  background: #000;
  display: flex;
  justify-content: flex-end;
}
/* ============================================================
   NAVIGATION
   ============================================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 60px;
  background: rgba(0,0,0,0.95);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}
nav.nav-transparent {
  background: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0));
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  font-stretch: semi-condensed;
  color: var(--color-accent);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.2s;
  cursor: pointer;
}

.nav-links a:hover,
.nav-links a.active { color: var(--color-accent); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-stretch: semi-condensed;
  line-height: 1.15;
  letter-spacing: 0.03em;
}

h1 { font-size: clamp(2.5rem, 7vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }

.accent { color: var(--color-accent); }
.muted  { color: var(--color-muted); }

/* ============================================================
   PAGE / SECTION SYSTEM
   ============================================================ */
section {
  display: none;
  padding: 6rem 2rem 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

section.active      { display: block; }
#home.active        { display: block; }
