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

html,
body {
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text-primary);
  overflow-x: hidden;
}

a {
  color: var(--neon-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 159, 0.4);
}

.home-button {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  color: #f1f5f9;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(139, 0, 255, 0.14));
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 16px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-button:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.7);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 240, 255, 0.32);
}

.home-button svg {
  width: 18px;
  height: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 2px solid var(--border-color);
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.logo-seal {
  position: relative;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-ring {
  position: absolute;
  inset: -7px;
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  animation: ring-spin 20s linear infinite;
}

.logo-ring-text {
  fill: rgba(0, 240, 255, 0.88);
  font-size: 8.4px;
  letter-spacing: 0.4px;
  font-family: "Noto Naskh Arabic", serif;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.22), 0 0 26px rgba(0, 240, 255, 0.16);
}

.brand {
  font-size: 34px;
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: var(--border-glow);
  letter-spacing: 0.02em;
  justify-self: center;
}

.brand-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 18px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.9)) padding-box,
    linear-gradient(120deg, rgba(0, 240, 255, 0.8), rgba(255, 0, 110, 0.85), rgba(0, 255, 159, 0.82)) border-box;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.22),
    0 0 18px rgba(0, 240, 255, 0.24),
    0 0 30px rgba(255, 0, 110, 0.12);
  overflow: hidden;
}

.brand-frame::before {
  content: "";
  position: absolute;
  inset: -120% -40%;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.16), transparent 60%);
  transform: rotate(8deg);
  animation: brand-shine 4s linear infinite;
  pointer-events: none;
}

.brand-ar {
  font-family: "Noto Naskh Arabic", serif;
  direction: rtl;
  line-height: 1;
  transform: perspective(420px) rotateX(13deg);
  background: linear-gradient(90deg, #cbf7ff 0%, #00f0ff 30%, #f8feff 55%, #00ff9f 80%, #cbf7ff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 #063149,
    0 2px 0 #063149,
    0 3px 0 #052235,
    0 4px 0 #031a2a,
    0 8px 18px rgba(0, 240, 255, 0.38),
    0 16px 34px rgba(0, 0, 0, 0.46);
  animation: brand-flow 6s ease-in-out infinite;
}

.header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-self: end;
}

.project-meta {
  color: var(--text-secondary);
  font-size: 13px;
  font-family: "JetBrains Mono", "Consolas", monospace;
}

.data-badge {
  font-size: 11px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.data-badge.is-loading {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.34);
  color: #d7deea;
}

.data-badge.is-live {
  background: rgba(0, 255, 159, 0.18);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 12px rgba(0, 255, 159, 0.28);
}

.data-badge.is-fallback {
  background: rgba(255, 193, 7, 0.15);
  border-color: rgba(255, 193, 7, 0.45);
  color: #ffd972;
}

.data-badge.is-error {
  background: rgba(255, 0, 110, 0.15);
  border-color: var(--neon-pink);
  color: #ff8db8;
}

.tabs-shell {
  border-bottom: 1px solid var(--border-color-soft);
  background: rgba(6, 11, 25, 0.88);
}

.tabs {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px;
}

.tabs::-webkit-scrollbar {
  height: 4px;
}

.tabs::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.tabs::-webkit-scrollbar-thumb {
  background: var(--neon-blue);
  border-radius: 2px;
}

.tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.tab.active {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--border-glow);
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px;
}

#section-root {
  will-change: opacity, transform;
}

#section-root.transition-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 140ms ease, transform 140ms ease;
}

#section-root.transition-in {
  opacity: 0;
  transform: translateY(12px);
  animation: section-in 260ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  animation: card-enter 0.35s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.card:hover {
  border-color: var(--neon-blue);
  box-shadow: var(--border-glow);
  transform: translateY(-2px);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h2,
.card h3 {
  color: var(--neon-blue);
  margin-bottom: 14px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.grid > div {
  border: 1px solid var(--border-color-soft);
  border-radius: 8px;
  padding: 10px;
  background: rgba(2, 6, 23, 0.42);
}

.media-card h3 {
  margin-bottom: 12px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.media-thumb {
  border: 1px solid var(--border-color-soft);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.52);
  padding: 0;
  text-align: left;
  cursor: zoom-in;
  transition: all 0.2s ease;
}

.media-thumb:hover {
  border-color: var(--neon-blue);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
  transform: translateY(-2px);
}

.media-thumb img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.25);
}

.media-caption {
  display: block;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}

.lightbox.show {
  display: block;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.86);
  backdrop-filter: blur(4px);
}

.lightbox-dialog {
  position: relative;
  width: min(92vw, 1100px);
  margin: 4vh auto 0;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  padding: 10px;
  background: rgba(5, 11, 22, 0.95);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.22);
}

.lightbox-image {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.lightbox-caption {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #dff9ff;
  background: rgba(2, 6, 23, 0.8);
  cursor: pointer;
}

.k {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.v {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "JetBrains Mono", "Consolas", monospace;
}

@keyframes card-enter {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes brand-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes brand-shine {
  0% {
    transform: translateX(-140%) rotate(8deg);
  }
  100% {
    transform: translateX(140%) rotate(8deg);
  }
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ring-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-wrap,
  .header-meta {
    justify-self: center;
  }

  .header-meta {
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand-frame {
    padding: 10px 22px;
  }

  .tabs {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 12px;
  }

  .card {
    padding: 14px;
  }

  .tab {
    padding: 9px 12px;
  }

  .brand {
    font-size: 28px;
  }

  .project-meta {
    font-size: 12px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .logo-seal {
    width: 44px;
    height: 44px;
  }

  .home-button {
    padding: 7px 10px;
  }

  .home-button span {
    display: none;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .media-thumb img {
    height: 128px;
  }

  .lightbox-dialog {
    width: 96vw;
    margin-top: 3vh;
    padding: 8px;
  }
}
