/* ============================================
   DESIGN SYSTEM — Premium Portfolio
   ============================================ */

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

:root {
  /* Colors — Dark Only */
  --bg: #0F0E0D;
  --bg-alt: #191715;
  --surface: #1C1917;
  --text: #E7E5E4;
  --text-secondary: #B5B0AB;
  --text-tertiary: #918A84;
  --accent: #F0784A;
  --accent-hover: #F59070;
  --accent-light: #2A1A12;
  --accent-glow: rgba(240, 120, 74, 0.15);
  --accent-secondary: #4AB4C8;
  --accent-secondary-glow: rgba(74, 180, 200, 0.15);
  --border: #363230;
  --border-light: #2A2724;
  --tag-bg: #272320;
  --tag-text: #B5B0AB;
  --nav-bg: rgba(15, 14, 13, 0.88);
  --card-shadow: rgba(0, 0, 0, 0.4);
  --code-bg: #0A0908;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Spacing */
  --section-padding: 120px;
  --container-width: 800px;

  /* Easings */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration: 0.6s;

  /* Project Colors */
  --project-warm: linear-gradient(135deg, #2E2318 0%, #3A2E1C 100%);
  --project-cool: linear-gradient(135deg, #1C2435 0%, #222D40 100%);
  --project-muted: linear-gradient(135deg, #222226 0%, #2A2A30 100%);
}

/* Animatable custom property for gradient rotation */
@property --card-gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-gradient {
  to { --card-gradient-angle: 360deg; }
}

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

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  /* No theme transition needed — dark only */
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.container-wide {
  max-width: 1000px;
}

/* --- Section --- */
.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-alt {
  background-color: var(--bg-alt);
}

/* --- Section Divider Glow --- */
.section:not(.hero)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: radial-gradient(ellipse, var(--accent) 0%, transparent 70%);
  opacity: 0;
  box-shadow: 0 0 30px rgba(240, 120, 74, 0.4);
  pointer-events: none;
  animation: none;
}

.section.glow-entered::before {
  animation: divider-activate 1.8s var(--ease-out-expo) forwards,
             divider-breathe 3s ease-in-out 1.8s infinite;
}

@keyframes divider-activate {
  0%   { opacity: 0; width: 100px; }
  40%  { opacity: 1; width: 500px; }
  100% { opacity: 0.7; width: 400px; }
}

@keyframes divider-breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

/* --- Section Heading --- */
.section-heading {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.section-heading.visible::after {
  content: '.';
  color: var(--accent);
}

.subsection-heading {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 20px;
}

/* --- Tags --- */
.tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 6px 14px;
  border-radius: 100px;
  transition: all 0.2s ease;
}

.tag:hover {
  background: #2E2A27;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(240, 120, 74, 0.4);
}

.skills-grid .tag:nth-child(3n):hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 12px var(--accent-secondary-glow);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #141211;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #141211;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(240, 120, 74, 0.3), 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 40px rgba(240, 120, 74, 0.15);
}

.contact-form .btn-primary {
  animation: btn-glow-pulse 3s ease-in-out infinite;
}

@keyframes btn-glow-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(240, 120, 74, 0.1); }
  50% { box-shadow: 0 4px 24px rgba(240, 120, 74, 0.25); }
}

/* Checkmark draw animation on success */
.checkmark-draw polyline {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw-check 0.5s ease forwards 0.1s;
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease);
  opacity: 0;
}

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

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease), height 0.4s var(--ease),
              border-color 0.3s, background 0.4s var(--ease),
              opacity 0.4s;
  opacity: 0;
}

.cursor-ring.active {
  opacity: 0.4;
}

/* Hover: ring grows */
.cursor-ring.cursor-hover {
  width: 56px;
  height: 56px;
  opacity: 0.25;
}

/* Project card: ring becomes "View" label */
.cursor-ring.cursor-view {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  border-color: transparent;
  opacity: 1;
  mix-blend-mode: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: #1C1917;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Hide on touch devices */
@media (hover: none) and (pointer: coarse) {
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}

/* Hide default cursor on desktop */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }
  a, button, input, textarea, .btn, .btn-resume, .tag, .project-card, .nav-toggle {
    cursor: none;
  }
}

