/* Core palette and spacing variables */
:root {
  --electric-blue: #3c7dff;
  --deep-blue: #0b1026;
  --midnight: #050714;
  --violet: #7b5cff;
  --teal: #3ce7ff;
  --text-main: #e8edff;
  --text-muted: #a9b3d8;
  --card-bg: rgba(12, 18, 46, 0.85);
  --accent-bg: rgba(17, 25, 54, 0.65);
  --section-padding: clamp(4rem, 5vw + 2rem, 6.5rem);
  font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Student Palette Experiment:
   Uncomment and tweak these colors to test new looks during a workshop.
   Remember to comment the old values above if you decide to swap them in.
   --
   --electric-blue: #ff7ad9;
   --violet: #ffb347;
   --teal: #7dffef;
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--midnight);
}

/* Global typography and background */
body {
  margin: 0;
  background: radial-gradient(circle at top, rgba(60, 125, 255, 0.25), transparent 60%), var(--midnight);
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

.inner {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* Sticky header navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 7, 20, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(124, 130, 161, 0.12);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav {
  margin-left: auto;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.active {
  color: var(--text-main);
}

.site-nav .cta {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--electric-blue), var(--violet));
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  padding: 0.35rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
}

.nav-toggle span {
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Circular flag buttons for language switcher */
.language-switcher {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: 0;
}

.lang-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 20, 42, 0.7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.lang-btn .flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-btn .flag.flag-arab-league {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: url('flags/arab-league.svg') center/cover no-repeat;
  font-size: 0;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(60, 125, 255, 0.9);
  outline: none;
}

.lang-btn.active {
  border-color: var(--teal);
  box-shadow: 0 0 12px rgba(60, 231, 255, 0.5);
}

/* Hero split layout */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--section-padding) clamp(1rem, 4vw, 3rem) clamp(3rem, 5vw, 5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}

.hero > .inner {
  position: relative;
  z-index: 2;
  padding-inline: 0;
  margin: 0;
  width: 100%;
  max-width: 560px;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  margin: 0.6rem 0 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-muted);
  max-width: 36ch;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(60, 125, 255, 0.15);
  color: var(--teal);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--electric-blue), var(--violet));
  color: #fff;
  box-shadow: 0 10px 30px rgba(60, 125, 255, 0.25);
}

.btn.secondary {
  border: 1px solid rgba(168, 179, 216, 0.4);
  color: var(--text-main);
  background: rgba(10, 15, 34, 0.6);
}

.btn.tertiary {
  border: 1px solid rgba(168, 179, 216, 0.3);
  color: var(--text-main);
  background: transparent;
  font-size: 0.95rem;
  padding: 0.65rem 1.2rem;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.hero-stats article {
  background: var(--accent-bg);
  border: 1px solid rgba(164, 175, 210, 0.2);
  border-radius: 1rem;
  padding: 1.2rem;
  display: grid;
  gap: 0.25rem;
}

.hero-stats strong {
  font-size: 1.8rem;
}

.hero-visual {
  position: relative;
  min-height: 320px;
  border-radius: 2rem;
  background: radial-gradient(circle at top, rgba(60, 125, 255, 0.35), rgba(10, 15, 35, 0.95));
  overflow: hidden;
  width: min(540px, 100%);
  margin: 0 auto;
}

.hero-visual .orb {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(8px);
}

.orb-one {
  top: -40px;
  right: -60px;
  background: radial-gradient(circle, rgba(60, 125, 255, 0.9), rgba(124, 92, 255, 0.1));
}

.orb-two {
  bottom: -60px;
  left: -50px;
  background: radial-gradient(circle, rgba(60, 231, 255, 0.85), rgba(124, 92, 255, 0.05));
}

.hero-visual .grid {
  position: absolute;
  inset: 20%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.spark {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 15, 34, 0.45);
  box-shadow: inset 0 0 30px rgba(124, 92, 255, 0.2);
  animation: pulse 6s ease-in-out infinite;
}

.spark-2 { animation-delay: 1s; }
.spark-3 { animation-delay: 2s; }
.spark-4 { animation-delay: 3s; }
.spark-5 { animation-delay: 4s; }
.spark-6 { animation-delay: 5s; }

@keyframes pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.65; }
  50% { transform: scale(1.03); opacity: 1; }
}

/* Shared section spacing */
.section {
  padding: var(--section-padding) 0;
}

.section.accent {
  background: rgba(9, 12, 30, 0.85);
}

.page-hero {
  padding: calc(var(--section-padding) * 0.9) 0 2.5rem;
  border-bottom: 1px solid rgba(124, 130, 161, 0.12);
}

.page-hero h1 {
  margin: 0.7rem 0;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  letter-spacing: -0.02em;
}

.page-hero p {
  color: var(--text-muted);
  max-width: 60ch;
}

.section-header {
  max-width: 60ch;
  margin-bottom: 3rem;
}

