/* ═══════════════════════════════════════════════════════════
   main.css — Awwwards Design System
   Portfolio Ferhid — Engineer from the Cosmos
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@300;400;500&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  /* Core Palette */
  --void: #02040a;
  --deep: #060b14;
  --surface: #0d1421;
  --surface-2: #121929;
  --surface-glass: rgba(13, 20, 33, 0.7);

  /* Text */
  --white: #edf2ff;
  --white-dim: rgba(237, 242, 255, 0.6);
  --white-faint: rgba(237, 242, 255, 0.12);
  --white-ghost: rgba(237, 242, 255, 0.04);

  /* Accent — Electric Cyan */
  --cyan: #00d4ff;
  --cyan-dim: rgba(0, 212, 255, 0.25);
  --cyan-glow: rgba(0, 212, 255, 0.08);

  /* Accent 2 — Gold */
  --gold: #f0b429;
  --gold-dim: rgba(240, 180, 41, 0.2);

  /* Accent 3 — Violet */
  --violet: #7c3aed;
  --violet-dim: rgba(124, 58, 237, 0.3);

  /* Borders */
  --border: rgba(237, 242, 255, 0.08);
  --border-accent: rgba(0, 212, 255, 0.3);
  --outline-stroke: rgba(237, 242, 255, 0.22);
  --card-img-opacity: 0.14;
  --card-img-hover-opacity: 0.38;

  /* Fonts */
  --font-head:  'Space Grotesk', sans-serif;
  --font-body:  'Inter', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --font-serif: 'Cormorant Garamond', serif;
  --font-logo:  'Space Grotesk', sans-serif;
  --font-tech:  'JetBrains Mono', monospace;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Kept for backward compat */
  --accent: var(--cyan);
  --accent-dim: var(--cyan-dim);
  --bg: var(--deep);
  --bg-2: var(--surface);
  --space: var(--void);
}

/* ── LIGHT MODE OVERRIDES ────────────────────────────────── */
[data-theme="light"] {
  --void: #f5f4f0;
  --deep: #ede9e3;
  --surface: #e8e3dc;
  --surface-2: #dfd9d1;
  --surface-glass: rgba(237, 233, 227, 0.8);

  --white: #1a1612;
  --white-dim: rgba(26, 22, 18, 0.65);
  --white-faint: rgba(26, 22, 18, 0.1);
  --white-ghost: rgba(26, 22, 18, 0.04);

  --cyan: #0095b3;
  --cyan-dim: rgba(0, 149, 179, 0.2);
  --cyan-glow: rgba(0, 149, 179, 0.06);

  --violet: #6d28d9;
  --violet-dim: rgba(109, 40, 217, 0.2);

  --border: rgba(26, 22, 18, 0.1);
  --border-accent: rgba(0, 149, 179, 0.35);
  --outline-stroke: rgba(26, 22, 18, 0.28);
  --card-img-opacity: 0.35;
  --card-img-hover-opacity: 0.78;

  --bg: var(--deep);
  --bg-2: var(--surface);
  --space: var(--void);
  --accent: var(--cyan);
  --accent-dim: var(--cyan-dim);
}

/* Light mode body + header adjustments */
[data-theme="light"] body {
  background: var(--void);
}

[data-theme="light"] .site-header.scrolled {
  background: rgba(237, 233, 227, 0.92);
  border-bottom-color: rgba(26, 22, 18, 0.1);
}

[data-theme="light"] .site-nav {
  color: var(--white);
}

[data-theme="light"] #scroll-progress {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

[data-theme="light"] #page-transition {
  background: var(--deep);
}

[data-theme="light"] .site-logo {
  color: var(--white);
}

[data-theme="light"] .btn-neon {
  color: var(--cyan);
  border-color: var(--border-accent);
}

[data-theme="light"] .btn-neon:hover {
  color: #f5f4f0;
}

[data-theme="light"] .tag {
  color: var(--cyan);
  border-color: var(--border-accent);
  background: var(--cyan-glow);
}

