/* =========================================================
   LIBA MAHMOOD — PORTFOLIO
   Theme: dark hacker-sci-fi, burgundy + charcoal grey
   ========================================================= */

:root {
  --bg: #121013;
  --bg-alt: #1a1719;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(179, 41, 79, 0.2);
  --border-strong: rgba(179, 41, 79, 0.42);

  --pink: #b3294f;
  --pink-soft: #d1617e;
  --violet: #6e6b74;
  --violet-soft: #9c98a3;

  --text: #f1eef0;
  --text-dim: #b9b3ba;
  --text-mute: #7c7680;

  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-cursive: 'Pinyon Script', cursive;

  --glow-pink: 0 0 8px rgba(179, 41, 79, 0.55), 0 0 24px rgba(179, 41, 79, 0.28);
  --glow-violet: 0 0 8px rgba(110, 107, 116, 0.5), 0 0 24px rgba(110, 107, 116, 0.22);

  --bubble-bg: rgba(22, 19, 21, 0.88);

  --radius: 14px;
}

/* ---------- pastel light theme ---------- */

[data-theme='light'] {
  --bg: #fdf4fa;
  --bg-alt: #fbe9f6;
  --surface: rgba(198, 88, 158, 0.05);
  --surface-strong: rgba(198, 88, 158, 0.09);
  --border: rgba(214, 64, 148, 0.18);
  --border-strong: rgba(214, 64, 148, 0.38);

  --pink: #e94f9e;
  --pink-soft: #d6408f;
  --violet: #9457d1;
  --violet-soft: #7d3fc0;

  --text: #3a2249;
  --text-dim: #6b4d7a;
  --text-mute: #9c86a8;

  --glow-pink: 0 0 6px rgba(233, 79, 158, 0.3), 0 0 16px rgba(233, 79, 158, 0.15);
  --glow-violet: 0 0 6px rgba(148, 87, 209, 0.3), 0 0 16px rgba(148, 87, 209, 0.15);

  --bubble-bg: rgba(255, 255, 255, 0.88);
}

[data-theme='light'] body {
  background: linear-gradient(180deg, #fff9fd 0%, #fdf4fa 40%, #fbeaf5 100%);
}

[data-theme='light'] #matrix-rain,
[data-theme='light'] .scanlines {
  display: none;
}

[data-theme='light'] .vignette {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(233, 150, 200, 0.25), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.5), transparent 40%);
}

[data-theme='light'] header {
  background: rgba(255, 249, 253, 0.8);
}

[data-theme='light'] .hero-glow {
  background: radial-gradient(ellipse, rgba(233, 79, 158, 0.16), transparent 70%);
}

[data-theme='light'] .glitch-heading.cursive-name {
  text-shadow: 0 0 14px rgba(233, 79, 158, 0.25);
}

[data-theme='light'] .terminal-window {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 50px rgba(190, 110, 160, 0.16), 0 0 30px rgba(148, 87, 209, 0.06);
}

[data-theme='light'] .btn-solid {
  color: #fff9fd;
}

[data-theme='light'] ::selection {
  background: var(--pink);
  color: #fff9fd;
}

[data-theme='light'] .btn-solid {
  box-shadow: 0 0 20px rgba(255, 63, 176, 0.35);
}

[data-theme='light'] .btn-solid:hover {
  box-shadow: 0 0 30px rgba(255, 63, 176, 0.55);
}

[data-theme='light'] .project-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 30px rgba(255, 63, 176, 0.12);
}

[data-theme='light'] .tag {
  background: rgba(168, 85, 255, 0.12);
  border-color: rgba(168, 85, 255, 0.3);
}

[data-theme='light'] .skill-tags li {
  background: rgba(255, 63, 176, 0.08);
  border-color: rgba(255, 63, 176, 0.22);
}

[data-theme='light'] .skill-tags li:hover {
  background: rgba(255, 63, 176, 0.14);
}

