:root {
  --navy: #0C1A2E;
  --blue: #185FA5;
  --mid: #378ADD;
  --light: #85B7EB;
  --pale: #B5D4F4;
  --cream: #F1EFE8;
  --gray: #2C2C2A;
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Exo 2', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--navy);
  color: var(--cream);
  font-family: var(--sans);
  overflow-x: hidden;
}

/* ── CIRCUIT BACKGROUND ── */
.circuit-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.07;
  background-image:
    linear-gradient(var(--mid) 1px, transparent 1px),
    linear-gradient(90deg, var(--mid) 1px, transparent 1px);
  background-size: 60px 60px;
}
.circuit-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 30px 30px, var(--light) 1.5px, transparent 1.5px);
  background-size: 60px 60px;
  opacity: 0.5;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 5%;
  background: rgba(12,26,46,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(55,138,221,0.15);
}
.nav-logo {
  font-family: var(--mono); font-size: 1.5rem; color: white; letter-spacing: 4px;
  display: flex; align-items: center; gap: 10px;
}
.logo-box {
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--blue); border-radius: 6px; padding: 4px 8px; line-height: 1.1;
}
.logo-box .top { color: white; font-size: 0.85rem; }
.logo-box .bot { color: var(--light); font-size: 0.85rem; }
.logo-divider { width: 100%; height: 1px; background: var(--mid); opacity: 0.5; margin: 1px 0; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-family: var(--mono); font-size: 0.78rem; color: var(--pale);
  text-decoration: none; letter-spacing: 2px; transition: color 0.2s;
}
.nav-links a:hover { color: white; }
.nav-cta {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 2px;
  padding: 8px 20px; border: 1px solid var(--mid); color: var(--light);
  background: transparent; border-radius: 4px; cursor: pointer; transition: all 0.2s;
  text-decoration: none;
}
.nav-cta:hover { background: var(--blue); color: white; border-color: var(--blue); }

/* ── SECTIONS ── */
section { position: relative; z-index: 1; }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 8% 0 8%;
  padding-top: 90px;
  overflow: hidden;
}
.hero-eyebrow {
  font-family: var(--mono); font-size: 0.72rem; color: var(--mid);
  letter-spacing: 4px; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 10px;
  animation: fadeUp 0.8s ease both;
}
.hero-eyebrow::before {
  content: ''; display: block; width: 30px; height: 1px; background: var(--mid);
}
.hero-h1 {
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  margin-bottom: 1rem;
  animation: fadeUp 0.8s 0.1s ease both;
}
.hero-h1 .d { color: white; }
.hero-h1 .i1 { color: var(--mid); }
.hero-h1 .f { color: white; }
.hero-h1 .i2 { color: var(--light); }
.hero-sub {
  font-family: var(--mono); font-size: 0.85rem; color: var(--light);
  letter-spacing: 3px; margin-bottom: 2rem;
  animation: fadeUp 0.8s 0.2s ease both;
}
.hero-desc {
  max-width: 520px; font-size: 1.1rem; font-weight: 300;
  color: rgba(241,239,232,0.7); line-height: 1.8; margin-bottom: 3rem;
  animation: fadeUp 0.8s 0.3s ease both;
}
.hero-btns {
  display: flex; gap: 1rem; flex-wrap: wrap;
  animation: fadeUp 0.8s 0.4s ease both;
}
.btn-primary {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 2px;
  padding: 14px 32px; background: var(--blue); color: white;
  border: none; border-radius: 4px; cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-primary:hover { background: var(--mid); transform: translateY(-2px); }
.btn-ghost {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 2px;
  padding: 14px 32px; background: transparent; color: var(--light);
  border: 1px solid rgba(133,183,235,0.4); border-radius: 4px; cursor: pointer;
  transition: all 0.2s; text-decoration: none; display: inline-block;
}
.btn-ghost:hover { border-color: var(--light); color: white; transform: translateY(-2px); }
.hero-tech-stack {
  position: absolute; right: 8%; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px;
  animation: fadeLeft 0.8s 0.5s ease both;
}
.tech-pill {
  font-family: var(--mono); font-size: 0.7rem; color: var(--pale);
  padding: 6px 14px; border: 1px solid rgba(55,138,221,0.2);
  border-radius: 20px; letter-spacing: 1px; background: rgba(24,95,165,0.1);
  text-align: center;
}
.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: fadeUp 1s 0.8s ease both;
}
.scroll-line {
  width: 1px; height: 40px; background: linear-gradient(to bottom, var(--mid), transparent);
  animation: scrollPulse 1.5s ease-in-out infinite;
}
.scroll-txt { font-family: var(--mono); font-size: 0.6rem; color: var(--mid); letter-spacing: 2px; }

