/* ===== Lovable Design System — Variables ===== */
:root {
  --bg-dark: #09090b;
  --bg-card: #18181b;
  --bg-elevated: #1c1c1f;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --border-hover: #3f3f46;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-subtle: rgba(167, 139, 250, 0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.3s var(--ease-out-expo);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

/* Subtle radial vignette — replaces starfield */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 0%, rgba(167, 139, 250, 0.05) 0%, transparent 55%),
              radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 40%),
              radial-gradient(ellipse at 20% 80%, rgba(167, 139, 250, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

/* Ambient floating orbs */
body::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  top: -200px;
  right: -200px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  animation: orbFloat 20s ease-in-out infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-80px, 60px) scale(1.1); }
  50% { transform: translate(-40px, 120px) scale(0.95); }
  75% { transform: translate(60px, 40px) scale(1.05); }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  opacity: 0.9;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Improve touch targets */
@media (hover: none) {
  a, .btn {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  padding-top: 5rem;
  overflow: hidden;
}

/* Second ambient orb — hero only */
.hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: -150px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  animation: orbFloat2 25s ease-in-out infinite;
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.08); }
  66% { transform: translate(-30px, -80px) scale(0.92); }
}

/* Starfield — now a no-op; kept for HTML compatibility */
.starfield {
  display: none;
}

.hero-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  z-index: 100;
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding-inline: max(var(--space-lg), env(safe-area-inset-left));
  padding-inline-end: max(var(--space-lg), env(safe-area-inset-right));
  transition: background 0.4s ease, border-color 0.4s ease;
}

.hero-header.scrolled {
  background: rgba(9, 9, 11, 0.9);
  border-bottom-color: var(--border-hover);
}

.hero-logo {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  transition: letter-spacing 0.3s ease;
  flex-shrink: 0;
}

.hero-logo:hover {
  letter-spacing: 0.12em;
  opacity: 1;
}

.hero-nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.hero-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  position: relative;
  border-radius: var(--radius-sm);
  transition: color 0.25s ease, background 0.25s ease;
}

.hero-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

/* Active dot indicator */
.hero-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s var(--ease-spring);
}

.hero-nav a:hover::after {
  transform: translateX(-50%) scale(1);
}

.hero-nav a.active {
  color: var(--text-primary);
}

.hero-nav a.active::after {
  transform: translateX(-50%) scale(1);
}

.hero-content {
  text-align: center;
  max-width: 680px;
  z-index: 1;
}

/* Staggered hero children animation */
.hero-content > * {
  opacity: 0;
  transform: translateY(24px);
  animation: heroChildReveal 0.7s var(--ease-out-expo) forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-content > *:nth-child(4) { animation-delay: 0.55s; }

@keyframes heroChildReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-md);
  line-height: 1.1;
  color: var(--text-primary);
  /* Subtle gradient shimmer on text */
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--accent-hover) 45%,
    var(--text-primary) 55%,
    var(--text-primary) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: heroChildReveal 0.7s var(--ease-out-expo) forwards, shimmer 6s ease-in-out 1.5s infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-contact {
  font-size: clamp(0.85rem, 1.4vw, 0.95rem);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  word-break: break-word;
}

.hero-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  padding: 0.7rem 1.5rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 9999px;
  transition: all 0.3s var(--ease-out-expo);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Magnetic ripple on buttons */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.btn:hover::after {
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-hover);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 1;
}

.btn-filled {
  background: var(--text-primary);
  color: var(--bg-dark);
  font-weight: 600;
}

.btn-filled::after {
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(167, 139, 250, 0.25), transparent 60%);
}

.btn-filled:hover {
  background: #e4e4e7;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.2);
  opacity: 1;
}

/* ===== Main Layout — Single Column ===== */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  padding-inline: max(var(--space-lg), env(safe-area-inset-left));
  padding-inline-end: max(var(--space-lg), env(safe-area-inset-right));
  /* Remove old flex layout — now single column */
  display: block;
}

/* ===== Sidebar — Hidden (content moved to bento grid) ===== */
.sidebar {
  display: none;
}

