/* Portafolio · Emilio Monzón — estilos
   Paleta del proyecto Redes Sociales: azul noche con acento cian → violeta.
   El tema oscuro es el principal; el claro es opcional. */

:root {
  --bg: #070B16;
  --surface: #11151F;
  --tint: #151923;
  --ink: #EEF1F8;
  --muted: #B8C0D9;
  --line: #262B3A;
  --pine: #28C8E8;
  --pine-ink: #070B16;
  --violet: #8060F0;
  --cta-bg: linear-gradient(90deg, #28C8E8, #8060F0);
  --amber: #28C8E8;
  --amber-ink: #070B16;
  --band: #101427;
  --band-ink: #EEF1F8;
  --band-muted: #B8C0D9;
  --live: #28C8E8;
  --glow: radial-gradient(60% 50% at 88% 0%, rgba(128, 96, 240, .22), transparent 70%), radial-gradient(50% 45% at 0% 100%, rgba(40, 200, 232, .12), transparent 70%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px -16px rgba(0, 0, 0, .75);
  --radius: 14px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F5F7FB; --surface: #FFFFFF; --tint: #E9EDF6; --ink: #0B1020; --muted: #4A5370; --line: #D6DCEA;
  --pine: #0A7FA0; --pine-ink: #FFFFFF; --violet: #6A4BE0; --amber: #0A7FA0; --amber-ink: #070B16;
  --band: #0B1020; --band-ink: #EEF1F8; --band-muted: #B8C0D9; --live: #0A7FA0;
  --glow: radial-gradient(60% 50% at 88% 0%, rgba(128, 96, 240, .10), transparent 70%), radial-gradient(50% 45% at 0% 100%, rgba(40, 200, 232, .08), transparent 70%);
  --shadow: 0 1px 2px rgba(11, 16, 32, .06), 0 14px 32px -14px rgba(11, 16, 32, .25);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--glow); pointer-events: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { width: 1.15em; height: 1.15em; flex: none; }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }
#root { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 1.3em; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 0 1.05em; font-size: .95rem; }
.btn-lg { min-height: 56px; padding: 0 1.6em; font-size: 1.08rem; }
.btn-cta { background: var(--cta-bg); color: var(--amber-ink); }
.btn-cta:hover { filter: brightness(1.08); }
.btn-cta:focus-visible { outline-color: var(--amber); }
.btn-primary { background: var(--pine); color: var(--pine-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
  transition: border-color .18s ease;
}
.icon-btn:hover { border-color: var(--ink); }
.lang-code { font: 600 .8rem/1 var(--font-head); letter-spacing: .04em; }
.text-link { color: var(--pine); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.text-link:hover { text-decoration-thickness: 2.5px; }

/* ---------- cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--cta-bg); color: var(--pine-ink); font: 700 .9rem/1 var(--font-head); letter-spacing: .02em; }
.brand-name { font: 600 1.08rem/1 var(--font-head); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav ul { display: flex; gap: 2px; }
.nav ul a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; }
.nav ul a:hover { color: var(--ink); }
.nav ul a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--pine); border-radius: 0; }
.nav-cta[aria-current="page"], .mobile-cta[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--amber); }
.header-tools, .desk-tools, .nav-tools { display: flex; align-items: center; gap: 8px; }
.nav-tools, .mobile-cta, .menu-btn { display: none; }

@media (max-width: 980px) {
  .menu-btn, .mobile-cta { display: inline-flex; }
  .desk-tools { display: none; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; z-index: 29; flex-direction: column; align-items: stretch; gap: 12px;
    padding: 12px var(--gutter) 24px; background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -20px rgba(0, 0, 0, .35);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .menu-open .nav { visibility: visible; opacity: 1; transform: none; transition: opacity .18s ease, transform .18s ease; }
  .nav ul { flex-direction: column; }
  .nav ul a { padding: 14px 4px; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav ul a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--pine); padding-left: 14px; }
  .nav-cta { display: none; }
  .nav-tools { display: flex; padding-top: 4px; }
}
@media (max-width: 359px) { .brand-name { display: none; } }

/* ---------- inicio ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-block: clamp(36px, 6vw, 80px) clamp(40px, 6vw, 88px); }
.hero-who { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; line-height: 1.3; }
.hero-who strong { display: block; font-weight: 600; }
.hero-who span span { color: var(--muted); font-size: .95rem; }
.avatar { width: 48px; height: 48px; border-radius: 999px; overflow: hidden; background: var(--tint); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 4rem); line-height: 1.04; letter-spacing: -.028em; max-width: 15ch; }
.lead { font-size: clamp(1.08rem, 1.4vw, 1.22rem); color: var(--muted); max-width: 52ch; margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* collage de capturas reales: el elemento memorable */
.collage { position: relative; aspect-ratio: 1 / .9; }
.collage .device { position: absolute; margin: 0; }
.collage .c-wide { top: 4%; left: 0; width: 92%; }
.collage .c-tall { width: 29%; }
.collage .c-tall-1 { right: 0; bottom: 0; }
.collage .c-tall-2 { right: 25%; bottom: 0; z-index: 2; }
.collage:has(.c-tall-2) .c-tall-1 { bottom: 7%; }
.collage.phones { aspect-ratio: 1 / .84; }
.collage.phones .device { width: 33%; top: 9%; }
.collage.phones .c-left { left: 2%; transform: rotate(-4deg); }
.collage.phones .c-right { right: 2%; transform: rotate(4deg); }
.collage.phones .c-mid { left: 31.5%; width: 37%; top: 0; z-index: 2; }
.collage.phones .c-mid:only-child { left: 31.5%; }
.ready .collage .device { animation: settle .9s cubic-bezier(.2, .8, .2, 1) both; }
.ready .collage .c-tall-1 { animation-delay: .12s; }
.ready .collage .c-tall-2 { animation-delay: .24s; }
.ready .collage.phones .c-left { animation-name: settle-left; animation-delay: .12s; }
.ready .collage.phones .c-right { animation-name: settle-right; animation-delay: .24s; }
@keyframes settle-left { from { opacity: 0; transform: translateY(28px) rotate(-4deg); } to { opacity: 1; transform: rotate(-4deg); } }
@keyframes settle-right { from { opacity: 0; transform: translateY(28px) rotate(4deg); } to { opacity: 1; transform: rotate(4deg); } }
@keyframes settle { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* marcos */
.device { margin: 0; position: relative; }
.browser { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.browser-bar i { width: 9px; height: 9px; border-radius: 99px; background: var(--line); }
.browser-bar span { margin-left: 10px; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--tint); padding: 3px 12px; border-radius: 99px; max-width: 70%; }
.browser-screen { position: relative; aspect-ratio: 1 / var(--r, .625); background: var(--tint); overflow: hidden; }
.browser-screen img, .phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.phone { padding: 7px; background: #111814; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.phone-screen { position: relative; aspect-ratio: 9 / 19; border-radius: 20px; overflow: hidden; background: var(--tint); }
.shot-initials { position: absolute; inset: 0; display: grid; place-items: center; font: 700 2rem/1 var(--font-head); color: var(--muted); }

.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 22%, transparent); flex: none; }

/* bloques */
.block { padding-block: clamp(56px, 8vw, 104px) 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.block-title { font-size: clamp(1.6rem, 2.6vw, 2.25rem); letter-spacing: -.02em; max-width: 24ch; }
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: 36px; }
.services li { border-top: 2px solid; border-image: var(--cta-bg) 1; padding-top: 22px; }
.services h3 { font-size: 1.28rem; margin-bottom: 10px; }
.services p { color: var(--muted); }

.process { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); margin-top: 36px; counter-reset: step; }
.process li { counter-increment: step; position: relative; padding-top: 58px; }
.process li::before { content: counter(step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 99px; background: var(--pine); color: var(--pine-ink); font: 600 1rem/1 var(--font-head); }
.process li:not(:last-child)::after { content: ""; position: absolute; top: 20px; left: 52px; right: -12px; height: 1.5px; background: var(--line); }
.process h3 { font-size: 1.18rem; margin-bottom: 8px; }
.process p { color: var(--muted); font-size: .98rem; }

/* franja de llamada a la acción */
.cta-band { background: radial-gradient(70% 120% at 100% 0%, rgba(128, 96, 240, .28), transparent 70%), var(--band); border-block: 1px solid var(--line); color: var(--band-ink); margin-top: clamp(64px, 9vw, 120px); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px 48px; flex-wrap: wrap; padding-block: clamp(44px, 6vw, 72px); }
.cta-band h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.02em; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* pie: solo redes */
.site-footer { border-top: 1px solid var(--line); }
.cta-band + .site-footer { border-top: 0; }
.page-inicio + .site-footer { margin-top: clamp(64px, 9vw, 120px); }
.footer-row { display: flex; justify-content: center; padding-block: 28px; }
.socials { display: flex; gap: 10px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); }
.socials a:hover { border-color: var(--ink); }

/* ---------- páginas internas ---------- */
.page-head { padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); letter-spacing: -.03em; line-height: 1.02; }

/* sobre mí */
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.about-text { display: grid; gap: 18px; font-size: 1.12rem; max-width: 62ch; }
.about-text p:first-child { font-size: clamp(1.22rem, 1.8vw, 1.42rem); line-height: 1.5; color: var(--ink); }
.about-text p + p { color: var(--muted); }
.about-photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--tint); aspect-ratio: 4 / 5; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.traits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 28px; }
.traits li { display: flex; gap: 12px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 1.08rem; }
.traits svg { color: var(--pine); margin-top: 4px; }
.traits small { display: block; color: var(--muted); font-size: .95rem; }

