/* ==========================================================================
   Omar Ibarra Castillo — página personal
   Tokens tomados del handoff de diseño (sistema Modernist).
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Color */
  --bg: #efecec;
  --card: #fbf9f9;
  --surface: #fff;
  --ink: #201e1d;
  --text: #444141;
  --muted: #605d5d;
  --faint: #7d7979;
  --border: #d7d3d3;
  --accent: #ec3013;
  --accent-dark: #ae1800;
  --halo: #ffd9d0;
  --black: #141212;
  --black-hover: #3b3534;

  /* Sombras */
  --shadow-card: 0 24px 60px rgba(32, 30, 29, .14);
  --shadow-low: 0 2px 10px rgba(32, 30, 29, .08);
  --shadow-low-strong: 0 2px 10px rgba(32, 30, 29, .12);
  --shadow-chip: 0 1px 4px rgba(32, 30, 29, .1);
  --shadow-accent: 0 10px 24px rgba(236, 48, 19, .28);
  --shadow-accent-hover: 0 16px 32px rgba(236, 48, 19, .4);
  --shadow-avatar: 0 8px 24px rgba(236, 48, 19, .22);
  --shadow-agency: 0 12px 30px rgba(160, 20, 120, .28);

  /* Movimiento. Las curvas propias existen porque las de serie (ease-out)
     son demasiado flojas para que el gesto se lea. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-press: 160ms;
  --t-reveal: 420ms;

  /* Padding horizontal de la tarjeta */
  --pad: 22px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--halo); }

img { max-width: 100%; }

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { text-decoration: none; color: inherit; }

/* --------------------------------------------------------------------------
   Estructura
   -------------------------------------------------------------------------- */

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  padding: 28px 16px 56px;
}

.card {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 26px;
  background: var(--card);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.block { padding: 0 var(--pad); }

/* --------------------------------------------------------------------------
   Cabecera
   -------------------------------------------------------------------------- */

.card__head {
  padding: 20px var(--pad) 0;
  background: radial-gradient(110% 80% at 50% -10%, var(--halo) 0%, var(--card) 72%);
}

.card__headrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
}

.status__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(236, 48, 19, .18);
}

/* El halo late despacio: es lo único que indica que «disponible» está vivo.
   Va en un pseudo-elemento para no tocar la maquetación. */
.status__dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: pulse 2600ms var(--ease-out) infinite;
}

@keyframes pulse {
  0%   { transform: scale(.6); opacity: .5; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Conmutador de idioma */
.lang {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(32, 30, 29, .12);
}

.lang__btn {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--t-press) ease, color var(--t-press) ease;
}

.lang__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.lang__btn:active { transform: scale(.94); }

/* El texto se atenúa un instante al cambiar de idioma para que las cadenas no
   se sustituyan de golpe. */
[data-i18n] { transition: opacity 120ms ease; }
.card.is-swapping [data-i18n] { opacity: 0; }

/* Retrato */
.avatar {
  width: 156px;
  height: 156px;
  margin: 6px auto 18px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-avatar);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  display: block;
}

/* --------------------------------------------------------------------------
   Identidad
   -------------------------------------------------------------------------- */

.identity {
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.identity__name {
  font-size: 34px;
  font-weight: 800;
  line-height: .96;
  letter-spacing: -.035em;
  color: var(--ink);
}

.identity__name span { color: var(--accent); }

.identity__role {
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  text-wrap: pretty;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-chip);
}

.chip--outline {
  padding: 8px 13px;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}

.chip--ghost {
  padding: 7px 12px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  box-shadow: none;
}

.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Cifras
   -------------------------------------------------------------------------- */

.stats {
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  padding: 14px 12px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-low);
}