/* --- Mouse-Following Glow --- */
.mouse-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 120, 74, 0.18) 0%, transparent 70%);
  filter: blur(90px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  will-change: transform;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
}

.mouse-glow.active {
  opacity: 1;
}

@media (hover: none) and (pointer: coarse) {
  .mouse-glow {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mouse-glow {
    display: none !important;
  }
}

/* ============================================
   GRAIN OVERLAY
   ============================================ */
.grain-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.06;
  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.65' numOctaves='3' 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 256px;
}

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

.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 0;
}

.nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
}

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

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

/* --- Theme Toggle --- */
/* --- Mobile Nav Toggle --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  gap: 6px;
  z-index: 102;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s var(--ease);
  border-radius: 2px;
}

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

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

/* --- Mobile Nav Overlay --- */
.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 101;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-mobile.active {
  opacity: 1;
}

.nav-mobile a {
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  padding: 16px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease), color 0.2s ease;
}

.nav-mobile a:hover {
  color: var(--accent);
}

.nav-mobile.active a {
  opacity: 1;
  transform: translateY(0);
}

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

/* Hero particle canvas */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* Aurora gradient blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.hero::before {
  width: 700px;
  height: 700px;
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, rgba(240, 120, 74, 0.35) 0%, rgba(245, 144, 112, 0.15) 50%, transparent 70%);
  animation: aurora-drift-1 9s ease-in-out infinite;
}

.hero::after {
  width: 600px;
  height: 600px;
  bottom: -5%;
  right: -8%;
  background: radial-gradient(circle, rgba(74, 180, 200, 0.25) 0%, rgba(240, 120, 74, 0.12) 50%, transparent 70%);
  animation: aurora-drift-2 11s ease-in-out infinite;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

@keyframes aurora-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.05); }
  66% { transform: translate(-30px, 20px) scale(0.95); }
}

@keyframes aurora-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, -30px) scale(1.08); }
  66% { transform: translate(40px, -20px) scale(0.92); }
}

/* --- Line Reveal System --- */
.line-wrap {
  display: block;
  overflow: hidden;
  padding-bottom: 0.15em;
}

.line-inner {
  display: block;
  transform: translateY(105%);
  filter: blur(8px);
  transition: transform 1.1s var(--ease-out-expo), filter 1.1s var(--ease-out-expo);
}

.line-inner.revealed {
  transform: translateY(0);
  filter: blur(0px);
}

/* Eyebrow also fades in */
.hero-eyebrow .line-inner {
  opacity: 0;
  transition: transform 1.1s var(--ease-out-expo), opacity 0.8s ease, filter 1.1s var(--ease-out-expo);
}

.hero-eyebrow .line-inner.revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

/* CTA + scroll indicator */
.hero-reveal-item {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(4px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out-expo), filter 0.8s var(--ease-out-expo);
}

.hero-reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

/* --- Hero Typography --- */
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-heading {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 24px;
}

