/* 21-templates-page.css — TEMPLATES PAGE — MODERN LIGHT / GLASS */

:root {
  --bg: #efefef;
  --bg-soft: #f5f5f5;
  --bg-card: rgba(255, 255, 255, 0.56);
  --bg-card-strong: rgba(255, 255, 255, 0.82);

  --ink: #202020;
  --ink-2: #4c4c4c;
  --ink-3: #7b7b7b;

  --line: rgba(32, 32, 32, 0.09);
  --line-strong: rgba(32, 32, 32, 0.16);
  --line-soft: rgba(255, 255, 255, 0.44);

  --accent: #ff4d4d;
  --accent-hover: #f90202;
  --accent-soft: rgba(255, 77, 77, 0.10);

  --shadow-xs: 0 8px 18px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 14px 30px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 22px 54px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, 0.12);

  --radius-sm: 18px;
  --radius-md: 28px;
  --radius-lg: 38px;
  --radius-xl: 46px;

  --maxw: 1240px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --hero-title-size: clamp(54px, 5.2vw, 68px);
  --hero-title-line: .94;
  --hero-title-spacing: -.065em;
  --hero-title-weight: 900;
  --hero-accent-size: clamp(22px, 2.2vw, 30px);
  --hero-accent-line: 1.08;
  --hero-accent-spacing: -.035em;
  --hero-accent-weight: 700;
}

.templatesPage {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
}

.templatesShell {
  position: relative;
  width: 100%;
}

.templatesContainer {
  width: min(var(--maxw), calc(100% - 40px));
  margin-inline: auto;
}

.templatesSection {
  position: relative;
  width: 100%;
  padding: 96px 0;
}

/* REVEAL */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity .75s var(--ease),
    transform .75s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal.d1 { transition-delay: .06s; }
.reveal.d2 { transition-delay: .14s; }
.reveal.d3 { transition-delay: .22s; }

/* TYPO */

.sectionHead {
  max-width: 900px;
}

.sectionHead--center {
  margin-inline: auto;
  text-align: center;
}

.sectionKicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.5);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sectionTitle {
  margin: 0 0 14px;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.02;
  font-weight: 550;
  letter-spacing: -.04em;
  color: var(--ink);
  text-wrap: balance;
}

.sectionText {
  max-width: 760px;
  color: var(--ink-2);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.72;
}

.sectionText--center {
  margin-inline: auto;
}

/* BUTTONS */

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  appearance: none;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition:
    transform .28s var(--ease),
    box-shadow .28s var(--ease),
    border-color .28s var(--ease),
    background .28s var(--ease),
    color .28s var(--ease);
}

.btn__icon {
  font-size: 18px;
  line-height: 1;
  transition: transform .24s var(--ease);
}

.btn:hover .btn__icon {
  transform: translateX(4px);
}

.btn:active {
  transform: scale(.985);
}

.btn:focus-visible {
  box-shadow:
    0 0 0 3px rgba(255,255,255,.92),
    0 0 0 6px rgba(255,77,77,.16);
}

.btn--primary {
  background: var(--accent);
  color: #fff !important;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(255,77,77,.20);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(255,77,77,.24);
}

.btn--ghost {
  background: rgba(255,255,255,.46) !important;
  color: var(--ink) !important;
  border-color: var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 700;
}

.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255,255,255,.72) !important;
  color: var(--accent) !important;
}

.btn--ghost.isActive,
.btn--ghost.gBtnSolid {
  background: rgba(255,77,77,.08) !important;
  border-color: rgba(255,77,77,.28) !important;
  color: var(--accent) !important;
}

.btn--pulse {
  animation: ctaPulse 3.8s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 14px 28px rgba(255,77,77,.18), 0 0 0 0 rgba(255,77,77,0);
  }
  50% {
    box-shadow: 0 18px 34px rgba(255,77,77,.24), 0 0 0 10px rgba(255,77,77,.08);
  }
}