.section h2 {
  margin: 0.75rem 0;
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  letter-spacing: -0.015em;
}

.section p {
  color: var(--text-muted);
}

/* Reusable grid layouts */
.feature-grid,
.impact-grid,
.team-grid,
.timeline {
  display: grid;
  gap: 1.5rem;
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.artifacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.link-grid article {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.text-link {
  font-weight: 600;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s ease;
}

.text-link::after {
  content: '↗';
  font-size: 0.95em;
}

.text-link:hover {
  gap: 0.55rem;
}

.feature-grid article,
.impact-grid article,
.team-grid article,
.timeline article,
.artifacts-grid .artifact-card,
.card-stack article,
.contact-card {
  background: var(--card-bg);
  border-radius: 1.2rem;
  padding: 1.8rem;
  border: 1px solid rgba(142, 152, 195, 0.16);
  color: white;
  box-shadow: 0 18px 40px rgba(4, 7, 26, 0.45);
}

.section .split {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
}

/* Artifact cards used on archive page */
.artifact-card {
  border: 1px solid rgba(142, 152, 195, 0.25);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.artifact-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.9rem;
  border: 1px solid rgba(60, 125, 255, 0.4);
}

.artifact-card strong {
  font-size: 1.05rem;
}

.artifact-card:hover,
.artifact-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(60, 125, 255, 0.8);
  outline: none;
}

.artifact-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  padding: 0.25rem 0.8rem;
  background: rgba(60, 125, 255, 0.18);
  color: var(--teal);
  font-weight: 600;
  width: fit-content;
}

/* Artifact modal overlay */
.artifact-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}

.artifact-modal[data-open="true"] {
  display: block;
}

.artifact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(254, 254, 255, 0.75);
  backdrop-filter: blur(8px);
}

.artifact-modal-panel {
  position: relative;
  max-width: min(960px, 90vw);
  max-height: 90vh;
  margin: min(10vh, 4rem) auto;
  background: rgba(7, 10, 26, 0.98);
  border: 1px solid rgba(60, 125, 255, 0.35);
  border-radius: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  overflow-y: auto;
}

.artifact-modal-media img {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(60, 125, 255, 0.4);
}

.artifact-modal-content {
  display: grid;
  gap: 0.75rem;
}

.artifact-map {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  border: 1px solid rgba(60, 125, 255, 0.35);
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(34, 53, 85, 0.6), rgba(15, 25, 45, 0.6));
}

.artifact-map img {
  display: block;
  width: 100%;
  height: auto;
}

.artifact-modal-tag {
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.05em;
}

.artifact-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.artifact-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}


.highlight-list {
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
  display: grid;
  gap: 0.9rem;
}

.highlight-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.highlight-list li::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.4rem;
  background: linear-gradient(135deg, var(--teal), var(--electric-blue));
  box-shadow: 0 0 12px rgba(60, 231, 255, 0.45);
}

.card-stack {
  display: grid;
  gap: 1.5rem;
}

.card-stack article {
  text-align: center;
  padding-block: 2.4rem;
}

.card-stack strong {
  font-size: 2rem;
  color: var(--teal);
}

.team-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.timeline {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Shared contact card styling */
.contact-card {
  display: grid;
  gap: 1rem;
}

.contact-card .btn {
  justify-self: flex-start;
}

/* Footer baseline */
.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(124, 130, 161, 0.12);
  background: rgba(5, 7, 20, 0.85);
}

.site-footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.back-to-top {
  color: var(--teal);
  font-weight: 600;
}

body[data-modal-open="true"] {
  overflow: hidden;
}

/* Responsive tweaks: tablets / mobile nav */
@media (max-width: 900px) {
  .site-nav {
    margin-left: 0;
  }

  .language-switcher {
    margin-left: auto;
    order: 3;
  }

  .site-header .inner {
    gap: 0.5rem;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(5, 7, 20, 0.95);
    backdrop-filter: blur(12px);
    padding: min(20vh, 6rem) clamp(1.5rem, 6vw, 3rem);
    transform: translateY(-10%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.2s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    font-size: 1.2rem;
    width: 100%;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .site-nav[data-open="true"] {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body[data-nav-open="true"] {
    overflow: hidden;
  }
}

/* Narrow phone adjustments */
@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 260px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer .inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .artifact-modal-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .hero > .inner {
    text-align: center;
  }

  .hero p {
    margin-inline: auto;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid,
  .impact-grid,
  .team-grid,
  .timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    padding: clamp(3rem, 12vw, 4rem) 0;
  }

  .artifact-modal-panel {
    margin: 1.5rem auto;
  }

  .artifact-modal-close {
    position: static;
    justify-self: end;
  }
}

@media (min-width: 1200px) {
  .hero {
    grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
    min-height: calc(100vh - 140px);
  }

  .hero-visual {
    justify-self: end;
  }
}