.hero-name {
  display: inline;
  font-size: 1.08em;
  background: linear-gradient(135deg, var(--accent) 0%, #FFD4C2 40%, #F59070 60%, var(--accent) 100%);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: nameShimmer 4s ease-in-out infinite;
}

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

.hero-subtitle {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 40px;
}

.hero-subtitle em {
  color: var(--accent);
  font-style: normal;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-scroll-indicator.revealed {
  transform: translateX(-50%) translateY(0);
}

.hero-scroll-indicator span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scrollLine 2s ease-in-out infinite;
}

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

/* ============================================
   MARQUEE
   ============================================ */
.marquee {
  padding: 28px 0;
  overflow: hidden;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  transition: background-color 0.4s ease;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll calc(30s / var(--marquee-speed, 1)) linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-content {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-right: 0;
}

.marquee-content strong {
  color: var(--accent);
  font-weight: 600;
}

.marquee-content strong.teal {
  color: var(--accent-secondary);
}

.marquee:hover .marquee-content {
  text-shadow: 0 0 30px rgba(240, 120, 74, 0.1);
}

.marquee:hover .marquee-content strong.teal {
  text-shadow: 0 0 30px var(--accent-secondary-glow);
}

/* Reverse second marquee */
.marquee-reverse {
  border-top: none;
}

.marquee-reverse .marquee-track {
  animation-direction: reverse;
  animation-duration: calc(35s / var(--marquee-speed, 1));
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* First card spans full width — featured project */
.project-card:first-child {
  grid-column: 1 / -1;
}

/* Offset even cards for asymmetry */
.project-card:nth-child(even) {
  margin-top: 48px;
}

.project-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.5s var(--ease);
  background: var(--surface);
}

.project-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1.5px;
  background: conic-gradient(from var(--card-gradient-angle, 0deg), var(--accent), rgba(74, 180, 200, 0.6), var(--accent-hover), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  opacity: 0.3;
  transition: opacity 0.4s var(--ease);
  animation: rotate-gradient 8s linear infinite;
}

.project-card:hover::after {
  opacity: 1;
  animation: rotate-gradient 3s linear infinite;
}

.project-card:hover {
  border-color: transparent;
  box-shadow: 0 20px 60px var(--card-shadow), 0 0 30px rgba(240, 120, 74, 0.08);
  transform: translateY(-6px);
}

/* --- Project Thumbnails --- */
.project-thumbnail {
  height: 200px;
  position: relative;
  overflow: hidden;
  transition: transform 0.6s var(--ease);
}

.project-card:first-child .project-thumbnail {
  height: 280px;
}

.project-card[data-color="warm"] .project-thumbnail {
  background: var(--project-warm);
}

.project-card[data-color="cool"] .project-thumbnail {
  background: var(--project-cool);
}

.project-card[data-color="muted"] .project-thumbnail {
  background: var(--project-muted);
}

.project-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.project-card:hover .project-thumbnail-img {
  transform: scale(1.14);
}

/* Shimmer sweep on hover */
.project-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.03) 45%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 55%,
    transparent 60%
  );
  transform: translateX(-100%);
  z-index: 2;
  pointer-events: none;
}

.project-card:hover .project-thumbnail::after {
  transform: translateX(100%);
  transition: transform 0.8s var(--ease);
}

.project-thumbnail-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  transition: transform 0.6s var(--ease);
}

.project-card:hover .project-thumbnail-pattern {
  transform: scale(1.14);
}

/* Card 1: dot grid */
.project-card:nth-child(1) .project-thumbnail-pattern {
  background-image: radial-gradient(circle, var(--text-tertiary) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Card 2: diagonal lines */
.project-card:nth-child(2) .project-thumbnail-pattern {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    var(--text-tertiary) 10px,
    var(--text-tertiary) 11px
  );
}

/* Card 3: grid */
.project-card:nth-child(3) .project-thumbnail-pattern {
  background-image:
    linear-gradient(var(--text-tertiary) 1px, transparent 1px),
    linear-gradient(90deg, var(--text-tertiary) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* --- Project Card Content --- */
.project-card-content {
  padding: 36px;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.project-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  display: inline-block;
  transition: color 0.3s ease, transform 0.3s var(--ease);
}

.project-card:hover .project-number {
  color: var(--accent);
  transform: scale(1.15);
}

.project-tags {
  display: flex;
  gap: 8px;
}

.project-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  color: var(--text);
}

.project-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s ease;
}

.project-link svg {
  transition: transform 0.2s ease;
}

.project-link:hover {
  color: var(--accent);
}

.project-link:hover svg {
  transform: translate(2px, -2px);
}

.project-card:hover .project-link {
  color: var(--accent);
}

.project-card:hover .project-link svg {
  transform: translate(3px, -3px);
}

/* --- Featured Card Treatment --- */
.project-card:first-child {
  border-color: rgba(240, 120, 74, 0.15);
  box-shadow: 0 0 40px rgba(240, 120, 74, 0.04), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card:first-child .project-card-content {
  padding: 40px 44px;
}

.project-card:first-child .project-title {
  font-size: 28px;
}

.project-card:first-child .project-number {
  position: relative;
  color: var(--accent);
  font-size: 14px;
}

.project-card:first-child .project-number::after {
  content: 'Featured';
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(240, 120, 74, 0.1);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid rgba(240, 120, 74, 0.2);
  white-space: nowrap;
}

.project-card:first-child::after {
  opacity: 0.5;
}

.project-card:first-child:hover {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 50px rgba(240, 120, 74, 0.12);
}

/* --- View All Projects Link --- */
.projects-view-all {
  text-align: center;
  margin-top: 40px;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 14px 32px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.4s var(--ease);
}

.view-all-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.view-all-link svg {
  transition: transform 0.3s var(--ease);
}

.view-all-link:hover svg {
  transform: translateX(4px);
}

/* --- Projects Page Hero --- */
.projects-hero {
  padding-top: 160px;
  padding-bottom: 48px;
}

.projects-hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
}

.projects-hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
}