/* ===== Content Sections ===== */
.content {
  width: 100%;
}

.section {
  margin-bottom: var(--space-2xl);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

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

.section:last-of-type {
  margin-bottom: var(--space-xl);
}

/* ===== Section Labels + Headings — Left-aligned, Lovable style ===== */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: inline-block;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  transition-delay: 0.1s;
}

.section.is-visible .section-label {
  opacity: 1;
  transform: translateX(0);
}

.section h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  line-height: 1.15;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out-expo) 0.15s, transform 0.5s var(--ease-out-expo) 0.15s;
}

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

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 540px;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease-out-expo) 0.25s, transform 0.5s var(--ease-out-expo) 0.25s;
}

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

/* ===== Bio ===== */
.bio-content {
  margin: 0 auto 0 0;
  max-width: 640px;
}

.bio-content p {
  margin-bottom: var(--space-lg);
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  font-weight: 400;
}

.bio-content p:last-child {
  margin-bottom: 0;
}

.subsection-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-xl);
  color: var(--text-primary);
}

/* ===== Certifications ===== */
.certifications {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  padding-left: 2.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: all var(--transition);
}

.cert-card::after {
  content: '✓';
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

.cert-card:hover {
  border-color: var(--border-hover);
  transform: scale(1.01);
}

/* ===== Bento Grid System ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: var(--space-sm);
}

.bento-cell {
  grid-column: span 1;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * 60ms);
}

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

.bento-cell--wide {
  grid-column: span 2;
}

.bento-cell--tall {
  grid-row: span 2;
}

.bento-cell--hero {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-cell--full {
  grid-column: 1 / -1;
}

/* ===== Bento Card (shared card style) ===== */
.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

/* Animated gradient border glow on hover */
.bento-card::before,
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), transparent 40%, transparent 60%, rgba(139, 92, 246, 0.15));
  -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 ease;
  pointer-events: none;
  z-index: 1;
}

.bento-card:hover::before,
.project-card:hover::before {
  opacity: 1;
}

.bento-card:hover {
  transform: scale(1.015);
  border-color: rgba(167, 139, 250, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(167, 139, 250, 0.08);
}

/* ===== Project Cards (inside bento) ===== */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
  position: relative;
}

.project-card:hover {
  transform: scale(1.015);
  border-color: rgba(167, 139, 250, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(167, 139, 250, 0.08);
}

.project-image-wrap {
  display: block;
  height: 220px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.bento-cell--hero .project-image-wrap {
  height: 280px;
}

.project-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out-expo);
}

.project-card:hover .project-image-img {
  transform: scale(1.04);
}

.project-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: var(--space-md) var(--space-md) var(--space-xs);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 var(--space-md) var(--space-md);
  line-height: 1.6;
  flex: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 var(--space-md) var(--space-sm);
}

.tech-tags span {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: var(--accent-subtle);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 9999px;
  font-weight: 500;
  color: var(--accent-hover);
  transition: all var(--transition);
}

.tech-tags span:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.3);
}

.project-achievements {
  list-style: none;
  padding: 0 var(--space-md) var(--space-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.project-achievements li {
  margin-bottom: 0.3rem;
}

.project-links {
  display: flex;
  gap: var(--space-xs);
  padding: 0 var(--space-md) var(--space-md);
  flex-wrap: wrap;
  margin-top: auto;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 9999px;
  transition: all var(--transition);
}

.project-link-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--text-primary);
  opacity: 1;
}

.project-link-icon {
  flex-shrink: 0;
}

/* ===== Education Bento Card ===== */
.education-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  height: 100%;
  transition: transform 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
}

.education-card:hover {
  transform: scale(1.015);
  border-color: rgba(167, 139, 250, 0.3);
}

.education-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.education-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.education-card p:last-of-type {
  margin-bottom: 0;
}

.education-card .subsection-title {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: normal;
  text-transform: none;
}

.courses-list {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.courses-list li {
  margin-bottom: 0.2rem;
}

/* ===== Skill Bento Cards ===== */
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  height: 100%;
  transition: transform 0.4s var(--ease-out-expo), border-color 0.4s var(--ease-out-expo);
}

