:root {
  --void: #0d1017;
  --void-2: #12151f;
  --steel: #151a24;
  --steel-2: #202737;
  --hairline: rgba(255, 255, 255, 0.1);
  --paper: #f4f7fb;
  --paper-rgb: 244, 247, 251;
  --ash: #a7b0c0;
  --ash-dim: #6d7688;
  --signal: #f5a623;
  --signal-rgb: 245, 166, 35;
}

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

html {
  scroll-behavior: smooth;
}

body.theme-liad {
  --accent: #f87171;
  --accent-dim: #ef4444;
  --accent-deep: #dc2626;
  --accent-rgb: 248, 113, 113;
  --badge: var(--paper);
  --badge-rgb: var(--paper-rgb);
  --bg-grad:
    radial-gradient(circle at 12% 0%, rgba(var(--accent-rgb), 0.16), transparent 34rem),
    linear-gradient(135deg, #0c111c 0%, #111723 52%, #080b12 100%);
  --card-bg: rgba(19, 24, 34, 0.92);
  --cmd-bg: rgba(28, 35, 49, 0.96);
  --cmd-bg-hover: rgba(38, 47, 64, 0.98);
  --text-body: var(--paper);
  --text-cmd: #f7f9fd;
  --text-muted: var(--ash);
  --scroll-thumb-a: var(--accent);
  --scroll-thumb-b: var(--accent-deep);
  --scroll-track: rgba(5, 8, 14, 0.75);

  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-grad);
  color: var(--text-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: 0.05;
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* ---- Overlays ---- */
.vignette,
.glow-wash,
.grain-grid,
.scanlines {
  display: none !important;
}

/* ---- HUD Frame ---- */
.hud-frame span {
  position: fixed;
  width: 26px;
  height: 26px;
  border-color: rgba(var(--accent-rgb), 0.48);
  border-style: solid;
  border-width: 0;
  z-index: 5;
  pointer-events: none;
  transition: border-color 0.4s ease;
}

.hud-frame .tl { top: 18px; left: 18px; border-top-width: 2px; border-left-width: 2px; }
.hud-frame .tr { top: 18px; right: 18px; border-top-width: 2px; border-right-width: 2px; }
.hud-frame .bl { bottom: 18px; left: 18px; border-bottom-width: 2px; border-left-width: 2px; }
.hud-frame .br { right: 18px; bottom: 18px; border-right-width: 2px; border-bottom-width: 2px; }

/* ---- Back Button ---- */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 2px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.back-button:hover,
.back-button:focus-visible {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: var(--accent);
  box-shadow: 0 6px 25px rgba(var(--accent-rgb), 0.34);
  outline: none;
  transform: translateX(-5px);
}

/* ---- Container ---- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ---- Header ---- */
header {
  width: 100%;
  text-align: center;
  position: relative;
  animation: fadeInUp 0.6s ease-out backwards;
}

header h1 {
  margin-bottom: 8px;
  color: var(--accent);
  background: linear-gradient(180deg, #ffffff 0%, var(--accent) 52%, var(--accent-dim) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(var(--accent-rgb), 0.4));
  font-family: 'Orbitron', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

@supports not (-webkit-background-clip: text) {
  header h1 {
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}

/* ---- Tab Navigation ---- */
.tab-nav {
  display: flex;
  gap: 4px;
  width: 100%;
  max-width: 900px;
  padding: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 14px;
  background: var(--card-bg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease-out 0.1s backwards;
  position: relative;
  overflow: hidden;
  --mouse-x: 50%;
  --mouse-y: 50%;
  --spotlight-opacity: 0;
}

.tab-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.04),
    transparent 40%
  );
  opacity: var(--spotlight-opacity);
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ash);
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}

.tab-btn:hover {
  color: var(--paper);
  background: rgba(var(--accent-rgb), 0.06);
}

.tab-btn:hover::after {
  width: 40%;
}

.tab-btn.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.15), inset 0 1px 0 rgba(var(--accent-rgb), 0.1);
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.4);
}

.tab-btn.active::after {
  width: 60%;
}

.tab-icon {
  font-size: 1.15rem;
  transition: transform 0.28s ease;
}

.tab-btn:hover .tab-icon,
.tab-btn.active .tab-icon {
  transform: scale(1.15);
}

.tab-label {
  white-space: nowrap;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Panels ---- */
.panels-wrap {
  width: 100%;
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.panel {
  display: none;
  width: 100%;
}

.panel.active {
  display: block;
  animation: panelIn 0.4s ease-out;
}

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

.panel iframe {
  width: 100%;
  height: 600px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 12px;
  background: rgba(12, 16, 24, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--accent-rgb), 0.08);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: linear-gradient(180deg, var(--scroll-thumb-a), var(--scroll-thumb-b));
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.45);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--scroll-thumb-a));
}

/* ---- Background Paths ---- */
.background-paths {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.6;
}

.paths-svg {
  width: 100%;
  height: 100%;
}

.path-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 2;
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  animation: drawPath 20s linear infinite alternate, floatPath 12s ease-in-out infinite alternate;
}

.path-line.path-1 { stroke: rgba(var(--accent-rgb), 0.15); animation-delay: 0s, 0s; stroke-width: 3; }
.path-line.path-2 { stroke: rgba(248, 113, 113, 0.15); animation-delay: -4s, -2s; }
.path-line.path-3 { stroke: rgba(192, 132, 252, 0.15); animation-delay: -8s, -4s; }
.path-line.path-4 { stroke: rgba(74, 222, 128, 0.15); animation-delay: -12s, -6s; }
.path-line.path-5 { stroke: rgba(245, 166, 35, 0.15); animation-delay: -16s, -8s; }

@keyframes drawPath {
  0% { stroke-dashoffset: 3000; }
  100% { stroke-dashoffset: 0; }
}

@keyframes floatPath {
  0% { transform: translateY(-15px) scale(1); }
  100% { transform: translateY(15px) scale(1.05); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .container {
    padding: 80px 15px 40px;
  }

  header h1 {
    font-size: 2.2rem;
    letter-spacing: 0.05em;
  }

  .back-button {
    top: 15px;
    left: 15px;
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .tab-nav {
    flex-wrap: wrap;
    gap: 4px;
  }

  .tab-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 12px 10px;
  }

  .tab-label {
    font-size: 0.72rem;
  }

  .panel iframe {
    height: 500px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.7rem;
  }

  .tab-btn {
    flex: 1 1 100%;
    padding: 10px;
    gap: 6px;
  }

  .tab-label {
    font-size: 0.7rem;
  }

  .panel iframe {
    height: 450px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
