body[data-design-template] {
  --design-radius: clamp(18px, 2vw, 34px);
  --design-section-gap: clamp(42px, 7vw, 92px);
  --design-reveal-y: 18px;
}

body[data-design-template] .section,
body[data-design-template] .content-section,
body[data-design-template] main > section {
  scroll-margin-top: 110px;
}

body[data-design-template] .card,
body[data-design-template] .feature-card,
body[data-design-template] .product-card,
body[data-design-template] .platform-card,
body[data-design-template] .site-card {
  border-radius: var(--design-radius);
}

body[data-design-template] .commerce-shell > section {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body[data-design-template="operational-atlas"] .hero,
body[data-design-template="operational-atlas"] .page-hero {
  position: relative;
  overflow: hidden;
}

body[data-design-template="operational-atlas"] .hero::after,
body[data-design-template="operational-atlas"] .page-hero::after {
  content: "";
  position: absolute;
  inset: auto clamp(16px, 6vw, 84px) 22px auto;
  width: min(34vw, 380px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary, currentColor), transparent);
  opacity: .45;
}

body[data-design-template="operational-atlas"] .stats-grid,
body[data-design-template="operational-atlas"] .process-grid {
  gap: clamp(14px, 2.2vw, 26px);
}

body[data-design-template="operational-atlas"] .process-card,
body[data-design-template="operational-atlas"] .feature-card {
  border-left: 4px solid color-mix(in srgb, var(--color-primary, #24476d) 72%, transparent);
}

body[data-design-template="editorial-journal"] {
  --design-radius: clamp(10px, 1.3vw, 22px);
  --design-section-gap: clamp(52px, 8vw, 120px);
}

body[data-design-template="editorial-journal"] h1,
body[data-design-template="editorial-journal"] h2 {
  letter-spacing: -.045em;
}

body[data-design-template="editorial-journal"] .hero,
body[data-design-template="editorial-journal"] .page-hero {
  align-items: end;
}

body[data-design-template="editorial-journal"] .hero-title,
body[data-design-template="editorial-journal"] .page-title,
body[data-design-template="editorial-journal"] h1 {
  max-width: 11ch;
}

body[data-design-template="editorial-journal"] .blog-card,
body[data-design-template="editorial-journal"] .module-card,
body[data-design-template="editorial-journal"] .article-card {
  display: grid;
  grid-template-columns: minmax(160px, .42fr) 1fr;
  align-items: stretch;
}

body[data-design-template="editorial-journal"] .blog-card img,
body[data-design-template="editorial-journal"] .module-card img,
body[data-design-template="editorial-journal"] .article-card img {
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

body[data-design-template="showcase-focus"] {
  --design-radius: clamp(14px, 1.6vw, 26px);
  --design-section-gap: clamp(36px, 5vw, 72px);
}

body[data-design-template="showcase-focus"] .products-grid,
body[data-design-template="showcase-focus"] .catalog-grid,
body[data-design-template="showcase-focus"] .feature-grid {
  gap: clamp(12px, 1.6vw, 20px);
}

body[data-design-template="showcase-focus"] .product-card,
body[data-design-template="showcase-focus"] .service-card {
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

body[data-design-template="showcase-focus"] .product-card:hover,
body[data-design-template="showcase-focus"] .service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 70px color-mix(in srgb, var(--color-primary, #1c405f) 18%, transparent);
}

body[data-design-template="showcase-focus"] .product-card img,
body[data-design-template="showcase-focus"] .service-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

body[data-design-template="civic-portal"] {
  --design-radius: clamp(12px, 1.4vw, 24px);
  --design-section-gap: clamp(34px, 5.5vw, 78px);
}

body[data-design-template="civic-portal"] .hero,
body[data-design-template="civic-portal"] .page-hero {
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary, #24476d) 24%, transparent);
}

body[data-design-template="civic-portal"] .feature-card,
body[data-design-template="civic-portal"] .contact-card,
body[data-design-template="civic-portal"] .module-card {
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--color-primary, #24476d) 18%, var(--line, #d9e1ea));
}

body[data-design-template="service-lab"] {
  --design-radius: clamp(22px, 2.4vw, 42px);
  --design-reveal-y: 26px;
}

body[data-design-template="service-lab"] .service-card,
body[data-design-template="service-lab"] .feature-card,
body[data-design-template="service-lab"] .process-card {
  background:
    radial-gradient(circle at 16% 8%, color-mix(in srgb, var(--color-primary, #24476d) 10%, transparent), transparent 36%),
    var(--surface, #fff);
}

body[data-design-template="service-lab"] .hero-actions .button,
body[data-design-template="service-lab"] .cta-actions .button {
  min-width: 190px;
}

body[data-design-template="launch-minimal"] {
  --design-radius: 14px;
  --design-section-gap: clamp(30px, 4vw, 62px);
  --design-reveal-y: 10px;
}

body[data-design-template="launch-minimal"] .hero,
body[data-design-template="launch-minimal"] .page-hero {
  min-height: auto;
}

body[data-design-template="launch-minimal"] .feature-card,
body[data-design-template="launch-minimal"] .service-card,
body[data-design-template="launch-minimal"] .process-card {
  box-shadow: none;
  border-radius: 14px;
}

body[data-design-template="story-canvas"] {
  --design-radius: clamp(26px, 3vw, 54px);
  --design-section-gap: clamp(64px, 10vw, 140px);
  --design-reveal-y: 34px;
}

body[data-design-template="story-canvas"] .hero,
body[data-design-template="story-canvas"] .page-hero,
body[data-design-template="story-canvas"] .section-gallery-grid,
body[data-design-template="story-canvas"] .section-home-gallery {
  overflow: hidden;
}

body[data-design-template="story-canvas"] .photo-frame,
body[data-design-template="story-canvas"] .gallery-item,
body[data-design-template="story-canvas"] .hero-media {
  border-radius: var(--design-radius);
  transform: translateZ(0);
}

body[data-design-template="academy-guide"] {
  --design-radius: clamp(16px, 1.7vw, 30px);
}

body[data-design-template="academy-guide"] h2,
body[data-design-template="academy-guide"] .section-title {
  counter-increment: academy-section;
}

body[data-design-template="academy-guide"] h2::before,
body[data-design-template="academy-guide"] .section-title::before {
  content: counter(academy-section, decimal-leading-zero);
  display: inline-flex;
  margin-right: .7em;
  font-size: .42em;
  letter-spacing: .08em;
  color: var(--color-primary, #24476d);
  vertical-align: middle;
}

body[data-design-template="event-route"] {
  --design-radius: clamp(18px, 2vw, 36px);
  --design-section-gap: clamp(40px, 6vw, 86px);
}

body[data-design-template="event-route"] .process-card,
body[data-design-template="event-route"] .timeline-item,
body[data-design-template="event-route"] .feature-card {
  position: relative;
}

body[data-design-template="event-route"] .process-card::before,
body[data-design-template="event-route"] .feature-card::before {
  content: "";
  position: absolute;
  inset: 18px auto 18px 18px;
  width: 2px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--color-primary, #24476d) 46%, transparent);
}

body[data-design-template="trust-ledger"] {
  --design-radius: 10px;
  --design-section-gap: clamp(38px, 5vw, 80px);
  --design-reveal-y: 8px;
}

body[data-design-template="trust-ledger"] .feature-card,
body[data-design-template="trust-ledger"] .service-card,
body[data-design-template="trust-ledger"] .product-card,
body[data-design-template="trust-ledger"] .module-card {
  box-shadow: none;
  border: 1px solid var(--line, #d9e1ea);
}

body[data-design-template="trust-ledger"] table,
body[data-design-template="trust-ledger"] .admin-table {
  border-radius: var(--design-radius);
}

@media (prefers-reduced-motion: no-preference) {
  body[data-design-template] main > section {
    animation: designSectionIn .5s ease both;
  }

  body[data-design-template="story-canvas"] main > section {
    animation-duration: .72s;
  }

  body[data-design-template="launch-minimal"] main > section,
  body[data-design-template="trust-ledger"] main > section {
    animation-duration: .32s;
  }

  body[data-design-template] main > section:nth-of-type(2) { animation-delay: .04s; }
  body[data-design-template] main > section:nth-of-type(3) { animation-delay: .08s; }
  body[data-design-template] main > section:nth-of-type(4) { animation-delay: .12s; }
}

@keyframes designSectionIn {
  from {
    opacity: 0;
    transform: translateY(var(--design-reveal-y));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  body[data-design-template] {
    --design-radius: 18px;
    --design-section-gap: 34px;
  }

  body[data-design-template] .blog-card,
  body[data-design-template] .module-card,
  body[data-design-template] .article-card {
    grid-template-columns: 1fr;
  }

  body[data-design-template] .blog-card img,
  body[data-design-template] .module-card img,
  body[data-design-template] .article-card img,
  body[data-design-template] .product-card img,
  body[data-design-template] .service-card img {
    min-height: 0;
    max-height: 260px;
    width: 100%;
  }

  body[data-design-template="showcase-focus"] .products-grid,
  body[data-design-template="showcase-focus"] .catalog-grid,
  body[data-design-template="showcase-focus"] .feature-grid {
    grid-template-columns: 1fr;
  }
}