.skill-card:hover {
  transform: scale(1.015);
  border-color: rgba(167, 139, 250, 0.3);
}

.skill-card h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.skill-card ul {
  list-style: none;
}

.skill-card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  padding-left: 1rem;
  position: relative;
}

.skill-card li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-weight: 700;
}

/* ===== Coming Soon Placeholder ===== */
.coming-soon-card {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 200px;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

/* Animated pulse ring behind coming soon icon */
.coming-soon-card::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.08) 0%, transparent 70%);
  animation: comingSoonPulse 3s ease-in-out infinite;
}

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

.coming-soon-card:hover {
  border-color: var(--border-hover);
  border-style: solid;
}

.coming-soon-icon {
  font-size: 1.5rem;
  animation: comingSoonBounce 2s ease-in-out infinite;
}

@keyframes comingSoonBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.coming-soon-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ===== Skills Grid (standalone, fallback) ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

/* ===== Interests ===== */
.interests-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  max-width: 600px;
}

.interest-tag {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  transition: all 0.4s var(--ease-spring);
  cursor: default;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
}

/* Stagger animation for interest tags */
.section.is-visible .interest-tag {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.section.is-visible .interest-tag:nth-child(1) { transition-delay: 0.35s; }
.section.is-visible .interest-tag:nth-child(2) { transition-delay: 0.42s; }
.section.is-visible .interest-tag:nth-child(3) { transition-delay: 0.49s; }
.section.is-visible .interest-tag:nth-child(4) { transition-delay: 0.56s; }
.section.is-visible .interest-tag:nth-child(5) { transition-delay: 0.63s; }

.interest-tag:hover {
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--text-primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ===== Blog ===== */
.blog-posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition);
}

.blog-card:hover {
  border-color: var(--border-hover);
  transform: scale(1.01);
}

.blog-card h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.blog-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.blog-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.65;
}

.blog-card p:last-of-type {
  margin-bottom: 0;
}

.blog-card a {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  transition: color var(--transition);
}

.blog-card a:hover {
  color: var(--accent-hover);
  opacity: 1;
}

.blog-read-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

.blog-view-all {
  text-align: left;
  margin-top: 1rem;
}

.blog-view-all a {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
}

.blog-view-all a:hover {
  color: var(--accent-hover);
  opacity: 1;
}

/* ===== Contact ===== */
.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.contact-block h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.contact-block p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.contact-block a {
  color: var(--text-primary);
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.contact-block a:hover {
  color: var(--accent);
  opacity: 1;
}

/* ===== Footer ===== */
.footer {
  padding: var(--space-lg);
  padding-inline: max(var(--space-lg), env(safe-area-inset-left));
  padding-inline-end: max(var(--space-lg), env(safe-area-inset-right));
  padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer a {
  margin: 0 var(--space-sm);
  padding: var(--space-xs) 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--text-primary);
  opacity: 1;
}

/* ===== Responsive — Tablet ===== */
@media (max-width: 900px) {
  .main-content {
    padding: var(--space-lg);
  }

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

  .bento-cell--hero {
    grid-column: 1 / -1;
    grid-row: span 1;
  }

  .bento-cell--wide {
    grid-column: 1 / -1;
  }

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

/* ===== Responsive — Mobile ===== */
@media (max-width: 600px) {
  .hero {
    padding: var(--space-xl) var(--space-sm);
  }

  .hero-header {
    padding: var(--space-sm);
    padding-inline: max(var(--space-sm), env(safe-area-inset-left));
    padding-inline-end: max(var(--space-sm), env(safe-area-inset-right));
  }

  .hero-nav {
    gap: 2px;
  }

  .hero-nav a {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }

  .hero-contact {
    font-size: 0.8rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .main-content {
    padding: var(--space-md);
  }

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

  .bento-cell--hero,
  .bento-cell--wide {
    grid-column: span 1;
    grid-row: span 1;
  }

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

  .section {
    margin-bottom: var(--space-xl);
  }

  .project-image-wrap,
  .bento-cell--hero .project-image-wrap {
    height: 180px;
  }
}

/* ===== Responsive — Small Mobile ===== */
@media (max-width: 380px) {
  .hero-nav {
    justify-content: center;
  }

  .hero-header {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
    padding-top: var(--space-md);
  }
}

/* ===== Cursor Tilt Effect (JS-driven) ===== */
.bento-card[style*="--rx"],
.project-card[style*="--rx"] {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.bento-card[style*="--rx"]:hover,
.project-card[style*="--rx"]:hover {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.015);
}

/* ===== Skill Card Stagger ===== */
.skill-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo),
              border-color 0.4s var(--ease-out-expo);
}

.section.is-visible .skill-card {
  opacity: 1;
  transform: translateY(0);
}

.section.is-visible .skill-card:nth-child(1) { transition-delay: 0.3s; }
.section.is-visible .skill-card:nth-child(2) { transition-delay: 0.4s; }
.section.is-visible .skill-card:nth-child(3) { transition-delay: 0.5s; }

/* ===== Blog Card Stagger ===== */
.blog-card {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo),
              border-color 0.3s ease;
}