[data-theme="light"] #cursor-dot {
  background: var(--cyan);
}

[data-theme="light"] #cursor-ring {
  border-color: rgba(0, 149, 179, 0.5);
}

[data-theme="light"] #cursor-ring.hovered {
  border-color: rgba(0, 149, 179, 0.8);
  background: rgba(0, 149, 179, 0.05);
}

[data-theme="light"] #music-btn {
  background: rgba(237, 233, 227, 0.85);
  border-color: rgba(0, 149, 179, 0.3);
  color: rgba(26, 22, 18, 0.5);
}

[data-theme="light"] #music-btn:hover,
[data-theme="light"] #music-btn.playing {
  border-color: var(--cyan);
  color: var(--cyan);
}

site-burger

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body, a, button, input, select, textarea, [role="button"] {
  cursor: none;
}

body {
  font-family: var(--font-body);
  color: var(--white);
  background: var(--deep);
  overflow-x: hidden;
}

/* ── CUSTOM CURSOR ───────────────────────────────────────── */
#cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.05s, background 0.3s, width 0.3s, height 0.3s;
  mix-blend-mode: screen;
}

#cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 212, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease-smooth),
    width 0.4s var(--ease-spring),
    height 0.4s var(--ease-spring),
    border-color 0.3s,
    background 0.3s;
}

#cursor-ring.hovered {
  width: 64px;
  height: 64px;
  border-color: rgba(0, 212, 255, 0.8);
  background: rgba(0, 212, 255, 0.05);
}

#cursor-ring.clicking {
  width: 24px;
  height: 24px;
  background: rgba(0, 212, 255, 0.15);
}

@media (hover: none) {

  #cursor-dot,
  #cursor-ring {
    display: none;
  }

  body, a, button, input, select, textarea, [role="button"] {
    cursor: auto;
  }
}

/* ── SCROLL PROGRESS BAR ─────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 56px;
  transition: background 0.5s, padding 0.4s, backdrop-filter 0.5s;
}

.site-header.scrolled {
  padding: 16px 56px;
  background: rgba(6, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
  position: relative;
  transition: color 0.3s;
}

.site-logo::after {
  content: '.';
  color: var(--cyan);
}

.site-logo:hover {
  color: var(--cyan);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 40px;
}

.site-nav a {
  text-decoration: none;
  color: var(--white-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s;
  padding-bottom: 3px;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.4s var(--ease-out-expo);
}

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

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

/* Burger */
.site-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  z-index: 1010;
  padding: 4px;
}

.site-burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--white);
  transition: transform 0.4s var(--ease-out-expo), opacity 0.3s;
}

.site-burger.open span {
  background: #f5f4f0;
}

.site-burger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.site-burger.open span:nth-child(2) {
  opacity: 0;
}

.site-burger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── SCROLL REVEAL ───────────────────────────────────────── */
.sr {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}

.sr.from-left {
  transform: translateX(-30px);
}

.sr.from-right {
  transform: translateX(30px);
}

.sr.visible {
  opacity: 1;
  transform: translate(0);
}

/* ── GLASSMORPHISM CARD ──────────────────────────────────── */
.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 2px;
}

/* ── NEON BUTTON ─────────────────────────────────────────── */
.btn-neon {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 36px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--border-accent);
  background: transparent;
  text-decoration: none;
  cursor: none;
  position: relative;
  overflow: hidden;
  transition: color 0.4s, border-color 0.4s;
}

.btn-neon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: translateX(-101%);
  transition: transform 0.45s var(--ease-out-expo);
  z-index: 0;
}

.btn-neon:hover {
  color: var(--void);
  border-color: var(--cyan);
}

.btn-neon:hover::before {
  transform: translateX(0);
}

.btn-neon>* {
  position: relative;
  z-index: 1;
}