.actionRow {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.actionRow--center {
  justify-content: center;
}

/* SURFACES */

.glassCard,
.catalogSearch,
.catalogEmpty,
.templatesWhyCard,
.templatesHeroBoard,
.templatesFinalCta__card,
.templateGrid__empty {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glassCard::before,
.catalogSearch::before,
.catalogEmpty::before,
.templatesWhyCard::before,
.templatesHeroBoard::before,
.templatesFinalCta__card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid var(--line-soft);
}

/* HERO */

.templatesHero {
  padding-top: 40px;
  padding-bottom: 86px;
  overflow: hidden;
}

.templatesHero__grid {
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(360px, 470px);
  align-items: center;
  gap: clamp(34px, 5vw, 76px);
}

.templatesHero__content {
  max-width: 620px;
}

.templatesHero__title {
  margin: 0;
  font-size: var(--hero-title-size);
  line-height: var(--hero-title-line);
  letter-spacing: var(--hero-title-spacing);
  font-weight: var(--hero-title-weight);
  color: var(--ink);
  text-wrap: balance;
}

.templatesHero__titleMainLine {
  display: inline-flex;
  align-items: flex-end;
  width: fit-content;
  max-width: 100%;
  padding-bottom: 8px;
  position: relative;
}

.templatesHero__titleMainText {
  display: inline-block;
  font-size: var(--hero-title-size);
  line-height: var(--hero-title-line);
  letter-spacing: var(--hero-title-spacing);
  font-weight: var(--hero-title-weight);
  color: var(--ink);
  background:
    linear-gradient(
      110deg,
      var(--ink) 0%,
      var(--ink) 30%,
      rgba(255,77,77,.75) 42%,
      #ff4d4d 48%,
      #f90202 50%,
      #ff4d4d 52%,
      rgba(255,77,77,.75) 58%,
      var(--ink) 70%,
      var(--ink) 100%
    );
  background-size: 300% 100%;
  background-position: 145% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: templatesTitleRun 9.8s linear infinite;
  will-change: background-position;
}

.templatesHero__titleMainLine::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(
      110deg,
      rgba(255,77,77,.28) 0%,
      rgba(255,77,77,.28) 30%,
      rgba(255,77,77,.7) 42%,
      #ff4d4d 48%,
      #f90202 50%,
      #ff4d4d 52%,
      rgba(255,77,77,.7) 58%,
      rgba(255,77,77,.28) 70%,
      rgba(255,77,77,.28) 100%
    );
  background-size: 300% 100%;
  background-position: 145% 50%;
  box-shadow: 0 6px 18px rgba(255,77,77,.16);
  animation: templatesTitleRun 9.8s linear infinite;
  will-change: background-position;
}

@keyframes templatesTitleRun {
  0% { background-position: 145% 50%; }
  28% { background-position: 145% 50%; }
  82% { background-position: -45% 50%; }
  100% { background-position: -45% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .templatesHero__titleMainText,
  .templatesHero__titleMainLine::after {
    animation: none;
    background-position: 50% 50%;
  }
}

.templatesHero__title > span:last-child {
  display: block;
  margin-top: 12px;
  color: var(--accent);
  font-size: var(--hero-accent-size);
  line-height: var(--hero-accent-line);
  letter-spacing: var(--hero-accent-spacing);
  font-weight: var(--hero-accent-weight);
}

.templatesHero__lead {
  margin: 20px 0 0;
  max-width: 620px;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.7;
}

.templatesHero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  max-width: 560px;
}

.templatesStat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.54);
  border: 1px solid rgba(32,32,32,.08);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(0,0,0,.045);
}

.templatesStat i {
  color: var(--accent);
  font-size: 15px;
}

.templatesHero__actions {
  margin-top: 30px;
}

.templatesHero__visual {
  position: relative;
}

/* HERO BOARD */

.templatesHeroBoard {
  padding: 20px;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.92), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.74), rgba(255,255,255,.52));
}

