/* ===== Sección «Проекты», tarjetas de estudio/CV y menú flotante (ver portfolio.js) ===== */

.projects[data-layout] {
  grid-template-columns: 1fr;
}

.projects[data-layout] > .section-label {
  display: none;
}

.pf-head {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(36px, 5vw, 72px);
}

.pf-head .mono {
  color: var(--ink-muted);
}

.pf-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.2rem, 11vw, 11rem);
  font-weight: 900;
  line-height: 0.86;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.pf-title sup {
  margin-left: 0.18em;
  color: var(--red);
  font-size: 0.2em;
  letter-spacing: 0;
  vertical-align: top;
}

/* ---------- Tarjetas de proyecto ---------- */
/* Ancho máximo: en pantallas grandes queda aire blanco a los lados */
.projects[data-layout] > .pf {
  justify-self: center;
  width: 100%;
  max-width: 1320px;
}

.pf-list {
  display: grid;
  /* Pausa entre proyectos: algo más del doble que antes */
  gap: clamp(40px, 5.4vw, 76px);
}

.pf-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  /* La tarjeta ocupa casi toda la pantalla */
  min-height: min(84vh, 760px);
  overflow: hidden;
  border-radius: calc(var(--radius) * 2);
}

.pf-card--flip .pf-card__cover {
  order: 2;
}

.pf-card--dark {
  background: var(--black-2);
  color: var(--white);
}

.pf-card--light {
  border: 1px solid var(--line-light);
  background: var(--pure-white);
  color: var(--black);
}

.pf-card__cover {
  display: block;
  min-height: 320px;
  background: #222222 center / cover no-repeat;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

a.pf-card__cover:hover {
  transform: scale(1.03);
}

.pf-card__body {
  display: grid;
  align-content: end;
  gap: 16px;
  padding: clamp(44px, 5.6vw, 84px) clamp(26px, 3.6vw, 52px);
}

.pf-card__num {
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(3.6rem, 7vw, 7rem);
  font-weight: 900;
  line-height: 0.8;
}

.pf-card__kind {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  opacity: 0.66;
}

.pf-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.4vw, 3.6rem);
  font-weight: 900;
  line-height: 0.92;
  text-transform: uppercase;
}

.pf-card p {
  margin: 0;
  max-width: 34rem;
  font-size: 1.06rem;
  opacity: 0.76;
}

.pf-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-family: var(--display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Enlaces secundarios: píldoras con contorno (el principal es el botón con luz) */
.pf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: var(--pure-white);
  color: var(--black);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.pf-chip:hover {
  border-color: var(--black);
  background: var(--black);
  color: var(--pure-white);
}

.pf-chip--soon {
  border-style: dashed;
  background: transparent;
  color: var(--ink-muted);
}

.pf-card--dark .pf-chip {
  border-color: rgba(237, 237, 237, 0.26);
  background: transparent;
  color: var(--white);
}

.pf-card--dark .pf-chip:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--black-2);
}

.pf-card--dark .pf-chip--soon {
  color: rgba(237, 237, 237, 0.62);
}

.pf-group {
  display: grid;
  gap: 8px;
}

.pf-chips + .pf-group,
.pf-group + .pf-group {
  margin-top: 8px;
}

.pf-group__title {
  font-family: var(--display);
  font-size: 0.72rem;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ---------- Студия и резюме: tarjetas de enlace ---------- */
.profile-links {
  display: grid;
  gap: 12px;
}

.profile-link {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 18px;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: 999px;
  background: var(--pure-white);
  transition: border-color 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-link:hover {
  border-color: var(--red);
  transform: translateX(6px);
}

.profile-link__thumb {
  width: 88px;
  height: 64px;
  border-radius: 999px;
  background: #ededed center / cover no-repeat;
}

.profile-link__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-link__text strong {
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 600;
  text-transform: uppercase;
}

.profile-link__text span {
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

/* Flecha en SVG: un carácter «→» queda sobre la línea base y no se centra en el círculo */
.profile-link__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #ffffff;
}

.profile-link__arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}

.profile-link:hover .profile-link__arrow svg {
  transform: translateX(2px);
}

/* ---------- Anclas: que el menú superior no tape el destino ---------- */
[id^="project-"],
#projects,
#studio,
#contacts {
  scroll-margin-top: 110px;
}

