/* ============================================
   Scaper landing page
   - Fixed full-screen background stack
   - Each scene = 100vh, content fades on scroll
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #f5f1e8;
  background: #0a0a0a;
  overflow-x: hidden;
  /* Total height = number of scenes * 100vh, set by sections themselves */
}

/* ===== Background layer stack ===== */
.bg-stack {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: #07060a;
}

#atmosphere {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Subtle vignette + darkening so text is always readable */
.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.45));
  pointer-events: none;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 2.5rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0));
  backdrop-filter: blur(2px);
}

.nav-brand {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.25em;
  color: #f5f1e8;
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  color: #f5f1e8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #d4a017;
}

.nav-cta {
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(212, 160, 23, 0.7);
  border-radius: 4px;
  background: rgba(212, 160, 23, 0.12);
  transition: all 0.2s;
}

.nav-cta:hover {
  background: rgba(212, 160, 23, 0.3);
  border-color: #d4a017;
  color: #fff !important;
}

/* ===== Scenes ===== */
.scene {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  position: relative;
}

.scene-content {
  max-width: 720px;
  text-align: center;
  /* opacity is driven by JS based on scroll proximity to scene center */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  will-change: opacity, transform;
}

.scene-content-wide {
  max-width: 1100px;
}

.scene-content.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Feature grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.75rem;
  text-align: left;
}

.feature-card {
  padding: 1.4rem 1.3rem;
  background: rgba(15, 12, 8, 0.55);
  border: 1px solid rgba(212, 160, 23, 0.18);
  border-radius: 6px;
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease-out, border-color 0.25s, background 0.25s;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 160, 23, 0.55);
  background: rgba(20, 16, 10, 0.7);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.feature-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  color: #f5f1e8;
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #c9c2b4;
  font-weight: 300;
}

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

/* ===== Typography ===== */
.title {
  font-family: 'Cinzel', serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  text-shadow: 0 4px 24px rgba(0,0,0,0.8);
  background: linear-gradient(180deg, #f5f1e8 0%, #d4a017 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  text-shadow: 0 3px 18px rgba(0,0,0,0.8);
}

.section-text {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 2rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  color: #ece6d8;
}

/* ===== Buttons ===== */
.cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.05em;
  font-size: 1rem;
  transition: all 0.2s ease-out;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: #d4a017;
  color: #1a1208;
  border-color: #d4a017;
  box-shadow: 0 4px 20px rgba(212, 160, 23, 0.3);
}

.btn-primary:hover {
  background: #e8b528;
  box-shadow: 0 6px 28px rgba(212, 160, 23, 0.5);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #f5f1e8;
  border-color: rgba(245, 241, 232, 0.4);
  backdrop-filter: blur(4px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(245, 241, 232, 0.8);
  transform: translateY(-2px);
}

.btn-large {
  padding: 1.1rem 2.5rem;
  font-size: 1.15rem;
}

.footer-note {
  margin-top: 4rem;
  font-size: 0.85rem;
  opacity: 0.6;
  letter-spacing: 0.05em;
}

/* Inline slash-command styling */
.cmd {
  display: inline-block;
  padding: 0.1em 0.5em;
  margin: 0 0.1em;
  background: rgba(212, 160, 23, 0.15);
  border: 1px solid rgba(212, 160, 23, 0.4);
  border-radius: 4px;
  color: #f0c860;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.92em;
  font-weight: 500;
  text-shadow: none;
  white-space: nowrap;
}

/* ===== Auth UI ===== */
.auth-slot {
  display: flex;
  align-items: center;
}

/* The HTML `hidden` attribute must beat our other display rules
   (e.g. `.scene { display: flex }` would otherwise reveal the dashboard
   to logged-out visitors). */
[hidden] { display: none !important; }

.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.7rem 0.35rem 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 241, 232, 0.18);
  border-radius: 999px;
  color: #f5f1e8;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.user-menu-btn:hover {
  background: rgba(212, 160, 23, 0.18);
  border-color: rgba(212, 160, 23, 0.6);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  object-fit: cover;
}

.user-menu-btn .chev {
  font-size: 0.7rem;
  opacity: 0.7;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: rgba(15, 12, 20, 0.95);
  border: 1px solid rgba(245, 241, 232, 0.15);
  border-radius: 8px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.8rem;
  background: transparent;
  border: 0;
  color: #f5f1e8;
  font: inherit;
  font-size: 0.92rem;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: rgba(212, 160, 23, 0.18);
  color: #f0c860;
}

