
:root {
  --bg: #0a0a0a;
  --bg-alt: #0e0e10;
  --surface: #121214;
  --surface-2: #17171a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --accent: #a200ff;
  --accent-hover: #b44bff;
  --accent-soft: rgba(162, 0, 255, 0.12);
  --accent-border: rgba(162, 0, 255, 0.35);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --container: 1200px;
  --nav-offset: 104px;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", var(--font-body);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-offset);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.15;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-home {
  --text-faint: #8b8b94;
}

html:has(> body.page-home) {
  scroll-padding-top: 0;
}

.page-home main [id],
.page-home .site-footer [id] {
  scroll-margin-top: var(--nav-offset);
}

.page-home main > section[id] {
  scroll-margin-top: calc(var(--nav-offset) - 24px);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(var(--container), 100% - 32px);
  margin-inline: auto;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
}

.brand i {
  color: var(--accent);
  font-size: 1.2rem;
}

.page-home .navbar-custom .nav-link:focus-visible,
.page-home .navbar-custom .navbar-brand:focus-visible,
.page-home .navbar-custom .navbar-toggler:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

@media (hover: none) {
  .page-home .navbar-custom .nav-link:hover:not([aria-current]) {
    background: transparent;
    color: rgba(255, 255, 255, 0.7) !important;
  }
}

@media (max-width: 991.98px) {
  html:has(> body.page-home) {
    --nav-offset: 84px;
  }

  .page-home .navbar-custom {
    top: 12px;
    width: calc(100% - 32px);
    padding: 8px 8px 8px 14px;
  }

  .page-home .navbar-custom .container-fluid {
    flex-wrap: wrap !important;
    padding: 0;
  }

  .page-home .navbar-custom .navbar-collapse {
    flex-basis: 100%;
  }

  .page-home .navbar-custom .navbar-brand {
    margin: 0;
    padding-block: 4px;
    font-size: 1.1rem;
  }

  .page-home .navbar-custom .navbar-toggler {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-sm);
  }

  .page-home .navbar-custom.is-open .navbar-toggler {
    background: rgba(255, 255, 255, 0.06);
  }

  .page-home .navbar-custom.is-open .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.9)' stroke-width='1.8' stroke-linecap='round' d='M8 8l14 14M22 8L8 22'/%3E%3C/svg%3E");
  }

  .page-home .navbar-custom .navbar-collapse {
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 8px 0 0;
    padding: 8px 0 2px;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  }

  .page-home .navbar-custom .navbar-collapse::-webkit-scrollbar {
    width: 6px;
  }

  .page-home .navbar-custom .navbar-collapse::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.18);
  }

  .page-home .navbar-custom .navbar-collapse::-webkit-scrollbar-track {
    background: transparent;
  }

  .page-home .navbar-custom .navbar-collapse.collapsing {
    overflow: hidden;
  }

  .page-home .navbar-custom .navbar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .page-home .navbar-custom .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px !important;
    border-radius: var(--radius-sm);
  }

  .page-home .navbar-custom .nav-link[target="_blank"]::after {
    content: "\F1C5";
    font-family: "bootstrap-icons";
    font-size: 11px;
    opacity: 0.55;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.button--primary {
  border: 0;
  background: var(--accent);
  color: #fff;
}

.button--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.button--secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.button--secondary:hover {
  border-color: var(--accent-border);
  background: var(--surface-2);
  color: var(--text);
}

.button--sm {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -160px;
  width: 680px;
  height: 680px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(162, 0, 255, 0.14), transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: center;
  gap: 56px;
  padding: calc(var(--nav-offset) + 16px) 0 40px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-lead {
  max-width: 560px;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: clamp(16px, 2vw, 19px);
}

.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
  margin-top: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.hero-search > i {
  position: absolute;
  left: 18px;
  color: var(--text-faint);
  pointer-events: none;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 12px 0 48px;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: none;
}

.hero-search input::placeholder {
  color: var(--text-faint);
}

.hero-search button {
  height: 42px;
  margin-right: 7px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  transition: background 0.15s;
}

.hero-search button:hover {
  background: var(--accent-hover);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 14px;
}

.hero-meta i {
  color: var(--accent-hover);
}

.palette {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(18, 18, 20, 0.92);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(162, 0, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.palette__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.palette__dots {
  display: flex;
  gap: 6px;
}

.palette__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.palette__title {
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
}

.palette__search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
}

.palette__search i {
  color: var(--text-faint);
}

.palette__typed:empty::before {
  content: "Search a game…";
  color: var(--text-faint);
}

.palette__caret {
  width: 2px;
  height: 20px;
  margin-left: -8px;
  background: var(--accent-hover);
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

.palette__list {
  display: grid;
  gap: 2px;
  padding: 6px;
}

.palette__row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  transition: background 0.2s var(--ease);
}

.palette__row img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
}

.palette__name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette__sub {
  display: block;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette__enter {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s;
}

.palette__row.is-active {
  background: var(--accent-soft);
}

.palette__row.is-active .palette__enter {
  opacity: 1;
}

.palette__skeleton {
  height: 50px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface));
  background-size: 200% 100%;
  animation: shimmer-bg 1.4s infinite;
}

@keyframes shimmer-bg {
  to { background-position: -200% 0; }
}

.palette__footer {
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12px;
}

.palette__footer kbd {
  margin-right: 4px;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  box-shadow: none;
}

.section {
  padding: 72px 0;
}

.section--alt {
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
}

.hero + .section {
  padding-top: 48px;
}

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

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-desc {
  max-width: 420px;
  color: var(--text-muted);
  font-size: 15px;
  text-align: right;
}

.section-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.page-home #featured {
  padding-bottom: 48px;
}

