:root {
  --primary: #1c4430;
  --primary-light: #2a5c42;
  --secondary: #0e2a1c;
  --accent: #3d7a5a;
  --warning: #c0392b;
  --bg-primary: #f2ede3;
  --bg-secondary: #e8e0d0;
  --bg-glass: #ede7d9;
  --text-primary: #111111;
  --text-secondary: #333333;
  --text-muted: #666666;
  --dark-bg: #1c4430;
  --dark-text: #f2ede3;
  --dark-border: rgba(242, 237, 227, 0.15);
  --border-c: #c8bfa8;
  --border-d: #9a8f78;
  --shadow-sm: 2px 3px 0px #9a8f78;
  --shadow-md: 3px 4px 0px #9a8f78;
  --shadow-lg: 4px 6px 0px #9a8f78;
  --shadow-glow: 3px 4px 0px #0e2a1c;
  --header-height: 80px;
  --container-max: 1200px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --transition: all 0.2s ease;
  --font-mono: "JetBrains Mono", monospace;
  --font-main: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}
[data-theme="dark"] {
  --bg-primary: #141410;
  --bg-secondary: #1c1c17;
  --bg-glass: #1c1c17;
  --text-primary: #f0ead6;
  --text-secondary: #c8bfa8;
  --text-muted: #8a8070;
  --dark-bg: #0e1a12;
  --dark-text: #f0ead6;
  --dark-border: rgba(240, 234, 214, 0.1);
  --border-c: #3a3830;
  --border-d: #4a4840;
  --shadow-sm: 2px 3px 0px #0a0a08;
  --shadow-md: 3px 4px 0px #0a0a08;
  --shadow-lg: 4px 6px 0px #0a0a08;
  --shadow-glow: 3px 4px 0px #000;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  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-size: 200px 200px;
}

body {
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  background: var(--bg-primary);
  color: var(--text-primary);
  scroll-behavior: smooth;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

/* ══════════════════════════════════════════════════════
   LOADING SCREEN
══════════════════════════════════════════════════════ */
#loadScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--dark-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loadScreen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.load-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  color: var(--dark-text);
  letter-spacing: -0.03em;
  animation: loadPulse 1s ease infinite alternate;
}
.load-logo span { color: #7ec8a0; }

.load-bar-wrap {
  width: 120px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
}
.load-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #7ec8a0);
  border-radius: 4px;
  animation: loadFill 0.9s ease forwards;
}
@keyframes loadPulse { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes loadFill { to { width: 100%; } }

/* ══════════════════════════════════════════════════════
   SCROLL PROGRESS BAR
══════════════════════════════════════════════════════ */
#progressBar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.1s linear;
}

/* ══════════════════════════════════════════════════════
   FLOATING PARTICLES CANVAS
══════════════════════════════════════════════════════ */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* ══════════════════════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }

/* ══════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════ */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: var(--dark-bg);
  border-bottom: 2px solid var(--secondary);
  transition: height 0.25s ease, box-shadow 0.25s ease;
}
header.scrolled { height: 62px; box-shadow: 0 4px 0 var(--secondary); }

.header-wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--dark-text);
  letter-spacing: -0.02em;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: var(--dark-text);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); }
.theme-toggle .material-symbols-outlined { font-size: 20px; }

nav#navMenu { display: flex; align-items: center; gap: 8px; z-index: 70; }

.nav-link {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: rgba(242,237,227,0.8);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-main);
  position: relative;
  overflow: hidden;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: rgba(242,237,227,0.7);
  border-radius: 2px;
  transition: width 0.25s ease, left 0.25s ease;
}
.nav-link:hover::after { width: 55%; left: 22%; }
.nav-link:hover .material-symbols-outlined { animation: iconSpin 0.4s ease; }
@keyframes iconSpin {
  0% { transform: rotate(0); }
  50% { transform: rotate(-15deg) scale(1.2); }
  100% { transform: rotate(0) scale(1); }
}
.nav-link:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.35); color: var(--dark-text); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.nav-link.active { background: var(--bg-primary); color: var(--primary); border-color: var(--bg-primary); font-weight: 700; box-shadow: var(--shadow-glow); }
.nav-link.active::after { display: none; }

