:root {
  --gallery-bg: #f5f7fb;
  --gallery-text: #10131a;
  --gallery-muted: rgba(16, 19, 26, 0.62);
  --gallery-blue: #3158ff;
  --gallery-line: rgba(17, 24, 39, 0.1);
  --gallery-card: rgba(255, 255, 255, 0.76);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--gallery-bg);
}

body.theme-gallery-page {
  min-height: 100vh;
  margin: 0;
  color: var(--gallery-text);
  background:
    radial-gradient(circle at 12% 6%, rgba(49, 88, 255, 0.16), transparent 26%),
    radial-gradient(circle at 86% 0%, rgba(111, 213, 237, 0.16), transparent 24%),
    linear-gradient(180deg, #f5f7fb 0%, #ffffff 44%, #f7f9fd 100%);
  font-family: "Plus Jakarta Sans", "Manrope", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.theme-gallery-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 16px clamp(18px, 4vw, 34px);
  background: rgba(245, 247, 251, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.theme-gallery-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gallery-text);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.theme-gallery-brand img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.theme-gallery-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.theme-gallery-nav a,
.theme-gallery-secondary,
.theme-gallery-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.theme-gallery-nav a,
.theme-gallery-secondary {
  color: rgba(16, 19, 26, 0.72);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--gallery-line);
}

.theme-gallery-nav-cta,
.theme-gallery-primary {
  color: #ffffff !important;
  background: #111827 !important;
  border: 1px solid #111827 !important;
}

.theme-gallery-hero {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(66px, 9vw, 118px) clamp(20px, 4vw, 42px) clamp(34px, 6vw, 64px);
  text-align: center;
}

.theme-gallery-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 18px;
  padding: 0 14px;
  border: 1px solid rgba(49, 88, 255, 0.16);
  border-radius: 999px;
  color: var(--gallery-blue);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.theme-gallery-hero h1,
.theme-gallery-library h2,
.theme-gallery-final-cta h2 {
  margin: 0;
  font-family: "Manrope", "Plus Jakarta Sans", sans-serif;
  font-weight: 850;
  letter-spacing: -0.065em;
  color: var(--gallery-text);
}

.theme-gallery-hero h1 {
  font-size: clamp(2.35rem, 5.6vw, 5.2rem);
  line-height: 1;
}

.theme-gallery-lead {
  width: min(100%, 680px);
  margin: 24px auto 0;
  color: var(--gallery-muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.72;
  letter-spacing: -0.025em;
}

.theme-gallery-hero-actions,
.theme-gallery-proof-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-gallery-hero-actions {
  margin-top: 28px;
}

.theme-gallery-proof-row {
  margin-top: 24px;
}

.theme-gallery-proof-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(16, 19, 26, 0.64);
  font-size: 0.78rem;
  font-weight: 720;
}

.theme-gallery-strip {
  width: 100%;
  overflow: hidden;
  padding: 20px 0 56px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
}

.theme-gallery-strip-track {
  display: flex;
  gap: 18px;
  width: max-content;
  padding-left: max(24px, calc((100vw - 1180px) / 2));
  animation: themeGalleryDrift 60s linear infinite;
}

.theme-gallery-strip-card {
  width: 168px;
  flex: 0 0 168px;
}

.theme-gallery-strip-card,
.theme-gallery-card {
  appearance: none;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: zoom-in;
  text-align: inherit;
}

.theme-gallery-strip-card img,
.theme-gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 22px;
  background: transparent;
}

.theme-gallery-strip-card span,
.theme-gallery-card span {
  display: block;
  margin-top: 8px;
  color: rgba(16, 19, 26, 0.56);
  font-size: 0.68rem;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-align: center;
}

.theme-gallery-library {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(46px, 7vw, 84px) clamp(18px, 4vw, 34px);
}

.theme-gallery-library-header {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(260px, 0.58fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 34px;
}

.theme-gallery-library h2,
.theme-gallery-final-cta h2 {
  font-size: clamp(2rem, 4.6vw, 4.1rem);
  line-height: 1.02;
}

.theme-gallery-library-header p:last-child {
  margin: 0;
  color: var(--gallery-muted);
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: -0.025em;
}

.theme-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}

