/* ============================================================
   TOKENS
   ============================================================ */
:root{
  --bg:        #10141A;
  --bg-alt:    #161B22;
  --surface:   #1B2028;
  --surface-2: #212832;
  --border:    #2A313D;

  --text:       #F2EFE6;
  --text-muted: #9AA3B2;
  --text-faint: #6B7280;

  --gold:       #F2A93B;
  --gold-soft:  rgba(242,169,59,0.14);
  --emerald:    #2FD9A6;
  --emerald-soft: rgba(47,217,166,0.14);
  --sapphire:   #5B8DEF;
  --sapphire-soft: rgba(91,141,239,0.14);
  --ruby:       #FF6B6B;
  --ruby-soft:  rgba(255,107,107,0.14);

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1120px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   MOTION
   ============================================================ */
@keyframes meshDrift{
  0%,100%{ background-position: 0% 0%, 100% 100%, 50% 40%; }
  50%{ background-position: 12% 6%, 88% 92%, 46% 55%; }
}
@keyframes pulseDot{
  0%{ box-shadow: 0 0 8px currentColor, 0 0 0 0 currentColor; }
  70%{ box-shadow: 0 0 8px currentColor, 0 0 0 7px transparent; }
  100%{ box-shadow: 0 0 8px currentColor, 0 0 0 0 transparent; }
}
@keyframes hueDrift{
  0%,100%{ filter: hue-rotate(0deg); }
  50%{ filter: hue-rotate(18deg); }
}
@keyframes shine{
  0%{ transform: translateX(-120%) skewX(-15deg); }
  100%{ transform: translateX(220%) skewX(-15deg); }
}

.reveal{
  opacity:0; transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view{ opacity:1; transform:none; }

*{ margin:0; padding:0; box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

.grain{
  position: fixed; inset:0; pointer-events:none; z-index:1; opacity:0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a{ color:inherit; text-decoration:none; }
ul, ol{ list-style:none; }
img{ max-width:100%; display:block; }

.dot{ display:inline-block; width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.dot-emerald{ background: var(--emerald); color: var(--emerald); box-shadow:0 0 8px rgba(47,217,166,0.6); }
.dot-gold{ background: var(--gold); color: var(--gold); box-shadow:0 0 8px rgba(242,169,59,0.6); }
.dot-sapphire{ background: var(--sapphire); color: var(--sapphire); box-shadow:0 0 8px rgba(91,141,239,0.6); }
.dot-ruby{ background: var(--ruby); color: var(--ruby); box-shadow:0 0 8px rgba(255,107,107,0.6); }

.h2{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  letter-spacing: -0.01em;
  margin-bottom: 2.4rem;
  color: var(--text);
  position:relative; display:inline-block;
}
.h2::after{
  content:''; position:absolute; left:0; bottom:-0.7rem; height:3px; width:2.6rem;
  border-radius:2px; background: linear-gradient(90deg, var(--gold), var(--emerald));
}

.section{ padding: 7rem 0; position:relative; z-index:2; }
.section-alt{ background: var(--bg-alt); }
.section-inner{ max-width: var(--container); margin: 0 auto; padding: 0 2rem; }

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 0.9rem 1.7rem; border-radius: 8px;
  font-family: var(--font-mono); font-size: 0.9rem; font-weight:500;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.3s ease;
}
.btn-solid{
  position:relative; overflow:hidden; background: var(--gold); color:#161105;
  box-shadow: 0 0 0 0 rgba(242,169,59,0.5);
  animation: btnGlow 2.6s ease-in-out infinite;
}
@keyframes btnGlow{
  0%,100%{ box-shadow: 0 0 0 0 rgba(242,169,59,0.35); }
  50%{ box-shadow: 0 0 22px 2px rgba(242,169,59,0.35); }
}
.btn-solid::after{
  content:''; position:absolute; top:0; left:0; width:40%; height:100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: translateX(-120%) skewX(-15deg);
}
.btn-solid:hover{ transform: translateY(-2px); background:#f6bb5c; }
.btn-solid:hover::after{ animation: shine 0.7s ease forwards; }
.btn-line{ border:1px solid var(--border); color: var(--text); }
.btn-line:hover{ border-color: var(--emerald); color: var(--emerald); transform: translateY(-2px); }

/* ============================================================
   NAV
   ============================================================ */
.nav{
  position: fixed; top:0; left:0; right:0; z-index: 50;
  background: rgba(16,20,26,0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled{ border-color: var(--border); background: rgba(16,20,26,0.92); }
.nav-inner{
  max-width: var(--container); margin:0 auto; padding: 1.1rem 2rem;
  display:flex; align-items:center; justify-content:space-between; gap:2rem;
}
.nav-mark{ font-family: var(--font-display); font-size:1.25rem; font-weight:600; }
.nav-mark .dot{ background:none; width:auto; height:auto; box-shadow:none; color: var(--gold); animation: hueDrift 5s ease-in-out infinite; }
.nav-links{ display:flex; gap:2.2rem; font-size:0.92rem; }
.nav-links a{ color: var(--text-muted); transition: color 0.2s ease; position:relative; padding-bottom:4px; }
.nav-links a::after{
  content:''; position:absolute; left:0; bottom:0; width:100%; height:1.5px;
  background: linear-gradient(90deg, var(--gold), var(--emerald));
  transform: scaleX(0); transform-origin:left; transition: transform 0.25s ease;
}
.nav-links a:hover{ color: var(--text); }
.nav-links a:hover::after{ transform: scaleX(1); }
.nav-links a.active{ color: var(--gold); }
.nav-links a.active::after{ transform: scaleX(1); }
.nav-cta{
  font-family: var(--font-mono); font-size:0.82rem; border:1px solid var(--border);
  padding:0.55rem 1.1rem; border-radius:6px; transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-cta:hover{ border-color: var(--gold); color: var(--gold); }
.nav-toggle{ display:none; flex-direction:column; gap:5px; background:none; border:none; cursor:pointer; padding:6px; }
.nav-toggle span{ width:22px; height:2px; background: var(--text); transition: transform 0.25s ease, opacity 0.25s ease; }

/* ============================================================
   HERO
   ============================================================ */
.hero{
  min-height: 100vh; display:flex; align-items:center;
  padding: 8rem 2rem 4rem; position:relative; z-index:2; overflow:hidden;
  background:
    radial-gradient(ellipse 900px 550px at 85% 10%, rgba(242,169,59,0.16), transparent 60%),
    radial-gradient(ellipse 750px 550px at 8% 95%, rgba(47,217,166,0.13), transparent 60%),
    radial-gradient(ellipse 650px 500px at 50% 45%, rgba(91,141,239,0.08), transparent 65%);
  background-size: 160% 160%, 160% 160%, 140% 140%;
  animation: meshDrift 16s ease-in-out infinite;
}
.hero-grid{
  max-width: var(--container); margin:0 auto; width:100%;
  display:grid; grid-template-columns: 1.15fr 0.85fr; gap: 4rem; align-items:center;
}
.hero-kicker{
  font-family: var(--font-mono); font-size:0.85rem; color: var(--emerald);
  margin-bottom: 1.1rem;
}
.hero-name{
  font-family: var(--font-display); font-weight:500;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem); line-height:1.04; letter-spacing:-0.015em;
  margin-bottom: 1.4rem;
  background: linear-gradient(100deg, var(--text) 30%, var(--gold) 55%, var(--emerald) 75%, var(--text) 95%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: nameShift 9s ease-in-out infinite;
}
@keyframes nameShift{
  0%,100%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
}
.hero-sub{
  max-width: 46ch; color: var(--text-muted); font-size:1.05rem; margin-bottom:2.2rem;
}
.hero-actions{ display:flex; gap:1rem; flex-wrap:wrap; }

.hero-side{ display:flex; flex-direction:column; gap:1.6rem; perspective: 900px; }

.photo-card{
  position:relative; border-radius:16px; overflow:hidden;
  border:1px solid var(--border);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.photo-card:hover{ box-shadow: 0 30px 70px -18px rgba(242,169,59,0.25); }
.photo-card img{
  width:100%; aspect-ratio: 4/4.4; object-fit:cover; filter: saturate(1.05) contrast(1.03);
  transition: transform 0.4s ease;
}
.photo-card:hover img{ transform: scale(1.045); }
.photo-tag{
  position:absolute; bottom:0.9rem; left:0.9rem;
  background: rgba(16,20,26,0.75); backdrop-filter: blur(6px);
  border:1px solid var(--border); border-radius:8px;
  padding:0.4rem 0.75rem; font-family: var(--font-mono); font-size:0.75rem;
  display:flex; align-items:center; gap:0.4rem; color: var(--text);
}

.status-panel{
  background: var(--surface); border:1px solid var(--border); border-radius:14px;
  padding:1.3rem 1.4rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}
.status-panel:hover{ border-color:#3a4250; }
.status-list .dot{ animation: pulseDot 2.4s ease-out infinite; animation-delay: calc(var(--d, 0) * 0.3s); }
.status-title{
  font-family: var(--font-mono); font-size:0.78rem; color: var(--text-faint);
  margin-bottom:0.9rem;
}
.status-list li{
  display:flex; align-items:baseline; gap:0.6rem;
  padding:0.55rem 0; border-top:1px solid var(--border);
  font-family: var(--font-mono); font-size:0.82rem;
  opacity:0; transform: translateY(6px);
  animation: statusIn 0.5s ease forwards;
  animation-delay: calc(var(--d) * 0.12s + 0.15s);
}
.status-list li:first-child{ border-top:none; }
@keyframes statusIn{ to{ opacity:1; transform:none; } }
.status-label{ color: var(--text-muted); min-width: 5.6rem; flex-shrink:0; }
.status-value{ color: var(--text); }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid{
  display:grid; grid-template-columns: 1.5fr 0.9fr; gap:3.5rem; align-items:start;
}
.about-copy p{ color: var(--text-muted); margin-bottom:1.1rem; max-width:60ch; }

.skill-groups{ display:grid; grid-template-columns:1fr 1fr; gap:1.4rem; margin-top:2.2rem; }
.skill-group-title{
  display:flex; align-items:center; gap:0.55rem;
  font-family: var(--font-mono); font-size:0.82rem; color: var(--text-muted);
  margin-bottom:0.7rem;
}
.chips{ display:flex; flex-wrap:wrap; gap:0.5rem; }
.chip{
  font-size:0.82rem; padding:0.35rem 0.7rem; border-radius:6px;
  background: var(--surface); border:1px solid var(--border); color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.skill-group:nth-child(1) .chip:hover{ border-color: var(--emerald); background: var(--emerald-soft); transform: translateY(-2px); }
.skill-group:nth-child(2) .chip:hover{ border-color: var(--sapphire); background: var(--sapphire-soft); transform: translateY(-2px); }
.skill-group:nth-child(3) .chip:hover{ border-color: var(--gold); background: var(--gold-soft); transform: translateY(-2px); }
.skill-group:nth-child(4) .chip:hover{ border-color: var(--ruby); background: var(--ruby-soft); transform: translateY(-2px); }

.id-card{
  background: var(--surface); border:1px solid var(--border); border-radius:14px;
  padding:1.8rem; position:sticky; top:6.5rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.id-card:hover{ border-color: rgba(242,169,59,0.35); box-shadow: 0 20px 45px -25px rgba(242,169,59,0.3); }
.id-card-label{
  font-family: var(--font-mono); font-size:0.75rem; color: var(--gold);
  margin-bottom:1.2rem;
}
.id-row{
  display:flex; justify-content:space-between; gap:1rem;
  padding:0.75rem 0; border-top:1px solid var(--border);
  font-size:0.9rem;
}
.id-row:first-child{ border-top:none; }
.id-row dt{ color: var(--text-faint); }
.id-row dd{ color: var(--text); text-align:right; }

/* ============================================================
   JOURNEY
   ============================================================ */
.journey-grid{ display:grid; grid-template-columns:1fr 1fr; gap:3.5rem; }
.journey-col-title{
  font-family: var(--font-mono); font-size:0.85rem; color: var(--text-faint);
  margin-bottom:1.6rem; padding-bottom:0.8rem; border-bottom:1px solid var(--border);
}
.timeline li{
  position:relative; padding:0 0 1.9rem 1.6rem; border-left:1px solid var(--border);
}
.timeline li:last-child{ padding-bottom:0; }
.timeline li::before{
  content:''; position:absolute; left:-5px; top:0.35rem; z-index:1;
  width:9px; height:9px; border-radius:50%; background: var(--gold); color: var(--gold);
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline li::after{
  content:''; position:absolute; left:-5px; top:0.35rem;
  width:9px; height:9px; border-radius:50%; color: var(--gold);
  animation: pulseDot 2.6s ease-out infinite;
}
.timeline li:first-child::before, .timeline li:first-child::after{ background: var(--emerald); color: var(--emerald); }
.timeline li h3{ transition: color 0.2s ease; }
.timeline li:hover h3{ color: var(--gold); }
.timeline-date{ font-family: var(--font-mono); font-size:0.78rem; color: var(--emerald); }
.timeline li h3{ font-size:1.1rem; font-weight:600; margin:0.35rem 0 0.2rem; }
.timeline-org{ color: var(--text-muted); font-size:0.9rem; margin-bottom:0.35rem; }
.timeline li p:not(.timeline-org){ color: var(--text-muted); font-size:0.9rem; max-width:42ch; }

/* ============================================================
   PROJECTS
   ============================================================ */
.featured-grid{ display:grid; grid-template-columns:1fr 1fr; gap:1.6rem; margin-bottom:3rem; }
.feature-card{
  position:relative; overflow:hidden;
  background: var(--surface); border:1px solid var(--border); border-radius:16px;
  padding:2rem; display:flex; flex-direction:column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.feature-card::before{
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
}
.feature-card:hover{ transform: translateY(-4px); }
.feature-card.accent-gold::before{ background: linear-gradient(90deg, var(--gold), transparent); }
.feature-card.accent-gold:hover{ border-color: rgba(242,169,59,0.4); box-shadow: 0 20px 45px -20px rgba(242,169,59,0.25); }
.feature-card.accent-sapphire::before{ background: linear-gradient(90deg, var(--sapphire), transparent); }
.feature-card.accent-sapphire:hover{ border-color: rgba(91,141,239,0.4); box-shadow: 0 20px 45px -20px rgba(91,141,239,0.25); }
.feature-head{ margin-bottom:1.1rem; }
.status-chip{
  display:inline-flex; align-items:center; gap:0.5rem;
  font-family: var(--font-mono); font-size:0.75rem; color: var(--text-muted);
  border:1px solid var(--border); padding:0.35rem 0.7rem; border-radius:999px;
}
.feature-card h3{ font-family: var(--font-display); font-size:1.5rem; font-weight:500; margin-bottom:0.7rem; }
.feature-card > p{ color: var(--text-muted); margin-bottom:1.2rem; }
.feature-points{ margin-bottom:1.4rem; }
.feature-points li{
  position:relative; padding-left:1.3rem; margin-bottom:0.5rem; font-size:0.9rem; color: var(--text-muted);
}
.feature-points li::before{ content:'—'; position:absolute; left:0; color: var(--gold); }
.tag-row{ display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:auto; }
.tag{ font-size:0.78rem; font-family: var(--font-mono); padding:0.3rem 0.6rem; border-radius:6px; }
.tag-gold{ background: var(--gold-soft); color: var(--gold); }
.tag-emerald{ background: var(--emerald-soft); color: var(--emerald); }
.tag-sapphire{ background: var(--sapphire-soft); color: var(--sapphire); }

.grid-divider{
  display:flex; align-items:center; gap:1rem; margin-bottom:2.2rem;
  font-family: var(--font-mono); font-size:0.8rem; color: var(--text-faint);
}
.grid-divider::before, .grid-divider::after{ content:''; flex:1; height:1px; background: var(--border); }

.projects-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:1.4rem; }
.project-card{
  position:relative; overflow:hidden;
  background: var(--surface); border:1px solid var(--border); border-radius:14px; padding:1.6rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card::before{ content:''; position:absolute; top:0; left:0; right:0; height:3px; opacity:0.85; }
.project-card:nth-child(1)::before{ background: var(--sapphire); }
.project-card:nth-child(2)::before{ background: var(--gold); }
.project-card:nth-child(3)::before{ background: var(--emerald); }
.project-card:nth-child(1):hover{ box-shadow: 0 20px 40px -22px rgba(91,141,239,0.3); }
.project-card:nth-child(2):hover{ box-shadow: 0 20px 40px -22px rgba(242,169,59,0.3); }
.project-card:nth-child(3):hover{ box-shadow: 0 20px 40px -22px rgba(47,217,166,0.3); }
.project-card:hover{ border-color:#3a4250; transform: translateY(-4px); }
.project-card h3{ font-size:1.05rem; font-weight:600; margin-bottom:0.6rem; }
.project-card p{ color: var(--text-muted); font-size:0.88rem; margin-bottom:1.1rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid{ display:grid; grid-template-columns:1fr 1fr; gap:3.5rem; align-items:start; }
.contact-lead{ color: var(--text-muted); margin-bottom:2rem; max-width:44ch; }
.contact-cards{ display:flex; flex-direction:column; gap:0.8rem; margin-bottom:1.8rem; }
.contact-card{
  display:flex; align-items:center; gap:1rem;
  background: var(--surface); border:1px solid var(--border); border-radius:10px; padding:1rem 1.2rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.contact-card:hover{ transform: translateX(4px); }
.contact-card i{ font-size:1.1rem; width:1.4rem; }
.contact-card:nth-child(1) i{ color: var(--sapphire); }
.contact-card:nth-child(2) i{ color: var(--emerald); }
.contact-card:nth-child(3) i{ color: var(--gold); }
.contact-card:nth-child(1):hover{ border-color: rgba(91,141,239,0.4); }
.contact-card:nth-child(2):hover{ border-color: rgba(47,217,166,0.4); }
.contact-card:nth-child(3):hover{ border-color: rgba(242,169,59,0.4); }
.contact-card div{ display:flex; flex-direction:column; }
.c-label{ font-family: var(--font-mono); font-size:0.72rem; color: var(--text-faint); }
.c-value{ font-size:0.95rem; }
.social-row{ display:flex; gap:0.8rem; }
.social-row a{
  width:2.6rem; height:2.6rem; border-radius:50%; border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  color: var(--text-muted);
}
.social-row a:hover{ transform: translateY(-3px) scale(1.06); }
.social-row a:nth-child(1):hover{ border-color:#5B8DEF; color:#5B8DEF; }
.social-row a:nth-child(2):hover{ border-color:#5B8DEF; color:#5B8DEF; }
.social-row a:nth-child(3):hover{ border-color:#F2EFE6; color:#F2EFE6; }
.social-row a:nth-child(4):hover{ border-color:#FF6B6B; color:#FF6B6B; }

.contact-actions{ display:flex; flex-direction:column; gap:0.9rem; }
.action-btn{
  display:flex; align-items:center; gap:1rem;
  background: var(--surface); border:1px solid var(--border); border-radius:12px; padding:1.1rem 1.3rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.action-btn:hover{ transform: translateY(-3px); }
.action-btn i{ font-size:1.3rem; width:1.8rem; }
.action-btn span{ display:flex; flex-direction:column; font-size:0.88rem; color: var(--text-muted); }
.action-btn span strong{ font-size:0.98rem; color: var(--text); font-weight:600; margin-bottom:0.1rem; }
.action-whatsapp:hover{ border-color: var(--emerald); box-shadow: 0 16px 34px -20px rgba(47,217,166,0.4); }
.action-whatsapp i{ color: var(--emerald); }
.action-email:hover{ border-color: var(--sapphire); box-shadow: 0 16px 34px -20px rgba(91,141,239,0.4); }
.action-email i{ color: var(--sapphire); }
.action-call:hover{ border-color: var(--gold); box-shadow: 0 16px 34px -20px rgba(242,169,59,0.4); }
.action-call i{ color: var(--gold); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer{ border-top:1px solid var(--border); padding:2rem 0; position:relative; z-index:2; }
.footer-inner{ display:flex; justify-content:space-between; align-items:center; }
.footer p{ color: var(--text-faint); font-size:0.85rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px){
  .hero-grid{ grid-template-columns:1fr; }
  .hero-side{ order:-1; max-width:360px; }
  .about-grid{ grid-template-columns:1fr; }
  .id-card{ position:static; }
  .journey-grid{ grid-template-columns:1fr; gap:2.6rem; }
  .featured-grid{ grid-template-columns:1fr; }
  .projects-grid{ grid-template-columns:1fr 1fr; }
  .contact-grid{ grid-template-columns:1fr; }
}

@media (max-width: 720px){
  .nav-links, .nav-cta{ display:none; }
  .nav-toggle{ display:flex; }
  .nav.open .nav-links{
    display:flex; flex-direction:column; position:absolute; top:100%; left:0; right:0;
    background: rgba(16,20,26,0.98); padding:1.5rem 2rem; gap:1.2rem; border-bottom:1px solid var(--border);
  }
  .nav.open .nav-cta{ display:none; }
  .skill-groups{ grid-template-columns:1fr; }
  .projects-grid{ grid-template-columns:1fr; }
  .section{ padding:4.5rem 0; }
}
