/* ────────────────────────────────────────────────────────────────
   Hoja de estilos compartida — Román Paparella Portfolio
   Usada por todas las páginas del sitio (home, /proyectos, y cada
   /proyectos/<slug>). Ver /estilos.html para la guía visual de estos
   mismos tokens y componentes.
   ──────────────────────────────────────────────────────────────── */

/* ── RESET ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p, figure, ul { margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; background: none; }

/* ── TOKENS ──────────────────────────────── */
:root {
  --font-body:       'Inter', sans-serif;
  --font-heading:    'Inter', sans-serif;

  /* Texto — 3 niveles + muted */
  --black:           #050505;  /* headlines (h1–h6) */
  --text-body:       #525252;  /* párrafos — tw neutral-600 */
  --text-tertiary:   #404040;  /* texto de apoyo — tw neutral-700 */
  --gray-mid:        #a3a3a3;  /* muted — tw neutral-400 */

  /* Fondos */
  --white:           #ffffff;
  --dark:            #141414;
  --gray-bg:         #f7f7f7;
  --success-bg:      #eaf7ef;
  --subtle-bg:       #efefef;

  /* Bordes */
  --gray-border:     #f2f2f2;
  --gray-300:        #d0d0d0;
  --gray-100:        #f0f0f0;

  /* Acentos */
  --green:           #0ea43b;
  --green-secondary: #2ecc71;
  --purple-500:      #6A71DF;

  /* Overlays sobre fondo oscuro — blanco con alpha (footer, testimonios) */
  --on-dark-line:    rgba(255,255,255,0.07);  /* divisores */
  --on-dark-border:  rgba(255,255,255,0.14);  /* bordes de control */
  --on-dark-hover:   rgba(255,255,255,0.1);   /* fondo hover */
  --on-dark-text:    rgba(255,255,255,0.28);  /* texto tenue */
  --on-dark-label:   rgba(255,255,255,0.35);  /* labels */

  /* Estados */
  --dark-hover:      #1c1c1c;

  /* Layout */
  --max-w:           1040px;
  --case-text-w:     880px;
}

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--text-body);
  line-height: 1.4em;
  -webkit-font-smoothing: antialiased;
}

/* Headings — siempre Black */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--black);
}

/* Headline 1 — unificado en todas las páginas (72px / line-height 90px) */
h1 {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.25em;
  letter-spacing: -0.025em;
  color: var(--black);
  margin-bottom: 24px;
}

h2 {
  line-height: 1.2em;
}

/* ── NAV ─────────────────────────────────── */
/* Componente único, compartido por todas las páginas del sitio.
   Fuente: Figma node 63:517 (Nav - Desktop). */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
}
.nav-logo-text {
  display: flex;
  flex-direction: column;
}
.nav-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.4em;
  color: var(--black);
}
.nav-title {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.0207407em;
  line-height: 1.5555556em;
  color: var(--dark);
  opacity: .7;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.55em;
  font-feature-settings: "cv05", "cv06", "cv10", "cv11";
  color: var(--black);
  transition: opacity .15s;
}
.nav-link:hover { opacity: .6; }
.nav-lang {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.55em;
  font-feature-settings: "cv05", "cv06", "cv10", "cv11";
  color: var(--black);
  transition: opacity .15s;
}
.nav-lang:hover { opacity: .6; }