.theme-gallery-card {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.theme-gallery-card img {
  transition: transform 0.24s ease, filter 0.24s ease;
}

.theme-gallery-card:hover img,
.theme-gallery-strip-card:hover img {
  transform: translateY(-4px);
  filter: saturate(1.04) contrast(1.02);
}

.theme-gallery-card:focus-visible,
.theme-gallery-strip-card:focus-visible {
  outline: 3px solid rgba(49, 88, 255, 0.34);
  outline-offset: 5px;
  border-radius: 24px;
}

.theme-preview-open {
  overflow: hidden;
}

.theme-preview-modal[hidden] {
  display: none !important;
}

.theme-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 38px);
}

.theme-preview-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.26), transparent 28%),
    rgba(7, 12, 24, 0.52);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.theme-preview-dialog {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 460px);
  max-height: calc(100vh - 36px);
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.76) 48%, rgba(245, 247, 251, 0.64) 100%);
  box-shadow: 0 36px 90px rgba(6, 11, 24, 0.34);
  animation: themePreviewIn 0.34s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.theme-preview-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  color: rgba(16, 19, 26, 0.78);
  background: rgba(255, 255, 255, 0.84);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.theme-preview-phone-shell {
  width: min(74vw, 332px);
  max-height: min(74vh, 590px);
  aspect-ratio: 9 / 16;
  padding: 12px;
  border-radius: 44px;
  background:
    linear-gradient(145deg, #ffffff 0%, #f4f6fb 100%);
  box-shadow:
    inset 0 0 0 1px rgba(17, 24, 39, 0.08),
    0 22px 58px rgba(16, 24, 40, 0.18);
}

.theme-preview-phone-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 32px;
  background: #ffffff;
}

.theme-preview-phone-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.theme-preview-caption {
  margin-top: 16px;
  text-align: center;
}

.theme-preview-caption p {
  margin: 0 0 4px;
  color: var(--gallery-blue);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-preview-caption h2 {
  margin: 0;
  color: var(--gallery-text);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: -0.045em;
}

@keyframes themePreviewIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

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

.theme-gallery-final-cta {
  width: min(100% - 36px, 1060px);
  margin: 34px auto 86px;
  padding: clamp(44px, 7vw, 82px) clamp(22px, 5vw, 72px);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 34px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 12%, rgba(49, 88, 255, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.58));
}

.theme-gallery-final-cta p:not(.theme-gallery-kicker) {
  width: min(100%, 620px);
  margin: 18px auto 26px;
  color: var(--gallery-muted);
  font-size: 1rem;
  line-height: 1.72;
  letter-spacing: -0.025em;
}

@keyframes themeGalleryDrift {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-gallery-strip-track {
    animation: none;
  }
}

@media (max-width: 760px) {
  .theme-gallery-topbar {
    padding: 12px 16px;
  }

  .theme-gallery-nav a:not(.theme-gallery-nav-cta) {
    display: none;
  }

  .theme-gallery-hero {
    padding-top: 58px;
  }

  .theme-gallery-hero h1 {
    font-size: clamp(2.28rem, 11vw, 3.6rem);
  }

  .theme-gallery-strip {
    padding-bottom: 38px;
  }

  .theme-gallery-strip-card {
    width: 132px;
    flex-basis: 132px;
  }

  .theme-gallery-library-header {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 26px;
  }

  .theme-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .theme-gallery-card img,
  .theme-gallery-strip-card img {
    border-radius: 16px;
  }

  .theme-preview-dialog {
    width: min(100%, 390px);
    border-radius: 28px;
  }

  .theme-preview-phone-shell {
    width: min(76vw, 286px);
    padding: 9px;
    border-radius: 36px;
  }

  .theme-preview-phone-screen {
    border-radius: 27px;
  }

  .theme-gallery-final-cta {
    width: min(100% - 28px, 1060px);
    margin-bottom: 58px;
    border-radius: 26px;
  }
}