.stat__big {
  display: block;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.stat__small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Acciones
   -------------------------------------------------------------------------- */

.actions {
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 20px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  transition:
    transform var(--t-press) var(--ease-out),
    box-shadow var(--t-press) var(--ease-out),
    background-color var(--t-press) ease;
}

.pill__icon {
  width: 19px;
  height: 19px;
  flex: none;
}

.pill__label {
  flex: 1;
  min-width: 0;
}

.pill__arrow {
  font-size: 18px;
  transition: transform var(--t-press) var(--ease-out);
}

.pill--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.pill--dark {
  background: var(--black);
  color: #fff;
}

.pill--plain {
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  box-shadow: var(--shadow-low-strong);
}

.pill--plain .pill__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Proyectos y casos (sección retirada hasta tener casos reales — ver index.html)
   -------------------------------------------------------------------------- */

.cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.case {
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, #eae6e6 0 7px, #f4f1f1 7px 14px);
  transition: transform var(--t-press) var(--ease-out);
}

.case img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------------------
   Bloque Nave Espacial
   -------------------------------------------------------------------------- */

.agency {
  display: block;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(105deg, #7b16b8 0%, #c1108f 55%, #e5194a 100%);
  box-shadow: var(--shadow-agency);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
}

.agency__logo {
  display: block;
  width: 150px;
  height: auto;
  margin-bottom: 14px;
}

.agency__body {
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .92);
  text-wrap: pretty;
}

.agency .chips { margin-bottom: 16px; }

.agency__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.agency__foot span:first-child { flex: 1; }

/* --------------------------------------------------------------------------
   Redes
   -------------------------------------------------------------------------- */

.social {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.social__link {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-low-strong);
  transition:
    transform var(--t-press) var(--ease-out),
    background-color var(--t-press) ease,
    color var(--t-press) ease;
}

.social__link svg {
  width: 19px;
  height: 19px;
}

/* --------------------------------------------------------------------------
   Movimiento
   -------------------------------------------------------------------------- */

/* Entrada. Los bloques visibles al cargar entran escalonados; los de más abajo
   entran al llegar a ellos, una sola vez. Sin JS quedan visibles (.no-js). */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--t-reveal) var(--ease-out),
    transform var(--t-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Si main.js no llega a ejecutarse, los bloques no pueden quedarse
   invisibles: a los 2,5 s se muestran sin animación. */
html.no-reveal .reveal,
html.no-reveal .card__head .avatar {
  opacity: 1;
  transform: none;
  transition: none;
}

/* El retrato entra con un punto de escala, nunca desde cero. */
.js .card__head .avatar {
  transform: scale(.94);
  transition: transform 520ms var(--ease-out) var(--reveal-delay, 0ms);
}

.js .card__head.is-visible .avatar { transform: none; }

/* Pulsación. Va sin gating: :active es una pulsación real también en táctil. */
.pill:active,
.agency:active { transform: scale(.975); }
.social__link:active { transform: scale(.93); }

/* Hover. Solo en punteros finos: en táctil el hover se dispara al tocar y
   deja el estado pegado. */
@media (hover: hover) and (pointer: fine) {
  .pill:hover { transform: translateY(-2px); }
  .pill--primary:hover { box-shadow: var(--shadow-accent-hover); }
  .pill--dark:hover { background: var(--black-hover); }
  .pill:hover .pill__arrow { transform: translateX(3px); }

  .agency:hover { transform: translateY(-2px); }
  .agency:hover .pill__arrow { transform: translateX(3px); }

  .case:hover { transform: translateY(-2px); }

  .social__link:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
  }

  .lang__btn:not(.is-active):hover { color: var(--ink); }

  .pill:active { transform: translateY(-1px) scale(.975); }
  .agency:active { transform: translateY(-1px) scale(.985); }
}

/* Menos movimiento: se conservan las transiciones de color y opacidad, que
   ayudan a entender el cambio, y se retira todo desplazamiento. */
@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .card__head .avatar {
    transform: none;
  }

  .status__dot::after { animation: none; }

  .pill:hover,
  .pill:active,
  .agency:hover,
  .agency:active,
  .case:hover,
  .social__link:hover,
  .social__link:active,
  .lang__btn:active {
    transform: none;
  }

  .pill:hover .pill__arrow,
  .agency:hover .pill__arrow {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Pantallas estrechas
   -------------------------------------------------------------------------- */

@media (max-width: 420px) {
  :root { --pad: 18px; }

  .page { padding: 20px 12px 44px; }

  .pill {
    padding-left: 17px;
    padding-right: 17px;
  }

  /* La dirección de correo es el propio texto del botón: se encoge antes que
     recortarse con puntos suspensivos. */
  .pill--plain { font-size: clamp(12.5px, 3.8vw, 16px); }
}
