:root {
  --bg-dark: #0a1218;
  --panel-line: rgba(200, 210, 215, 0.35);
  --panel-line-soft: rgba(200, 210, 215, 0.15);
  --text-main: #dde3e6;
  --text-dim: #9aa7ad;
  --accent-red: #ff4655;
  --accent-gold: #ece0c4;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  font-family: var(--font-body);
  color: var(--text-main);
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

.menu {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 700px;
  background: url('assets/background.jpg') center center / cover no-repeat;
  overflow: hidden;
}

.menu::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0.1) 70%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ============ TOP BAR ============ */
.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 54px;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgba(8,14,18,0.92), rgba(8,14,18,0.75));
  border-bottom: 1px solid var(--panel-line-soft);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 40px;
}
.topbar-left { justify-self: start; }
.topbar-right { justify-self: end; }

.back-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-nav-left, .top-nav-right {
  display: flex;
  align-items: center;
  gap: 26px;
}

.top-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.top-icon:hover { color: var(--text-main); }
.top-icon.danger { color: var(--accent-red); }

.main-menu-title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 4px;
  color: #e7ecee;
  white-space: nowrap;
  padding: 0 24px;
}

.top-right-info {
  display: flex;
  align-items: center;
  gap: 22px;
}

.info-chip {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.settings { font-size: 18px; margin-left: 6px; }

/* ============ RIGHT SOCIAL RAIL ============ */
.social-rail {
  position: absolute;
  top: 55px;
  right: 0;
  bottom: 0;
  width: 46px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 10px;
  border-left: 1px solid var(--panel-line-soft);
  background: linear-gradient(to bottom, rgba(8,14,18,0.35), rgba(8,14,18,0.15));
}

.social-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 17px;
  transition: color 0.15s, background 0.15s;
}
.social-icon:hover { color: #fff; background: rgba(255,255,255,0.06); }
.social-icon[aria-disabled="true"] { opacity: 0.45; cursor: default; }

/* ============ LEFT PANEL ============ */
.left-panel {
  position: absolute;
  left: 28px;
  top: 300px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 220px;
}

.left-label {
  background: none;
  border: none;
  color: var(--text-main);
  text-align: left;
}

.left-label.small {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 2px;
  display: block;
}

.left-label.big {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #eef2f3;
}
.left-label.big i { font-size: 14px; color: var(--text-dim); }
.left-label.big:hover i { color: var(--accent-red); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; }

.toggle { position: relative; display: inline-block; }
.toggle input { display: none; }
.toggle-track {
  display: block;
  width: 40px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid var(--panel-line);
  position: relative;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: left 0.2s, background 0.2s;
}
.toggle input:checked + .toggle-track { background: rgba(255,70,85,0.35); }
.toggle input:checked + .toggle-track .toggle-thumb { left: 22px; background: var(--accent-red); }

/* ============ CENTER CARD ============ */
.card-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 165px;
}

.card-slots {
  display: flex;
  align-items: flex-start;
  gap: 26px;
}

.slot {
  width: 150px;
  height: 300px;
  border: 1px solid var(--panel-line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-line);
  font-size: 20px;
  font-weight: 300;
  margin-top: 22px;
}

.agent-card-wrap {
  position: relative;
  width: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-top-line {
  width: 170px;
  height: 1px;
  background: var(--panel-line);
  margin-bottom: 8px;
}

.level-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: #0d1418;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
}

.signal-icon {
  position: absolute;
  top: -8px;
  right: -4px;
  font-size: 12px;
  color: #4fd1c5;
}

.agent-card {
  width: 170px;
  border: 1px solid var(--accent-gold);
  background: #0d1418;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.card-art {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--accent-gold);
}
.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-agent-label {
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  padding: 6px 0 4px;
  font-weight: 600;
}