/* ── SERVICES ── */
#servicios {
  padding: 7rem 8%;
  background: linear-gradient(180deg, transparent 0%, rgba(24,95,165,0.04) 100%);
}
.section-header { margin-bottom: 4rem; }
.section-tag {
  font-family: var(--mono); font-size: 0.7rem; color: var(--mid);
  letter-spacing: 4px; margin-bottom: 1rem; display: flex; align-items: center; gap: 10px;
}
.section-tag::before { content: '//'; color: var(--light); }
.section-title {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
  color: white; line-height: 1.1;
}
.section-title span { color: var(--mid); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5px;
  background: rgba(55,138,221,0.1);
  border: 1px solid rgba(55,138,221,0.15);
  border-radius: 12px; overflow: hidden;
}
.service-card {
  background: var(--navy); padding: 2.5rem 2rem;
  transition: background 0.3s;
  position: relative; overflow: hidden;
}
.service-card:hover { background: rgba(24,95,165,0.15); }
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, var(--blue), var(--mid));
  transform: scaleX(0); transition: transform 0.3s; transform-origin: left;
}
.service-card:hover::before { transform: scaleX(1); }
.svc-num {
  font-family: var(--mono); font-size: 0.65rem; color: var(--mid);
  letter-spacing: 2px; margin-bottom: 1rem;
}
.svc-icon {
  width: 44px; height: 44px; border-radius: 8px;
  background: rgba(24,95,165,0.2); border: 1px solid rgba(55,138,221,0.3);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2rem;
}
.svc-icon svg { width: 22px; height: 22px; stroke: var(--light); fill: none; stroke-width: 1.5; }
.svc-title {
  font-size: 1.15rem; font-weight: 700; color: white; margin-bottom: 0.75rem;
}
.svc-desc { font-size: 0.9rem; font-weight: 300; color: rgba(241,239,232,0.6); line-height: 1.7; }
.svc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1.2rem; }
.svc-tag {
  font-family: var(--mono); font-size: 0.62rem; color: var(--mid);
  padding: 3px 8px; border: 1px solid rgba(55,138,221,0.25); border-radius: 3px;
  letter-spacing: 1px;
}

/* ── PORTFOLIO ── */
#portafolio { padding: 7rem 8%; }
.portfolio-filter {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 3rem;
}
.filter-btn {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 2px;
  padding: 7px 16px; border-radius: 3px; cursor: pointer; transition: all 0.2s;
  border: 1px solid rgba(55,138,221,0.2); color: var(--pale); background: transparent;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--blue); color: white; border-color: var(--blue);
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card {
  border: 1px solid rgba(55,138,221,0.15);
  border-radius: 10px; overflow: hidden; background: rgba(24,95,165,0.05);
  transition: all 0.3s; cursor: pointer;
}
.project-card:hover {
  border-color: var(--mid); transform: translateY(-4px);
  background: rgba(24,95,165,0.12);
}
.project-thumb {
  height: 160px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(12,26,46,0.9), rgba(24,95,165,0.3));
  display: flex; align-items: center; justify-content: center;
}
.project-type-badge {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(55,138,221,0.2); color: var(--light);
  border: 1px solid rgba(55,138,221,0.3);
}
.project-mock {
  width: 80%; height: 70%; border-radius: 6px;
  background: rgba(12,26,46,0.8); border: 1px solid rgba(55,138,221,0.2);
  display: flex; flex-direction: column; overflow: hidden;
}
.mock-bar {
  height: 22px; background: rgba(24,95,165,0.3); border-bottom: 1px solid rgba(55,138,221,0.2);
  display: flex; align-items: center; padding: 0 8px; gap: 5px;
}
.mock-dot { width: 6px; height: 6px; border-radius: 50%; }
.mock-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.mock-line {
  height: 6px; border-radius: 2px; background: rgba(55,138,221,0.2);
}
.project-info { padding: 1.25rem 1.5rem; }
.project-name { font-size: 1rem; font-weight: 700; color: white; margin-bottom: 0.4rem; }
.project-desc { font-size: 0.85rem; font-weight: 300; color: rgba(241,239,232,0.6); line-height: 1.6; margin-bottom: 1rem; }
.project-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-tag {
  font-family: var(--mono); font-size: 0.6rem; color: var(--mid);
  padding: 2px 8px; border: 1px solid rgba(55,138,221,0.2); border-radius: 2px;
}

