@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap");

:root {
  --bg: #0b0d10;
  --surface: #101318;
  --surface-2: #151a21;
  --text: #e7eaf0;
  --muted: #a9b0bc;
  --brand: #c41721;
  --brand-600: #9f151c;
  --ghost: #2a3039;
  --ring: rgba(196, 23, 33, 0.35);
  --shadow: 0 10px 30px rgba(0,0,0,0.5);
  /* Parallax tuning */
  --bg-base: -120px; /* shift up/down initial position */
  --bg-factor: -0.12; /* parallax strength (negative = moves slower upward) */
}

/* Base */
html, body {
  margin: 0;
  padding: 0;
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* For landing, let the fixed image layer be visible */
body.landing { background: transparent; position: relative; }

.container {
  width: min(1180px, 92%);
  margin-inline: auto;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }

/* Page background with parallax */
.page-bg { position: fixed; inset: 0; z-index: -2; pointer-events: none; background-image: url('/assets/fleshmoonBG.png'); background-size: cover; background-repeat: no-repeat; background-position: center var(--bg-base, -120px); }
.page-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(1200px 600px at 20% 10%, rgba(0,0,0,0.2), transparent 60%), linear-gradient(to bottom, rgba(11,13,16,0.25), rgba(11,13,16,0.45)); }

/* Buttons */
.btn-1, .btn-2, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; border-radius: 10px; padding: .75rem 1rem; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn-1 { background: var(--brand); color: white; box-shadow: var(--shadow); }
.btn-1:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn-2 { background: transparent; color: white; border-color: var(--brand); }
.btn-2:hover { background: rgba(196,23,33,0.1); }
.btn-ghost { background: var(--ghost); color: #e9edf5; border-color: #2f3640; }
.btn-ghost:hover { background: #343b46; }

/* Nav */
.landing-nav { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(140%) blur(8px); background: rgba(11,13,16,.6); border-bottom: 1px solid rgba(255,255,255,.06); }
.landing-nav .nav-inner { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; flex-wrap: wrap; position: relative; }
.landing-nav .brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .4px; }
.landing-nav .brand img { height: auto; width: auto; max-width: 220px; }
.landing-nav .nav-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.landing-nav .menu-toggle { display: none; background: transparent; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* Hero */
.landing-hero {
  background-position: center; background-size: cover; background-repeat: no-repeat; margin:6rem 0;
  position: relative; isolation: isolate;
}
.hero-inner { align-items: center; }
.hero-copy { max-width: 720px; padding: 4rem 0 2.5rem; text-align: left; }
.hero-copy .title { font-size: clamp(2rem, 3.8vw, 3.25rem); line-height: 1.1; margin: 0 0 .6rem; font-weight: 800; }
.hero-copy .tagline { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); margin: 0 0 .4rem; }
.hero-copy .cta { font-weight: 600; margin: 0 0 1rem; color: #f1f3f7; }
.hero-ctas { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Sections */
.info-section { padding: 3rem 0; text-align: left; scroll-margin-top: 80px; }
.info-section#world { padding-top: 1.25rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); margin: 0; }
.section-head .section-sub { color: var(--muted); margin: 0; }
.lead { color: #d6dbe6; font-size: 1.075rem; max-width: 70ch; }
.flavor { margin-top: .6rem; }
.flavor summary { cursor: pointer; color: #c9d1e2; }

/* Bullets */
.bullets { padding-left: 1rem; margin: .5rem 0 1.25rem; display: grid; gap: .35rem; }
.bullets li { margin-left: 1rem; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.card { background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card .media { aspect-ratio: 16/10; background: #0f1216; overflow: hidden; }
.card .media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s ease; }
.card[data-entity="operator"] .media,
.card[data-entity="enemy"] .media { aspect-ratio: auto; }
.card[data-entity="operator"] .media img,
.card[data-entity="enemy"] .media img { object-fit: contain; object-position: center; background: #0f1216; }
.card:hover .media img { transform: scale(1.05); }
.card-body { padding: .9rem; display: grid; gap: .25rem; }
.card-title { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: .2px; }
.card-kicker { margin: 0; color: var(--muted); font-size: .92rem; }
.card-text { margin: .25rem 0 .5rem; color: #ced5e2; }
.card .details-btn { width: fit-content; }

/* Enemy and Operator categories */
.enemy-cat, .enemy-subcat, .operator-cat {
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: var(--surface);
}
.enemy-subcat { margin-left: 1rem; }
.enemy-cat summary, .enemy-subcat summary, .operator-cat summary {
  padding: .6rem 1rem;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.enemy-cat[open] > summary, .enemy-subcat[open] > summary, .operator-cat[open] > summary {
  background: var(--surface-2);
}
.category-content, .subcategory-content {
  padding: 0 1rem 1rem;
  display: grid;
  gap: .75rem;
}

/* CTAs inline */
.mini-cta { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }

/* Footer */
.site-footer { padding: 2rem 0; border-top: 1px solid rgba(255,255,255,.06); background: transparent; }
.tiny { color: var(--muted); font-size: .9rem; }

/* Login overlay (scoped for landing usage) */
.login-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none; align-items: center; justify-content: center; z-index: 1000; }
.login-overlay.open { display: flex; }
.login-modal { background: #fff; color: #111; padding: 2rem; border-radius: 12px; width: min(420px, 92%); position: relative; }
.landing-login { display: grid; gap: .6rem; }
.landing-login input { padding: .7rem .8rem; border: 1px solid #d7dbe0; border-radius: 10px; font-size: 1rem; }
.close-overlay { position: absolute; top: .6rem; right: .6rem; background: transparent; border: none; font-size: 1.6rem; cursor: pointer; }
.landing-login .btn-1 { margin-top: .2rem; }
.landing-login a.extra { display: inline-block; margin-top: .2rem; color: #334; }

/* Detail modal (Operators/Enemies) */
.detail-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: none; align-items: center; justify-content: center; z-index: 1100; padding: 1rem; }
.detail-overlay.open { display: flex; }
.detail-modal { background: var(--surface); color: var(--text); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; box-shadow: var(--shadow); width: min(720px, 100%); max-height: 85vh; overflow: auto; position: relative; padding: 1.2rem; }
.detail-modal h3 { margin-top: 0; }
.detail-content-slot { display: grid; gap: .5rem; }
.close-detail { position: absolute; top: .4rem; right: .4rem; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; }

/* Detail hero image */
.detail-hero { width: 100%; max-height: min(70vh, 720px); height: auto; object-fit: contain; object-position: center; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: #0f1216; }

/* Focus rings */
:where(a, button, summary, [tabindex]){ outline: none; }
:where(a, button, summary, [tabindex]):focus-visible{ box-shadow: 0 0 0 3px var(--ring); border-color: var(--brand); }

/* Utilities */
.centered { text-align: center; }


.flex-landing {
  display:grid;
  flex-direction: column;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .landing-nav .nav-inner { flex-wrap: nowrap; padding: .5rem 0; }
  .landing-nav .brand img { max-width: 120px; }
  .landing-nav .menu-toggle { display: block; }
  .landing-nav .nav-actions { display: none; flex-direction: column; position: absolute; top: 100%; right: 0; background: rgba(11,13,16,.95); padding: .5rem; gap: .4rem; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; }
  .landing-nav .nav-actions.open { display: flex; }
  .landing-nav .nav-actions a,
  .landing-nav .nav-actions button { font-size: .9rem; padding: .6rem 1rem; width: 100%; text-align: left; }
  .hero-copy { text-align: center; }
  .hero-ctas { justify-content: center; }
}