.card-name-band {
  background: linear-gradient(to right, #d8b874, #f0dfae);
  color: #1a1a1a;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 5px 0;
  letter-spacing: 0.5px;
}

.card-tag {
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  padding: 6px 0 10px;
  font-weight: 600;
}

.card-wings {
  display: flex;
  width: 170px;
  justify-content: space-between;
  margin-top: -1px;
}
.wing { width: 50%; height: 40px; }
.wing path { fill: none; stroke: var(--accent-gold); stroke-width: 2; }

.card-diamond {
  width: 10px; height: 10px;
  background: #1c2a33;
  border: 1px solid var(--panel-line);
  transform: rotate(45deg);
  margin-top: 10px;
}

.card-dots {
  color: var(--text-dim);
  letter-spacing: 3px;
  margin-top: 4px;
  font-size: 12px;
}

.mute-btn {
  margin-top: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* ============ BOTTOM BAR ============ */
.bottombar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 16px 28px;
  gap: 20px;
}

.note-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8,14,18,0.55);
  border: 1px solid var(--panel-line-soft);
  padding: 8px 14px;
  width: 260px;
  color: var(--text-dim);
  font-size: 12px;
}
.note-label { letter-spacing: 1px; font-weight: 600; white-space: nowrap; }
.note-field input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13px;
}
.note-field i { color: var(--text-dim); font-size: 12px; }

.tabs {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.tab {
  background: rgba(20,28,34,0.7);
  border: 1px solid var(--panel-line-soft);
  color: var(--text-dim);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 1.5px;
  font-size: 13px;
  padding: 12px 30px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text-main); }
.tab.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

/* spacer to balance note-field width on the right so tabs stay centered */
.bottombar::after {
  content: '';
  width: 260px;
}

/* ============ TAB CONTENT PANEL ============ */
.tab-panel {
  position: absolute;
  left: 50%;
  bottom: 95px;
  transform: translateX(-50%);
  z-index: 9;
  width: 560px;
  max-width: 90vw;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  background: rgba(8,14,18,0.9);
  border: 1px solid var(--panel-line-soft);
  transition: max-height 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}
.tab-panel.open {
  max-height: 170px;
  opacity: 1;
  pointer-events: auto;
}
.tab-content { display: none; padding: 20px 24px; }
.tab-content.active { display: block; }
.tab-content h3 {
  font-family: var(--font-display);
  letter-spacing: 2px;
  font-size: 15px;
  color: var(--accent-red);
  margin-bottom: 8px;
}
.tab-content p { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.about-facts-line {
  margin-top: 10px;
  font-size: 12px !important;
  letter-spacing: 0.3px;
  color: var(--text-main) !important;
}

/* ============ PROJECTS MODAL ============ */
.projects-modal {
  position: absolute;
  inset: 55px 0 0 0;
  z-index: 30;
  background: rgba(5,9,13,0.94);
  backdrop-filter: blur(6px);
  padding: 36px 60px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow-y: auto;
}
.projects-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.projects-modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
  margin-bottom: 30px;
}
.projects-modal-header h2 {
  font-family: var(--font-display);
  letter-spacing: 4px;
  font-size: 22px;
  color: #eef2f3;
  white-space: nowrap;
}
.pm-line {
  height: 1px;
  flex: 1;
  max-width: 260px;
  background: linear-gradient(to right, transparent, var(--panel-line), transparent);
}
.pm-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
}
.pm-close:hover { color: var(--accent-red); }

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1160px;
  margin: 0 auto;
}
.grid-row { display: flex; gap: 16px; }

.project-tile {
  flex: 1;
  position: relative;
  border: 1px solid rgba(120, 200, 220, 0.35);
  background:
    linear-gradient(180deg, rgba(10,20,28,0.4) 0%, rgba(6,12,18,0.85) 70%),
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--tile-color) 25%, transparent), transparent 60%),
    #0b1319;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px 16px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--text-main);
}
.row-3 .project-tile { height: 220px; }
.row-4 .project-tile { height: 160px; }