#hamburger {
  display: none;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: var(--dark-text);
  font-size: 20px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
#hamburger:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); }

/* Layout */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
}
main { padding-top: calc(var(--header-height) + 40px); padding-bottom: 40px; flex: 1; }

main section { display: none; opacity: 0; transform: translateY(22px); transition: opacity 0.4s ease, transform 0.4s ease; }
main section.active { display: block; opacity: 1; transform: translateY(0); }
main section.exiting { opacity: 0; transform: translateY(-16px); transition: opacity 0.25s ease, transform 0.25s ease; }

/* ══════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════ */
.hero {
  border-radius: var(--radius-xl);
  padding: clamp(40px, 8vw, 80px);
  background: var(--bg-glass);
  border: 2px solid var(--border-c);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(28,68,48,0.05), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(61,122,90,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 20%, rgba(28,68,48,0.06) 0%, transparent 55%);
  animation: meshDrift 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
@keyframes meshDrift { from { transform: translate(0,0) rotate(0deg); } to { transform: translate(3%,2%) rotate(3deg); } }
.hero > * { position: relative; z-index: 1; }

.hero h1 {
  margin: 0 0 24px;
  font-weight: 900;
  font-size: clamp(36px, 8vw, 84px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-family: var(--font-display);
  color: var(--text-primary);
  min-height: 1.2em;
  animation: heroH1 0.7s 0.1s both;
  font-variation-settings: "wght" 450;
  transition: font-variation-settings 0.7s ease, letter-spacing 0.7s ease;
}
.hero h1:hover { font-variation-settings: "wght" 900; letter-spacing: 0.02em; }
.hero h1 .typed-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes heroH1 { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.cursor {
  display: inline-block;
  width: 3px;
  height: 0.8em;
  background: var(--primary);
  margin-left: 4px;
  vertical-align: middle;
  border-radius: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.hero p {
  margin: 0 auto 32px;
  max-width: 800px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 400;
  animation: heroPara 0.7s 0.3s both;
}
@keyframes heroPara { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.hero-btns { margin-top: 32px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; animation: heroBtns 0.7s 0.5s both; }
@keyframes heroBtns { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
#heroParallax { transition: transform 0.1s linear; }

/* ══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.cta-btn, .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  border: 2px solid var(--secondary);
  font-weight: 700;
  color: var(--dark-text);
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  font-size: 16px;
  transition: var(--transition);
  font-family: var(--font-main);
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
.cta-btn:hover, .btn-primary:hover { transform: translate(calc(-2px + var(--mx,0px)),calc(-2px + var(--my,0px))); box-shadow: 5px 7px 0px var(--secondary); }
.cta-btn:active, .btn-primary:active { transform: translate(1px,1px); box-shadow: 1px 2px 0px var(--secondary); }

.btn-ghost {
  padding: 14px 26px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 2px solid var(--border-d);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-main);
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  position: relative;
  overflow: hidden;
}
.btn-ghost:hover { transform: translate(calc(-2px + var(--mx,0px)),calc(-2px + var(--my,0px))); box-shadow: 4px 5px 0px var(--border-d); border-color: var(--primary); color: var(--primary); }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleAnim 0.55s linear;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

.btn-success {
  background: var(--accent) !important;
  border-color: #1a5c38 !important;
  box-shadow: 3px 4px 0px #1a5c38 !important;
  animation: successPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes successPop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.05) translate(-2px,-2px); }
  100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════
   GLASS CARD
══════════════════════════════════════════════════════ */
.glass {
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-c);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  margin-bottom: 32px;
}
.glass:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translate(-1px,-1px); }

/* ══════════════════════════════════════════════════════
   PROJECT CARDS
══════════════════════════════════════════════════════ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; justify-items: center; }

.proj-card {
  max-width: 320px;
  min-height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-c);
  background: var(--bg-glass);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-md);
  transform-style: preserve-3d;
  will-change: transform;
}
.proj-card:hover { border-color: var(--primary); box-shadow: 6px 7px 0px var(--border-d); }
.proj-card:hover .proj-media img { transform: scale(1.05); }

.proj-media { width: 100%; height: 140px; border-bottom: 2px solid var(--border-c); overflow: hidden; }
.proj-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }

.proj-body { padding: 18px; }
.proj-body h3 { font-size: 19px; margin: 0 0 8px; font-family: var(--font-display); font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }
.proj-body p { font-size: 14px; line-height: 1.55; margin: 0 0 16px; color: var(--text-secondary); }

.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  border: 1.5px solid var(--secondary);
  font-weight: 600;
  color: var(--dark-text);
  letter-spacing: 0.03em;
  transition: var(--transition);
}
.proj-card:hover .badge { transform: translateY(-1px); box-shadow: 1px 2px 0px var(--secondary); }

.proj-actions { display: flex; gap: 10px; margin-top: auto; }
.proj-actions a {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  font-family: var(--font-main);
  position: relative;
  overflow: hidden;
}
.proj-view { background: var(--primary); color: var(--dark-text); border: 2px solid var(--secondary); box-shadow: var(--shadow-glow); }
.proj-view:hover { transform: translate(-1px,-1px); box-shadow: 3px 4px 0px var(--secondary); }
.proj-source { background: var(--bg-primary); color: var(--text-secondary); border: 2px solid var(--border-d); box-shadow: var(--shadow-sm); }
.proj-source:hover { transform: translate(-1px,-1px); box-shadow: 3px 4px 0px var(--border-d); border-color: var(--primary); color: var(--primary); }

/* ══════════════════════════════════════════════════════
   CONTACT
══════════════════════════════════════════════════════ */
#contact { padding: 80px 24px; }
.contact-container { max-width: 600px; margin: 0 auto; text-align: center; }
.contact-container h2 { font-family: var(--font-display); font-size: 2.6rem; font-weight: 900; margin-bottom: 20px; letter-spacing: -0.03em; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact-container p { color: var(--text-muted); margin-bottom: 40px; line-height: 1.7; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 400px; margin: 0 auto; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 2px solid var(--border-c);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}
.contact-card:hover { transform: translate(-3px,-3px); border-color: var(--primary); box-shadow: 5px 7px 0px var(--border-d); }
.contact-card:hover .contact-icon { animation: iconBounce 0.4s ease; }
@keyframes iconBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.2) rotate(-5deg); }
  70% { transform: scale(0.95) rotate(3deg); }
  100% { transform: scale(1); }
}
.contact-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px; flex-shrink: 0;
  border: 2px solid rgba(0,0,0,0.15); box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}
.contact-text .title { font-weight: 700; font-size: 17px; color: var(--text-primary); }
.contact-text .subtitle { font-size: 14px; color: var(--text-secondary); font-family: var(--font-mono); }

/* ══════════════════════════════════════════════════════
   FORM
══════════════════════════════════════════════════════ */
.form-group { position: relative; margin-bottom: 24px; }

.form-input {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 2px solid var(--border-c);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-main);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 3px 4px 0px var(--secondary); transform: translateY(-2px); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:valid:not(:focus):not(:placeholder-shown) { border-color: var(--accent); }
.form-input:invalid:not(:focus):not(:placeholder-shown) { border-color: var(--warning); }
textarea.form-input { min-height: 120px; resize: vertical; }

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.form-message {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin-top: 20px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 15px;
  border: 2px solid;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.35s ease forwards;
}
.form-success { background: #e8f5ee; border-color: var(--accent); color: var(--primary); }
.form-error { background: #fcecea; border-color: var(--warning); color: #8b1a1a; }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.message-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.success-icon { background: rgba(29,68,48,0.1); border: 2px solid var(--accent); }
.error-icon { background: rgba(192,57,43,0.1); border: 2px solid var(--warning); color: #8b1a1a; }
.message-title { font-weight: 800; font-size: 17px; }
.message-subtitle { font-weight: 500; font-size: 13px; opacity: 0.9; margin-top: 3px; }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  top: 50%; left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
footer {
  margin-top: auto;
  padding: 32px;
  font-size: 15px;
  border-top: 2px solid var(--secondary);
  background: var(--dark-bg);
  color: var(--dark-text);
}
.footer-wrap { max-width: var(--container-max); margin: 0 auto; display: flex; flex-direction: column; gap: 20px; align-items: center; text-align: center; }
.footer-copy { color: rgba(242,237,227,0.65); font-weight: 500; }
.footer-social { display: flex; gap: 16px; }
.footer-social a {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.15);
  color: var(--dark-text); font-size: 17px; text-decoration: none;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.footer-social a:hover { color: var(--primary); background: var(--dark-text); border-color: var(--dark-text); transform: translate(-2px,-2px); box-shadow: 3px 4px 0px var(--secondary); }

/* ══════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════ */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(14,42,28,0.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.project-modal.active { display: flex; }
.project-modal-content {
  max-width: 900px;
  width: 100%;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-c);
  box-shadow: 6px 8px 0px var(--border-d);
  margin-top: 40px;
  animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.project-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 28px; border-bottom: 2px solid var(--border-c); gap: 16px; }
.project-modal-title { font-family: var(--font-display); font-size: 26px; font-weight: 900; margin: 0; letter-spacing: -0.02em; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.project-modal-body { padding: 28px; display: grid; grid-template-columns: 1fr 340px; gap: 36px; }
.project-modal-left { display: flex; flex-direction: column; gap: 24px; }
.project-modal-right { display: flex; flex-direction: column; gap: 20px; }
.project-description { color: var(--text-secondary); line-height: 1.7; font-size: 15px; }
.project-image { width: 100%; border-radius: var(--radius-md); border: 2px solid var(--border-c); overflow: hidden; background: var(--bg-glass); box-shadow: var(--shadow-md); }
.project-image img { width: 100%; height: auto; display: block; }
.project-features { display: flex; flex-direction: column; gap: 12px; }
.project-features h4 { margin: 0 0 12px; font-weight: 800; font-size: 16px; color: var(--text-primary); font-family: var(--font-display); }
.feature-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-secondary);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-c);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.feature-item:hover { border-color: var(--primary); transform: translate(-1px,-1px); box-shadow: 3px 4px 0px var(--border-d); }
.feature-icon {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--primary);
  border: 2px solid var(--secondary);
  box-shadow: var(--shadow-glow);
  color: var(--dark-text);
}
.feature-icon svg { stroke: var(--dark-text); }
.feature-content { flex: 1; }
.feature-title { font-weight: 700; font-size: 15px; margin: 0 0 6px; color: var(--text-primary); font-family: var(--font-display); }
.feature-desc { color: var(--text-secondary); font-size: 14px; margin: 0; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  #hamburger { display: block; }
  nav#navMenu {
    display: none;
    position: absolute;
    top: calc(var(--header-height) + 8px);
    left: 12px; right: 12px;
    background: var(--dark-bg);
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--secondary);
    flex-direction: column;
    gap: 8px;
    box-shadow: 4px 6px 0px #040f08;
    z-index: 9999;
  }
  nav#navMenu.nav-open { display: flex !important; }
  .nav-link { width: 100%; justify-content: flex-start; padding: 14px 16px; font-size: 16px; }
  .header-wrap { padding: 0 12px; }
  .container { padding: 20px; }
  .hero { padding: 28px; }
  .glass { padding: 24px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-btns .cta-btn, .hero-btns .btn-ghost { width: 100%; justify-content: center; }
  .projects-grid { grid-template-columns: 1fr; gap: 20px; }
  .contact-card { flex-direction: column; gap: 10px; text-align: center; }
  .project-modal-body { grid-template-columns: 1fr; gap: 28px; }
  .project-modal { padding: 20px; }
  .form-message { flex-direction: column; text-align: center; gap: 10px; }
}
@media (max-width: 480px) {
  .project-modal-header { flex-direction: column; align-items: stretch; }
  .project-modal-header .btn-ghost, .project-modal-header .btn-primary { width: 100%; justify-content: center; }
}
@media (min-width: 768px) {
  .footer-wrap { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
}

/* ══════════════════════════════════════════════════════
   TEXT REVEAL — word-by-word
══════════════════════════════════════════════════════ */
.reveal-text .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal-text.revealed .word { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════════
   BLUR-UP IMAGE LOADING
══════════════════════════════════════════════════════ */
.blur-up { filter: blur(14px); transform: scale(1.06); transition: filter 0.5s ease, transform 0.5s ease; background: var(--bg-glass); }
.blur-up.loaded { filter: blur(0); transform: scale(1); }

/* ══════════════════════════════════════════════════════
   STAGGER REVEAL DELAYS
══════════════════════════════════════════════════════ */
.s-delay-1 { transition-delay: 0.05s; }
.s-delay-2 { transition-delay: 0.12s; }
.s-delay-3 { transition-delay: 0.19s; }
.s-delay-4 { transition-delay: 0.26s; }
.s-delay-5 { transition-delay: 0.33s; }
.s-delay-6 { transition-delay: 0.40s; }

/* ══════════════════════════════════════════════════════
    CUSTOM SCROLLBAR
   ══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
html { scrollbar-width: thin; scrollbar-color: var(--primary) var(--bg-primary); }

/* ══════════════════════════════════════════════════════
    PERFORMANCE — defer offscreen rendering
   ══════════════════════════════════════════════════════ */
section#projects, section#contact, section#form { content-visibility: auto; contain-intrinsic-size: 600px; }

button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ══════════════════════════════════════════════════════
   UTILITY CLASSES
══════════════════════════════════════════════════════ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-28 { gap: 28px; }
.gap-36 { gap: 36px; }
.m-0 { margin: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }
.mt-32 { margin-top: 32px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-sm { font-size: 14px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.ls-01 { letter-spacing: 0.01em; }
.ls-005 { letter-spacing: 0.05em; }
.ls-n2 { letter-spacing: -0.02em; }
.lh-16 { line-height: 1.6; }
.lh-17 { line-height: 1.7; }
.grid { display: grid; }
.max-w-600 { max-width: 600px; }
.w-full { width: 100%; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ══════════════════════════════════════════════════════
   STAGGERED REVEAL — scale entrance
══════════════════════════════════════════════════════ */
.reveal.scale-in { transform: translateY(24px) scale(0.95); }
.reveal.scale-in.revealed { transform: translateY(0) scale(1); }
.proj-card { transition-delay: var(--s-delay, 0s); }

/* ══════════════════════════════════════════════════════
   MAGNETIC BUTTON — smooth snap-back
══════════════════════════════════════════════════════ */
.cta-btn, .btn-primary, .btn-ghost { will-change: transform; }

/* ══════════════════════════════════════════════════════
   GRADIENT BORDER GLOW — on glass hover
══════════════════════════════════════════════════════ */
.glass { position: relative; }
.glass:hover::before { opacity: 1; }
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg, var(--primary), var(--accent), #7ec8a0, var(--accent), var(--primary));
  padding: 2px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: hueSpin 6s linear infinite;
  pointer-events: none;
}
@keyframes hueSpin { to { filter: hue-rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   SHIMMER SKELETON — on unloaded images
══════════════════════════════════════════════════════ */
.proj-media, .project-image { position: relative; }
.proj-media:has(img.blur-up:not(.loaded))::after,
.project-image:has(img.blur-up:not(.loaded))::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: shimmerSlide 1.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes shimmerSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
