/* ============================================================
   MAIN.CSS — Portfolio Design System
   AI/ML Theme: Dark Cosmic Terminal
   Author: Portfolio Generator for Rajveer Singh
   ============================================================ */

/* Google Fonts are preconnected and loaded in the HTML headers for performance */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg: #050a0f;
  --bg2: #080f18;
  --bg3: #0c1825;
  --surface: #0e1e2e;
  --surface2: #132436;
  --border: #1a3346;
  --border2: #204060;
  --accent: #00d4ff;
  --accent2: #00ff9f;
  --accent3: #ff6b35;
  --text: #c8dde8;
  --text2: #7a9db5;
  --text3: #4a6e88;
  --white: #e8f4ff;
  --danger: #ff4757;
  --warning: #ffa502;
  --success: #2ed573;

  --font-mono: "Share Tech Mono", monospace;
  --font-display: "Playfair Display", serif;
  --font-body: "DM Sans", sans-serif;

  --radius: 8px;
  --radius2: 16px;
  --shadow: 0 4px 24px rgba(0, 212, 255, 0.08);
  --shadow2: 0 8px 48px rgba(0, 212, 255, 0.15);
  --glow: 0 0 20px rgba(0, 212, 255, 0.3);
  --glow2: 0 0 40px rgba(0, 212, 255, 0.2);

  --nav-h: 70px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--accent2);
}
img {
  max-width: 100%;
  display: block;
}
ul {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── Selection ─────────────────────────────────────────────── */
::selection {
  background: rgba(0, 212, 255, 0.25);
  color: var(--white);
}

/* ── Background Grid ───────────────────────────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 60% at 50% -10%,
    rgba(0, 212, 255, 0.06) 0%,
    transparent 60%
  );
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  background: rgba(5, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
.navbar.scrolled {
  background: rgba(5, 10, 15, 0.97);
  border-bottom-color: var(--border2);
  box-shadow: var(--shadow);
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-logo span {
  color: var(--accent2);
}
.nav-logo .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: var(--text2);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  position: relative;
  text-transform: uppercase;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  right: 50%;
  height: 1px;
  background: var(--accent);
  transition: all var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.06);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  left: 10%;
  right: 10%;
}
.nav-cta {
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  color: var(--bg) !important;
  background: var(--accent) !important;
  padding: 0.45rem 1rem !important;
  border-radius: var(--radius) !important;
}
.nav-cta:hover {
  background: var(--accent2) !important;
  color: var(--bg) !important;
}
.nav-cta::after {
  display: none !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.hamburger:hover {
  background: var(--surface);
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text2);
  transition: all var(--transition);
  display: block;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(5, 10, 15, 0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text2);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  letter-spacing: 1px;
  transition: all var(--transition);
  text-transform: uppercase;
}
.mobile-menu a:hover {
  color: var(--accent);
  background: var(--surface);
}

/* ── Page Wrapper ───────────────────────────────────────────── */
.page-wrapper {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Section Styles ─────────────────────────────────────────── */
.section {
  padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 6vw, 5rem);
  max-width: 1200px;
  margin: 0 auto;
}
.section-full {
  padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 6vw, 5rem);
}
.section-header {
  margin-bottom: 3.5rem;
  text-align: center;
}
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.section-title em {
  color: var(--accent);
  font-style: italic;
}
.section-desc {
  color: var(--text2);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.8;
}
.divider {
  width: 60px;
  height: 2px;
  margin: 1.5rem auto 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 1px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all var(--transition);
  font-weight: 400;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent2);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border2);
}
.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.06);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--border2);
}
.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.75rem;
}
.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 0.88rem;
}
.btn-icon {
  padding: 0.65rem;
  border-radius: var(--radius);
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  transition: all var(--transition);
  overflow: hidden;
}
.card:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: var(--shadow2);
}
.card-glow:hover {
  box-shadow:
    var(--shadow2),
    0 0 0 1px rgba(0, 212, 255, 0.2);
}

/* ── Tags / Badges ───────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.2);
}
.tag-green {
  background: rgba(0, 255, 159, 0.08);
  color: var(--accent2);
  border-color: rgba(0, 255, 159, 0.2);
}
.tag-orange {
  background: rgba(255, 107, 53, 0.08);
  color: var(--accent3);
  border-color: rgba(255, 107, 53, 0.2);
}
.tag-yellow {
  background: rgba(255, 165, 2, 0.08);
  color: var(--warning);
  border-color: rgba(255, 165, 2, 0.2);
}
.tag-red {
  background: rgba(255, 71, 87, 0.08);
  color: var(--danger);
  border-color: rgba(255, 71, 87, 0.2);
}

/* ── Stars ───────────────────────────────────────────────────── */
.stars {
  display: flex;
  gap: 2px;
}
.star {
  font-size: 1rem;
  color: var(--border2);
  transition: color var(--transition);
}
.star.filled {
  color: var(--warning);
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 1s ease;
}