.project-tile:hover {
  transform: translateY(-3px);
  border-color: var(--tile-color, #4fd1c5);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

.tile-icon {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 38px;
  color: var(--tile-color, #4fd1c5);
  opacity: 0.9;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--tile-color) 60%, transparent));
}
.row-3 .tile-icon { font-size: 46px; }

.project-tile.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.project-tile.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.15), transparent 40%);
  pointer-events: none;
  transition: background 0.15s ease;
}
.project-tile.has-image:hover::after {
  background: rgba(0,0,0,0);
}

.tile-label {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 13px;
  text-align: left;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.row-3 .tile-label { font-size: 16px; }

/* ============ CONTACTS PANEL (standalone now) ============ */
.contacts-panel {
  position: absolute;
  top: 55px;
  bottom: 0;
  left: 0;
  width: 320px;
  z-index: 20;
  background: rgba(6,11,15,0.97);
  border-right: 1px solid var(--panel-line);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 24px;
}
.contacts-panel.open { transform: translateX(0); }

.projects-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--panel-line-soft);
  padding-bottom: 12px;
}
.projects-panel-header h2 {
  font-family: var(--font-display);
  letter-spacing: 2px;
  font-size: 18px;
}
.projects-panel-header button {
  background: none; border: none; color: var(--text-dim); font-size: 22px; line-height: 1;
}

.contacts-list { display: flex; flex-direction: column; gap: 16px; }
.contacts-list a { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-main); }
.contacts-list a:hover { color: var(--accent-red); }

/* ============ DESCRIPTION TOOLTIP ============ */
.desc-box {
  position: fixed;
  z-index: 100;
  background: rgba(10,16,20,0.96);
  border: 1px solid var(--accent-red);
  color: var(--text-main);
  font-size: 13px;
  padding: 8px 12px;
  max-width: 220px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.desc-box.visible { opacity: 1; }

/* ============ PROJECT DETAIL VIEW ============ */
.project-detail {
  display: none;
  width: 900px;
  max-width: 90vw;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  background: rgba(6,11,15,0.94);
  border: 1px solid var(--panel-line-soft);
  padding: 26px 30px 30px;
  color: var(--text-main);
}
.project-detail.open { display: block; }
.project-detail::-webkit-scrollbar { width: 8px; }
.project-detail::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.pd-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--panel-line-soft);
}
.pd-back {
  background: none;
  border: 1px solid var(--panel-line-soft);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.pd-back:hover { color: #fff; border-color: var(--accent-red); }
.pd-header h2 {
  font-family: var(--font-display);
  letter-spacing: 2px;
  font-size: 20px;
  color: #eef2f3;
}
.pd-tagline {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 0 22px;
}

.pd-banners { display: flex; flex-direction: column; gap: 10px; }
.pd-banner { border: 1px solid var(--panel-line-soft); background: rgba(255,255,255,0.02); }
.pd-banner-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
}
.pd-banner-head:hover { background: rgba(255,255,255,0.03); }
.pd-icon { font-size: 19px; }
.pd-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.5px;
}
.pd-chevron { color: var(--text-dim); font-size: 12px; transition: transform 0.2s ease; }
.pd-banner.open .pd-chevron { transform: rotate(180deg); color: var(--accent-red); }

.pd-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 18px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
  white-space: pre-line;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.pd-banner.open .pd-body { max-height: 900px; padding: 10px 18px 18px; }

.pd-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-dim);
}
.pd-empty i { font-size: 34px; margin-bottom: 14px; display: block; color: var(--accent-red); }
.pd-empty p { font-size: 14px; letter-spacing: 0.5px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .left-panel { display: none; }
  .card-slots .slot { display: none; }
  .top-nav-left, .top-nav-right { gap: 14px; margin-left: 14px; }
  .main-menu-title { font-size: 18px; letter-spacing: 2px; }
  .social-rail { width: 38px; }
  .social-icon { width: 38px; height: 38px; font-size: 15px; }
}