.section.is-visible .blog-card {
  opacity: 1;
  transform: translateY(0);
}

.section.is-visible .blog-card:nth-child(1) { transition-delay: 0.3s; }
.section.is-visible .blog-card:nth-child(2) { transition-delay: 0.4s; }

/* ===== Contact Block Stagger ===== */
.contact-block {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.section.is-visible .contact-block {
  opacity: 1;
  transform: translateY(0);
}

.section.is-visible .contact-block:nth-child(1) { transition-delay: 0.3s; }
.section.is-visible .contact-block:nth-child(2) { transition-delay: 0.4s; }

/* ===== Cert Card Animation ===== */
.cert-card {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo),
              border-color 0.3s ease;
}

.section.is-visible .cert-card {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.3s;
}

/* ===== Smooth scroll indicator ===== */
.hero::after {
  content: '';
  position: absolute;
  bottom: 2rem;
  left: 50%;
  width: 24px;
  height: 40px;
  border: 2px solid var(--border-hover);
  border-radius: 12px;
  transform: translateX(-50%);
  z-index: 1;
}

.hero::after {
  animation: heroChildReveal 0.7s var(--ease-out-expo) 0.8s forwards;
  opacity: 0;
}

/* Scroll dot inside the indicator (via box-shadow trick) */
@keyframes scrollDot {
  0% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ===== Noise Texture Overlay — Premium Depth ===== */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ===== Cursor Spotlight ===== */
.cursor-spotlight {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
  will-change: left, top;
}

.cursor-spotlight.active {
  opacity: 1;
}

/* ===== Scroll To Top Button ===== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: all 0.4s var(--ease-spring);
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.scroll-to-top:hover {
  background: var(--bg-elevated);
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--text-primary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.scroll-to-top svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease-spring);
}

.scroll-to-top:hover svg {
  transform: translateY(-2px);
}

/* ===== Section Dividers — Glowing Line ===== */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 20%, rgba(167, 139, 250, 0.2) 50%, var(--border) 80%, transparent 100%);
  margin: var(--space-sm) 0 var(--space-2xl);
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
}

.section.is-visible .section-divider {
  opacity: 1;
}

/* ===== Hero Dot Grid Pattern ===== */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(167, 139, 250, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  opacity: 0;
  animation: heroChildReveal 1s var(--ease-out-expo) 0.3s forwards;
}

/* ===== Page Load Transition ===== */
.page-transition {
  animation: pageIn 0.5s var(--ease-out-expo) forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
    filter: blur(4px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* ===== Scroll Indicator Dot (inside mouse shape) ===== */
.hero-scroll-dot {
  position: absolute;
  bottom: calc(2rem + 28px);
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  z-index: 2;
  animation: heroChildReveal 0.7s var(--ease-out-expo) 0.8s forwards, scrollDotMove 2s ease-in-out 1.5s infinite;
  opacity: 0;
}

@keyframes scrollDotMove {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(10px); opacity: 0; }
}

/* ===== Footer Enhancement ===== */
.footer {
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.3), transparent);
}

.footer-copyright {
  display: block;
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
