/* ============================================
   DESIGN SYSTEM — Salman Asmat Portfolio
   Minimal · Interactive · Dark-first
   Typography: Space Grotesk + Inter
   Palette: Monochrome + Electric Blue
   ============================================ */
/* ---------- CSS Custom Properties ---------- */
:root {
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* HSL Palette — More vibrant and controllable */
  --hue: 220;
  --accent-hue: 217;
  
  --bg-primary: hsl(var(--hue), 20%, 4%);
  --bg-secondary: hsl(var(--hue), 20%, 7%);
  --bg-card: hsla(var(--hue), 20%, 10%, 0.5);
  --bg-card-hover: hsla(var(--hue), 20%, 14%, 0.8);
  --bg-elevated: hsl(var(--hue), 20%, 12%);

  --text-primary: hsl(var(--hue), 10%, 96%);
  --text-secondary: hsl(var(--hue), 10%, 65%);
  --text-tertiary: hsl(var(--hue), 10%, 55%);

  --accent: hsl(var(--accent-hue), 91%, 60%);
  --accent-dim: hsl(var(--accent-hue), 91%, 50%);
  --accent-glow: hsla(var(--accent-hue), 91%, 60%, 0.3);
  
  --success: hsl(142, 71%, 45%);

  --border: hsla(var(--hue), 10%, 100%, 0.08);
  --border-hover: hsla(var(--hue), 10%, 100%, 0.15);

  --glass-bg: hsla(var(--hue), 20%, 4%, 0.7);
  --glass-border: hsla(var(--hue), 10%, 100%, 0.1);
  --glass-glow: hsla(var(--hue), 10%, 100%, 0.05);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 40px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --section-gap: clamp(48px, 8vw, 80px);
  --container-max: 1200px;
  --container-px: 2rem;

  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3仿真%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

:root[data-theme="light"] {
  --hue: 220;
  --bg-primary: hsl(var(--hue), 20%, 98%);
  --bg-secondary: hsl(var(--hue), 20%, 95%);
  --bg-card: hsla(var(--hue), 20%, 100%, 0.7);
  --bg-card-hover: hsla(var(--hue), 20%, 94%, 0.9);
  --bg-elevated: hsl(var(--hue), 20%, 100%);

  --text-primary: hsl(var(--hue), 20%, 10%);
  --text-secondary: hsl(var(--hue), 10%, 40%);
  --text-tertiary: hsl(var(--hue), 10%, 60%);

  --accent: hsl(var(--accent-hue), 91%, 50%);
  --accent-dim: hsl(var(--accent-hue), 91%, 40%);
  --accent-glow: hsla(var(--accent-hue), 91%, 50%, 0.15);

  --border: hsla(var(--hue), 20%, 10%, 0.08);
  --border-hover: hsla(var(--hue), 20%, 10%, 0.15);

  --glass-bg: hsla(var(--hue), 20%, 100%, 0.7);
  --glass-border: hsla(var(--hue), 20%, 10%, 0.1);
  --glass-glow: hsla(var(--hue), 20%, 10%, 0.03);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  opacity: 0.03;
  z-index: 9999;
  pointer-events: none;
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
}

ul { list-style: none; }

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

/* ---------- Skip Navigation ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100002;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.3s var(--ease-out);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* ---------- Section ---------- */
.section {
  padding: var(--section-gap) 0;
  scroll-margin-top: 60px;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.7;
}

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: all 0.4s var(--ease-out);
}

.nav.scrolled {
  padding: 1rem 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo .dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  transition: all 0.3s var(--ease-out);
  position: relative;
  padding: 6px 14px;
  border-radius: 20px;
}

.nav-links a.active {
  color: var(--text-primary);
  background: var(--glass-glow);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--glass-glow);
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-primary);
  transition: all 0.3s var(--ease-out);
  margin-left: 12px;
}

.theme-toggle:hover {
  background: var(--glass-glow);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .moon-icon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .sun-icon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .moon-icon {
  display: block;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
  transform-origin: center;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
  padding-bottom: 100px;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 80%);
  opacity: 0.4;
}