/* ============================================
   ALL PROJECTS — Compact grid
   ============================================ */
.projects-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  perspective: 1200px;
}

.project-compact-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.5s var(--ease);
  background: var(--surface);
  transform-style: preserve-3d;
  will-change: transform;
}

.project-compact-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  padding: 1.5px;
  background: conic-gradient(from var(--card-gradient-angle, 0deg), var(--accent), rgba(74, 180, 200, 0.6), var(--accent-hover), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.project-compact-card:hover::after {
  opacity: 1;
  animation: rotate-gradient 3s linear infinite;
}

.project-compact-card:hover {
  border-color: transparent;
  box-shadow: 0 16px 48px var(--card-shadow), 0 0 30px rgba(240, 120, 74, 0.08);
  transform: translateY(-4px);
}

.project-compact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(240, 120, 74, 0.12),
    transparent 40%
  );
}

.project-compact-card.glow-active::before {
  opacity: 1;
}

.project-compact-thumbnail {
  height: 140px;
  position: relative;
  overflow: hidden;
}

.project-compact-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.project-compact-card:hover .project-compact-thumbnail-img {
  transform: scale(1.12);
}

.project-compact-content {
  padding: 20px 24px 24px;
}

.project-compact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.project-compact-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text);
}

.project-compact-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Resume Button --- */
.btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s var(--ease);
  margin-top: 8px;
}

.btn-resume:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-resume svg {
  transition: transform 0.3s var(--ease);
}

.btn-resume:hover svg {
  transform: translateY(2px);
}

/* ============================================
   CERTIFICATIONS
   ============================================ */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.cert-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.cert-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 3px;
  opacity: 0;
  transform: scaleY(0);
  transition: all 0.4s var(--ease);
}

.cert-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--card-shadow);
}

.cert-card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.cert-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.cert-card:hover .cert-card-icon {
  opacity: 1;
}

.cert-card-icon svg {
  width: 28px;
  height: 28px;
}

.cert-card-body {
  flex: 1;
  min-width: 0;
}

.cert-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 4px;
}

.cert-card-issuer {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.cert-card-date {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ============================================
   ABOUT — Redesigned with personality
   ============================================ */
.about-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 44px;
  align-items: start;
  margin-bottom: 32px;
}

.about-photo {
  width: 320px;
  height: 400px;
  border-radius: 20px;
  background: linear-gradient(145deg, #1E1A17 0%, #2A2118 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  border: 1px solid var(--border);
  transition: box-shadow 0.4s var(--ease), border-color 0.4s ease;
}

.about-photo::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 22px;
  background: conic-gradient(from var(--card-gradient-angle), var(--accent), var(--accent-secondary), var(--accent), var(--accent-secondary), var(--accent));
  opacity: 0.4;
  z-index: -1;
  animation: rotate-gradient 12s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 3px;
}

.about-photo:hover::after {
  opacity: 0.8;
}

.about-photo-img {
  border-radius: 20px;
  overflow: hidden;
}

.about-photo:hover {
  box-shadow: 0 0 40px rgba(240, 120, 74, 0.15);
  border-color: rgba(240, 120, 74, 0.3);
}

.about-photo-initial {
  font-size: 80px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.3;
  user-select: none;
}

.about-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 20px;
}