[data-theme='light'] .contact-card:hover {
  box-shadow: 0 0 24px rgba(255, 63, 176, 0.15);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

::selection {
  background: var(--pink);
  color: #f5eef0;
}

/* ---------- background fx ---------- */

#matrix-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  opacity: 0.5;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(110, 107, 116, 0.14), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(18, 16, 19, 0.9), transparent 40%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(18, 16, 19, 0.85) 100%);
}

/* ---------- header / nav ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 16, 19, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.logo-bracket {
  color: var(--pink);
  text-shadow: var(--glow-pink);
}

.logo-cursor {
  color: var(--violet);
  animation: blink 1.1s steps(1) infinite;
}

nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.25s ease, text-shadow 0.25s ease;
  position: relative;
}

.nav-index {
  color: var(--pink);
  margin-right: 4px;
  font-size: 0.8rem;
}

.nav-link:hover {
  color: var(--text);
  text-shadow: var(--glow-violet);
}

.header-cta {
  font-size: 0.85rem;
  padding: 8px 14px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--pink-soft);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: translateY(-2px) rotate(15deg);
  border-color: var(--pink);
  box-shadow: var(--glow-pink);
}

/* ---------- buttons ---------- */

.btn-solid,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-solid {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #f5eef0;
  border: 1px solid transparent;
  box-shadow: 0 0 20px rgba(179, 41, 79, 0.35);
}

.btn-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(179, 41, 79, 0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--pink);
  color: var(--pink-soft);
  box-shadow: var(--glow-pink);
}

/* ---------- layout ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#contact {
  border-bottom: none;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 10px;
}

.heading-index {
  color: var(--violet-soft);
  font-family: var(--font-mono);
  font-size: 1rem;
  margin-right: 6px;
}

.section-sub {
  color: var(--text-mute);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

/* ---------- hero ---------- */

.hero {
  padding-top: 72px;
  padding-bottom: 96px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(179, 41, 79, 0.24), transparent 70%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink-soft);
  margin-bottom: 24px;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink), 0 0 16px var(--pink);
  animation: pulse 1.6s ease-in-out infinite;
}

.glitch-heading.cursive-name {
  font-family: var(--font-cursive);
  font-weight: 400;
  font-size: clamp(4.4rem, 15vw, 8.5rem);
  letter-spacing: 0;
  line-height: 1.15;
  color: var(--text);
  position: relative;
  text-shadow: 0 0 18px rgba(179, 41, 79, 0.4);
  margin-bottom: 16px;
}

.glitch-heading::before,
.glitch-heading::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 0);
}

.glitch-heading::before {
  color: var(--pink);
  z-index: -1;
  animation: glitch-shift-1 6s infinite steps(1);
}

.glitch-heading::after {
  color: var(--violet);
  z-index: -1;
  animation: glitch-shift-2 6s infinite steps(1);
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  color: var(--text-dim);
  margin-bottom: 48px;
}

.hero-subtitle .sep {
  color: var(--violet-soft);
  margin: 0 6px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 44px;
}

/* ---------- hero row: terminal + photo ---------- */

.hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  max-width: 980px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.hero-row .hero-terminal {
  margin: 0;
  flex: 1 1 460px;
}

.hero-photo-wrap {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  text-align: left;
}

.speech-bubble {
  position: relative;
  background: var(--bubble-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-dim);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: var(--bubble-bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.photo-frame {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--glow-pink);
  flex-shrink: 0;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-mute);
  font-size: 2rem;
  text-align: center;
  padding: 12px;
  z-index: 1;
}

.photo-fallback span {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--text-mute);
}

.frame-tag {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--pink-soft);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 3;
}

/* ---------- terminal window ---------- */