.hero-glow {
  position: absolute;
  width: clamp(600px, 60vw, 1200px);
  height: clamp(600px, 60vw, 1200px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: var(--y, 40%);
  left: var(--x, 50%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
  transition: top 0.8s var(--ease-out), left 0.8s var(--ease-out);
  animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.15); }
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  position: relative;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--success);
  border-radius: 50%;
  animation: statusPulse 2s ease-out infinite;
}

@keyframes statusPulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.hero-code-stream {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40%;
  pointer-events: none;
  opacity: 0.15;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.2;
  color: var(--accent);
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  z-index: 0;
}

.stream-line {
  position: absolute;
  white-space: nowrap;
  animation: streamMove linear forwards;
}

@keyframes streamMove {
  from { transform: translateY(110vh); }
  to { transform: translateY(-10vh); }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  margin-bottom: 60px;
}

.hero-greeting {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.2s forwards;
}

.hero-greeting::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  color: var(--text-primary);
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.4s forwards;
}

.hero-role {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 12px;
  min-height: 1.5em;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.typing-cursor {
  display: inline-block;
  color: var(--accent);
  font-weight: 300;
  margin-left: 2px;
  animation: cursorBlink 0.75s steps(1) infinite;
}

.typing-cursor.fade {
  animation: cursorFadeOut 0.8s var(--ease-out) forwards;
}

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

@keyframes cursorFadeOut {
  to { opacity: 0; }
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-tertiary);
  max-width: 540px;
  line-height: 1.7;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.8s forwards;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 1s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 1rem 2.5rem;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.4s var(--ease-out);
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 0 hsl(var(--accent-hue), 91%, 40%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 transparent;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  z-index: 5;
  animation: fadeUp 0.8s var(--ease-out) 1.4s forwards;
}

.scroll-indicator span {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--border-hover) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, var(--accent) 50%, transparent 100%);
  animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { top: -100%; }
  50% { top: 100%; }
  100% { top: 100%; }
}

/* ============================================
   ABOUT
   ============================================ */
.about-text {
  max-width: 680px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 15px;
}

.about-text p:first-of-type {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 400;
}

.about-highlight {
  display: inline;
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   STATS
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 60px;
}

.stat-item {
  background: var(--bg-secondary);
  padding: 40px 32px;
  text-align: center;
  transition: background 0.3s;
}

.stat-item:hover {
  background: var(--bg-card);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-punch {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ============================================
   SKILLS
   ============================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  transition: all 0.5s var(--ease-out);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.skill-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px -10px rgba(0,0,0,0.5),
    0 0 0 1px var(--glass-border);
}

.skill-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), var(--glass-glow), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 10;
}

.skill-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 20;
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card:hover::after {
  opacity: 1;
}

.skill-card h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.skill-item {
  margin-bottom: 16px;
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.skill-item span {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.5s var(--ease-out);
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 
    0 30px 60px -15px rgba(0,0,0,0.6),
    0 0 0 1px var(--accent-glow);
}

.project-card:hover::after {
  opacity: 1;
}

.project-thumb {
  height: 180px;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb::before {
  content: '\e618'; /* ti-arrow-top-right */
  font-family: 'themify';
  position: absolute;
  inset: 0;
  background: var(--glass-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-primary);
  opacity: 0;
  transition: all 0.4s var(--ease-out);
  z-index: 2;
  transform: scale(0.9);
}

.project-card:hover .project-thumb::before {
  opacity: 1;
  transform: scale(1);
}

.project-thumb-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: rgba(255,255,255,0.15);
  letter-spacing: -1px;
}

.project-body {
  padding: 24px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.project-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  background: var(--glass-glow);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--accent);
}

.project-body h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.project-punch {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ============================================
   TOOLS / PLAYGROUND
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.tool-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: all 0.4s var(--ease-out);
  cursor: pointer;
  position: relative;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(59, 130, 246, 0.4), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 10;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(59,130,246,0.15);
}

