/* Fer Labs — tokens tomados del diseño en Pencil */
:root {
  --bg: #f8f8fb;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --border: #e4e4e9;
  --border-strong: #d3d3db;
  --text: #0d0d12;
  --text-2: #61616d;
  --muted: #9797a2;
  --accent: #5a45e0;
  --accent-soft: #5a45e012;

  --radius-card: 14px;
  --radius-pill: 999px;
  --shell: 1248px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 12% 4%, rgba(90, 69, 224, 0.09), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(246, 130, 31, 0.055), transparent 24rem);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px max(20px, calc((100vw - var(--shell)) / 2));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.5s var(--ease-out);
}

.brand:hover .brand__mark {
  transform: rotate(-8deg) scale(1.06);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  max-width: 46vw;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search__icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex: none;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
}

.search input::placeholder {
  color: var(--muted);
}

.search input::-webkit-search-cancel-button {
  appearance: none;
}

.search__kbd {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  transition: opacity 0.2s var(--ease);
}

.search:focus-within .search__kbd {
  opacity: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease-out);
}

.icon-btn.is-list svg {
  transform: rotate(90deg);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 84px 20px 70px;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.hero__title {
  max-width: 840px;
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(46px, 7vw, 86px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero__title span {
  color: var(--text-2);
}

.hero__copy {
  max-width: 540px;
  margin: 28px 0 0;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- Sección ---------- */
.section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px 76px;
}

.section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section__label {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section__title {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.8px;
}

.section__sub {
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
  text-align: right;
}

/* ---------- Filtros ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.22s var(--ease), color 0.22s var(--ease),
    border-color 0.22s var(--ease), transform 0.18s var(--ease);
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip:active {
  transform: scale(0.96);
}

.chip[aria-selected="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  font-weight: 500;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.grid.is-list {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ---------- Card ---------- */
.card {
  --card-accent: var(--accent);
  --lift: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 276px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
  transform: translateY(var(--lift));
  transition: transform 0.35s var(--ease-out), border-color 0.25s var(--ease),
    box-shadow 0.35s var(--ease-out);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--card-accent) 12%, transparent),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.card:hover {
  --lift: -4px;
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px -18px rgba(13, 13, 18, 0.35);
}

.card:hover::after {
  opacity: 1;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.4s var(--ease-out);
}

.card__icon svg {
  width: 22px;
  height: 22px;
}

.card:hover .card__icon {
  background: color-mix(in srgb, var(--card-accent) 10%, transparent);
  color: var(--card-accent);
  transform: scale(1.06) rotate(-4deg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot, var(--text));
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card__name {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 19px;
  font-weight: 600;
}

.card__desc {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}

.card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.open {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.22s var(--ease), background-color 0.22s var(--ease),
    color 0.22s var(--ease), transform 0.18s var(--ease);
}

.open svg {
  width: 15px;
  height: 15px;
  transition: transform 0.28s var(--ease-out);
}

.card:hover .open {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.card:hover .open svg {
  transform: translate(2px, -2px);
}

.open:active {
  transform: scale(0.97);
}

.card__stack {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

/* Vista lista */
.grid.is-list .card {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  min-height: 0;
  padding: 18px 22px;
}

.grid.is-list .card__top {
  flex: none;
}

.grid.is-list .card__body {
  gap: 4px;
}

.grid.is-list .card__bottom {
  flex: none;
  gap: 20px;
}

.grid.is-list .badge {
  display: none;
}

/* ---------- Empty ---------- */
.empty {
  margin: 48px 0 0;
  color: var(--muted);
  text-align: center;
  animation: rise 0.4s var(--ease-out) both;
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 22px 20px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

/* ---------- Animaciones ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-reveal] {
  animation: rise 0.6s var(--ease-out) both;
  animation-delay: var(--delay, 0ms);
}

.card {
  animation: rise 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 55ms + var(--base-delay, 0ms));
}

.card.is-leaving {
  animation: none;
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
  }

  .nav__actions {
    width: 100%;
  }

  .search {
    width: auto;
    max-width: none;
    flex: 1;
  }

  .hero {
    padding: 58px 20px 48px;
  }

  .hero__title {
    font-size: clamp(42px, 13vw, 58px);
  }

  .hero__copy {
    margin-top: 22px;
    font-size: 15px;
  }

  .section {
    padding: 0 20px 44px;
  }

  .section__header {
    display: block;
  }

  .section__sub {
    margin-top: 9px;
    text-align: left;
  }

  .section__title {
    font-size: 24px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer {
    flex-direction: column;
    gap: 5px;
  }

  .card {
    min-height: 0;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -20px;
    padding-inline: 20px;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: none;
  }
}

@media (min-width: 721px) and (max-width: 1040px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
