/* ================================================================
   DIEGO BADILLO — PORTFOLIO v2
   style.css — Premium Dark Edition
   ================================================================ */

/* ─── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:           #080808;
  --bg-2:         #0e0e0e;
  --bg-3:         #141414;
  --surface:      #181818;
  --surface-2:    #1f1f1f;
  --border:       rgba(255,255,255,0.06);
  --border-2:     rgba(255,255,255,0.10);

  --white:        #f8f8f8;
  --gray-1:       #e4e4e4;
  --gray-2:       #a8a8a8;
  --gray-3:       #686868;
  --gray-4:       #2e2e2e;

  --red:          #c8102e;
  --red-dim:      rgba(200,16,46,.12);
  --red-glow:     rgba(200,16,46,.22);
  --red-glow-lg:  rgba(200,16,46,.35);

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --nav-h:  68px;
  --max-w:  1160px;
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-full: 9999px;

  --ease:     cubic-bezier(0.16,1,0.3,1);
  --ease-io:  cubic-bezier(0.45,0,0.55,1);
  --fast:   0.18s;
  --normal: 0.38s;
  --slow:   0.7s;
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}
@media (hover: none) { body { cursor: auto; } #cursor { display: none; } }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { background: none; border: none; cursor: pointer; font-family: inherit; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────── */
h1,h2,h3,h4 { line-height: 1.08; font-weight: 700; font-family: var(--font-display); }
.accent-dot { color: var(--red); }

/* ─── LAYOUT UTILITIES ───────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

.section {
  padding: clamp(5rem, 10vw, 9rem) 0;
  position: relative;
}
.section--alt { background: var(--bg-2); }

.section-header {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
}

/* ─── LOADER ─────────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-wrap {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.loader-logo {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--white);
  position: relative;
}
.loader-logo::after {
  content: '';
  position: absolute; bottom: 0; right: -4px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
}
.loader-progress {
  width: 120px; height: 1px;
  background: var(--border-2);
  position: relative; overflow: hidden;
}
.loader-line {
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: loaderSweep 1.2s var(--ease) forwards;
}
@keyframes loaderSweep { to { left: 100%; } }
.loader-pct {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray-3);
  letter-spacing: 0.1em;
}

/* ─── CURSOR ─────────────────────────────────────────────────── */
#cursor {
  position: fixed; top: 0; left: 0; z-index: 9998;
  pointer-events: none;
}
.cursor-dot {
  position: fixed;
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: transform 0.08s, opacity 0.2s;
}
.cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1px solid rgba(200,16,46,0.4);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: transform 0.25s var(--ease), width 0.25s, height 0.25s, opacity 0.2s, border-color 0.2s;
}
body.cursor-hover .cursor-ring {
  width: 52px; height: 52px;
  border-color: rgba(200,16,46,0.7);
}

/* ─── NAVBAR ─────────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  transition: background var(--normal), backdrop-filter var(--normal), border-color var(--normal);
}
#navbar.scrolled {
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  height: 100%;
  display: flex; align-items: center; gap: 2rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--white);
  flex-shrink: 0;
}
.logo-text { position: relative; }
.logo-dot {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.nav-links {
  display: flex; gap: 0.25rem;
  margin-left: auto;
}
.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-2);
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-sm);
  position: relative;
  transition: color var(--fast);
}
.nav-link::after {
  content: '';
  position: absolute; bottom: 4px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 16px; height: 1px;
  background: var(--red);
  transition: transform var(--fast) var(--ease);
}
.nav-link:hover { color: var(--white); }
.nav-link:hover::after,
.nav-link.active::after { transform: translateX(-50%) scaleX(1); }
.nav-link.active { color: var(--white); }

.nav-cta {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
  background: var(--red);
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-sm);
  letter-spacing: 0.01em;
  transition: background var(--fast), transform var(--fast), box-shadow var(--fast);
  flex-shrink: 0;
}
.nav-cta:hover {
  background: #a50d24;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--red-glow);
}
.nav-cta svg { opacity: 0.8; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  padding: 0.5rem;
  margin-left: 0.5rem;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--normal) var(--ease), opacity var(--normal);
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile overlay */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(8,8,8,0.97);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--normal), visibility var(--normal);
}
.mobile-overlay.open { opacity: 1; visibility: visible; }
.mobile-nav { text-align: center; }
.mobile-nav ul { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 3rem; }
.mobile-link {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--gray-2);
  display: block; padding: 0.4rem 1rem;
  transition: color var(--fast);
  opacity: 0; transform: translateY(20px);
  animation: none;
}
.mobile-overlay.open .mobile-link {
  animation: mobileLinkIn 0.5s var(--ease) calc(var(--i) * 0.06s) forwards;
}
@keyframes mobileLinkIn { to { opacity: 1; transform: none; } }
.mobile-link:hover { color: var(--white); }
.mobile-footer-links {
  display: flex; flex-direction: column; gap: 0.5rem; align-items: center;
}
.mobile-contact-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gray-3);
  letter-spacing: 0.05em;
  transition: color var(--fast);
}
.mobile-contact-link:hover { color: var(--red); }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  background: var(--red);
  padding: 0.8rem 1.6rem;
  border-radius: var(--r-sm);
  letter-spacing: 0.01em;
  transition: background var(--fast), transform var(--fast), box-shadow var(--fast);
  position: relative; overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}