.tool-card:hover::after {
  opacity: 1;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 22px;
}

.tool-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.tool-card .tool-punch {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-wrapper {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-wrapper .section-subtitle {
  margin: 0 auto 40px;
}

.contact-form {
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
  transition: all 0.3s var(--ease-out);
  margin-bottom: 0;
  background: transparent;
  padding: 0;
  z-index: 1;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 24px 16px 8px; /* Extra padding top for floating label */
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.3s var(--ease-out);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card-hover);
}

/* Floating Label Logic */
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: 8px;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.8;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: transparent; /* Hide placeholder text initially */
}

.contact-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.success-msg {
  display: none;
  padding: 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  text-align: center;
  font-size: 14px;
  margin-top: 16px;
}

/* ---------- Form Validation States ---------- */
.form-group.error input,
.form-group.error textarea {
  border-color: hsl(0, 70%, 55%);
  box-shadow: 0 0 0 3px hsla(0, 70%, 55%, 0.12);
}

.form-group.error label {
  color: hsl(0, 70%, 55%) !important;
  opacity: 1 !important;
}

.form-group.success input,
.form-group.success textarea {
  border-color: var(--success);
  box-shadow: 0 0 0 3px hsla(142, 71%, 45%, 0.12);
}

.form-group.success label {
  color: var(--success) !important;
}

.error-msg {
  font-size: 12px;
  font-weight: 500;
  color: hsl(0, 70%, 55%);
  margin-top: 6px;
  padding-left: 2px;
  display: none;
}

.form-group.error .error-msg {
  display: block;
  animation: errorSlideIn 0.3s var(--ease-out);
}

@keyframes errorSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group.shake {
  animation: formShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes formShake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-6px); }
  30%, 60%, 90% { transform: translateX(6px); }
}

.contact-form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 60px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-socials {
  display: flex;
  gap: 20px;
}

.footer-socials a {
  color: var(--text-tertiary);
  transition: color 0.3s, transform 0.3s;
  font-size: 18px;
}

.footer-socials a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease-out);
  z-index: 999;
  cursor: pointer;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.scroll-top-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --section-gap: 48px;
    --container-px: 20px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
  }

  .nav-links.open {
    display: flex;
    background: var(--bg-primary); /* Use solid background for open mobile menu */
  }

  .nav-links a {
    font-size: 24px;
  }

  .nav-hamburger {
    display: flex;
  }

  .hero-name {
    letter-spacing: -2px;
  }

  .hero-cta-group {
    flex-direction: column;
  }

  .hero-cta-group .btn {
    justify-content: center;
  }

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

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============================================
   ADVANCED UI / UX ENHANCEMENTS
   ============================================ */

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s var(--ease-out);
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-logo {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  animation: pulseLogo 1.5s ease-in-out infinite alternate;
}

.preloader-logo .dot {
  color: var(--accent);
}

@keyframes pulseLogo {
  from { opacity: 0.5; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Custom Cursor ---------- */
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 100000;
  pointer-events: none;
}

.cursor-outline::after {
  content: attr(data-text);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}

.cursor-outline.hover::after {
  opacity: 1;
}

/* Responsive fixes */
@media (pointer: coarse) {
  .cursor-outline {
    display: none;
  }
}

.cursor-dot {
  display: none;
}

.cursor-outline {
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent);
  transition: width 0.2s var(--ease-out), height 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.cursor-outline.hover {
  width: 50px;
  height: 50px;
  background: var(--accent-glow);
  border-color: transparent;
}

/* ---------- Scroll Progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 100001;
  width: 0%;
  box-shadow: 0 0 10px var(--accent);
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: toastSlideIn 0.4s var(--ease-out) forwards;
  position: relative;
  overflow: hidden;
}

.toast.fade-out {
  animation: toastSlideOut 0.4s var(--ease-out) forwards;
}

.toast::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  width: 100%;
  animation: toastProgress 5s linear forwards;
}

.toast i {
  color: var(--accent);
  font-size: 18px;
}

@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}