/* ── Tooltip ─────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 100;
}
[data-tooltip]:hover::before {
  opacity: 1;
}

/* ── Reveal Animation ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.2s;
}
.delay-3 {
  transition-delay: 0.3s;
}
.delay-4 {
  transition-delay: 0.4s;
}
.delay-5 {
  transition-delay: 0.5s;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 6vw, 5rem) 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-brand .nav-logo {
  margin-bottom: 1rem;
}
.footer-brand p {
  color: var(--text2);
  font-size: 0.9rem;
  line-height: 1.8;
  max-width: 280px;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 1.25rem;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-col a {
  color: var(--text2);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: var(--accent);
}
.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.social-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  font-size: 0.9rem;
  transition: all var(--transition);
  text-decoration: none;
}
.social-btn:hover {
  color: var(--accent);
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-2px);
}
.footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom p {
  color: var(--text3);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}
.footer-bottom span {
  color: var(--accent);
}

/* ── Utility ─────────────────────────────────────────────────── */
.text-accent {
  color: var(--accent);
}
.text-accent2 {
  color: var(--accent2);
}
.text-accent3 {
  color: var(--accent3);
}
.text-muted {
  color: var(--text2);
}
.text-dim {
  color: var(--text3);
}
.text-mono {
  font-family: var(--font-mono);
}
.text-display {
  font-family: var(--font-display);
}
.text-center {
  text-align: center;
}
.flex {
  display: flex;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gap-1 {
  gap: 0.5rem;
}
.gap-2 {
  gap: 1rem;
}
.gap-3 {
  gap: 1.5rem;
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.w-full {
  width: 100%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* ── Keyboard Accessibility Focus States ── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 2000;
  transition: top 0.3s ease;
}
.skip-link:focus-visible {
  top: 10px;
  outline: none;
}

/* ── Desktop Navbar Dropdown ── */
.nav-dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-trigger {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: var(--text2);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
}
.dropdown-trigger svg {
  transition: transform var(--transition);
}
.nav-dropdown:hover .dropdown-trigger,
.nav-dropdown:focus-within .dropdown-trigger {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.06);
}
.nav-dropdown:hover .dropdown-trigger svg,
.nav-dropdown:focus-within .dropdown-trigger svg {
  transform: rotate(180deg);
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0;
  min-width: 160px;
  display: none;
  flex-direction: column;
  z-index: 1001;
  box-shadow: var(--shadow2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--transition),
    transform var(--transition);
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
  font-size: 0.72rem !important;
  padding: 0.6rem 1rem !important;
  text-align: left;
  width: 100%;
  border-radius: 0 !important;
}
.dropdown-menu a::after {
  display: none !important;
}
.dropdown-menu a:hover {
  background: rgba(0, 212, 255, 0.08) !important;
  color: var(--accent) !important;
}

/* ── Navbar Theme Toggle ── */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text2);
  padding: 0.45rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover {
  color: var(--accent);
  background: rgba(0, 212, 255, 0.06);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}
.theme-toggle .moon-icon {
  display: none;
}
.light-theme .theme-toggle .sun-icon {
  display: none;
}
.light-theme .theme-toggle .moon-icon {
  display: block;
}

/* ── Mobile Menu Additions ── */
.mobile-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0.5rem;
}
.mobile-group-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding-left: 0.75rem;
  margin-bottom: 0.25rem;
}
.mobile-sub-link {
  font-size: 0.78rem !important;
  color: var(--text2) !important;
  padding-left: 1.5rem !important;
}

/* ── Mouse Spotlight Glow effect for cards ── */
.card-glow {
  position: relative;
  overflow: hidden;
}
.card-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--x, 50%) var(--y, 50%),
    rgba(0, 212, 255, 0.08),
    transparent 40%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card-glow:hover::before {
  opacity: 1;
}

/* ── Parallel Light Theme variables ── */
:root.light-theme,
body.light-theme {
  --bg: #f4f7fa;
  --bg2: #ebeff3;
  --bg3: #e0e6ec;
  --surface: #ffffff;
  --surface2: #f1f5f8;
  --border: #cfdae5;
  --border2: #b6c7d8;
  --accent: #008aa3;
  --accent2: #009e60;
  --accent3: #cc4e1a;
  --text: #182a3a;
  --text2: #4c6275;
  --text3: #7a8f9f;
  --white: #0a141e;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow2: 0 8px 30px rgba(0, 0, 0, 0.08);
  --glow: 0 0 15px rgba(0, 138, 163, 0.08);
  --glow2: 0 0 30px rgba(0, 138, 163, 0.04);
}
.light-theme .bg-grid {
  background-image:
    linear-gradient(rgba(0, 138, 163, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 138, 163, 0.025) 1px, transparent 1px);
}
.light-theme .bg-glow {
  background: radial-gradient(
    ellipse 80% 60% at 50% -10%,
    rgba(0, 138, 163, 0.04) 0%,
    transparent 60%
  );
}
.light-theme .card-glow::before {
  background: radial-gradient(
    400px circle at var(--x, 50%) var(--y, 50%),
    rgba(0, 138, 163, 0.08),
    transparent 40%
  );
}

/* ── View Transitions API ── */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 250ms;
  animation-timing-function: ease;
}

/* ── Reduced Motion Override ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
