/* ============================================================
   David Vasquez — Web & App Development
   Dark engineering aesthetic. Single accent: electric blue.
   No violet, no emoji, no gradient-text spam. Asymmetric hero.
   ============================================================ */

:root {
  --bg: #0a0c10;          /* off-black, warm-neutral */
  --bg-2: #111419;
  --surface: #14181f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eaed;
  --muted: #8b929e;
  --muted-2: #6b7280;
  --accent: #38bdf8;      /* sky / electric blue — the ONLY accent */
  --accent-ink: #06131c;
  --radius: 14px;
  --maxw: 1200px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

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

h1, h2, h3, .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);       /* solid base so cloud sits truly behind */
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
.nav-inner {
  position: relative;
  z-index: 3;                  /* content on top */
  max-width: var(--maxw);
  margin: 0 auto;
  height: 66px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- Flying nimbus cloud: behind the text, clearly visible ---- */
.nimbus-fly {
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  z-index: 1;                  /* behind nav content (z-index 3) */
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0.55;               /* visible but clearly a backdrop */
  transform: translateX(-180px);
  animation: nimbus-cross 9s linear infinite;
  will-change: transform;
}
.nimbus-fly img {
  display: block;
  height: 52px;
  width: auto;
}
@keyframes nimbus-cross {
  0%   { transform: translateX(-180px); }
  100% { transform: translateX(calc(100vw + 40px)); }
}
@media (prefers-reduced-motion: reduce) {
  .nimbus-fly { display: none; }
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.brand-name { font-size: 1rem; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.92rem; transition: color .18s; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  color: var(--accent-ink) !important;
  background: var(--accent);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-weight: 500;
}
.nav-cta:hover { filter: brightness(1.08); }

.lang-switch { display: flex; align-items: center; gap: 0.35rem; margin-left: 0.4rem; }
.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.15rem 0.1rem;
  transition: color .18s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active { color: var(--accent); }
.lang-sep { color: var(--muted-2); font-size: 0.8rem; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform .14s ease, filter .2s, border-color .2s, background .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--text); border: 1px solid var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- HERO (full-bleed neural background) ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100dvh - 66px);
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
/* veil keeps hero copy legible over the animated network */
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(10,12,16,0.62) 34%, rgba(10,12,16,0.12) 68%, transparent 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 34%);
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 38rem;
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .hero { padding-left: max(1.5rem, calc((100vw - var(--maxw)) / 2 + 1.5rem)); }
  .hero-copy { margin: 0; }
}
.hero-title {
  font-size: clamp(2.3rem, 4.6vw, 3.9rem);
  font-weight: 700;
  margin-bottom: 1.3rem;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 30rem;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-cred {
  display: none; /* deprecated: badges moved to #certs section */
}
/* Certifications section */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.cert-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  padding: 1.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, transform .2s;
}
.cert-badge:hover { border-color: var(--accent); transform: translateY(-3px); }
.cert-badge img { width: 120px; height: 120px; object-fit: contain; }
.cert-badge span { font-family: var(--font-display); font-size: 0.9rem; color: var(--text); font-weight: 500; }
/* badges inside About */
.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.3rem;
}
.about-badges img {
  width: 108px;
  height: 108px;
  object-fit: contain;
  transition: transform .2s;
}
.about-badges img:hover { transform: scale(1.06); }
.hero-meta {
  display: flex;
  gap: 2.2rem;
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.hero-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); margin-bottom: 0.3rem; }
.hero-meta dd { font-family: var(--font-display); font-size: 1rem; color: var(--text); }

/* ---------- SECTIONS ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
}
/* Reveal is PROGRESSIVE ENHANCEMENT: hidden state only applies once JS
   confirms it's running (html.js-reveal). Without JS, everything shows. */
