:root {
  --green: #0E7C66;
  --green-dark: #0A5E4D;
  --green-soft: #E2EFEB;
  --coral: #E8735A;
  --bg: #F3F6F5;
  --white: #FFFFFF;
  --ink: #13201E;
  --ink-2: #44534F;
  --line: #D6E0DD;

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --radius: 18px;
  --wrap: 1120px;
  --gutter: 20px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--green); }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.dot { color: var(--coral); }
.mono { font-family: var(--mono); font-weight: 400; letter-spacing: 0; }
.mono-inline { font-family: var(--mono); font-size: 0.9em; white-space: nowrap; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.logo {
  font-weight: 900; font-size: 1.75rem; letter-spacing: -0.03em;
  color: var(--green); text-decoration: none; line-height: 1;
}
.logo-sm { font-size: 1.4rem; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.98rem;
}
.nav a:not(.btn):hover { color: var(--green); }

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; margin-right: -8px;
    background: none; border: 0; cursor: pointer; border-radius: 10px;
  }
  .nav-toggle span { display: block; width: 22px; height: 2.5px; border-radius: 2px; background: var(--ink); transition: transform .25s; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .nav .btn { margin-top: 16px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font: inherit; font-weight: 800; font-size: 1.05rem;
  border-radius: 999px; text-decoration: none; cursor: pointer;
  background: var(--green); color: #fff; border: 2px solid var(--green);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 0.98rem; }
.btn-lg { min-height: 60px; padding: 0 34px; font-size: 1.15rem; }
.btn-wa { box-shadow: 0 8px 24px -10px rgba(14, 124, 102, .7); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); border-color: var(--ink-2); }

/* ---------- Hero ---------- */
.hero { background: var(--bg); padding: 56px 0 72px; overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.eyebrow {
  font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--green); margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.3rem, 8.5vw, 4rem); font-weight: 900; letter-spacing: -0.025em; max-width: 15ch; }
.lead { font-size: 1.15rem; color: var(--ink-2); margin-top: 20px; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

@media (max-width: 520px) {
  .hero-actions .btn { width: 100%; }
}

/* Ficha de entrega */
.handover {
  background: var(--white); border-radius: 22px; padding: 22px;
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -30px rgba(19, 32, 30, .28);
  border: 1px solid var(--line);
  max-width: 460px; width: 100%; justify-self: center;
}
.handover-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2);
  padding-bottom: 14px; border-bottom: 1px dashed var(--line);
}
.handover-head .mono { text-transform: none; letter-spacing: 0; font-size: 0.85rem; color: var(--green); }
.handover ul { list-style: none; margin: 0; padding: 0; }
.handover li {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k ok" "v ok";
  column-gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--bg);
}
.handover .k { grid-area: k; font-weight: 800; font-size: 0.98rem; }
.handover .v { grid-area: v; color: var(--ink-2); font-size: 0.9rem; overflow-wrap: anywhere; }
.handover .ok {
  grid-area: ok; align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 0.8rem; color: var(--green);
  background: var(--green-soft); padding: 6px 12px 6px 9px; border-radius: 999px; white-space: nowrap;
}
.handover .ok::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.8 7.2l2.1 2 4.3-4.4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
@media (max-width: 420px) {
  .handover li { grid-template-areas: "k ok" "v v"; row-gap: 4px; }
  .handover .ok { align-self: start; }
}
.handover-foot { margin-top: 16px; font-size: 0.92rem; color: var(--ink-2); }
.handover-foot strong { color: var(--ink); }

/* Animación de carga de la ficha */
.js .handover li { opacity: 0; transform: translateY(6px); }
.js .handover .ok { opacity: 0; transform: scale(.85); }
.js .handover.play li { animation: rowIn .45s ease forwards; }
.js .handover.play .ok { animation: okIn .35s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.js .handover.play li:nth-child(1), .js .handover.play li:nth-child(1) .ok { animation-delay: .15s; }
.js .handover.play li:nth-child(1) .ok { animation-delay: .55s; }
.js .handover.play li:nth-child(2) { animation-delay: .3s; }
.js .handover.play li:nth-child(2) .ok { animation-delay: .8s; }
.js .handover.play li:nth-child(3) { animation-delay: .45s; }
.js .handover.play li:nth-child(3) .ok { animation-delay: 1.05s; }
.js .handover.play li:nth-child(4) { animation-delay: .6s; }
.js .handover.play li:nth-child(4) .ok { animation-delay: 1.3s; }
@keyframes rowIn { to { opacity: 1; transform: none; } }
@keyframes okIn { to { opacity: 1; transform: none; } }

@media (min-width: 900px) {
  .hero { padding: 96px 0 112px; }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 64px; }
  .handover { justify-self: end; padding: 28px; transform: rotate(1.2deg); }
}

/* ---------- Secciones ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg); }
.section-head { margin-bottom: 40px; }
.section h2 { font-size: clamp(1.9rem, 5.5vw, 2.75rem); font-weight: 900; letter-spacing: -0.02em; max-width: 20ch; }
.section h3 { font-size: 1.25rem; }

@media (min-width: 900px) {
  .section { padding: 112px 0; }
  .section-head { margin-bottom: 56px; }
}

/* Servicios */
.cards { display: grid; gap: 16px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.card .icon {
  width: 44px; height: 44px; padding: 9px; margin-bottom: 18px;
  border-radius: 12px; background: var(--green-soft);
  fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.card p { color: var(--ink-2); margin-top: 10px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; gap: 20px; } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(4, 1fr); } }

