/* =========================================================================
   cv-gstark · styles.css
   Sistema visual del sitio: gramática de "página de producto Apple" sobre el
   branding de marca (paleta oscura, acento único #C8527C, tipografías de
   marca). Aire generoso, una idea por pantalla, tipografía gigante y scroll
   narrativo con reveals. Fuentes self-hosted (ADR-002); sin build (ADR-001).
   ========================================================================= */

/* ---- Fuentes de marca self-hosted (idénticas al sitio) ------------------ */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-serif-400.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/instrument-serif-italic-400.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("assets/fonts/dm-sans-300.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/dm-sans-400.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/dm-sans-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/jetbrains-mono-500.woff2") format("woff2"); }

/* ---- Tokens (mismos colores de marca; espaciado generoso tipo Apple) ---- */
:root {
  --ink: #111118;          /* fondo base */
  --ink-tint: #16151d;     /* alterna el ritmo de secciones (sigue siendo oscuro) */
  --plum: #3a3040;
  --mauve: #888096;        /* texto secundario / metadatos */
  --dusty: #e0b0bb;        /* apoyo cálido */
  --paper: #fafafa;        /* texto primario */
  --accent: #c8527c;       /* acento ÚNICO / firma */
  --hairline: rgba(255, 255, 255, 0.08);

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --container: 1080px;
  --pad: clamp(1.5rem, 1rem + 3vw, 2.5rem);
  --nav-h: 3.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-body); font-weight: 300; font-size: 1.05rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }

.skip-link {
  position: absolute; left: 0.5rem; top: -3.5rem; z-index: 100;
  padding: 0.6rem 1rem; background: var(--ink-tint); color: var(--paper);
  font-family: var(--font-mono); font-size: 0.85rem; border-radius: 8px; transition: top 0.2s ease;
}
.skip-link:focus { top: 0.5rem; }

/* ---- Navegación translúcida sticky (patrón de página de producto Apple) - */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner {
  max-width: var(--container); margin-inline: auto; padding-inline: var(--pad);
  min-height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500; color: var(--paper); }
/* Badge del logo oficial (nudo GS) como "app icon" redondeado. */
.nav__mark { width: 30px; height: 30px; border-radius: 8px; display: block; }
.nav__cursor { color: var(--accent); }
.nav__links { display: flex; align-items: center; gap: 1.75rem; }
.nav__links a { font-size: 0.9rem; color: color-mix(in srgb, var(--paper) 68%, transparent); transition: color 0.2s ease; }
.nav__links a:hover { color: var(--paper); }
.nav__cta { color: var(--accent) !important; }
.nav__toggle { display: none; font-family: var(--font-mono); font-size: 0.9rem; color: color-mix(in srgb, var(--paper) 80%, transparent); background: none; border: 0; padding: 0.25rem 0.5rem; cursor: pointer; }

/* ---- Botones estilo Apple (pill limpio) --------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.9rem; border-radius: 999px;
  font-family: var(--font-body); font-weight: 400; font-size: 1.02rem; color: var(--paper);
  border: 1px solid transparent; transition: background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }
.btn--plain { color: var(--accent); padding-inline: 0.5rem; }
.btn--plain:hover { opacity: 0.7; }

/* ---- Cursor de firma que parpadea --------------------------------------- */
.blink { animation: blink 1.15s steps(1, end) infinite; }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

/* ---- Entrada del hero al cargar (escalonada). Los CTAs principales NUNCA
       dependen del scroll: el hero completo debe verse desde el primer paint. */
