/* ─────────────────────────────────────────
   davidgamboa.dev — stylesheet
   ───────────────────────────────────────── */

/* ── Tokens ── */
:root {
  --bg:         #09090b;
  --surface:    #18181b;
  --border:     #27272a;
  --border-sub: #1c1c1f;
  --text:       #fafafa;
  --text-2:     #a1a1aa;
  --text-3:     #52525b;
  --accent:     #22d3ee;
  --accent-h:   #67e8f9;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Layout ── */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Scroll progress bar ── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ─────────────────────────────────────────
   NAV
   ───────────────────────────────────────── */
nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
nav.scrolled {
  background: rgba(9, 9, 11, 0.88);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fade-in 0.5s var(--ease-out) 0.2s forwards;
}
.nav-logo em { font-style: normal; color: var(--accent); }
.nav-links {
  display: flex;
  gap: 2.25rem;
  list-style: none;
  opacity: 0;
  animation: fade-in 0.5s var(--ease-out) 0.3s forwards;
}
.nav-links a {
  font-size: 0.8125rem;
  color: var(--text-3);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

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

/* Dot grid background */
.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, black 20%, transparent 80%);
  pointer-events: none;
}

/* Radial glow behind name */
.hero-glow {
  position: absolute;
  top: 30%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  width: 100%;
  padding-bottom: 6rem;
}

/* Staggered hero animations */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  opacity: 0;
  animation: slide-up 0.6s var(--ease-out) 0.4s forwards;
}
.hero-badge::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-name {
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-bottom: 1.25rem;
  color: var(--text);
  opacity: 0;
  animation: slide-up 0.7s var(--ease-out) 0.5s forwards;
}

.hero-role {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 1.5vw, 1.125rem);
  color: var(--text-2);
  margin-bottom: 1.5rem;
  min-height: 1.75rem;
  opacity: 0;
  animation: slide-up 0.7s var(--ease-out) 0.65s forwards;
}
.hero-role-prefix { color: var(--text-3); }
.hero-role-text { color: var(--accent); }
.cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.hero-sub {
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 2.75rem;
  opacity: 0;
  animation: slide-up 0.7s var(--ease-out) 0.8s forwards;
}

.hero-ctas {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: slide-up 0.7s var(--ease-out) 0.95s forwards;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  opacity: 0;
  animation: fade-in 0.8s var(--ease-out) 1.4s forwards;
}
.hero-scroll-hint span {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero-scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--border), transparent);
  animation: scroll-line 2s ease-in-out 2s infinite;
}

/* ─────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────── */
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.5rem;
  background: var(--accent);
  color: #09090b;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn-solid:hover {
  background: var(--accent-h);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
}
.btn-solid:active { transform: scale(0.98); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.5rem;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-outline:hover { color: var(--text); border-color: var(--text-3); }

/* ─────────────────────────────────────────
   SECTION SHARED
   ───────────────────────────────────────── */
section {
  border-top: 1px solid var(--border);
  padding: 7rem 0;
}

.sec-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 3.5rem;
}

h2 {
  font-size: clamp(1.875rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Scroll reveal — elements start invisible */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ─────────────────────────────────────────
   ABOUT
   ───────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 5fr 4fr;
  gap: 5rem;
  align-items: start;
}
.about-body p {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.125rem;
}
.about-body p:last-child { margin-bottom: 0; }

.about-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-value span { color: var(--accent); }
.stat-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
}

.stack-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
}
.chip {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3125rem 0.6875rem;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip-hl {
  color: var(--accent);
  border-color: rgba(34, 211, 238, 0.3);
  background: var(--accent-dim);
}
.chip-hl:hover { border-color: var(--accent); }

/* ─────────────────────────────────────────
   EXPERIENCE
   ───────────────────────────────────────── */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.exp-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.exp-item:last-child { border-bottom: 1px solid var(--border); }
.exp-meta { padding-top: 0.2rem; }
.exp-period {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.exp-company {
  font-size: 0.8125rem;
  color: var(--text-2);
  font-weight: 500;
}
.exp-location {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}
.exp-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.875rem;
  color: var(--text);
}
.exp-info ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.exp-info li {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
  padding-left: 1.25rem;
  position: relative;
}
.exp-info li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-3);
  font-size: 0.75rem;
}
.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 1.25rem;
}
.exp-tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border-sub);
  padding: 0.1875rem 0.5rem;
}