.about-bio {
  padding-top: 8px;
}

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

.about-text strong {
  color: var(--accent);
  font-weight: 500;
}

.about-highlight-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.highlight-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  transition: all 0.3s var(--ease);
  background: var(--bg-alt);
}

.highlight-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--card-shadow), inset 0 0 30px rgba(240, 120, 74, 0.04), 0 0 40px rgba(240, 120, 74, 0.08);
}

.highlight-card:hover .highlight-card-icon {
  transform: scale(1.15);
}

.highlight-card:hover .highlight-card-title {
  color: var(--accent);
}

.highlight-card-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

.highlight-card-icon svg {
  width: 28px;
  height: 28px;
}

.highlight-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.highlight-card-stat {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 8px;
  line-height: 1;
}

.highlight-card:nth-child(2) .highlight-card-stat {
  color: var(--accent-secondary);
}

.highlight-card:nth-child(2) .highlight-card-icon {
  color: var(--accent-secondary);
}

.highlight-card:nth-child(2):hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 8px 32px var(--card-shadow), inset 0 0 30px var(--accent-secondary-glow), 0 0 40px var(--accent-secondary-glow);
}

.highlight-card:nth-child(2):hover .highlight-card-title {
  color: var(--accent-secondary);
}

.highlight-card-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.about-content {
  margin-bottom: 8px;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Staggered skill tag reveal */
.skills-grid .tag {
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
}

.skills-grid.visible .tag {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.skills-grid.visible .tag:nth-child(1) { transition-delay: 0ms; }
.skills-grid.visible .tag:nth-child(2) { transition-delay: 40ms; }
.skills-grid.visible .tag:nth-child(3) { transition-delay: 80ms; }
.skills-grid.visible .tag:nth-child(4) { transition-delay: 120ms; }
.skills-grid.visible .tag:nth-child(5) { transition-delay: 160ms; }
.skills-grid.visible .tag:nth-child(6) { transition-delay: 200ms; }
.skills-grid.visible .tag:nth-child(7) { transition-delay: 240ms; }
.skills-grid.visible .tag:nth-child(8) { transition-delay: 280ms; }
.skills-grid.visible .tag:nth-child(9) { transition-delay: 320ms; }
.skills-grid.visible .tag:nth-child(10) { transition-delay: 360ms; }
.skills-grid.visible .tag:nth-child(11) { transition-delay: 400ms; }
.skills-grid.visible .tag:nth-child(12) { transition-delay: 440ms; }
.skills-grid.visible .tag:nth-child(13) { transition-delay: 480ms; }
.skills-grid.visible .tag:nth-child(14) { transition-delay: 520ms; }

/* ============================================
   EXPERIENCE TIMELINE
   ============================================ */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  width: 1px;
  height: 0;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  transition: height 1.5s var(--ease-out-expo);
}

.timeline.visible::before {
  height: calc(100% - 16px);
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  transition: all 0.5s var(--ease);
}

.timeline-item:hover .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px rgba(240, 120, 74, 0.4);
}

/* Sequential dot lighting on scroll */
.timeline.visible .timeline-item:nth-child(1) .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px rgba(240, 120, 74, 0.4);
  transition-delay: 0.3s;
}

.timeline.visible .timeline-item:nth-child(2) .timeline-dot {
  border-color: var(--accent-secondary);
  background: var(--accent-secondary);
  box-shadow: 0 0 12px var(--accent-secondary-glow);
  transition-delay: 0.8s;
}

.timeline.visible .timeline-item:nth-child(3) .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px rgba(240, 120, 74, 0.4);
  transition-delay: 1.3s;
}

.timeline-content {
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 2px solid var(--border);
  border-radius: 12px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
              border-color 0.4s var(--ease), background 0.4s ease;
}

.timeline-item:first-child .timeline-content {
  border-left-color: var(--accent);
}