@media (prefers-reduced-motion: no-preference) {
  .enter { opacity: 0; transform: translateY(24px); animation: enter 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
  .enter--1 { animation-delay: 0.05s; }
  .enter--2 { animation-delay: 0.15s; }
  .enter--3 { animation-delay: 0.35s; }
  .enter--4 { animation-delay: 0.5s; }
  .enter--5 { animation-delay: 0.65s; }
}
@keyframes enter { to { opacity: 1; transform: none; } }

/* ---- HERO: pantalla completa, centrado, aire máximo --------------------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--nav-h) + 4rem) var(--pad) 6rem;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 45% at 50% 32%, rgba(200, 82, 124, 0.12), transparent 70%);
}
.hero__eyebrow { font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--mauve); margin-bottom: 2rem; }
.hero__name { font-family: var(--font-display); font-weight: 400; font-size: clamp(4rem, 13vw, 9.5rem); line-height: 0.9; letter-spacing: -0.02em; }
.hero__name em { font-style: italic; }
.hero__handle { margin-top: 1.75rem; font-family: var(--font-mono); font-size: clamp(1.1rem, 2.5vw, 1.5rem); color: var(--accent); }
.hero__lead { margin-top: 2.25rem; max-width: 40rem; font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.5; color: color-mix(in srgb, var(--paper) 82%, transparent); text-wrap: balance; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.75rem; align-items: center; }
.hero__cta--center { justify-content: center; }
.hero__scroll { position: absolute; bottom: 2.25rem; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent); border-radius: 999px; display: flex; justify-content: center; }
.hero__scroll-dot { width: 4px; height: 8px; margin-top: 8px; border-radius: 999px; background: var(--accent); animation: scrolldot 1.8s ease-in-out infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(-4px); } 40% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(10px); } }

/* ---- STAGE: cada sección es un "momento" con mucho aire ----------------- */
.stage { padding: clamp(6rem, 4rem + 10vw, 11rem) var(--pad); }
.stage--tint { background: var(--ink-tint); }
.stage__inner { max-width: var(--container); margin-inline: auto; }
.stage__inner--center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.kicker { font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--mauve); margin-bottom: 1.75rem; }

/* Statement: el gran titular de sección, tipografía de display gigante. */
.statement { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; letter-spacing: -0.01em; text-wrap: balance; }
.statement em { font-style: italic; color: var(--accent); }
.stage__lead { max-width: 42rem; margin-top: 2rem; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.55; color: color-mix(in srgb, var(--paper) 72%, transparent); text-wrap: pretty; }
.stage__lead--center { margin-inline: auto; }

.prose { max-width: 46rem; margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.7; color: color-mix(in srgb, var(--paper) 78%, transparent); }
.prose strong { color: var(--paper); font-weight: 500; }
.langs { list-style: none; padding: 0; margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem 3rem; font-family: var(--font-mono); font-size: 0.95rem; }
.langs__lang { color: var(--paper); }
.langs__lvl { color: var(--mauve); }

/* ---- Perfil: retrato + copy en dos columnas (Apple product + copy) ------- */
.perfil { display: grid; gap: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); align-items: center; }
.portrait { margin: 0; position: relative; justify-self: center; width: 100%; max-width: 420px; }
/* Marco con acento tenue + degradado de marca que funde los bordes con el fondo. */
.portrait__img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px; display: block; }
.portrait::after {
  content: ""; position: absolute; inset: 0; border-radius: 22px; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--hairline);
  background: linear-gradient(180deg, transparent 55%, rgba(17, 17, 24, 0.55) 100%),
              radial-gradient(120% 80% at 100% 0%, rgba(200, 82, 124, 0.16), transparent 55%);
}

/* ---- NÚMEROS: el momento de impacto ------------------------------------- */
.numbers { text-align: center; }
.numbers .kicker { text-align: center; }
.hero-metric { margin-bottom: clamp(3.5rem, 2rem + 6vw, 6rem); }
.hero-metric__value { font-family: var(--font-display); font-weight: 400; font-size: clamp(6rem, 20vw, 16rem); line-height: 0.85; color: var(--accent); letter-spacing: -0.02em; }
.hero-metric__unit { font-size: 0.4em; color: var(--paper); }
.hero-metric__label { max-width: 32rem; margin: 1.75rem auto 0; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.5; color: color-mix(in srgb, var(--paper) 80%, transparent); text-wrap: balance; }
.metrics { display: grid; gap: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 2rem; text-align: center; }
.metric__value { font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; color: var(--paper); }
.metric__label { max-width: 22rem; margin: 1rem auto 0; font-size: 1rem; line-height: 1.5; color: color-mix(in srgb, var(--paper) 65%, transparent); }