/* ─────────────────────────────────────────
   PROJECTS
   ───────────────────────────────────────── */
.proj-list { display: flex; flex-direction: column; }
.proj-item {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  cursor: default;
}
.proj-item:last-child { border-bottom: 1px solid var(--border); }

.proj-num {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-3);
  padding-top: 0.3rem;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.proj-item:hover .proj-num { color: var(--accent); }

.proj-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.proj-info h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
  transition: color 0.2s;
}
.proj-item:hover .proj-info h3 { color: var(--accent); }

.proj-info p {
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: 1rem;
  max-width: 560px;
}
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.proj-tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border-sub);
  padding: 0.1875rem 0.5rem;
  transition: color 0.2s, border-color 0.2s;
}
.proj-item:hover .proj-tag { color: var(--text-2); }

.proj-cta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding-top: 0.25rem;
  transition: color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.proj-cta:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   CONTACT
   ───────────────────────────────────────── */
#contact { text-align: center; }
#contact h2 { margin-bottom: 1rem; }

.contact-sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 380px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}
.contact-email {
  display: inline-block;
  font-size: clamp(1.125rem, 2.5vw, 1.625rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: 3rem;
}
.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  font-size: 0.8125rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.social-link:hover { color: var(--text-2); }

/* ─────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-copy, .footer-domain {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-3);
}

/* ─────────────────────────────────────────
   KEYFRAMES
   ───────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}
@keyframes scroll-line {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@keyframes count-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────── */
@media (max-width: 900px) {
  .exp-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .exp-meta {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-stats { gap: 1.5rem; }
  .nav-links { display: none; }
  section { padding: 5rem 0; }
  .proj-inner { flex-direction: column; gap: 1rem; }
  .proj-cta { align-self: flex-start; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 3rem; }
  .hero-ctas { flex-direction: column; }
  .btn-solid, .btn-outline { justify-content: center; }
  .hero-scroll-hint { display: none; }
}

/* ─────────────────────────────────────────
   BILINGUAL — language gating
   ───────────────────────────────────────── */
html.lang-es [lang="en"] { display: none !important; }
html.lang-en [lang="es"] { display: none !important; }

/* ─────────────────────────────────────────
   LANG TOGGLE BUTTON
   ───────────────────────────────────────── */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 1.875rem;
  padding: 0 0.625rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  opacity: 0;
  animation: fade-in 0.5s var(--ease-out) 0.3s forwards;
}
.lang-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─────────────────────────────────────────
   HAMBURGER BUTTON
   ───────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 2.25rem;
  height: 2.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  animation: fade-in 0.5s var(--ease-out) 0.3s forwards;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-2);
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
  transform-origin: center;
}
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* ─────────────────────────────────────────
   MOBILE MENU OVERLAY
   ───────────────────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 58px 0 0 0;
  background: rgba(9, 9, 11, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 90;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out);
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: static;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.mobile-link {
  display: block;
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 0.75rem 1rem;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}
.mobile-link:hover { color: var(--text); }

/* ─────────────────────────────────────────
   PROJECT ADDITIONS
   ───────────────────────────────────────── */

/* NDA badge — non-clickable lock label */
.proj-nda {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-3);
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  padding-top: 0.25rem;
  cursor: default;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  pointer-events: none;
  user-select: none;
}

/* WIP badge pill */
.proj-wip-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #eab308;
  font-family: var(--mono);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Project title row (title + WIP badge) */
.proj-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.proj-title-row h3 {
  margin-bottom: 0;
}

/* ─────────────────────────────────────────
   ACCESSIBILITY
   ───────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
  .lang-toggle { opacity: 1; animation: none; }
  .hamburger { opacity: 1; animation: none; }
}
