/* ============================================
   NEVERMORE DETECTIVE AGENCY — style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Raleway:wght@300;400;500;600&display=swap');

@font-face {
  font-family: 'Nevermore';
  src: url('../assets/fonts/Nevermore.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* ── CSS Variables ── */
:root {
  --bg-darkest:    #050008;
  --bg-dark:       #0d000f;
  --bg-card:       #110015;
  --bg-panel:      #1a0020;
  --purple-deep:   #3A0057;
  --purple-mid:    #660099;
  --purple-light:  #9C59BD;
  --purple-glow:   rgba(102, 0, 153, 0.4);
  --gold:          #F9D402;
  --gold-dark:     #C79C0E;
  --gold-glow:     rgba(249, 212, 2, 0.3);
  --text-light:    #ede0f7;
  --text-muted:    #9a80aa;
  --text-gold:     #F9D402;
  --border-purple: #660099;
  --border-gold:   #C79C0E;
  --success:       #2d7a3a;
  --danger:        #7a1a1a;
  --radius:        8px;
  --radius-lg:     14px;
  --transition:    0.25s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Raleway', sans-serif;
  background-color: var(--bg-darkest);
  background-image: url('../assets/images/bg-hero.png');
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Background atmospheric overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(5, 0, 8, 0.25) 0%, rgba(5, 0, 8, 0.55) 100%),
    radial-gradient(ellipse at 20% 50%, rgba(58, 0, 87, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(102, 0, 153, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Bottom fog / vignette ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ── */
h1, h2, h3 { font-family: 'Nevermore', 'Cinzel', serif; letter-spacing: 0.05em; }

h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: var(--text-light); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--gold); }
h3 { font-size: clamp(1rem, 2vw, 1.3rem); color: var(--purple-light); }

p  { font-size: 0.95rem; color: var(--text-muted); }

a  { color: var(--purple-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

/* ── Layout Wrappers ── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── NAVBAR ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  background: rgba(5, 0, 8, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(102, 0, 153, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
  flex-shrink: 0;
}
.navbar-brand:hover { color: var(--text-light); }
.navbar-brand span { color: var(--gold); }

/* ── Nav links — horizontal on desktop ── */
.nav-links {
  display: flex;
  flex-direction: row;
  list-style: none;
  gap: 0.25rem;
  margin-left: auto;
  padding: 0;
}

.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  border-color: rgba(102, 0, 153, 0.35);
  background: rgba(102, 0, 153, 0.12);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Language Toggle */
.lang-toggle {
  background: rgba(102, 0, 153, 0.2);
  border: 1px solid var(--border-purple);
  color: var(--text-light);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lang-toggle:hover {
  background: rgba(102, 0, 153, 0.4);
  border-color: var(--purple-light);
}

/* Hamburger — hidden on desktop, shown on mobile */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-light);
  transition: var(--transition);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--purple-mid);
  color: #fff;
  border-color: var(--purple-mid);
  box-shadow: 0 0 18px var(--purple-glow);
}
.btn-primary:hover {
  background: var(--purple-deep);
  border-color: var(--purple-light);
  box-shadow: 0 0 28px rgba(102, 0, 153, 0.6);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(200, 180, 220, 0.4);
}
.btn-outline:hover {
  border-color: var(--purple-light);
  color: var(--purple-light);
  background: rgba(102, 0, 153, 0.1);
}

.btn-gold {
  background: var(--gold);
  color: #1a0020;
  border-color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 18px var(--gold-glow);
}
.btn-gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  box-shadow: 0 0 28px rgba(249, 212, 2, 0.5);
  color: #1a0020;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-sm { padding: 0.45rem 1rem; font-size: 0.78rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 0.95rem; }
.btn-full { width: 100%; }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(102, 0, 153, 0.35);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--purple-mid);
  box-shadow: 0 0 20px rgba(102, 0, 153, 0.25);
  transform: translateY(-2px);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(102, 0, 153, 0.25);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--purple-light);
  text-transform: uppercase;
}