/* ---- PROYECTOS: showcase de producto ------------------------------------ */
.showcase { display: grid; gap: 1.25rem; margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); }
.show { display: flex; flex-direction: column; padding: clamp(2rem, 1.5rem + 2vw, 3rem); border-radius: 22px; background: color-mix(in srgb, var(--paper) 4%, transparent); border: 1px solid var(--hairline); transition: border-color 0.35s ease, background-color 0.35s ease, transform 0.35s ease; }
.show:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--paper) 6%, transparent); transform: translateY(-4px); }
.show__step { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dusty); }
.show__name { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 4vw, 3rem); color: var(--paper); margin: 0.75rem 0 1rem; }
.show__desc { font-size: 1.05rem; line-height: 1.6; color: color-mix(in srgb, var(--paper) 70%, transparent); flex: 1; }
.show__link { margin-top: 1.75rem; font-family: var(--font-mono); font-size: 0.92rem; color: var(--accent); }
.repos { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1.25rem; padding: 1.75rem clamp(2rem, 1.5rem + 2vw, 3rem); border-radius: 22px; border: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 0.95rem; color: color-mix(in srgb, var(--paper) 78%, transparent); transition: border-color 0.35s ease; }
.repos:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.repos__url { color: var(--mauve); }

/* ---- EXPERIENCIA: timeline aireado -------------------------------------- */
.timeline { margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); display: flex; flex-direction: column; }
.tl { display: grid; gap: 1rem; padding-block: clamp(2rem, 1.5rem + 2vw, 3rem); border-top: 1px solid var(--hairline); }
.tl:first-child { border-top: 0; }
.tl__date { font-family: var(--font-mono); font-size: 0.9rem; color: var(--mauve); }
.tl__role { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 500; line-height: 1.25; color: var(--paper); text-wrap: balance; }
.tl__org { font-family: var(--font-mono); font-size: 0.95rem; color: var(--dusty); margin: 0.5rem 0 1.25rem; }
.tl__sum { font-size: 1.1rem; line-height: 1.6; color: color-mix(in srgb, var(--paper) 75%, transparent); max-width: 46rem; }
.tl__list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: 0.6rem; max-width: 46rem; }
.tl__list li { position: relative; padding-left: 1.5rem; font-size: 1.05rem; line-height: 1.5; color: color-mix(in srgb, var(--paper) 68%, transparent); }
.tl__list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 80%, transparent); }

/* ---- STACK: categorías con aire ----------------------------------------- */
.stack { margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); display: flex; flex-direction: column; }
.stack__cat { display: grid; gap: 0.75rem; padding-block: clamp(1.75rem, 1.25rem + 2vw, 2.5rem); border-top: 1px solid var(--hairline); }
.stack__title { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 500; color: var(--paper); }
.stack__items { font-family: var(--font-mono); font-size: clamp(0.95rem, 1.4vw, 1.1rem); line-height: 1.7; color: color-mix(in srgb, var(--paper) 66%, transparent); }

/* ---- FORMACIÓN ---------------------------------------------------------- */
.edu { margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); display: grid; gap: 3.5rem; }
.edu__subtitle { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper); margin-bottom: 1.75rem; }
.edu__entry { margin-bottom: 1.75rem; }
.edu__degree { font-size: 1.25rem; font-weight: 500; color: var(--paper); }
.edu__inst { font-size: 1.05rem; color: color-mix(in srgb, var(--paper) 72%, transparent); margin-top: 0.35rem; }
.certs { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.certs li { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--hairline); font-size: 1.05rem; color: color-mix(in srgb, var(--paper) 80%, transparent); }
.certs li span { font-family: var(--font-mono); font-size: 0.9rem; color: var(--mauve); flex: none; }