/* .nav-links (Proyectos/Servicios/Estilos/idioma) y .nav-actions
   (Descargar CV + botón hamburguesa) viven dentro de .nav-right.
   En desktop se ven como una sola fila — igual que antes. En mobile
   .nav-links se convierte en panel desplegable; .nav-actions queda
   siempre visible. Ver @media (max-width: 720px) más abajo. */
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  flex-shrink: 0;
  transition: background .15s;
}
.nav-burger:hover { background: var(--gray-bg); }
.nav-burger-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--black);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-burger[aria-expanded="true"] .nav-burger-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] .nav-burger-bar:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] .nav-burger-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── BUTTONS ─────────────────────────────── */
/* Sistema de botones: 2 estilos (primary/outline) × 2 tamaños (sm/lg) */
.btn {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  border-radius: 100px;
  -webkit-font-smoothing: antialiased;
  -webkit-backface-visibility: hidden;
}
.btn-primary {
  background: var(--black);
  color: var(--white);
}
.btn-outline {
  border: 1.5px solid var(--black);
  color: var(--black);
}
.btn-outline-white {
  border: 1.5px solid var(--on-dark-text);
  color: var(--white);
}
.btn-text {
  color: var(--black);
  padding: 8px 12px;
  transition: background 0.3s ease;
}
.btn-text:hover {
  background: var(--gray-bg);
}
.btn-sm {
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.btn-lg {
  padding: 13px 28px;
  font-size: 16px;
}
/*
  .btn-inner es el clip: overflow:hidden con height exacta de 1 línea.
  .btn-top y .btn-bot se apilan en columna dentro de ese clip.
  En hover ambos suben -100% (= 1 línea): top sale por arriba,
  bot entra desde abajo. El botón en sí no necesita overflow:hidden.
*/
.btn-inner {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.2em;
  height: 1.2em;
}
.btn-top,
.btn-bot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 1.2em;
  white-space: nowrap;
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.btn-bot {
  height: 1.2em;
}
.btn:hover .btn-top,
.btn:hover .btn-bot { transform: translateY(-1.2em); }

/* ── DIVIDER ─────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-border);
  margin: 0;
}

/* ── PROJECT CARDS (home, /proyectos) ────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 32px;
}
.project-card {
  display: block;
}
.project-cover-frame {
  border-radius: 20px;
  overflow: hidden;
}
.project-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card:hover .project-cover {
  transform: scale(1.06);
}
.project-info {
  padding: 18px 2px 0;
}
.project-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0;
  line-height: 1.35em;
}
.project-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.project-tag {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.55em;
  font-feature-settings: "cv05", "cv06", "cv10", "cv11";
  color: var(--text-body);
}
.project-sep {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.55em;
  font-feature-settings: "cv05", "cv06", "cv10", "cv11";
  color: var(--text-body);
}

/* ── HOME — hero, clients, projects wrapper, skills, testimonials ──
   Compartido por index.html (ES) y en/index.html (EN). Antes vivía
   duplicado en un <style> embebido en cada una de las dos homes. */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 72px 24px 88px;
  text-align: center;
  position: relative;
}
.hero-photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin: 0 auto 36px;
}
/* .hero-h1 es redundante con el h1 global (mismo color y margin-bottom)
   — se mantiene documentada porque en/index.html todavía la referencia. */
.hero-h1 {
  color: var(--black);
  margin-bottom: 24px;
}
.hero-desc {
  font-size: 18px;
  line-height: 1.65em;
  color: var(--text-body);
  margin: 0 auto;
  max-width: 680px;
}

.clients-bg {
  background: var(--gray-bg);
}
.clients {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 72px 24px;
}
.clients-label {
  text-align: center;
  font-size: 16px;
  line-height: 1.65em;
  color: var(--text-body);
  margin-bottom: 32px;
}
.clients-track-wrapper {
  overflow: hidden;
  /* fade en los extremos */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 14%,
    black 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 14%,
    black 86%,
    transparent 100%
  );
}
.clients-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 22s linear infinite;
}
/*
  Cada imagen lleva su propio margin-right.
  Así el ancho total incluye el espaciado trailing de TODOS
  los ítems, y translateX(-50%) cae exactamente al inicio
  del segundo set → loop sin salto visible.
*/
.clients-track img {
  height: 24px;
  width: auto;
  opacity: 0.55;
  filter: grayscale(1);
  flex-shrink: 0;
  margin-right: 64px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.projects {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 88px 24px;
}
.section-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}
.projects-cta {
  text-align: center;
  margin-top: 48px;
}