/* ── TAG CHIP ────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--border-accent);
  background: var(--cyan-glow);
  border-radius: 2px;
  transition: background 0.3s, color 0.3s;
}

/* ── SECTION LABEL ───────────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
  margin-bottom: 20px;
}

.section-label::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--cyan);
}

/* ── PAGE TRANSITION OVERLAY ─────────────────────────────── */
#page-transition {
  position: fixed;
  inset: 0;
  background: var(--void);
  z-index: 99990;
  transform: scaleY(0);
  transform-origin: top;
  pointer-events: none;
}

/* ── DARK MODE TOGGLE ────────────────────────────────────── */
#theme-toggle {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 2000;
  border: 1px solid var(--border);
  width: 40px;
  height: 72px;
  border-radius: 20px;
  cursor: none;
  backdrop-filter: blur(10px);
  background: var(--surface);
  opacity: 0.85;
  transition: border-color 0.4s, background 0.4s, opacity 0.4s;
}

#theme-toggle:hover {
  border-color: var(--cyan);
  opacity: 1;
}

#theme-toggle .icon-sun {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5c842;
  box-shadow: 0 0 6px rgba(245, 200, 66, 0.5);
  transition: opacity 0.4s;
}

#theme-toggle .icon-moon {
  position: absolute;
  bottom: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--cyan);
  box-shadow: 3px -3px 0 0 var(--cyan) inset;
  clip-path: circle(50%);
  transition: opacity 0.4s;
}

#theme-toggle .toggle-pill {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.15;
  transform: translateX(-50%) translateY(0);
  transition: transform 0.4s var(--ease-spring);
  pointer-events: none;
}

[data-theme="dark"] #theme-toggle .toggle-pill {
  transform: translateX(-50%) translateY(36px);
}

[data-theme="dark"] #theme-toggle .icon-sun {
  opacity: 0.3;
}

[data-theme="light"] #theme-toggle .icon-moon {
  opacity: 0.3;
}

/* ── GLOBAL MUSIC BUTTON ── */
#music-btn {
  position: fixed;
  bottom: 32px;
  right: 36px;
  z-index: 2000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.3s, color 0.4s, background 0.4s;
  color: var(--white-dim);
}

#music-btn:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 24px var(--cyan-glow);
  color: var(--cyan);
  transform: scale(1.08);
}

#music-btn.playing {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-dim), 0 0 30px var(--cyan-glow);
  color: var(--cyan);
}

#music-btn.playing .wave-bars {
  display: flex;
}

#music-btn.playing .icon-speaker {
  display: none;
}

.wave-bars {
  display: none;
  gap: 3px;
  align-items: flex-end;
  height: 18px;
}

.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--cyan);
  animation: wavePulse 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
  animation-delay: 0s;
  height: 6px;
}

.wave-bar:nth-child(2) {
  animation-delay: 0.15s;
  height: 14px;
}

.wave-bar:nth-child(3) {
  animation-delay: 0.3s;
  height: 9px;
}

.wave-bar:nth-child(4) {
  animation-delay: 0.45s;
  height: 18px;
}

.wave-bar:nth-child(5) {
  animation-delay: 0.6s;
  height: 11px;
}

@keyframes wavePulse {

  0%,
  100% {
    transform: scaleY(0.4);
    opacity: 0.6;
  }

  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

#music-label {
  position: fixed;
  bottom: 44px;
  right: 96px;
  z-index: 2000;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white-dim);
  pointer-events: none;
  transition: color 0.4s, opacity 0.4s;
  opacity: 0;
}

#music-btn:hover~#music-label,
#music-btn.playing~#music-label {
  opacity: 1;
  color: var(--cyan);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header {
    padding: 18px 24px;
  }

  .site-header.scrolled {
    padding: 14px 24px;
  }

  .site-burger {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    background: rgba(6, 11, 20, 0.97);
    backdrop-filter: blur(30px);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.5s var(--ease-out-expo);
    z-index: 1005;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 32px;
    text-align: center;
    font-size: 1.1rem;
  }

  .site-nav a {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: rgba(237, 242, 255, 0.6)
  }

  .site-nav a:hover,
  .site-nav a.active {
    color: #f5f4f0;
  }

  .site-nav.open {
    transform: translateX(0);
  }
}