/* proyectos */
.cases { display: grid; gap: clamp(56px, 8vw, 104px); }
.case { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; scroll-margin-top: 96px; }
.case.flip .case-media { order: 2; }
.case-media { background: var(--tint); border-radius: calc(var(--radius) + 6px); padding: clamp(20px, 4vw, 48px); display: grid; place-items: center; }
.case-media .phone { width: min(260px, 62%); }
.case-media .browser { width: 100%; }
.case-live { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--live); font-size: .95rem; }
.case-live > span { white-space: nowrap; }
.case h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); letter-spacing: -.025em; margin-top: 14px; }
.case-desc { color: var(--muted); font-size: 1.1rem; margin-top: 14px; max-width: 52ch; }
.case-label { font: 600 .95rem/1 var(--font-body); color: var(--ink); margin-top: 26px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags li { padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .92rem; }
.tags-lg li { padding: 10px 16px; font-size: 1rem; }
.case-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* habilidades */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 80px); }
.skill-list { margin-top: 20px; }
.skill { padding: 16px 0; border-bottom: 1px solid var(--line); }
.skill-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.skill-top strong { font-size: 1.1rem; font-weight: 600; }
.skill-meta { display: flex; gap: 14px; color: var(--muted); font-size: .92rem; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.meter i { height: 6px; border-radius: 99px; background: var(--line); }
.meter i.on { background: var(--cta-bg); background-size: 400% 100%; }
.meter i.on:nth-child(2) { background-position: 33% 0; }
.meter i.on:nth-child(3) { background-position: 66% 0; }
.meter i.on:nth-child(4) { background-position: 100% 0; }
.skill-note { color: var(--muted); font-size: .95rem; margin-top: 8px; }

/* experiencia */
.timeline { border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 40px; padding: 0 0 48px 32px; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px; border-radius: 99px; background: var(--bg); border: 3px solid var(--pine); }
.tl-period { color: var(--muted); font-weight: 500; padding-top: 2px; }
.tl-body h2 { font-size: 1.4rem; }
.tl-body p { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.tl-body .tl-place { color: var(--pine); font-weight: 600; margin-top: 4px; }

/* contacto */
.contact { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 88px); align-items: start; padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 112px); }
.contact h1 { font-size: clamp(2.5rem, 5.6vw, 4.6rem); letter-spacing: -.03em; line-height: 1.02; max-width: 13ch; }
.contact-actions { margin-top: 36px; }
.email-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.contact-alt { width: 100%; color: var(--muted); font-size: .95rem; }
.email-link { display: inline-flex; align-items: center; gap: 10px; font: 600 clamp(1.1rem, 2vw, 1.35rem)/1.2 var(--font-head); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 6px; overflow-wrap: anywhere; }
.email-link:hover { text-decoration-color: currentColor; }
.contact-more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.contact-more a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 99px; text-decoration: none; font-weight: 500; }
.contact-more a:hover { border-color: var(--ink); }
.brief { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: clamp(24px, 3vw, 36px); }
.brief h2 { font-size: 1.2rem; }
.brief ol { counter-reset: q; margin-top: 14px; display: grid; gap: 12px; }
.brief li { counter-increment: q; display: flex; gap: 12px; }
.brief li::before { content: counter(q); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 99px; background: var(--tint); color: var(--pine); font: 600 .85rem/1 var(--font-head); margin-top: 1px; }

/* ---------- adaptable ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .collage { max-width: 620px; width: 100%; margin-inline: auto; }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .process li:nth-child(2n)::after { display: none; }
  .case, .case.flip { grid-template-columns: minmax(0, 1fr); }
  .case.flip .case-media { order: 0; }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .traits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .services, .skills, .about { grid-template-columns: minmax(0, 1fr); }
  .about-photo { max-width: 420px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); padding-left: 26px; }
  .cta-actions, .cta-actions .btn { width: 100%; }
}
@media (max-width: 520px) {
  .process { grid-template-columns: 1fr; }
  .process li::after { display: none; }
  .traits { grid-template-columns: 1fr; }
  .hero-actions .btn, .contact-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