.skills {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 88px 24px;
  border-top: 1px solid var(--gray-border);
  text-align: center;
}
.skills-h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 48px;
}
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  text-align: left;
}

.testimonials-bg {
  border-top: 1px solid var(--gray-border);
}
.testimonials {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 24px;
  text-align: center;
}
.tag-pill-neutral {
  display: inline-flex;
  align-items: center;
  background: var(--gray-bg);
  color: var(--black);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.03em;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.testimonials-h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 24px;
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: left;
}
.tcard {
  background: var(--gray-bg);
  border-radius: 16px;
  padding: 24px 20px;
  height: 352px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tcard-quote {
  font-size: 16px;
  line-height: 1.55em;
  letter-spacing: -0.04em;
  color: var(--black);
}
.tcard-author {
  display: flex;
  align-items: center;
  gap: 16px;
}
.tcard-photo {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.tcard-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--black);
  line-height: 1.4em;
}
.tcard-role {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-tertiary);
  opacity: 0.7;
  line-height: 1.3em;
  margin-top: 2px;
}
.testimonials-cta {
  text-align: center;
  margin-top: 96px;
}

@media (max-width: 720px) {
  .hero-desc          { font-size: 16px; }
  .testimonials-grid  { grid-template-columns: 1fr; }
  .skills-grid        { grid-template-columns: 1fr; }

  /* logos: de marquee a grilla estática */
  .clients-track-wrapper {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .clients-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
    align-items: center;
    width: 100%;
    gap: 32px 24px;
    animation: none;
  }
  .clients-track img {
    margin-right: 0;
  }
  .clients-track img:nth-child(n+7) {
    display: none;
  }
}

/* ── SKILL ROW (home /skills, documentado en UI Kit) ── */
.skill-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 100px !important;
  background: var(--gray-bg) !important;
  transition: background .15s;
}
.skill-row:hover { background: var(--gray-100); }
.skill-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-shrink: 0;
}
.skill-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
  line-height: 1.4em;
  letter-spacing: -0.03em;
}

/* ── PROJECT PAGE — placeholder simple ───── */
/* Usado por páginas de proyecto que todavía no tienen case study
   completo: solo título + imagen cover. */
.project-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 40px;
}
.project-cover-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 88px;
}
.project-cover-img {
  width: 100%;
  border-radius: 20px;
}

/* ── PROJECTS LISTADO (/proyectos) ───────── */
.projects-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 40px;
  text-align: center;
}
.projects-hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── PROJECT PAGE — case study completo ──── */
.case-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 24px;
}
.case-eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-500);
  margin-bottom: 14px;
}
.case-logo {
  height: 28px;
  width: auto;
  margin-bottom: 16px;
}
.case-hero h1 {
  margin-bottom: 16px;
}
/* Description — subtítulo/descripción debajo de títulos principales */
.description {
  font-size: 18px;
  line-height: 1.4em;
  color: var(--text-body);
  max-width: 880px;
}
.case-subtitle {
  font-size: 16px;
  line-height: 1.65em;
  color: var(--text-body);
  max-width: 640px;
}
.case-cover-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 0;
}
.case-meta-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 24px 0;
}
.case-meta {
  display: flex;
  gap: 56px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--gray-border);
  flex-wrap: wrap;
}
.case-meta-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 6px;
}
.case-meta-val {
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
}
/* Case Section — para bloques de texto solamente */
.case-section {
  max-width: var(--case-text-w);
  margin: 0 auto;
  padding: 48px 24px;
}