/* ---------- Menú flotante de proyectos: cristal esmerilado ---------- */
.pf-dock {
  position: fixed;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  z-index: 70;
  display: flex;
  gap: 4px;
  max-width: calc(100vw - 32px);
  padding: 6px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(247, 247, 244, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(17, 17, 17, 0.06),
    0 22px 48px -18px rgba(17, 17, 17, 0.38);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  scrollbar-width: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 160%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.pf-dock.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  animation: pf-float 6s ease-in-out 0.6s infinite;
}

@keyframes pf-float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -5px); }
}

/* Texto del menú: Noto Sans 16px, frases claras (versión corta en móvil) */
.pf-dock a {
  padding: 11px 18px;
  border-radius: 999px;
  color: var(--black);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}

.pf-dock a[aria-current] {
  font-weight: 600;
}

.pf-dock__short {
  display: none;
}

.pf-dock a:hover {
  background: rgba(255, 255, 255, 0.7);
}

.pf-dock a[aria-current] {
  background: var(--red);
  color: #ffffff;
}

.pf-dock a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Sin soporte de desenfoque: fondo casi opaco para que se lea */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pf-dock {
    background: rgba(247, 247, 244, 0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-dock.is-visible {
    animation: none;
  }
}

/* ---------- Tableta y móvil ---------- */
@media (max-width: 920px) {
  .pf-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .pf-card--flip .pf-card__cover {
    order: 0;
  }

  .pf-card__cover {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
}

@keyframes pf-float-mobile {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -4px); }
}

@media (max-width: 560px) {
  .profile-link {
    grid-template-columns: 64px minmax(0, 1fr) 40px;
    gap: 12px;
  }

  .profile-link__thumb {
    width: 64px;
    height: 48px;
  }

  .profile-link__arrow {
    width: 40px;
    height: 40px;
  }

  /* El menú ocupa el ancho y los enlaces caben sin scroll */
  .pf-dock {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    justify-content: space-between;
    max-width: none;
    padding: 5px;
    transform: translate(0, 160%);
  }

  .pf-dock.is-visible {
    transform: translate(0, 0);
    animation-name: pf-float-mobile;
  }

  .pf-dock a {
    padding: 10px 6px;
  }

  .pf-dock__full {
    display: none;
  }

  .pf-dock__short {
    display: inline;
  }
}

/* ---------- Botón con luz (emula huly.io: mismos colores cálidos y medidas) ----------
   --lx: posición de la luz (px desde el centro); --rim-r / --rim-l: brillo de cada extremo (0–1).
   Lo actualiza setupGlowButtons() en portfolio.js; en reposo la luz está a la derecha. */
.glow-btn-wrap {
  --lx: 0px;
  --rim-r: 1;
  --rim-l: 0;
  position: relative;
  display: inline-flex;
  isolation: isolate;
}

.glow-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: #d1d1d1;
  color: #5a250a;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  white-space: nowrap;
}

.glow-btn__label {
  position: relative;
}

/* Sin enlace todavía: misma luz, sin aspecto de clic */
.glow-btn--soon {
  cursor: default;
}

.glow-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* Luz interior: núcleo caliente (::before) y, ENCIMA, el halo ancho desenfocado (::after).
   El halo tapa los anillos del núcleo: así el degradado se ve continuo, como en Huly */