.ad-slot {
  display: none;
}

.ad-slot:not(:empty),
.show-ad-slots .ad-slot {
  display: block;
  width: min(var(--container), 100% - 32px);
  min-height: 100px;
  margin: 32px auto;
}

.show-ad-slots .ad-slot:empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.show-ad-slots .ad-slot:empty::before {
  content: "Ad space";
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-grid > .ad-slot {
  grid-column: 1 / -1;
  width: 100%;
  margin: 16px 0;
}

.featured-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
}

.spotlight {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.spotlight__track,
.spotlight__skeleton {
  position: absolute;
  inset: 0;
}

.spotlight__skeleton {
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.spotlight__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease), visibility 0s linear 0.6s;
}

.spotlight__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s var(--ease), visibility 0s;
}

.spotlight__slide > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.04;
  transition: scale 6s linear;
}

.spotlight__slide.is-active > img {
  scale: 1;
}

.spotlight__slide > img.is-letterbox {
  inset: 50% auto auto 50%;
  width: max(100%, calc(var(--spot-h, 440px) * 16 / 9));
  max-width: none;
  height: auto;
  object-fit: fill;
  translate: -50% -50%;
}

.spotlight__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0) 25%, rgba(10, 10, 10, 0.75) 60%, rgba(10, 10, 10, 0.96));
}

.spotlight__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 24px 72px;
}

.spotlight__body h3 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
}

.spotlight__slide,
.spotlight__slide:hover {
  color: var(--text);
  text-decoration: none;
}

.spotlight__slide:focus-visible {
  outline-offset: -4px;
}

.spotlight__cta {
  align-self: flex-start;
  margin-top: 4px;
}

.spotlight__badge {
  align-self: flex-start;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.78);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.script-card__badge[data-badge="new"],
.spotlight__badge[data-badge="new"] {
  border-color: var(--accent-border);
  background: rgba(60, 0, 95, 0.85);
}

.spotlight__meta {
  color: var(--text-muted);
  font-size: 14px;
}

.spotlight__controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spotlight__dots {
  display: flex;
  flex: 1;
  gap: 6px;
}

.spotlight__dot {
  position: relative;
  flex: 1;
  max-width: 56px;
  height: 4px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
}

.spotlight__dot::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}

.spotlight__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}

.spotlight__dot.is-done::after {
  transform: scaleX(1);
  opacity: 0.6;
}

.spotlight__dot.is-active::after {
  animation: dot-progress var(--spotlight-interval, 6s) linear forwards;
}

.spotlight.is-paused .spotlight__dot.is-active::after {
  animation: none;
  transform: scaleX(1);
}

@keyframes dot-progress {
  to { transform: scaleX(1); }
}

.spotlight__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(10, 10, 10, 0.6);
  color: var(--text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.15s;
}

.spotlight__btn:hover {
  border-color: var(--accent-border);
}

.featured-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.featured-side .script-card__media {
  aspect-ratio: 16 / 8;
}

.featured-side .script-card__body {
  padding: 12px 14px;
}

.featured-side .script-card__title {
  font-size: 15px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.script-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: card-in 0.35s var(--ease) both;
}

.script-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

.script-card:focus-within {
  border-color: var(--accent-border);
}

.script-card:has(.script-card__link:focus-visible) {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.script-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.script-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}

.script-card:hover .script-card__media img {
  transform: scale(1.03);
}

.script-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.script-card__badge.is-official {
  border-color: var(--accent-border);
  background: rgba(60, 0, 95, 0.85);
}

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

.script-card__title {
  font-size: 17px;
  font-weight: 600;
}

.script-card__link {
  color: inherit;
  text-decoration: none;
}