.templatesHeroBoard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.templatesHeroBoard__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink, #202020);
  font-size: 14px;
  font-weight: 850;
}

.templatesHeroBoard__label i {
  color: var(--accent, #ff4d4d);
  font-size: 16px;
}

.templatesHeroBoard__pill {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 77, 77, .08);
  border: 1px solid rgba(255, 77, 77, .18);
  color: var(--accent, #ff4d4d);
  font-size: 12px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

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

.templatesHeroMini {
  position: relative;
  isolation: isolate;
  min-height: 148px;
  overflow: hidden;
  border-radius: 22px;
  padding: 16px;
  display: flex;
  align-items: stretch;
  background:
    radial-gradient(circle at 18% 16%, rgba(255,255,255,.82), transparent 34%),
    radial-gradient(circle at 92% 88%, color-mix(in srgb, var(--ph-accent) 30%, transparent), transparent 48%),
    linear-gradient(135deg, var(--ph-paper) 0%, var(--ph-bg) 56%, color-mix(in srgb, var(--ph-accent) 24%, var(--ph-bg)) 100%);
  border: 1px solid color-mix(in srgb, var(--ph-accent) 22%, rgba(32,32,32,.08));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.74),
    0 12px 26px rgba(0,0,0,.045);
  transition:
    transform .24s cubic-bezier(.2,.8,.2,1),
    box-shadow .24s cubic-bezier(.2,.8,.2,1),
    border-color .24s cubic-bezier(.2,.8,.2,1);
}

.templatesHeroMini__glow {
  position: absolute;
  inset: auto -18% -34% 22%;
  height: 82px;
  z-index: -1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ph-accent) 30%, transparent);
  filter: blur(22px);
  opacity: .82;
}

.templatesHeroMini__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 9px;
  width: 100%;
  min-width: 0;
}

.templatesHeroMini__sub {
  max-width: 100%;
  min-height: 30px;
  color: color-mix(in srgb, var(--ph-ink) 72%, transparent);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -.01em;
}

.templatesHeroMini__dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.templatesHeroMini__dots span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.78);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 4px 10px rgba(0,0,0,.08);
}

.templatesHeroMini__badge {
  width: fit-content;
  max-width: 100%;
  margin-top: auto;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.72);
  color: color-mix(in srgb, var(--ph-ink) 94%, #000);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  box-shadow: 0 8px 18px rgba(0,0,0,.045);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.templatesHeroMini__tag {
  display: none !important;
}

.templatesHeroBoard__note {
  margin-top: 16px;
  color: var(--ink-2, #4c4c4c);
  font-size: 15px;
  line-height: 1.62;
}

@media (hover:hover) {
  .templatesHeroMini:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--ph-accent) 34%, rgba(32,32,32,.08));
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.78),
      0 18px 34px rgba(0,0,0,.07),
      0 10px 24px color-mix(in srgb, var(--ph-accent) 12%, transparent);
  }
}

/* TOOLBAR */

.templatesCatalog {
  padding-top: 64px;
  scroll-margin-top: 96px;
}

.templatesToolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
  margin-top: 28px;
}

.templateFilter--catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.catalogSearch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 16px;
}

.catalogSearch i {
  color: var(--accent);
  font-size: 15px;
  opacity: .9;
}

.catalogSearch input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.catalogSearch input::placeholder {
  color: var(--ink-3);
}

.catalogMeta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 18px;
}

.catalogMeta__count {
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.04em;
}

.catalogMeta__label {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.4;
}

/* GRID */

.templateGrid--catalog {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.templateGrid__empty {
  padding: 24px;
  text-align: center;
  color: var(--ink-2);
}

.catalogEmpty {
  margin-top: 22px;
  padding: 32px 22px;
  text-align: center;
}

.catalogEmpty i {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 12px;
}

.catalogEmpty h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.15;
  color: var(--ink);
}

.catalogEmpty p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
}

/* WHY */

.templatesWhy {
  padding-top: 74px;
  padding-bottom: 74px;
}

.templatesWhyGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.templatesWhyCard {
  padding: 28px;
  transition:
    transform .26s var(--ease),
    box-shadow .26s var(--ease),
    border-color .26s var(--ease);
}

.templatesWhyCard:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.templatesWhyCard__icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,77,77,.08);
  color: var(--accent);
  border: 1px solid rgba(255,77,77,.12);
  margin-bottom: 18px;
  font-size: 22px;
}

.templatesWhyCard__title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.14;
  font-weight: 560;
  letter-spacing: -.025em;
}

.templatesWhyCard__text {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.75;
}

/* FINAL CTA */

.templatesFinalCta {
  padding-top: 74px;
  padding-bottom: 96px;
}

.templatesFinalCta__card {
  padding: 42px 30px;
  text-align: center;
}

/* RESPONSIVE */

@media (max-width: 1180px) {
  :root {
    --hero-title-size: clamp(52px, 6vw, 68px);
  }

  .templatesHero__grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .templatesHero__content {
    max-width: 760px;
  }

  .templatesHero__visual {
    max-width: 520px;
  }

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

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

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

@media (max-width: 760px) {
  :root {
    --hero-title-size: clamp(34px, 10.5vw, 46px);
    --hero-title-line: .98;
    --hero-title-spacing: -.05em;
    --hero-title-weight: 900;
    --hero-accent-size: clamp(19px, 5.8vw, 25px);
    --hero-accent-line: 1.1;
    --hero-accent-weight: 800;
  }

  .templatesSection {
    padding: 68px 0;
  }

  .templatesHero {
    padding-top: 14px;
    padding-bottom: 56px;
  }

  .templatesContainer {
    width: min(var(--maxw), calc(100% - 20px));
  }

  .templatesHero__title {
    font-size: var(--hero-title-size);
    line-height: var(--hero-title-line);
    font-weight: var(--hero-title-weight);
    letter-spacing: var(--hero-title-spacing);
  }

  .templatesHero__titleMainText {
    font-size: var(--hero-title-size);
    line-height: var(--hero-title-line);
    font-weight: var(--hero-title-weight);
  }

  .templatesHero__lead {
    font-size: 15px;
    line-height: 1.68;
  }

  .sectionTitle {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.04;
  }

  .templatesHero__stats {
    display: grid;
    gap: 8px;
  }

  .templatesStat {
    width: 100%;
    min-height: 40px;
    font-size: 12px;
  }

  .templatesHeroMini {
    min-height: 132px;
  }

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

  .actionRow {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .templatesWhyCard {
    padding: 22px 18px;
  }

  .templatesWhyCard__title {
    font-size: 19px;
  }

  .templatesFinalCta__card {
    padding: 28px 18px;
  }
}

@media (max-width: 560px) {
  :root {
    --hero-title-size: clamp(32px, 10vw, 40px);
    --hero-title-line: 1;
    --hero-title-spacing: -.045em;
    --hero-accent-size: clamp(18px, 5.6vw, 23px);
  }

  .templatesHeroBoard {
    padding: 18px;
    border-radius: 26px;
  }

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

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

  .templatesHeroMini {
    min-height: 132px;
  }
}

@media (max-width: 390px) {
  :root {
    --hero-title-size: 30px;
    --hero-title-line: 1.02;
    --hero-title-spacing: -.035em;
    --hero-accent-size: 18px;
    --hero-accent-line: 1.14;
  }

  .templatesContainer {
    width: min(var(--maxw), calc(100% - 16px));
  }

  .templatesHero__title {
    font-size: var(--hero-title-size);
    line-height: var(--hero-title-line);
    letter-spacing: var(--hero-title-spacing);
  }

  .templatesHero__titleMainText {
    font-size: var(--hero-title-size);
    line-height: var(--hero-title-line);
  }

  .templatesHero__title > span:last-child {
    font-size: var(--hero-accent-size);
    line-height: var(--hero-accent-line);
  }
}