/* ── ABOUT ── */
#sobre {
  padding: 7rem 8%;
  background: linear-gradient(180deg, transparent, rgba(24,95,165,0.05), transparent);
}
.about-grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 5rem; align-items: center;
}
.about-visual {
  position: relative; display: flex; justify-content: center;
}
.about-avatar {
  width: 260px; height: 260px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(24,95,165,0.3), rgba(55,138,221,0.1));
  border: 2px solid rgba(55,138,221,0.3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 4rem; color: var(--light);
  position: relative;
}
.about-avatar::before {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(55,138,221,0.12);
}
.about-avatar::after {
  content: ''; position: absolute; inset: -18px; border-radius: 50%;
  border: 1px dashed rgba(55,138,221,0.08);
  animation: spin 20s linear infinite;
}
.about-badge {
  position: absolute; right: -10px; bottom: 40px;
  background: var(--blue); border-radius: 8px; padding: 10px 14px;
  font-family: var(--mono); font-size: 0.7rem; color: white; letter-spacing: 1px;
  border: 1px solid rgba(133,183,235,0.2);
}
.about-badge span { display: block; color: var(--light); font-size: 1.2rem; font-weight: 700; }
.about-text { }
.about-family {
  display: flex; flex-direction: column; gap: 8px; margin: 2rem 0;
}
.family-member {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.75rem;
}
.fm-initial {
  width: 32px; height: 32px; border-radius: 6px; background: rgba(24,95,165,0.2);
  border: 1px solid rgba(55,138,221,0.25); display: flex; align-items: center;
  justify-content: center; color: var(--light); font-size: 0.9rem; font-weight: 700;
  flex-shrink: 0;
}
.fm-name { color: var(--pale); }
.fm-role { color: rgba(241,239,232,0.4); margin-left: auto; font-size: 0.65rem; }
.skills-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem;
}
.skill-chip {
  font-family: var(--mono); font-size: 0.68rem; color: var(--pale);
  padding: 5px 12px; border: 1px solid rgba(55,138,221,0.2); border-radius: 3px;
  letter-spacing: 1px;
}

/* ── CONTACT ── */
#contacto { padding: 7rem 8% 5rem; }
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 5rem; align-items: start;
}
.contact-info { }
.contact-links { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.contact-link {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.8rem; color: var(--pale);
  text-decoration: none; padding: 12px 16px;
  border: 1px solid rgba(55,138,221,0.15); border-radius: 6px;
  transition: all 0.2s; letter-spacing: 1px;
}
.contact-link:hover { border-color: var(--mid); color: white; background: rgba(24,95,165,0.1); }
.contact-link svg { width: 16px; height: 16px; stroke: var(--light); fill: none; stroke-width: 2; flex-shrink: 0; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-family: var(--mono); font-size: 0.65rem; color: var(--mid); letter-spacing: 2px; }
.form-input, .form-textarea {
  background: rgba(24,95,165,0.06); border: 1px solid rgba(55,138,221,0.2);
  border-radius: 6px; padding: 12px 16px; color: var(--cream);
  font-family: var(--sans); font-size: 0.9rem; font-weight: 300;
  transition: border-color 0.2s; outline: none; resize: none;
  width: 100%;
}
.form-input:focus, .form-textarea:focus { border-color: var(--mid); }
.form-input::placeholder, .form-textarea::placeholder { color: rgba(241,239,232,0.25); }
.form-textarea { min-height: 130px; }
.form-submit {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 3px;
  padding: 16px 32px; background: var(--blue); color: white;
  border: none; border-radius: 6px; cursor: pointer; transition: all 0.2s;
  align-self: flex-start;
}
.form-submit:hover { background: var(--mid); transform: translateY(-2px); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid rgba(55,138,221,0.12);
  padding: 2.5rem 8%;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-logo { font-family: var(--mono); font-size: 1.1rem; color: var(--light); letter-spacing: 4px; }
.footer-copy { font-family: var(--mono); font-size: 0.65rem; color: rgba(241,239,232,0.3); letter-spacing: 1px; }
.footer-family {
  font-family: var(--mono); font-size: 0.65rem; color: rgba(241,239,232,0.3); letter-spacing: 1px;
  text-align: right;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.4; transform: scaleY(0.6); }
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── WHATSAPP FLOTANTE ── */
.wa-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55); }
.wa-float svg { width: 30px; height: 30px; fill: white; }
.wa-float::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: #25D366; opacity: 0.5; z-index: -1;
  animation: waPulse 2s ease-out infinite;
}
.wa-tooltip {
  position: fixed; bottom: 36px; right: 94px; z-index: 200;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 400;
  background: white; color: var(--navy);
  padding: 8px 14px; border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none;
  transform: translateX(8px);
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.wa-float:hover + .wa-tooltip, .wa-tooltip.show { opacity: 1; transform: translateX(0); }
@keyframes waPulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── RESPONSIVE ── */
@media(max-width:768px) {
  .hero-tech-stack { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .about-avatar { width: 200px; height: 200px; font-size: 3rem; }
}

/* ── CURSOR BLINK ── */
.cursor::after {
  content: '_'; animation: blink 1s step-start infinite; color: var(--mid);
}

/* ── Compartido por todas las páginas (header/footer vía PHP) ── */
a.nav-logo { text-decoration: none; }
.nav-links a.active { color: white; border-bottom: 1px solid var(--mid); padding-bottom: 4px; }
:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