.btn-primary:hover {
  background: #a50d24;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--red-glow);
}
.btn-primary.btn-sm { padding: 0.65rem 1.25rem; font-size: 0.82rem; }
.btn-primary.btn-submit { width: 100%; justify-content: center; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-1);
  border: 1px solid var(--border-2);
  padding: 0.8rem 1.6rem;
  border-radius: var(--r-sm);
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.btn-ghost:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}

/* spinner */
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn-submit.loading .btn-text,
.btn-submit.loading .btn-icon { display: none; }
.btn-submit.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) clamp(1.25rem,5vw,3rem) 4rem;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Atmosphere */
.hero-atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.atm-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}
.atm-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.atm-glow--1 {
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(200,16,46,0.18), transparent 70%);
  top: -20%; left: -10%;
  animation: glowDrift 12s ease-in-out infinite alternate;
}
.atm-glow--2 {
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, rgba(200,16,46,0.10), transparent 70%);
  bottom: 10%; right: -5%;
  animation: glowDrift 16s ease-in-out infinite alternate-reverse;
}
@keyframes glowDrift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(3%, 3%) scale(1.05); }
}
.atm-noise {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px;
  opacity: 0.5;
}
.atm-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 50%, rgba(8,8,8,0.8) 100%);
}

/* Hero badge */
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gray-2);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  padding: 0.4rem 0.9rem 0.4rem 0.75rem;
  border-radius: var(--r-full);
  margin-bottom: 2.5rem;
  width: fit-content;
}
.badge-pulse {
  width: 7px; height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s ease infinite;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.4);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Hero headline */
.hero-headline { margin-bottom: 1.5rem; }
.hero-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75rem;
}
.hero-name {
  font-size: clamp(4rem, 13vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.92;
  color: var(--white);
  position: relative;
}
.name-line { display: block; overflow: hidden; }
.name-line span { display: block; }
.name-accent { color: var(--red); }

/* Clip reveal */
.reveal-clip {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  animation: clipReveal 0.9s var(--ease) calc(var(--d, 0s)) forwards;
}
@keyframes clipReveal {
  to { opacity: 1; clip-path: inset(0 0 0% 0); }
}

.hero-copy {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--gray-2);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 2.5rem;
}
.type-span {
  color: var(--white);
  border-right: 2px solid var(--red);
  padding-right: 2px;
}

.hero-actions {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

/* Stats */
.hero-stats {
  display: flex; align-items: center; gap: 2.5rem;
  flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-n {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--white);
  line-height: 1;
}
.stat-sfx { font-size: 1.2rem; color: var(--red); font-weight: 700; }
.stat-l {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-3);
}
.stat-sep {
  width: 1px; height: 36px;
  background: var(--border-2);
  flex-shrink: 0;
}

/* Scroll hint */
.scroll-hint {
  position: absolute; bottom: 2rem; left: clamp(1.25rem,5vw,3rem);
  display: flex; align-items: center; gap: 0.75rem;
  opacity: 0.5;
  transition: opacity var(--fast);
}
.scroll-hint:hover { opacity: 1; }
.scroll-icon {
  width: 28px; height: 44px;
  border: 1px solid var(--border-2);
  border-radius: 14px;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6px;
}
.scroll-dot {
  width: 4px; height: 8px;
  background: var(--red);
  border-radius: 2px;
  animation: scrollBob 1.8s ease infinite;
}
@keyframes scrollBob {
  0%,100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.3; }
}
.scroll-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-3);
  writing-mode: vertical-rl;
}

/* ─── ABOUT ──────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(3rem, 8vw, 6rem);
  align-items: center;
}

/* Avatar */
.about-visual {
  display: flex; flex-direction: column; align-items: center; gap: 2rem;
}
.avatar-frame {
  position: relative; width: 200px; height: 200px;
  flex-shrink: 0;
}
.avatar-inner {
  width: 100%; height: 100%;
  background: var(--surface);
  border-radius: 50%;
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  overflow: hidden;
}
.avatar-inner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--red-dim), transparent 60%);
}
.avatar-initials {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--white);
  position: relative; z-index: 1;
}
.avatar-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--border);
  pointer-events: none;
}
.avatar-ring--1 { inset: -14px; animation: ringPulse 3s ease infinite; }
.avatar-ring--2 { inset: -28px; animation: ringPulse 3s ease 0.5s infinite; }
@keyframes ringPulse {
  0%,100% { opacity: 0.5; }
  50% { opacity: 0.15; }
}
.avatar-glow {
  position: absolute;
  width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 50%, var(--red-glow), transparent 70%);
  filter: blur(24px);
  border-radius: 50%;
  z-index: 0;
}