/* Proyectos */
.project { display: grid; gap: 32px; align-items: center; }
.project + .project { margin-top: 72px; }
.project-meta { font-weight: 700; color: var(--ink-2); font-size: 0.95rem; }
.project h3 { font-size: clamp(1.7rem, 4.5vw, 2.2rem); font-weight: 900; margin: 4px 0 14px; }
.project-copy > p:not(.project-meta) { color: var(--ink-2); }
.tags { list-style: none; padding: 0; margin: 20px 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 0.85rem; font-weight: 700; color: var(--green-dark);
  background: var(--white); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px;
}
.link-out {
  font-weight: 800; text-decoration: none; display: inline-flex; gap: 8px; align-items: center;
  border-bottom: 2px solid var(--green-soft); padding-bottom: 2px; transition: border-color .2s, gap .2s;
}
.link-out:hover { border-color: var(--green); gap: 12px; }

@media (min-width: 900px) {
  .project { grid-template-columns: 1.35fr 1fr; gap: 64px; }
  .project-flip { grid-template-columns: 1fr 1.35fr; }
  .project-flip .devices { order: 2; }
  .project + .project { margin-top: 112px; }
}

/* Mockups */
.devices { position: relative; padding: 0 14% 9% 0; }
.project-flip .devices { padding: 0 0 9% 14%; }
.laptop-screen {
  background: var(--ink); padding: 2.2% 2.2% 0; border-radius: 14px 14px 0 0;
  box-shadow: 0 30px 50px -30px rgba(19, 32, 30, .45);
}
.laptop-screen img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top; border-radius: 3px 3px 0 0; }
.laptop-base {
  position: relative; height: 0; padding-bottom: 3.2%;
  width: 112%; margin-left: -6%;
  background: linear-gradient(#DCE4E1, #BCC8C4); border-radius: 2px 2px 14px 14px;
}
.laptop-base::before {
  content: ""; position: absolute; left: 42%; right: 42%; top: 0; height: 40%;
  background: #AEBBB7; border-radius: 0 0 8px 8px;
}
.phone {
  position: absolute; right: 0; bottom: 0; width: 25%;
  background: var(--ink); padding: 2.2%; border-radius: 22% / 10.5%;
  box-shadow: 0 24px 40px -18px rgba(19, 32, 30, .55);
}
.phone img { aspect-ratio: 9 / 19.5; width: 100%; object-fit: cover; object-position: top; border-radius: 18% / 8.3%; }
.project-flip .phone { right: auto; left: 0; }

@media (max-width: 899px) {
  .devices, .project-flip .devices { padding: 0 12% 10% 0; }
  .project-flip .phone { left: auto; right: 0; }
  .laptop-base { width: 108%; margin-left: -4%; }
}

/* Cómo trabajo */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: none; }
.steps li {
  position: relative; padding: 28px 26px; border-radius: var(--radius);
  background: var(--bg);
}
.step-n {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 900; font-size: 1.2rem; margin-bottom: 18px;
}
.steps p { color: var(--ink-2); margin-top: 10px; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .steps li:not(:last-child)::after {
    content: ""; position: absolute; top: 49px; left: calc(26px + 44px + 12px); right: -8px;
    border-top: 2px dashed var(--line);
  }
}

/* Sobre mí */
.about { display: grid; gap: 36px; align-items: center; }
.about-photo {
  width: 160px; aspect-ratio: 4 / 5; height: auto; object-fit: cover;
  border-radius: 24px; background: var(--green-soft);
  box-shadow: 0 20px 40px -24px rgba(19, 32, 30, .45);
}
.about-copy p:not(.eyebrow) { color: var(--ink-2); margin-top: 16px; max-width: 38em; }
.about-copy h2 { margin-bottom: 4px; }
@media (min-width: 900px) {
  .about { grid-template-columns: 220px 1fr; gap: 64px; }
  .about-photo { width: 220px; border-radius: 32px; }
}

/* Contacto */
.contact { text-align: center; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact h2 { font-size: clamp(2.3rem, 8vw, 3.6rem); max-width: none; }
.contact .lead { margin: 14px auto 32px; }
.contact-list {
  list-style: none; padding: 0; margin: 48px 0 0; width: 100%; max-width: 760px;
  display: grid; gap: 12px;
}
.contact-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px; border-radius: 14px; background: var(--bg); text-align: left;
}
.contact-list .k { font-weight: 800; color: var(--ink-2); font-size: 0.9rem; }
.contact-list a { font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; }
.contact-list a.mono { font-weight: 500; font-size: 1.02rem; }
@media (min-width: 760px) {
  .contact-list { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .contact-list li { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 32px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.site-footer p { color: var(--ink-2); font-size: 0.92rem; }

/* Botón flotante WhatsApp (solo celular, aparece al bajar) */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff;
  box-shadow: 0 10px 24px -8px rgba(14, 124, 102, .8);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.wa-float svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.wa-float.show { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 900px) { .wa-float { display: none; } }

/* Aparición al hacer scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .handover li, .js .handover .ok { opacity: 1; transform: none; }
}