/* ---- CIERRE / CONTACTO -------------------------------------------------- */
.closing { text-align: center; min-height: 82vh; display: flex; align-items: center; }
.closing .kicker { text-align: center; }
.closing__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.8rem, 8vw, 6.5rem); line-height: 1; letter-spacing: -0.015em; text-wrap: balance; }
.closing__title em { font-style: italic; color: var(--accent); }

/* ---- Footer: logo oficial + firma --------------------------------------- */
.foot { max-width: var(--container); margin-inline: auto; padding: 3.5rem var(--pad); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; border-top: 1px solid var(--hairline); }
/* El logo oficial trae su propio fondo plum; se enmarca para que lea intencional. */
.foot__logo { width: 168px; height: auto; border-radius: 12px; border: 1px solid var(--hairline); display: block; }
.foot__text { text-align: right; }
.foot__sig { font-family: var(--font-mono); font-size: 1.4rem; color: var(--accent); }
.foot__meta { font-family: var(--font-mono); font-size: 0.85rem; color: var(--mauve); margin-top: 0.35rem; }
@media (max-width: 560px) { .foot { justify-content: center; } .foot__text { text-align: center; } }

/* ---- Enlace "ver más" bajo secciones de la landing --------------------- */
.seemore { display: inline-block; margin-top: 2.75rem; font-family: var(--font-mono); font-size: 0.95rem; color: var(--accent); }
.seemore:hover { opacity: 0.7; }

/* ---- Banda CTA que invita al perfil profesional ------------------------- */
.cta-band { text-align: center; }
.cta-band .statement { margin-top: 1.25rem; }
.cta-band .stage__lead { margin-inline: auto; }
.cta-band .btn { margin-top: 2.5rem; }

/* ---- Cabecera de página interior (perfil.html) -------------------------- */
.pagehead { max-width: var(--container); margin-inline: auto; padding: calc(var(--nav-h) + 4rem) var(--pad) clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.pagehead__name { font-family: var(--font-display); font-weight: 400; font-size: clamp(3rem, 8vw, 6rem); line-height: 0.94; letter-spacing: -0.02em; margin-top: 1rem; }
.pagehead__role { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--mauve); margin-top: 1.5rem; }
.pagehead__lead { max-width: 46rem; margin-top: 1.75rem; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.55; color: color-mix(in srgb, var(--paper) 80%, transparent); text-wrap: pretty; }
.pagehead__lead strong { color: var(--paper); font-weight: 500; }
.backlink { display: inline-block; margin-top: 2.25rem; font-family: var(--font-mono); font-size: 0.9rem; color: color-mix(in srgb, var(--paper) 70%, transparent); }
.backlink:hover { color: var(--paper); }

/* ---- Idiomas en el perfil (bloque propio) ------------------------------- */
.langs--block { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--hairline); }

/* ---- Offset de anchors bajo el nav sticky ------------------------------- */
:where(#top, section[id]) { scroll-margin-top: calc(var(--nav-h) + 1rem); }

/* ---- Reveal on scroll (lo activa apple.js; sin JS todo visible) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
  .reveal.in-view { opacity: 1; transform: none; }
}

/* ---- Escritorio: rejillas multi-columna --------------------------------- */
@media (min-width: 741px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .showcase { grid-template-columns: repeat(3, 1fr); }
  .tl { grid-template-columns: 220px 1fr; gap: 2.5rem; }
  .tl__date { padding-top: 0.4rem; }
  .edu { grid-template-columns: 1fr 1.15fr; gap: 5rem; }
  /* Perfil: copy a la izquierda, retrato a la derecha. */
  .perfil { grid-template-columns: 1.25fr 0.75fr; }
  .portrait { max-width: 100%; }
}

/* ---- Móvil: menú colapsable + una columna ------------------------------- */
@media (max-width: 740px) {
  body.js .nav__toggle { display: inline-block; }
  body.js .nav__links {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 1.25rem;
    background: var(--ink-tint); border-bottom: 1px solid var(--hairline); padding: 1.5rem var(--pad);
  }
  body.js .nav__links.is-open { display: flex; }
}

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