/* ===== Dashboard ===== */
#dashboard .section-title { margin-bottom: 0.5rem; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.dash-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem auto 1rem;
  max-width: 1100px;
  text-align: left;
}
.dash-overview { grid-column: 1 / -1; }
#clan-card     { grid-column: span 1; }

.dash-empty {
  margin: 2rem auto;
  max-width: 600px;
}

.dash-card {
  background: rgba(15, 12, 20, 0.55);
  border: 1px solid rgba(245, 241, 232, 0.12);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: left;
  backdrop-filter: blur(6px);
}

.dash-card h3 {
  font-family: 'Cinzel', serif;
  color: #f0c860;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.dash-accounts { display: flex; flex-direction: column; gap: 0.75rem; }

.acct-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(245, 241, 232, 0.08);
  border-radius: 8px;
}

.acct-row .acct-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: #f5f1e8;
  letter-spacing: 0.02em;
}

.acct-row .acct-meta {
  display: block;
  font-size: 0.82rem;
  opacity: 0.65;
  margin-top: 0.2rem;
}

.acct-row .unlink-btn {
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1px solid rgba(220, 80, 80, 0.5);
  border-radius: 4px;
  color: #e89a9a;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.acct-row .unlink-btn:hover {
  background: rgba(220, 80, 80, 0.2);
  color: #fff;
}

.muted { opacity: 0.6; }
.small { font-size: 0.85rem; }

/* ── Player overview ── */
.overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ov-rsn {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: #f5f1e8;
  letter-spacing: 0.05em;
}
.ov-meta {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  opacity: 0.7;
}
.ov-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.ov-stat {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(245, 241, 232, 0.08);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
}
.ov-stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 0.2rem;
}
.ov-stat-value {
  display: block;
  font-size: 1.15rem;
  color: #f0c860;
  font-weight: 600;
}

/* ── Status bars ── */
.status-bars { display: flex; flex-direction: column; gap: 0.55rem; }
.status-line {
  display: grid;
  grid-template-columns: 90px 1fr 90px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.status-label { opacity: 0.75; }
.status-track {
  height: 8px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow: hidden;
}
.status-fill {
  height: 100%;
  transition: width 0.4s;
  border-radius: 4px;
}
.status-val {
  text-align: right;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* ── Skills grid ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.45rem;
}
.skill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(245, 241, 232, 0.06);
  border-radius: 5px;
  font-size: 0.88rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.skill:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(240,200,96,0.15);
}
.skill-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(240,200,96,0.55)) drop-shadow(0 0 8px rgba(240,200,96,0.25));
}
.skill-name { opacity: 0.85; }
.skill-level {
  font-weight: 600;
  color: #f0c860;
  font-variant-numeric: tabular-nums;
}
.skill-level sup {
  color: #7ec07e;
  font-size: 0.65em;
  margin-left: 0.1em;
}

/* ── Clan ── */
.clan-name {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: #f5f1e8;
  margin-bottom: 0.35rem;
}

/* ── Activity lists ── */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 260px;
  overflow-y: auto;
}
.act-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.45rem 0.6rem;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  font-size: 0.85rem;
}
.act-main { color: #f5f1e8; }
.act-sub  { color: #f0c860; font-variant-numeric: tabular-nums; }
.act-time { opacity: 0.55; font-size: 0.78rem; }

/* Subtle scrollbar */
.activity-list::-webkit-scrollbar { width: 6px; }
.activity-list::-webkit-scrollbar-thumb {
  background: rgba(212, 160, 23, 0.35);
  border-radius: 3px;
}

.link-new {
  margin-top: 1.25rem;
  border-top: 1px solid rgba(245, 241, 232, 0.1);
  padding-top: 1rem;
}

.link-new summary {
  cursor: pointer;
  color: #f0c860;
  font-weight: 500;
  padding: 0.3rem 0;
}

.link-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.link-form input {
  flex: 1;
  padding: 0.55rem 0.9rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(245, 241, 232, 0.2);
  border-radius: 4px;
  color: #f5f1e8;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.link-form input:focus {
  outline: none;
  border-color: rgba(212, 160, 23, 0.8);
}

.btn-small { padding: 0.55rem 1.1rem; font-size: 0.9rem; }

.link-msg {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}
.link-msg.ok  { background: rgba(120, 200, 140, 0.15); color: #b0e6c0; }
.link-msg.err { background: rgba(220, 80, 80, 0.15);  color: #ffb0b0; }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .nav {
    padding: 1rem 1.25rem;
  }
  .nav-links {
    gap: 1rem;
  }
  .nav-links a:not(.nav-cta) {
    display: none;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-layer,
  .scene-content {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}
