/* Styles for /designs/ hub page. */

.hub-hero {
  text-align: center;
  padding: 72px 20px 52px;
  background: radial-gradient(circle at 50% -20%, rgba(103, 179, 255, 0.12), transparent 60%);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.hub-hero h1 {
  font-size: 48px;
  margin: 0 0 16px;
  background: linear-gradient(to bottom right, var(--headline), var(--text));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hub-hero p {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 720px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.category-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 auto;
}
.category-nav-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 auto 36px;
}
.category-nav-clip {
  position: relative;
  width: 100%;
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding-bottom: 4px;
}
.category-nav-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 64px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 16, 27, 0), rgba(10, 16, 27, 0.1) 45%, rgba(10, 16, 27, 0.85));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.category-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(31, 40, 55, 0.9);
  background: color-mix(in srgb, var(--surface-3) 90%, transparent);
  color: var(--headline);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.category-toggle:hover {
  border-color: var(--accent2);
  color: var(--headline);
  background: rgba(46, 59, 80, 0.95);
  background: color-mix(in srgb, var(--surface-2) 95%, transparent);
}
.category-toggle__chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}
.category-nav-shell.is-clamped .category-toggle {
  display: inline-flex;
}
.category-nav-shell.is-clamped:not(.is-expanded) .category-nav-fade {
  opacity: 1;
  visibility: visible;
}
.category-nav-shell.is-expanded .category-toggle__chevron {
  transform: rotate(180deg);
}
.category-nav-shell.is-peeking .category-nav-clip {
  padding-bottom: 14px;
}
.category-nav-shell.is-peeking .category-nav-fade {
  opacity: 1;
  visibility: visible;
}
:root[data-theme="light"] .category-nav-fade {
  background: linear-gradient(180deg, rgba(245, 248, 252, 0), rgba(245, 248, 252, 0.4) 45%, rgba(245, 248, 252, 0.95));
}
.grid-shell {
  position: relative;
  overflow: hidden;
  max-height: none;
  transition: max-height 0.35s ease;
  margin-bottom: 8px;
}
.grid-shell .hub-grid { margin-bottom: 0; }
.grid-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(31, 40, 55, 0.9);
  background: color-mix(in srgb, var(--surface-3) 90%, transparent);
  color: var(--headline);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  margin: 10px auto 32px;
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.grid-toggle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.18), rgba(255,255,255,0.02), rgba(255,255,255,0.18));
  pointer-events: none;
  transform: translateX(-100%);
  animation: shine 3s infinite;
}
.grid-toggle:hover {
  border-color: var(--accent2);
  color: var(--headline);
  background: rgba(46, 59, 80, 0.95);
  background: color-mix(in srgb, var(--surface-2) 95%, transparent);
  transform: translateY(-1px);
}
section.is-clamped .grid-toggle { display: inline-flex; }
@keyframes shine {
  20% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--headline);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
}
.cat-chip:hover {
  border-color: var(--accent2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transform: translateY(-2px);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.section-header h2 {
  font-size: 24px;
  margin: 0;
  color: var(--headline);
}
.badge {
  background: rgba(80, 227, 164, 0.1);
  color: var(--accent);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
:root[data-theme="light"] .badge {
  background: color-mix(in srgb, var(--accent2) 18%, #ffffff 82%);
  border: 1px solid color-mix(in srgb, var(--accent2) 42%, transparent);
  color: #1f4f83;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 52px;
}
.tmpl-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.tmpl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.4);
  border-color: var(--edge);
}
.tmpl-card__img {
  aspect-ratio: 16/9;
  background: transparent;
  position: relative;
}
.tmpl-card__img::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.09), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.25));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 -1px 0 rgba(0,0,0,0.25);
  opacity: 0.8;
}
.tmpl-card__img img { width: 100%; height: 100%; object-fit: cover; }
.tmpl-card__body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.tmpl-card__title { font-size: 18px; color: var(--headline); margin: 0 0 8px; font-weight: 600; }
.tmpl-card__desc { font-size: 14px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.5; flex-grow: 1; }
.tmpl-card__footer { margin-top: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.link-primary { color: var(--accent2); }
.free-pill.design-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1d9b63;
  background: color-mix(in srgb, var(--accent) 68%, #0f6a4a 32%);
  color: #f5fff7;
  font-size: 11px;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 999px;
  letter-spacing: .03em;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  line-height: 1;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  pointer-events: none;
}
.free-pill[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .category-nav-clip,
  .category-nav-fade,
  .category-toggle__chevron {
    transition: none;
  }
}
@media (max-width: 768px) {
  .hub-hero h1 { font-size: 34px; }
  .hub-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (max-width: 540px) {
  .hub-hero { padding: 64px 18px 40px; }
  .hub-hero h1 { font-size: 30px; }
  .hub-grid { grid-template-columns: 1fr; }
}