.terminal-window {
  background: rgba(20, 17, 20, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(110, 107, 116, 0.1);
  backdrop-filter: blur(6px);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.dot-group {
  display: flex;
  gap: 7px;
}

.tdot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.tdot-pink { background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.tdot-violet { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.tdot-mute { background: var(--text-mute); }

.terminal-title {
  font-size: 0.78rem;
  color: var(--text-mute);
  margin-left: 4px;
}

.terminal-body {
  padding: 24px 22px 28px;
  font-size: 0.92rem;
}

.terminal-body p {
  margin-bottom: 10px;
  color: var(--text-dim);
  min-height: 1.4em;
}

.terminal-body .prompt {
  color: var(--pink);
  font-weight: 700;
  margin-right: 8px;
}

.type-line {
  color: var(--text);
  padding-left: 22px;
}

.type-line::after {
  content: '';
}

.cursor-blink {
  display: inline-block;
  color: var(--pink);
  animation: blink 1s steps(1) infinite;
}

/* ---------- projects ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: var(--surface-strong);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), 0 0 30px rgba(179, 41, 79, 0.14);
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-card h3 i {
  color: var(--pink);
}

.emoji-icon {
  font-size: 1.15em;
  line-height: 1;
}

.card-icon-link {
  color: var(--text-mute);
  font-size: 1rem;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.card-icon-link:hover {
  color: var(--pink);
  transform: translate(2px, -2px);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(110, 107, 116, 0.16);
  border: 1px solid rgba(110, 107, 116, 0.35);
  color: var(--violet-soft);
  white-space: nowrap;
}

.project-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink-soft);
  text-decoration: none;
  transition: color 0.2s ease, gap 0.2s ease;
}

.project-link:hover {
  color: var(--pink);
  gap: 12px;
}

.project-card--empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 160px;
}

.project-card--empty:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.project-card--empty h3 {
  color: var(--text-mute);
}

.project-card--empty h3 i {
  color: var(--text-mute);
}

.project-desc--empty {
  color: var(--text-mute);
  font-style: italic;
  margin-bottom: 0;
}

/* ---------- skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.skill-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.skill-block-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.skill-block-title i {
  color: var(--violet);
}

.skill-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags li {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(179, 41, 79, 0.1);
  border: 1px solid rgba(179, 41, 79, 0.28);
  color: var(--text-dim);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.skill-tags li:hover {
  color: var(--pink-soft);
  border-color: var(--pink);
  background: rgba(179, 41, 79, 0.18);
}

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card i {
  font-size: 1.2rem;
  color: var(--pink);
  flex-shrink: 0;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: 0 0 24px rgba(179, 41, 79, 0.18);
}

/* ---------- footer ---------- */

footer {
  text-align: center;
  padding: 40px 24px 60px;
  color: var(--text-mute);
  font-size: 0.85rem;
}

footer .prompt {
  color: var(--pink);
  margin-right: 6px;
}

.footer-sub {
  margin-top: 10px;
  font-size: 0.78rem;
}

.footer-sub a {
  color: var(--text-mute);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-sub a:hover {
  color: var(--pink-soft);
}

/* ---------- reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- animations ---------- */

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes glitch-shift-1 {
  0%, 92%, 100% { transform: translate(0, 0); opacity: 0; }
  93% { transform: translate(-2px, 1px); opacity: 0.6; }
  95% { transform: translate(2px, -1px); opacity: 0.4; }
  97% { transform: translate(-1px, 0); opacity: 0; }
}

@keyframes glitch-shift-2 {
  0%, 90%, 100% { transform: translate(0, 0); opacity: 0; }
  91% { transform: translate(2px, -1px); opacity: 0.5; }
  94% { transform: translate(-2px, 1px); opacity: 0.35; }
  96% { transform: translate(1px, 0); opacity: 0; }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  nav {
    order: 3;
    width: 100%;
    gap: 10px 16px;
    font-size: 0.85rem;
  }

  .header-cta span {
    display: none;
  }

  .header-cta {
    padding: 8px 12px;
  }

  section {
    padding: 64px 0;
  }

  .hero {
    padding-top: 48px;
  }
}

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

  #matrix-rain {
    display: none;
  }
}