.script-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.script-card__link:hover {
  color: inherit;
}

.script-card__link:focus-visible {
  outline: none;
}

.script-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.script-card__tags li {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.script-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--text-faint);
  font-size: 13px;
}

.script-card__cta {
  color: var(--accent-hover);
  font-weight: 600;
  white-space: nowrap;
}

.script-card__stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.script-card__stats + .script-card__cta {
  margin-left: 0;
}

.script-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.script-stat .bi-heart {
  color: #f472b6;
}

.script-card__cta i {
  display: inline-block;
  transition: transform 0.2s var(--ease);
}

.script-card:hover .script-card__cta i {
  transform: translateX(3px);
}

.card-skeleton {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.card-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.catalog-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 520px;
}

.catalog-search > i {
  position: absolute;
  left: 14px;
  color: var(--text-faint);
  pointer-events: none;
}

.catalog-search input {
  width: 100%;
  height: 44px;
  padding: 0 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.catalog-search input::placeholder {
  color: var(--text-faint);
}

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

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

.catalog-search__clear {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
}

.catalog-search__clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

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

.chip[aria-pressed="true"] {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--text);
}

.catalog-status {
  min-height: 22px;
  margin-bottom: 14px;
  color: var(--text-faint);
  font-size: 14px;
}

.catalog-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
  padding: 56px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
}

.catalog-message i {
  color: var(--text-faint);
  font-size: 28px;
}

.catalog-message strong {
  color: var(--text);
  font-size: 17px;
}

.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.step {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.step__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
}

.step h3 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
}

.step p {
  color: var(--text-muted);
  font-size: 15px;
}

.step a,
.about-copy a {
  color: var(--accent-hover);
  text-underline-offset: 3px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.resource-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.resource-card:hover {
  border-color: var(--accent-border);
  color: inherit;
  transform: translateY(-3px);
}

.resource-card > i {
  margin-bottom: 8px;
  color: var(--accent-hover);
  font-size: 22px;
}

.resource-card h3 {
  font-size: 17px;
  font-weight: 600;
}

.resource-card p {
  color: var(--text-muted);
  font-size: 14px;
}

.resource-card__cta {
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent-hover);
  font-size: 14px;
  font-weight: 600;
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 48px;
}

.about h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-muted);
  font-size: 16px;
}

.lds-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 10000;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}

.lds-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 901px) and (max-height: 820px) {
  .hero-inner {
    padding-bottom: 28px;
  }

  .hero + .section {
    padding-top: 36px;
  }
}

@media (max-width: 1080px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    gap: 40px;
  }

  .featured-layout {
    grid-template-columns: 1fr;
  }

  .catalog-grid,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 1080px) {
  .page-home .spotlight {
    min-height: 400px;
  }

  .page-home .featured-side {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .page-home .featured-side .script-card__tags,
  .page-home .featured-side .script-card__footer {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --nav-offset: 96px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 36px;
  }

  .palette {
    max-width: 520px;
  }

  .palette__list > li:nth-child(n + 4) {
    display: none;
  }

  .hero + .section {
    padding-top: 40px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .section {
    padding: 56px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-desc {
    text-align: left;
  }

  .catalog-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .spotlight {
    min-height: 380px;
  }

  .spotlight__body {
    padding: 18px 18px 64px;
  }

  .featured-side {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .featured-side .script-card__tags,
  .featured-side .script-card__footer {
    display: none;
  }

  .hero-search input {
    height: 52px;
  }

  .hero-search button {
    padding: 0 14px;
  }

  .palette__footer {
    display: none;
  }

  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -16px;
    padding: 2px 16px;
    scroll-behavior: smooth;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .chip-row::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
    height: 36px;
    scroll-snap-align: start;
  }

  .chip-scroller {
    position: relative;
  }

  .chip-scroller::before,
  .chip-scroller::after {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 64px;
    color: var(--accent-hover);
    font-family: "bootstrap-icons";
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }

  .chip-scroller::before {
    content: "\F284";
    left: -16px;
    justify-content: flex-start;
    padding-left: 6px;
    background: linear-gradient(to right, var(--bg-alt) 45%, transparent);
  }

  .chip-scroller::after {
    content: "\F285";
    right: -16px;
    justify-content: flex-end;
    padding-right: 6px;
    background: linear-gradient(to left, var(--bg-alt) 45%, transparent);
  }

  .chip-scroller.has-more-start::before,
  .chip-scroller.has-more-end::after {
    opacity: 1;
  }

  .catalog-toolbar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .catalog-search input {
    height: 42px;
    background: transparent;
    font-size: 16px;
  }

  .page-home #featured {
    padding-bottom: 40px;
  }

  .section-aside {
    align-items: flex-start;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  .chip-row {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
