:root {
  --bg: #f4fbff;
  --bg-deep: #e9f4ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(83, 122, 184, 0.14);
  --line-strong: rgba(83, 122, 184, 0.24);
  --text: #10233f;
  --muted: #617a98;
  --accent: #2f7cf6;
  --accent-strong: #1457c8;
  --accent-soft: #e8f2ff;
  --cyan: #11a0c8;
  --shadow: 0 30px 90px rgba(32, 82, 156, 0.14);
  --shadow-soft: 0 20px 52px rgba(32, 82, 156, 0.1);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --max: 1380px;
  --preview-height: 186px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(17, 160, 200, 0.16), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(47, 124, 246, 0.16), transparent 26%),
    linear-gradient(180deg, #f9fcff 0%, #f1f8ff 52%, #ebf4ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      90deg,
      rgba(61, 113, 186, 0.04) 0,
      rgba(61, 113, 186, 0.04) 1px,
      transparent 1px,
      transparent 112px
    );
  pointer-events: none;
}

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

button {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(240, 248, 255, 0.72)),
    rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  animation: rise 0.7s ease both;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto auto -120px -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 160, 200, 0.18), transparent 72%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 124, 246, 0.2), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(17, 160, 200, 0.16);
  background: rgba(17, 160, 200, 0.08);
  color: #0d7f9f;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 6px rgba(17, 160, 200, 0.1);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.82fr);
  gap: 24px;
  align-items: end;
}

.hero-copy h1 {
  margin: 0;
  max-width: 11ch;
  font-family: "Fraunces", serif;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.hero-copy p {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.76;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(83, 122, 184, 0.14);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(83, 122, 184, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(234, 244, 255, 0.82));
  box-shadow: var(--shadow-soft);
}

.hero-panel-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero-panel-title {
  display: block;
  max-width: 18ch;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-chip {
  min-height: 112px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(83, 122, 184, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

.hero-chip strong {
  display: block;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-chip span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.catalog-meta {
  display: flex;
  justify-content: center;
  margin: 22px 0 0;
  animation: rise 0.82s ease both;
  animation-delay: 0.08s;
}

.catalog-meta span {
  max-width: 880px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(83, 122, 184, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.category-section,
.content-section {
  margin-top: 24px;
}

.section-copy {
  margin-bottom: 16px;
}

.section-copy h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.05em;
}

.section-copy p {
  max-width: 860px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(83, 122, 184, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(47, 124, 246, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
}

.category-pill:hover,
.category-pill.is-active {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.category-pill.is-active {
  background: linear-gradient(135deg, rgba(47, 124, 246, 0.14), rgba(17, 160, 200, 0.1));
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  align-items: start;
  margin-top: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-self: start;
  overflow: hidden;
  border: 1px solid rgba(83, 122, 184, 0.12);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.86));
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
  animation: rise 0.7s ease both;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 62px rgba(32, 82, 156, 0.14);
}

.card:focus-visible {
  outline: 0;
}

.preview {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: var(--preview-height);
  overflow: hidden;
  border-bottom: 1px solid rgba(83, 122, 184, 0.12);
  background:
    linear-gradient(180deg, rgba(230, 242, 255, 0.9), rgba(214, 233, 255, 0.58));
}

.preview::before {
  content: "";
  position: absolute;
  inset: auto -54px -56px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 124, 246, 0.18), transparent 70%);
  pointer-events: none;
}

.preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(233, 244, 255, 0), rgba(233, 244, 255, 0.8));
  pointer-events: none;
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(83, 122, 184, 0.1);
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(10px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(20, 87, 200, 0.22);
}

.dot:first-child {
  background: rgba(47, 124, 246, 0.4);
}

.dot:nth-child(2) {
  background: rgba(17, 160, 200, 0.34);
}

.preview-label {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-media {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.preview-image,
.preview-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview-image {
  display: block;
  object-fit: cover;
}

.preview-empty {
  background:
    radial-gradient(circle at top left, rgba(47, 124, 246, 0.18), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(17, 160, 200, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(230, 242, 255, 0.92), rgba(214, 233, 255, 0.6));
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill.code {
  background: rgba(47, 124, 246, 0.1);
  color: var(--accent-strong);
}

.pill.file {
  background: rgba(17, 160, 200, 0.1);
  color: #0d7f9f;
}

.pill.category {
  background: rgba(12, 126, 98, 0.1);
  color: #0b7d62;
}

.pill.mode {
  background: rgba(16, 35, 63, 0.08);
  color: var(--text);
}

.card h2 {
  margin: 0;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.card-subtitle {
  margin: 0;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.card-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card-actions {
  padding-top: 2px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

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

.mini-button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 18px 32px rgba(20, 87, 200, 0.22);
}

.empty-state {
  padding: 36px 28px;
  border: 1px dashed rgba(83, 122, 184, 0.18);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max));
    padding-top: 18px;
  }

  .hero {
    padding: 22px;
    border-radius: 28px;
  }

  .hero-badges {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-chip-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .catalog-meta span {
    border-radius: 24px;
    text-align: left;
  }

  .category-nav {
    flex-direction: column;
  }

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

  .card-body {
    padding: 18px;
  }

  .mini-button {
    width: 100%;
  }
}