.about-tag-stack {
  display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
}
.about-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-3);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  border-radius: var(--r-full);
}

/* About text */
.about-content { display: flex; flex-direction: column; gap: 1.25rem; }
.about-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.75;
  color: var(--gray-1);
}
.about-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--gray-2);
}
.about-traits {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin: 0.25rem 0;
}
.trait {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--gray-2);
}
.trait-icon { color: var(--red); font-style: normal; flex-shrink: 0; }

/* ─── SKILLS ─────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.skill-card {
  background: var(--bg-2);
  padding: 2rem 1.75rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  position: relative;
  transition: background var(--fast);
}
.skill-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--normal) var(--ease);
}
.skill-card:hover { background: var(--surface); }
.skill-card:hover::before { transform: scaleX(1); }

.skill-icon-wrap {
  width: 48px; height: 48px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  flex-shrink: 0;
  transition: background var(--fast), border-color var(--fast);
}
.skill-card:hover .skill-icon-wrap {
  background: var(--red-dim);
  border-color: rgba(200,16,46,0.3);
}
.skill-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}
.skill-desc { font-size: 0.85rem; color: var(--gray-2); line-height: 1.6; flex: 1; }
.skill-bar {
  height: 3px;
  background: var(--border-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.25rem;
}
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), rgba(200,16,46,0.5));
  border-radius: 2px;
  width: 0;
  transition: width 1.2s var(--ease);
}
.skill-pct {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gray-3);
  letter-spacing: 0.08em;
  text-align: right;
}

/* ─── PROJECTS ───────────────────────────────────────────────── */
.project-filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 3rem;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-3);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-full);
  transition: color var(--fast), border-color var(--fast), background var(--fast);
  cursor: pointer;
}
.filter-btn:hover, .filter-btn.active {
  color: var(--white);
  border-color: var(--red);
  background: var(--red-dim);
}
.filter-btn.active { color: var(--red); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--normal) var(--ease), box-shadow var(--normal), border-color var(--normal), opacity 0.4s;
  display: flex; flex-direction: column;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(200,16,46,0.2);
  border-color: rgba(200,16,46,0.2);
}
.project-card.hidden { display: none; }

.project-link { display: block; position: relative; }
.project-visual { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.project-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-placeholder--barber {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a0505 50%, #0d0d0d 100%);
}
.project-placeholder--commerce {
  background: linear-gradient(135deg, #0a0a14 0%, #0d0d20 50%, #0a0a14 100%);
}
.project-placeholder--saas {
  background: linear-gradient(135deg, #0a100d 0%, #0d1a14 50%, #0a100d 100%);
}
.placeholder-icon {
  font-size: 3rem;
  opacity: 0.15;
  position: relative; z-index: 1;
  user-select: none;
}
.placeholder-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}
.project-hover-overlay {
  position: absolute; inset: 0;
  background: rgba(200,16,46,0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--normal);
}
.project-card:hover .project-hover-overlay { opacity: 1; }
.overlay-cta {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
}
.project-badge {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #22c55e;
  background: rgba(22,163,74,0.15);
  border: 1px solid rgba(22,163,74,0.3);
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-full);
  z-index: 2;
}
.project-badge--wip { color: var(--gray-3); background: rgba(104,104,104,0.1); border-color: rgba(104,104,104,0.2); }

.project-info {
  padding: 1.5rem 1.75rem 1.75rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  flex: 1;
}
.project-meta {
  display: flex; align-items: center; gap: 0.75rem;
}
.project-year {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gray-3);
  letter-spacing: 0.08em;
}
.project-type {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--red-dim);
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-full);
}
.project-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.project-desc {
  font-size: 0.85rem;
  color: var(--gray-2);
  line-height: 1.65;
  flex: 1;
}
.project-tags {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-3);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-full);
}
.project-links {
  display: flex; gap: 0.75rem; align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}
.plink-demo {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
  background: var(--red);
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  transition: background var(--fast), transform var(--fast);
}
.plink-demo:hover { background: #a50d24; transform: translateY(-1px); }
.plink-github {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gray-2);
  border: 1px solid var(--border-2);
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  transition: color var(--fast), border-color var(--fast);
}
.plink-github:hover { color: var(--white); border-color: rgba(255,255,255,0.2); }