.card-body { padding: 1.25rem; }

/* ── PANEL (investigation sections) ── */
.panel {
  background: var(--bg-panel);
  border: 1px solid rgba(102, 0, 153, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.panel-title {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(249, 212, 2, 0.2);
}

/* ── WARNING BOX ── */
.warning-box {
  background: rgba(58, 0, 87, 0.3);
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.warning-box .warning-icon { color: var(--gold); font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.warning-box .warning-title {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.warning-box p { font-size: 0.82rem; color: var(--text-muted); }

/* ── CLUE SLOTS ── */
.clue-slots {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.clue-slot {
  width: 60px;
  height: 60px;
  border: 2px dashed rgba(102, 0, 153, 0.5);
  border-radius: var(--radius);
  background: rgba(58, 0, 87, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all var(--transition);
  position: relative;
  cursor: default;
}

.clue-slot.found {
  border-color: var(--gold-dark);
  background: rgba(58, 0, 87, 0.5);
  border-style: solid;
  box-shadow: 0 0 10px var(--gold-glow);
  animation: clueReveal 0.4s ease;
}

@keyframes clueReveal {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.clue-slot .clue-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.clue-slot.found:hover .clue-tooltip { opacity: 1; }

/* ── CHARACTER BUBBLE ── */
.character-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.character-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--purple-deep);
  border: 2px solid var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--purple-glow);
}

.character-bubble {
  background: rgba(58, 0, 87, 0.4);
  border: 1px solid rgba(102, 0, 153, 0.4);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  flex: 1;
}

/* ── BADGE / DIFFICULTY ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-easy   { background: rgba(45, 122, 58, 0.3); color: #6ddc82; border: 1px solid #2d7a3a; }
.badge-medium { background: rgba(102, 0, 153, 0.3); color: var(--purple-light); border: 1px solid var(--purple-mid); }
.badge-hard   { background: rgba(122, 26, 26, 0.3); color: #e07070; border: 1px solid #7a1a1a; }

/* ── PROGRESS / STATS ── */
.stat-box {
  background: var(--bg-panel);
  border: 1px solid rgba(102, 0, 153, 0.3);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  text-align: center;
}
.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--gold);
  display: block;
}
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ── SUSPECT BUTTONS ── */
.suspect-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.suspect-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.85rem 1rem;
  background: var(--bg-panel);
  border: 2px solid rgba(102, 0, 153, 0.4);
  border-radius: var(--radius);
  color: var(--text-light);
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}
.suspect-btn:hover {
  border-color: var(--purple-light);
  background: rgba(102, 0, 153, 0.2);
  color: var(--gold);
  box-shadow: 0 0 14px var(--purple-glow);
}
.suspect-btn.selected {
  border-color: var(--gold);
  background: rgba(249, 212, 2, 0.1);
  color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}

/* ── SCENE IMAGE ── */
.scene-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(102, 0, 153, 0.3);
  cursor: pointer;
  transition: var(--transition);
}
.scene-image:hover { border-color: var(--purple-light); }

.scene-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--purple-deep), var(--bg-dark));
  border-radius: var(--radius);
  border: 1px solid rgba(102, 0, 153, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.scene-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(102, 0, 153, 0.2) 0%, transparent 70%);
}
.scene-placeholder:hover { border-color: var(--purple-mid); }
.scene-placeholder .scene-icon { font-size: 2.5rem; }
.scene-placeholder .scene-label { font-family: 'Cinzel', serif; letter-spacing: 0.1em; color: var(--purple-light); }

/* Clickable hotspot */
.scene-hotspot {
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(249, 212, 2, 0.2);
  border: 2px solid var(--gold);
  cursor: pointer;
  animation: pulse 2s infinite;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* ── QR CODE AREA ── */
.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid rgba(102, 0, 153, 0.35);
  border-radius: var(--radius-lg);
}