/* Image Section — para bloques de imagen solamente */
.image-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px;
}
.case-section h2 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.case-section p {
  font-size: 16px;
  line-height: 1.7em;
  color: var(--text-body);
  max-width: 720px;
  margin-bottom: 16px;
}
.case-section p:last-child { margin-bottom: 0; }
.case-subhead {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  margin: 28px 0 4px;
}
.case-subhead:first-child { margin-top: 0; }
/* Usa el estilo Description (18px / 1.4em) */
.case-quote {
  border-left: 3px solid var(--black);
  padding-left: 20px;
  font-size: 18px;
  line-height: 1.4em;
  font-style: italic;
  color: var(--black);
  margin: 24px 0;
  max-width: 640px;
}
.case-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin-top: 16px;
}
.case-list li {
  position: relative;
  padding-left: 16px;
  font-size: 16px;
  line-height: 1.6em;
  color: var(--text-body);
}
.case-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-500);
}
.case-img {
  width: 100%;
  border-radius: 16px;
  margin-top: 32px;
  border: 1px solid var(--gray-border);
}
.case-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.case-img-grid .case-img { margin-top: 0; }
.case-caption {
  font-size: 13px;
  color: var(--gray-mid);
  text-align: left;
  margin-top: 10px;
}
.case-stat {
  margin: 24px 0;
}
.case-stat-value {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--purple-500);
  line-height: 1em;
}
.case-stat-label {
  font-size: 13px;
  color: var(--gray-mid);
  margin-top: 8px;
}
/* Usa el estilo Body Text (16px / 1.65em) */
.case-callout {
  background: var(--gray-bg);
  border-radius: 14px;
  padding: 20px 24px;
  font-size: 16px;
  line-height: 1.65em;
  color: var(--black);
  margin-top: 24px;
  max-width: 720px;
}
/* Contenedor del botón "Próximo proyecto" al pie de cada case study.
   Un solo botón (.btn-outline con flecha), alineado a la derecha. */
.case-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 24px 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ── FOOTER ──────────────────────────────── */
.footer-bg {
  background: var(--dark);
  border-top: 1px solid var(--on-dark-line);
}
.footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px 24px 40px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 44px;
}
.footer-contacts {
  display: flex;
  gap: 56px;
}
.footer-field-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-dark-label);
  margin-bottom: 7px;
}
.footer-field-val {
  font-size: 13px;
  color: var(--white);
}
a.footer-field-val:hover { opacity: .75; }
.footer-social {
  display: flex;
  gap: 10px;
}
.footer-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--on-dark-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: background .15s;
}
.footer-icon-btn:hover { background: var(--on-dark-hover); }
.footer-divider {
  border: none;
  border-top: 1px solid var(--on-dark-line);
  margin: 0 0 24px;
}
.footer-disclaimer {
  font-size: 11.5px;
  line-height: 1.65em;
  color: var(--on-dark-text);
  max-width: 680px;
}

/* ── STAT COUNTER ────────────────────────── */
.stat-counter {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2em;
  color: var(--black);
  display: inline-block;
}
.stat-value {
  display: inline;
}
.stat-unit {
  margin-left: 4px;
}

/* ── RESPONSIVE (compartido) ─────────────── */
@media (max-width: 720px) {
  .nav-lang           { display: none; }
  .projects-grid      { grid-template-columns: 1fr; }
  .case-img-grid      { grid-template-columns: 1fr; }
  .case-meta          { gap: 28px; }
  .footer-top         { flex-direction: column; gap: 28px; }
  .footer-contacts    { flex-direction: column; gap: 24px; }

  /* Nav mobile: Proyectos/Servicios/Estilos/idioma pasan a un panel
     desplegable. Descargar CV y el botón hamburguesa quedan siempre
     visibles en el header, fuera del panel. */
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-border);
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  }
  .nav-links.is-open { display: flex; }
  .nav-links .btn-text { width: 100%; justify-content: flex-start; }
}

@media (max-width: 480px) {
  .nav-inner   { padding: 14px 16px; gap: 12px; }
  .nav-logo    { gap: 10px; }
  .nav-avatar  { width: 36px; height: 36px; }
  .nav-name    { font-size: 13px; line-height: 1.3em; white-space: nowrap; }
  .nav-title   { display: none; }
  .nav-right   { gap: 14px; }
  .nav-link    { font-size: 13px; }
  .btn-sm      { padding: 10px 16px; font-size: 13px; }
}