/* ─── SERVICES ───────────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--normal), transform var(--normal) var(--ease);
  display: flex; flex-direction: column; gap: 1rem;
}
.service-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  transform: scaleX(0);
  transition: transform var(--normal) var(--ease);
}
.service-card:hover { border-color: rgba(200,16,46,0.2); transform: translateY(-4px); }
.service-card:hover::after { transform: scaleX(1); }

.service-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--red);
  letter-spacing: 0.1em;
  opacity: 0.6;
}
.service-icon {
  width: 56px; height: 56px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
}
.service-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.service-desc {
  font-size: 0.88rem;
  color: var(--gray-2);
  line-height: 1.7;
}
.service-list {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.service-list li {
  font-size: 0.82rem;
  color: var(--gray-3);
  padding-left: 1rem;
  position: relative;
}
.service-list li::before {
  content: '—';
  position: absolute; left: 0;
  color: var(--red); opacity: 0.5;
  font-size: 0.7rem;
}

/* ─── CONTACT ────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: clamp(3rem, 7vw, 6rem);
  align-items: start;
}
.contact-intro {
  font-size: 1.05rem;
  color: var(--gray-1);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}
.contact-channels { display: flex; flex-direction: column; gap: 0.75rem; }
.channel-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
  cursor: pointer;
}
.channel-item:hover {
  border-color: rgba(200,16,46,0.25);
  background: var(--surface-2);
  transform: translateX(4px);
}
.channel-icon {
  width: 38px; height: 38px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}
.channel-text { flex: 1; }
.channel-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-3);
  margin-bottom: 2px;
}
.channel-value {
  display: block;
  font-size: 0.88rem;
  color: var(--gray-1);
  font-weight: 500;
}
.channel-arrow {
  color: var(--gray-3);
  flex-shrink: 0;
  transition: color var(--fast), transform var(--fast);
}
.channel-item:hover .channel-arrow { color: var(--red); transform: translate(2px,-2px); }

/* Form */
.contact-form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem;
}
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-3);
}
.form-input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--white);
  transition: border-color var(--fast), box-shadow var(--fast);
  outline: none;
  width: 100%;
  resize: vertical;
}
.form-input::placeholder { color: var(--gray-3); }
.form-input:focus {
  border-color: rgba(200,16,46,0.5);
  box-shadow: 0 0 0 3px var(--red-dim);
}
.form-input.error { border-color: rgba(200,16,46,0.7); }
.form-textarea { min-height: 130px; }

.form-success {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  color: #86efac;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--white);
  display: flex; align-items: center; gap: 4px;
}
.footer-logo-dot {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 6px;
}
.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gray-3);
  letter-spacing: 0.06em;
  margin-right: auto;
}
.footer-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.footer-link {
  font-size: 0.82rem;
  color: var(--gray-3);
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-sm);
  transition: color var(--fast);
}
.footer-link:hover { color: var(--white); }
.footer-socials { display: flex; gap: 0.5rem; }
.footer-social {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-3);
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.footer-social:hover {
  color: var(--white);
  border-color: var(--border-2);
  background: var(--surface-2);
}
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gray-3);
  letter-spacing: 0.06em;
}

/* ─── BACK TO TOP ────────────────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 90;
  width: 44px; height: 44px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-2);
  transition: color var(--fast), background var(--fast), border-color var(--fast), transform var(--fast), opacity var(--fast);
  opacity: 0;
}
.back-to-top:not([hidden]) { opacity: 1; }
.back-to-top:hover {
  color: var(--white);
  background: var(--red);
  border-color: transparent;
  transform: translateY(-2px);
}

/* ─── ANIMATIONS & REVEALS ───────────────────────────────────── */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--slow) var(--ease) var(--d, 0s),
              transform var(--slow) var(--ease) var(--d, 0s);
}
.reveal-fade {
  opacity: 0;
  transition: opacity var(--slow) var(--ease) var(--d, 0s);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.in-view.reveal-up,
.in-view.reveal-fade { opacity: 1; transform: none; }
.in-view.reveal-left,
.in-view.reveal-right { opacity: 1; transform: none; }

/* ─── REDUCED MOTION ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal-up, .reveal-fade, .reveal-left, .reveal-right, .reveal-clip {
    opacity: 1; transform: none; clip-path: none;
  }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-cta { display: none; }

  .about-grid { grid-template-columns: 1fr; }
  .about-visual { flex-direction: row; justify-content: flex-start; }
  .avatar-frame { width: 140px; height: 140px; }

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

  .footer-tagline { display: none; }
}

@media (max-width: 600px) {
  .hero-name { font-size: clamp(3.5rem, 18vw, 6rem); }
  .hero-stats { gap: 1.5rem; }
  .stat-n { font-size: 1.6rem; }

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

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

  .about-visual { flex-direction: column; align-items: center; }
  .contact-form-wrap { padding: 1.5rem; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; }
  .back-to-top { bottom: 1.25rem; right: 1.25rem; }
}