.timeline-item:hover .timeline-content {
  padding-left: 28px;
  transform: translateY(-3px) translateX(4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(240, 120, 74, 0.04);
  border-left-color: var(--accent);
  background: #1E1C19;
}

.timeline-item:hover .timeline-role {
  color: var(--accent);
  transition: color 0.3s ease;
}

.timeline-item:hover .timeline-company {
  color: var(--text);
  transition: color 0.3s ease;
}

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

.timeline-role {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-company {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
  padding-top: 3px;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #22c55e;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.timeline-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ============================================
   CONTACT — Reimagined with bold CTA
   ============================================ */
.contact-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.contact-headline {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.contact-headline em {
  color: var(--accent);
  font-style: normal;
}

.contact-subtext {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.contact-email-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(20px, 3.5vw, 36px);
  font-weight: 400;
  color: var(--text);
  padding: 16px 0;
  border-bottom: 3px solid var(--accent);
  transition: all 0.4s var(--ease);
  letter-spacing: -0.01em;
  word-break: break-all;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 3px;
  background-position: 0 100%;
  background-repeat: no-repeat;
}

.contact-email-link:hover {
  color: var(--accent);
  border-bottom-color: transparent;
  background-size: 100% 3px;
  transform: translateY(-2px);
  text-shadow: 0 0 20px var(--accent-glow);
  filter: drop-shadow(0 0 8px rgba(240, 120, 74, 0.3));
}

.contact-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
}

.contact-divider {
  width: 100%;
  max-width: 200px;
  height: 1px;
  background: var(--border);
  margin: 40px auto;
}

/* Keep form as secondary */
.contact-form-section {
  max-width: 640px;
  margin: 0 auto;
}

.contact-form-label {
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

.contact-intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 540px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-top: 16px;
}

.form-label {
  position: absolute;
  top: 30px;
  left: 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: all 0.25s var(--ease);
  transform-origin: left center;
}

/* Float label up on focus or when filled */
.form-group:focus-within .form-label,
.form-group.filled .form-label {
  transform: translateY(-24px) scale(0.75);
  color: var(--accent);
  font-weight: 600;
}

.form-input {
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: all 0.3s var(--ease);
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(240, 120, 74, 0.08);
  transform: translateY(-1px);
}

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

/* Textarea label stays at top */
.form-group:has(.form-textarea) .form-label {
  top: 30px;
}

.contact-footer {
  margin-top: 64px;
  text-align: center;
}

.contact-or {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 100px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s var(--ease);
  z-index: -1;
}

.social-link:hover {
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.social-link:hover::before {
  transform: scaleX(1);
}

/* ============================================
   FOOTER — Premium redesign
   ============================================ */
.footer {
  padding: 64px 0 40px;
  border-top: none;
  background: linear-gradient(to bottom, var(--bg) 0%, #0D0C0B 100%);
  position: relative;
  transition: background-color 0.4s ease;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  max-width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-secondary), transparent);
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.footer-logo:hover {
  color: var(--accent);
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-tertiary);
  max-width: 280px;
  line-height: 1.6;
}

.footer-status {
  font-size: 13px;
  color: var(--text-tertiary);
  opacity: 0.7;
  margin-top: 2px;
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.footer-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

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

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

.footer-credit span {
  color: var(--accent-secondary);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer-credit span:hover {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(240, 120, 74, 0.3);
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
  pointer-events: none;
  box-shadow: 0 4px 12px var(--card-shadow);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(240, 120, 74, 0.2), 0 0 0 1px rgba(240, 120, 74, 0.1);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   SCROLL ANIMATIONS — Varied per Section
   ============================================ */

/* Base: all animated elements start invisible */
[data-animate] {
  opacity: 0;
  will-change: transform, opacity;
}

/* Default: fade up */
[data-animate="fade-up"] {
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-animate="fade-up"].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Clip up: project cards — wipe reveal from bottom */
[data-animate="clip-up"] {
  clip-path: inset(8% 0 0 0);
  transform: translateY(40px);
  transition: clip-path 1s var(--ease-out-expo),
              transform 1s var(--ease-out-expo),
              opacity 0.8s var(--ease-out-expo);
}
[data-animate="clip-up"].visible {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  transform: translateY(0);
}

/* Staggered card entrances */
.project-card[data-animate="clip-up"]:nth-child(1) { transition-delay: 0s; }
.project-card[data-animate="clip-up"]:nth-child(2) { transition-delay: 0.2s; }
.project-card[data-animate="clip-up"]:nth-child(3) { transition-delay: 0.4s; }
.project-card[data-animate="clip-up"]:nth-child(4) { transition-delay: 0.6s; }
.project-compact-card[data-animate="clip-up"]:nth-child(1) { transition-delay: 0s; }
.project-compact-card[data-animate="clip-up"]:nth-child(2) { transition-delay: 0.12s; }
.project-compact-card[data-animate="clip-up"]:nth-child(3) { transition-delay: 0.24s; }
.project-compact-card[data-animate="clip-up"]:nth-child(4) { transition-delay: 0.36s; }

/* Staggered highlight cards */
.about-highlight-cards .highlight-card[data-animate]:nth-child(1) { transition-delay: 0s; }
.about-highlight-cards .highlight-card[data-animate]:nth-child(2) { transition-delay: 0.12s; }
.about-highlight-cards .highlight-card[data-animate]:nth-child(3) { transition-delay: 0.24s; }

/* Staggered timeline items */
.timeline-item[data-animate="slide-left"]:nth-child(1) { transition-delay: 0s; }
.timeline-item[data-animate="slide-left"]:nth-child(2) { transition-delay: 0.15s; }
.timeline-item[data-animate="slide-left"]:nth-child(3) { transition-delay: 0.3s; }

/* Fade left: about paragraph 1 */
[data-animate="fade-left"] {
  transform: translateX(-40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-animate="fade-left"].visible {
  opacity: 1;
  transform: translateX(0);
}

/* Fade right: about paragraph 2 */
[data-animate="fade-right"] {
  transform: translateX(40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-animate="fade-right"].visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide left: timeline items */
[data-animate="slide-left"] {
  transform: translateX(-60px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-animate="slide-left"].visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale in: contact section */
[data-animate="scale-in"] {
  transform: scale(0.95);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-animate="scale-in"].visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for siblings */
[data-animate]:nth-child(2) { transition-delay: 0.1s; }
[data-animate]:nth-child(3) { transition-delay: 0.15s; }
[data-animate]:nth-child(4) { transition-delay: 0.2s; }

/* ============================================
   MAGNETIC BUTTON OVERRIDES
   ============================================ */
@media (hover: hover) and (pointer: fine) {
  .btn.magnetic-active,
  .project-link.magnetic-active,
  .social-link.magnetic-active {
    transition: transform 0.15s ease-out;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
  }

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-mobile {
    display: flex;
  }

  .hero-heading {
    font-size: clamp(32px, 8vw, 48px);
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-scroll-indicator {
    display: none;
  }

  /* Projects: single column on tablet */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card:first-child {
    grid-column: 1;
  }

  .project-card:nth-child(even) {
    margin-top: 0;
  }

  .projects-hero {
    padding-top: 120px;
  }

  .project-card-content {
    padding: 28px;
  }

  .project-card-header {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 12px;
  }

  .project-title {
    font-size: 20px;
  }

  .project-thumbnail {
    height: 160px;
  }

  .project-card:first-child .project-thumbnail {
    height: 200px;
  }

  .projects-compact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .project-compact-content {
    padding: 16px 20px 20px;
  }

  .project-compact-title {
    font-size: 16px;
  }

  .project-compact-thumbnail {
    height: 120px;
  }

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

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

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .social-links {
    flex-direction: column;
  }

  /* About: stack on tablet */
  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-photo {
    width: 220px;
    height: 270px;
    margin: 0 auto;
  }

  .about-highlight-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Contact */
  .contact-email-link {
    font-size: clamp(18px, 4vw, 28px);
  }

  .contact-social {
    flex-direction: column;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-nav {
    flex-wrap: wrap;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --section-padding: 64px;
  }

  .section-heading {
    font-size: 13px;
    margin-bottom: 32px;
  }

  .projects-hero {
    padding-top: 100px;
  }

  .projects-hero-title {
    font-size: 28px;
  }

  .hero-heading {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .project-card-content {
    padding: 24px;
  }

  .project-title {
    font-size: 18px;
  }

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

  .project-compact-thumbnail {
    height: 160px;
  }

  .btn-large {
    width: 100%;
    justify-content: center;
  }

  .marquee-content {
    font-size: 12px;
  }

  .about-photo {
    width: 180px;
    height: 220px;
  }

  .about-photo-initial {
    font-size: 56px;
  }

  .about-highlight-cards {
    grid-template-columns: 1fr;
  }

  .contact-headline {
    font-size: 28px;
  }

  .contact-email-link {
    font-size: 18px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

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

  .line-inner {
    transform: none !important;
    opacity: 1 !important;
  }

  .hero-reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }

  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .marquee-track {
    animation: none !important;
  }

  body {
    transition: none !important;
  }

  /* Preloader: skip */
  .preloader {
    display: none !important;
  }

  /* Name shimmer: disable */
  .hero-name {
    animation: none !important;
  }

  /* Character reveal: show immediately */
  .section-heading .char {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Parallax: disable */
  [data-parallax] {
    translate: none !important;
    transform: none !important;
    will-change: auto;
  }
}

/* ============================================
   KEYBOARD FOCUS — Accessibility
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons and pills get rounded outline */
.btn:focus-visible,
.tag:focus-visible,
.social-link:focus-visible,
.back-to-top:focus-visible {
  outline-offset: 2px;
  border-radius: 100px;
}

/* Project cards get larger offset */
.project-card:focus-visible {
  outline-offset: 4px;
  border-radius: 16px;
}

/* Remove default outline when using mouse */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   SELECTION & SCROLLBAR
   ============================================ */
::selection {
  background: rgba(240, 120, 74, 0.2);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.7s var(--ease-out-expo);
}

.preloader.dissolving {
  opacity: 0;
  filter: blur(6px);
  transition: opacity 0.6s ease, filter 0.6s ease;
  pointer-events: none;
}

.preloader.hidden {
  display: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.preloader-logo {
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  opacity: 0;
  transform: scale(0.9);
  animation: preloaderLogoIn 0.5s var(--ease-out-expo) 0.1s forwards;
}

@keyframes preloaderLogoIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.preloader-bar {
  width: 180px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: preloaderFadeIn 0.3s ease 0.3s forwards;
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.05s linear;
}

.preloader-counter {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  opacity: 0;
  animation: preloaderFadeIn 0.3s ease 0.3s forwards;
}

@keyframes preloaderFadeIn {
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   TEXT SCRAMBLE
   ============================================ */
.hero-name .scramble-char {
  display: inline-block;
  min-width: 0.05em;
}

/* ============================================
   3D CARD TILT & CURSOR GLOW
   ============================================ */
.projects-grid {
  perspective: 1200px;
}

.project-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.project-card.tilt-active {
  transition: none !important;
}

.project-card.tilt-reset {
  transition: transform 0.5s var(--ease) !important;
}

/* Cursor glow on card */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(240, 120, 74, 0.12),
    transparent 40%
  );
}

.project-card.glow-active::before {
  opacity: 1;
}

/* ============================================
   SECTION HEADING CHARACTER REVEAL
   ============================================ */
.section-heading {
  overflow: hidden;
}

.section-heading .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.4s var(--ease-out-expo), transform 0.4s var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * 30ms);
}

.section-heading .char.space-char {
  width: 0.3em;
}

.section-heading.visible .char {
  opacity: 1;
  transform: translateY(0);
  text-shadow: 0 0 40px rgba(240, 120, 74, 0.06);
}

/* ============================================
   PARALLAX DEPTH
   ============================================ */
[data-parallax] {
  will-change: translate;
}