.js-reveal .section {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-reveal .section.is-in { opacity: 1; transform: none; }
.section-head { margin-bottom: 3rem; max-width: 40rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: 0.7rem; }
.section-lead { color: var(--muted); }

/* ---------- SERVICES (2-col rows, not equal cards) ---------- */
.svc-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}
/* 5 services in a 2-col grid: last (odd) item spans full width, no empty cell */
.svc-list .svc:last-child:nth-child(odd) { grid-column: 1 / -1; }
.svc {
  display: flex;
  gap: 1.1rem;
  padding: 1.8rem 1.4rem;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.js-reveal .svc {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.js-reveal .svc.is-in { opacity: 1; transform: none; }
.svc:nth-child(odd) { border-right: 1px solid var(--line); }
.svc-icon {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.svc-icon svg { width: 22px; height: 22px; }
.svc h3 { font-size: 1.12rem; margin-bottom: 0.35rem; }
.svc p { color: var(--muted); font-size: 0.94rem; }

/* ---------- WORK (asymmetric grid) ---------- */
/* ---------- WORK (logo / name grid) ---------- */
.work-logos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.logo-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.6rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .2s, background .2s;
}
.js-reveal .logo-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease, border-color .2s, background .2s;
}
.js-reveal .logo-item.is-in { opacity: 1; transform: none; }
.logo-item:hover { border-color: var(--accent); background: #171c24; transform: translateY(-3px); }
.logo-mark {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  background: linear-gradient(150deg, rgba(56,189,248,0.14), rgba(56,189,248,0.02));
}
.logo-name { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; }
.logo-tag {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted-2);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.logo-tag-wip { color: var(--accent); border-color: rgba(56,189,248,0.4); }

/* ---------- ABOUT ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: start; }
.about-role { color: var(--accent); font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; margin-bottom: 1rem; }
.about-text h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: 1.1rem; }
.about-text p { color: var(--muted); margin-bottom: 1rem; max-width: 40ch; }
.muted-note { color: var(--muted-2); font-size: 0.88rem; }
.stack-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-2); margin-bottom: 0.9rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chips li {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

/* ---------- CONTACT ---------- */
.contact { text-align: left; }
.contact-inner {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3rem 2.4rem;
  background:
    radial-gradient(90% 120% at 90% 0%, rgba(56,189,248,0.08), transparent 60%),
    var(--bg-2);
}
.contact-inner h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-bottom: 0.6rem; }
.contact-actions { display: flex; gap: 0.9rem; margin-top: 1.8rem; flex-wrap: wrap; }

/* ---------- CLIENT MARQUEE ---------- */
.clients {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}
.clients-label {
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  margin-bottom: 1.6rem;
}
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  align-items: center;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.client-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0.8;
  transition: color .2s, opacity .2s;
}
.client-logo:hover { color: var(--text); opacity: 1; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
/* right-to-left variant for the projects banner */
.marquee-rtl { animation: marquee-rtl 34s linear infinite; }
@keyframes marquee-rtl {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
.marquee-work { padding: 1rem 0; }
/* color logo wall on dark background */
.marquee-white {
  background: transparent;
  border: none;
  padding: 1.5rem 0;
}
.marquee-white .marquee-track { gap: 4rem; align-items: center; }
.proj-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  flex: none;
  padding: 0 1rem;
}
.proj-logo img {
  height: 100px;
  max-width: 260px;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity .25s, transform .2s;
}
.proj-logo:hover img { opacity: 1; transform: scale(1.05); }
.proj-lv img { height: 150px; max-width: 380px; }

/* ---------- SECTION NEURAL BACKGROUND ---------- */
.section-neural { position: relative; overflow: hidden; }
.section-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.section-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(95% 85% at 50% 50%, rgba(10,12,16,0.5), rgba(10,12,16,0.86) 92%);
}
.section-inner { position: relative; z-index: 2; }

/* ---------- TECH STACK ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stack-col {
  padding: 1.6rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.stack-col-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.stack-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.stack-col li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}
.stack-col li img { flex: none; opacity: 0.92; object-fit: contain; }
.stack-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 0 7px; }

/* ---------- PROCESS ---------- */
.process { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.step {
  display: flex;
  gap: 1.4rem;
  padding: 1.8rem 0.2rem;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.step-no {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  flex: none;
  width: 2.4rem;
  padding-top: 0.15rem;
}
.step-head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.step-head h3 { font-size: 1.15rem; }
.step-time {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}
.step p { color: var(--muted); max-width: 60ch; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.3rem 0.2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  flex: none;
  transition: transform .2s;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--muted); padding: 0 0.2rem 1.4rem; max-width: 68ch; }

/* ---------- WHATSAPP BUTTON ---------- */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #25d366;
  color: #052e16;
}
.btn-whatsapp:hover { filter: brightness(1.06); }
.btn-whatsapp .wa-icon { flex: none; }

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-tagline { color: var(--text); font-family: var(--font-display); font-size: 0.95rem; }
.footer-wa {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #25d366;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
}
.footer-wa:hover { filter: brightness(1.1); }
.footer-copy {
  color: var(--muted-2);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-logo {
  height: 26px;
  width: auto;
  vertical-align: middle;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 900px) {
  .work-logos { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-links { gap: 1rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  .svc-list { grid-template-columns: 1fr; }
  .svc:nth-child(odd) { border-right: none; }
  .work-logos { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-meta { gap: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section, .svc, .logo-item { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; }
}