.glow-btn__light {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 204px;
  height: 121px;
  pointer-events: none;
  transform: translate(calc(-50% + var(--lx)), -50%);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.glow-btn-wrap.is-tracking .glow-btn__light {
  transition-duration: 0.18s;
}

.glow-btn__light::before,
.glow-btn__light::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.glow-btn__light::before {
  width: 121px;
  height: 121px;
  background: radial-gradient(50% 50% at 50% 50%, #fffff5 3.5%, #ffaa81 26.5%, #ffda9f 37.5%, rgba(255, 170, 129, 0.5) 49%, rgba(210, 106, 58, 0) 92.5%);
}

.glow-btn__light::after {
  width: 204px;
  height: 103px;
  background: radial-gradient(43.3% 44.23% at 50% 49.51%, #fffff7 29%, #fffacd 48.5%, #f4d2bf 60.71%, rgba(214, 211, 210, 0) 100%);
  filter: blur(5px);
}

/* Aro detrás de la píldora: borde degradado + brillo fino + halo exterior */
.glow-btn__rim {
  position: absolute;
  inset: -4.5px;
  z-index: 0;
  border-radius: 999px;
  opacity: var(--rim-r);
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.glow-btn__rim--left {
  opacity: var(--rim-l);
  transform: scaleX(-1);
}

.glow-btn-wrap.is-tracking .glow-btn__rim {
  transition-duration: 0.18s;
}

.glow-btn__rim i {
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: linear-gradient(103.7deg, rgba(188, 155, 143, 0.1) 38.66%, rgba(233, 132, 99, 0.1) 68.55%, #e98463 85.01%, #ffffff 92.12%);
}

.glow-btn__rim::before,
.glow-btn__rim::after {
  content: "";
  position: absolute;
  border-radius: inherit;
}

.glow-btn__rim::before {
  inset: -2px;
  background: linear-gradient(97.68deg, rgba(255, 177, 153, 0) 38.1%, rgba(255, 177, 153, 0.2) 82.47%, #ff7950 93.3%);
  filter: blur(2px);
}

.glow-btn__rim::after {
  inset: -3px;
  background: linear-gradient(91.88deg, rgba(255, 137, 100, 0.2) 46.45%, #cd3100 98.59%);
  filter: blur(15px);
}


/* ===== CTA: misma estructura en todo el sitio =====
   Alto 48px, píldora, 13px seminegrita en mayúsculas. Cambia solo el estilo según el fondo:
   luz Huly (fondo oscuro), rojo / blanco (sólidos) y contorno (secundario). */
:root {
  --cta-h: 48px;
  --cta-px: 28px;
  --cta-fs: 13px;
}

.button,
.pf-chip,
.lp-btn,
.contact__consultation button,
.contact-row__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: var(--cta-h);
  min-height: var(--cta-h);
  padding: 0 var(--cta-px);
  border-radius: 999px;
  font-family: var(--body);
  font-size: var(--cta-fs);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Botón con luz: mismo alto y letra; un poco más de aire a la derecha para la luz */
.glow-btn {
  height: var(--cta-h);
  padding: 0 calc(var(--cta-px) + 14px) 0 calc(var(--cta-px) + 10px);
  font-size: var(--cta-fs);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Contorno sobre fondo oscuro (secundario junto al botón con luz) */
.lp-hero-band .lp-btn--outline,
.pf-card--dark .pf-chip {
  border: 1px solid rgba(237, 237, 237, 0.3);
  background: transparent;
  color: var(--white);
}

.lp-hero-band .lp-btn--outline:hover {
  border-color: var(--white);
  background: var(--white);
  color: var(--black-2);
}

/* El halo del botón con luz necesita aire: más separación con lo que va al lado */
.pf-chips .glow-btn-wrap:not(:last-child) {
  margin-right: 14px;
}

/* Tiendas: enlaces de texto en una línea («Купить: Ozon · Wildberries · …»), no botones */
.pf-stores {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 2px 0 0;
  max-width: none;
  font-size: 0.9rem;
  opacity: 1;
}

.pf-stores span {
  color: rgba(237, 237, 237, 0.55);
}

.pf-stores a {
  color: rgba(237, 237, 237, 0.92);
  text-decoration: underline;
  text-decoration-color: rgba(237, 237, 237, 0.3);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.pf-stores a:hover {
  color: #ffffff;
  text-decoration-color: var(--red);
}

.pf-stores i {
  color: rgba(237, 237, 237, 0.3);
  font-style: normal;
}

.pf-group + .pf-group {
  margin-top: 14px;
}

/* Студия и резюме: el círculo de la flecha mide lo mismo que la miniatura → mismo aire arriba, abajo y a la derecha */
.profile-link__arrow {
  width: 64px;
  height: 64px;
}

.profile-link__arrow svg {
  width: 18px;
  height: 18px;
}

.profile-link {
  grid-template-columns: 88px minmax(0, 1fr) 64px;
}

@media (max-width: 560px) {
  .profile-link {
    grid-template-columns: 64px minmax(0, 1fr) 48px;
  }

  .profile-link__arrow {
    width: 48px;
    height: 48px;
  }
}

/* Enlaces secundarios de las tarjetas: texto + ↗ (pestaña nueva), alineados con el botón con luz */
.pf-chips {
  align-items: center;
}

.pf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--cta-h);
  color: rgba(237, 237, 237, 0.88);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(237, 237, 237, 0.3);
  text-underline-offset: 5px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.pf-link:hover {
  color: #ffffff;
  text-decoration-color: var(--red);
}

.pf-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
  border-radius: 4px;
}

.pf-link__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

.pf-link:hover .pf-link__icon {
  transform: translate(2px, -2px);
}

/* Icono ↗ dentro de los botones (botón con luz y contorno) */
.glow-btn .pf-link__icon,
.lp-btn .pf-link__icon {
  position: relative;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  stroke-width: 1.8;
}

.lp-btn .pf-link__icon {
  margin-left: 0;
}

.glow-btn:hover .pf-link__icon,
.lp-btn:hover .pf-link__icon {
  transform: translate(2px, -2px);
}

/* Icono ↗ en enlaces de texto (tiendas, contacto, pie) */
.pf-stores a,
.contact-row__value,
.contact-row__action,
.footer__credit-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pf-stores .pf-link__icon,
.footer__credit-link .pf-link__icon {
  width: 11px;
  height: 11px;
}

.contact-row__value .pf-link__icon {
  width: 0.6em;
  height: 0.6em;
  margin-left: 4px;
  stroke-width: 2;
}

.contact-row__action .pf-link__icon {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

/* Portadas que abren otra web: círculo de cristal con ↗ en la esquina */
.pf-card__cover {
  position: relative;
}

a.pf-card__cover[target="_blank"]::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.5h6.5V10M12.5 3.5 4 12' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.25s ease, transform 0.25s ease;
}

a.pf-card__cover[target="_blank"]:hover::after {
  background-color: rgba(233, 63, 63, 0.9);
  transform: translate(2px, -2px);
}

/* Portadas dibujadas (SVG): se ven enteras, sin recortar, sobre su mismo fondo */
.pf-card__cover[style*=".svg"] {
  background-color: #151515;
  background-size: contain;
}

/* Tarjeta de libros: un bloque por libro (portada + sus enlaces), sin panel detrás de la portada */
.pf-card--books {
  grid-template-columns: minmax(0, 1fr);
}

.pf-card--books .pf-card__body {
  align-content: start;
  gap: clamp(32px, 4vw, 56px);
}

.pf-books__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
}

.pf-books__head > div {
  display: grid;
  gap: 16px;
}

.pf-books__head p {
  max-width: 560px;
  margin: 0;
}

.pf-books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
}

.pf-book {
  display: grid;
  grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  gap: clamp(20px, 2.4vw, 32px);
  align-items: start;
}

.pf-book__cover {
  display: block;
}

.pf-book__cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px 6px 6px 3px;
  box-shadow: inset -6px 0 0 rgba(0, 0, 0, 0.18), 0 24px 48px rgba(0, 0, 0, 0.55);
  transform: rotate(-2deg);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

a.pf-book__cover:hover img {
  transform: rotate(0deg) translateY(-6px);
}

.pf-book__info {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.pf-book__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
}

.pf-book__sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pf-book .pf-stores {
  margin: 0;
}

@media (max-width: 920px) {
  .pf-books__head,
  .pf-books {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-book {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
  }
}