.qr-box {
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  overflow: hidden;
}

.qr-scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: rgba(102, 0, 153, 0.8);
  animation: scanLine 2s linear infinite;
}
@keyframes scanLine {
  0% { top: 0%; }
  100% { top: 100%; }
}

.qr-label { font-size: 0.75rem; color: var(--text-muted); text-align: center; font-family: 'Cinzel', serif; letter-spacing: 0.1em; text-transform: uppercase; }

/* ── AR CAMERA VIEW ── */
.ar-viewport {
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(102, 0, 153, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ar-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ar-corner {
  position: absolute;
  width: 30px; height: 30px;
  border-color: var(--purple-light);
  border-style: solid;
  border-width: 0;
}
.ar-corner.tl { top: 16px; left: 16px; border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.ar-corner.tr { top: 16px; right: 16px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.ar-corner.bl { bottom: 16px; left: 16px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.ar-corner.br { bottom: 16px; right: 16px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }

.ar-status {
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--purple-mid);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-size: 0.72rem;
  color: var(--purple-light);
  letter-spacing: 0.1em;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
}

.ar-no-camera {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}
.ar-no-camera .icon { font-size: 3rem; margin-bottom: 1rem; }

/* ── RESULT SCREEN ── */
.result-banner {
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.result-banner.success {
  background: rgba(30,15,0,0.75);
  border: 1px solid rgba(249,212,2,0.55);
  color: #f9d402;
  box-shadow: 0 0 20px rgba(249,212,2,0.15);
}
.result-banner.fail {
  background: rgba(20,0,35,0.75);
  border: 1px solid rgba(160,0,220,0.5);
  color: #c084fc;
  box-shadow: 0 0 20px rgba(102,0,153,0.2);
}

/* ── ANIMATIONS ── */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.glow-text {
  text-shadow: 0 0 20px rgba(102, 0, 153, 0.6), 0 0 40px rgba(102, 0, 153, 0.3);
}

.gold-glow-text {
  text-shadow: 0 0 20px var(--gold-glow), 0 0 40px rgba(249, 212, 2, 0.2);
}

/* ── STEP INDICATOR ── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
  font-size: 0.75rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}
.step.active { color: var(--gold); }
.step.done   { color: var(--purple-light); }
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-family: 'Cinzel', serif;
}
.step-divider { flex: 1; height: 1px; background: rgba(102, 0, 153, 0.3); margin: 0 0.5rem; min-width: 20px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  /* Restore hamburger + dropdown nav on mobile */
  .hamburger { display: flex; }
  .navbar-brand {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-size: 0.65rem; letter-spacing: 0.1em;
  }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: row; justify-content: center;
    background: rgba(10,0,15,0.97);
    border-bottom: 1px solid var(--border-purple);
    backdrop-filter: blur(20px);
    padding: 0.6rem 1rem; gap: 0.25rem; z-index: 99; margin-left: 0;
  }
  .nav-links.open { display: flex; }

  .navbar { padding: 0.75rem 1rem; }
  .container { padding: 0 1rem; }

  .two-col { grid-template-columns: 1fr !important; }
  .three-col { grid-template-columns: 1fr 1fr !important; }
  .case-grid { grid-template-columns: 1fr !important; }

  .btn-lg { padding: 0.75rem 1.5rem; font-size: 0.88rem; }
  .site-footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

  /* Cards: smaller padding on mobile */
  .card-body { padding: 1rem; }
  .panel { padding: 1rem; }
}

@media (max-width: 480px) {
  .three-col { grid-template-columns: 1fr !important; }
  .btn-group { flex-direction: column; }
  .navbar-brand { font-size: 0.6rem; letter-spacing: 0.07em; }
}

/* ── UTILITY ── */
.text-center  { text-align: center; }
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-muted); }
.text-purple  { color: var(--purple-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }
