
@font-face { font-family: "Jost"; src: url("/static/fonts/Jost.ttf") format("truetype"); font-display: swap;}
@font-face { font-family: "Raleway"; src: url("/static/fonts/Raleway.ttf") format("truetype"); font-display: swap;}

:root {
  color-scheme: light dark;

  /* Light theme — референс из конструктора */
  --bg:        light-dark(#fbf9ff, #141416);
  --bg2:       light-dark(#f6f4fb, #1b1b1e);
  --bg3:       light-dark(#ede9f7, #222226);
  --surface: light-dark(#ffffff, #1e1e22);
  --surface2:  light-dark(#f6f4fb,  #26262c);
  --border:    light-dark(rgba(232,229,242,0.92), rgba(255,255,255,0.08));
  --border2:   light-dark(rgba(106,92,255,0.18),  rgba(255,255,255,0.13));
  --text:      light-dark(#2c2f36, #e8e8f0);
  --text2:     light-dark(#6f7482, #8a8a9a);
  --text3:     light-dark(#8f94a3, #5e5e72);

  /* purple / pink — основной акцент */
  --purple:    #6a5cff;
  --pink:      #ff5ea7;
  --gold:      light-dark(#6a5cff, #a08aff);   /* переназначаем --gold → purple */
  --gold-subtle: light-dark(rgba(106,92,255,0.10), rgba(106,92,255,0.15));
  --rose:      light-dark(#ff5ea7, #ff85bf);
  --rose-subtle: light-dark(rgba(255,94,167,0.12), rgba(255,94,167,0.14));
  --accent:    light-dark(#6a5cff, #a08aff);
  --accent2:   light-dark(#ff5ea7, #ff85bf);
  --shadow:    light-dark(0 2px 20px rgba(39,22,70,0.10), 0 2px 20px rgba(0,0,0,0.35));
  --shadow-lg: light-dark(0 8px 40px rgba(39,22,70,0.16), 0 12px 48px rgba(0,0,0,0.45));
  --radius: 14px;
  --radius-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Jost', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  font-weight: 300;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
}

/* ─── HEADER ─── */
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(39,22,70,0.06);
}
.header-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.logo {
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 60px;
}

nav { display: flex; gap: 4px; flex-shrink: 0; }
.nav-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border: none; background: none;
  color: var(--text2);
  font-family: 'Jost', sans-serif;
  font-size: 13px; font-weight: 400;
  letter-spacing: 0.05em; text-transform: uppercase;
  cursor: pointer; border-radius: 12px;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}
.nav-btn:hover { background: var(--bg3); color: var(--text); }
.nav-btn.active {
  color: var(--purple);
  background: var(--gold-subtle);
}
.nav-btn .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { display: inline; }

/* ── Desktop badge: pill with number ── */
.badge {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
  line-height: 1.6;
}

/* ── Mobile: icon wrapper for dot indicator ── */
.nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-dot {
  display: none; /* hidden by default, shown on mobile via media query */
  position: absolute;
  top: -3px; right: -3px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border: 1.5px solid var(--surface);
  box-shadow: 0 1px 4px rgba(106,92,255,0.4);
}

@media (max-width: 600px) {
  .header-inner { padding: 0 12px; height: 56px; }
  .logo svg { height: 48px; }
  .nav-btn { padding: 8px 10px; gap: 0; }
  .nav-label { display: none; }
  /* hide numeric badge on mobile */
  .badge { display: none !important; }
  /* show dot instead */
  .nav-dot { display: block; }
}

/* ─── PAGES ─── */
.page { display: none; }
.page.active { display: block; flex: 1; }
.site-footer { margin-top: auto; }

/* ─── C0: HOME ─── */
.hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: 80px 32px 60px;
  display: grid;
  /* grid-template-columns: 1fr 1fr; */
  gap: 80px;
  align-items: center;
}
.hero-text h1 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(30px, 3.8vw, 52px);
  font-weight: 200;
  font-style: normal;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-text h1 em { font-style: normal; font-weight: 500; color: var(--purple); letter-spacing: 0.04em; }
.hero-text p {
  color: var(--text2);
  font-size: 17px;
  line-height: 1.7;
  max-width: 400px;
  margin-bottom: 20px;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(106,92,255,.95), rgba(255,94,167,.95));
  color: #fff;
  padding: 13px 24px;
  font-family: 'Jost', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: none; cursor: pointer; border-radius: 14px;
  transition: all 0.25s;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(106,92,255,0.25);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(106,92,255,0.35); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent;
  color: var(--purple);
  padding: 13px 24px;
  font-family: 'Jost', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid rgba(106,92,255,0.30); cursor: pointer; border-radius: 14px;
  transition: all 0.25s;
}
.btn-secondary:hover { border-color: var(--purple); background: var(--gold-subtle); }

.hero-visual {
  position: relative;
  height: 420px;
}
.hero-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s ease;
}
.hero-card:nth-child(1) { width: 220px; height: 300px; top: 0; left: 40px; transform: rotate(-4deg); z-index: 1; }
.hero-card:nth-child(2) { width: 240px; height: 320px; top: 40px; left: 160px; transform: rotate(1deg); z-index: 2; }
.hero-card:nth-child(3) { width: 200px; height: 280px; top: 80px; left: 290px; transform: rotate(5deg); z-index: 1; }
.hero-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.hero-card-inner {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg2) 100%);
  display: flex; align-items: center; justify-content: center;
}
.hero-card-inner .card-label {
  font-family: 'Raleway', sans-serif;
  font-size: 18px; font-style: italic;
  color: var(--text2); text-align: center; padding: 20px;
}
.hero-visual:hover .hero-card:nth-child(1) { transform: rotate(-6deg) translateY(-8px); }
.hero-visual:hover .hero-card:nth-child(3) { transform: rotate(8deg) translateY(-4px); }

.stats-row {
  max-width: 1320px; margin: 0 auto;
  padding: 0 32px 80px;
  display: flex; gap: 48px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}
.stat { }
.stat-num {
  font-family: 'Raleway', sans-serif;
  font-size: 42px; font-weight: 200;
  font-style: normal;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text2); margin-top: 4px; }

/* ─── GALLERY COMMON ─── */
.gallery-page { max-width: 1320px; margin: 0 auto; padding: 40px 28px; }
.gallery-header { margin-bottom: 32px; }
.gallery-header h2 {
  font-family: 'Raleway', sans-serif;
  font-size: 28px; font-weight: 200;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}
.gallery-header p { color: var(--text2); font-size: 14px; }

/* Filters */
.filters-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.filters-row::-webkit-scrollbar { display: none; }
.filter-group { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.filter-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text3); margin-right: 2px; flex-shrink: 0; white-space: nowrap; }
.filter-chip {
  padding: 7px 14px;
  border: 1px solid var(--border2);
  background: none;
  font-family: 'Jost', sans-serif;
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text2);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-chip:hover { border-color: var(--text2); color: var(--text); }
.filter-chip.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.divider-v { width: 1px; height: 20px; background: var(--border2); margin: 0 4px; flex-shrink: 0; }
.sort-select {
  appearance: none;
  padding: 7px 28px 7px 12px;
  border: 1px solid var(--border2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-family: 'Jost', sans-serif;
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text2);
  border-radius: 100px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .filter-label { display: none; }
  .divider-v { display: none; }
}

/* Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 14px;
}
@media (min-width: 480px) {
  .templates-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
}
@media (min-width: 900px) {
  .templates-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
}

/* Template Card */
.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 2px 10px rgba(39,22,70,0.07);
}
.template-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(106,92,255,0.25);
}
.card-preview {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg3);
}
.card-preview-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  font-style: italic;
  color: var(--text2);
  transition: transform 0.5s ease;
  background-position: top;
  background-size: cover;
  background-repeat: no-repeat;
}
.template-card:hover .card-preview-inner { transform: scale(1.03); }

/* Fake preview designs */
.preview-1 { background: linear-gradient(160deg, #f0e8d8 0%, #e8d5c0 100%); }
.preview-2 { background: linear-gradient(160deg, #d8e8e0 0%, #c0d8c8 100%); }
.preview-3 { background: linear-gradient(160deg, #e8d8e8 0%, #d0c0d8 100%); }
.preview-4 { background: linear-gradient(160deg, #e8e0d0 0%, #d8cdb8 100%); }
.preview-5 { background: linear-gradient(160deg, #d8e0e8 0%, #c0ccd8 100%); }
.preview-6 { background: linear-gradient(160deg, #f0e0d0 0%, #e0c8b8 100%); }
.preview-dark-1 { background: linear-gradient(160deg, #1e1a14 0%, #2a2318 100%); }
.preview-dark-2 { background: linear-gradient(160deg, #14181e 0%, #18232a 100%); }
.preview-dark-3 { background: linear-gradient(160deg, #1a1420 0%, #231828 100%); }

.card-preview-inner svg { width: 80px; height: 80px; opacity: 0.4; }

.fav-btn {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  background: var(--surface);
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
  z-index: 2;
}
.fav-btn:hover { transform: scale(1.12); }
.fav-btn svg { width: 16px; height: 16px; }
.fav-btn.active svg { fill: var(--pink); stroke: var(--pink); }
.fav-btn:not(.active) svg { fill: none; stroke: var(--text2); }

.card-footer { padding: 12px 12px; }
@media (min-width: 600px) { .card-footer { padding: 16px 18px; } }
.card-name {
  font-family: 'Raleway', sans-serif;
  font-size: 14px; font-weight: 500;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 5px;
  line-height: 1.3;
}
@media (min-width: 600px) { .card-name { font-size: 15px; } }
/* ── Price ── */
.card-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@media (min-width: 600px) { .card-price { font-size: 18px; } }
.card-price.free { color: var(--text3); font-weight: 400; }

/* Sale price */
.card-price-wrap { display: flex; align-items: center; gap: 6px; }
.card-price-old {
  font-size: 11px;
  font-weight: 400;
  color: var(--text3);
  text-decoration: line-through;
  text-decoration-color: var(--text3);
  white-space: nowrap;
}
.card-price-sale {
  font-size: 13px;
  font-weight: 700;
  color: #ff5e5e;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@media (min-width: 600px) { .card-price-sale { font-size: 18px; } }
.card-price-sale-icon {
  width: 13px;
  height: 13px;
  color: #ff5e5e;
  flex-shrink: 0;
  display: none;
  justify-content: center;
  align-items: center;
}
@media (min-width: 600px) { .card-price-sale-icon { display: flex; } }

.card-sale-badge {
  font-size: 9px;
  font-weight: 700;
  color: #ff5e5e;
  background: rgba(255,94,94,0.10);
  border: 1px solid rgba(255,94,94,0.25);
  border-radius: 100px;
  padding: 2px 8px;
  white-space: nowrap;
}
@media (min-width: 600px) { .card-sale-badge { font-size: 11px; } }

/* ── Card meta: pages + year icons ── */
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}
.card-meta-info {
  display: flex; align-items: center; gap: 5px;
}
.card-meta-pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 100px;
  white-space: nowrap;
  line-height: 1;
}
.card-meta-pill svg {
  width: 9px; height: 9px;
  flex-shrink: 0;
}
.card-tags {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.card-tag-top {
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 100px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text2);
  background: rgb(255 255 255);
  border: 1px solid rgba(220,216,232,0.9);
}
.card-tag-top.popular {
  color: var(--pink);
  border-color: rgba(255,94,167,0.28);
}
.card-tag-top.premium {
  color: #a07620;
  border-color: rgba(184,138,20,0.45);
  background: rgba(255,245,210,0.92);
  background-image: linear-gradient(135deg, rgba(255,245,200,0.95), rgba(255,228,130,0.85));
}
@media (prefers-color-scheme: dark) {
  .card-tag-top {background: rgba(30,30,34,0.88);border-color: rgb(255 255 255 / 11%);color: var(--text1);}
  .card-tag-top.popular { color: var(--pink); border-color: rgba(255,94,167,0.3); background: rgba(30,30,34,0.88); }
  .card-tag-top.premium {
    color: #d4a030;
    border-color: rgba(212,160,48,0.45);
    background: rgb(35 35 37);
    border-top-color: rgb(247 203 110 / 45%);
    border-bottom-color: rgb(244 211 139 / 45%);
    background-image: none;
  }
}
/* Tag badge moved to top-left of preview */
.lightbox-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12, 8, 22, 0.80);
  backdrop-filter: blur(10px);
  align-items: center; justify-content: center;
  padding: 20px;
  touch-action: none;
  overscroll-behavior: none;
}
.lightbox-overlay.open { display: flex; }
.lightbox-inner {
  position: relative;
  max-width: 420px;
  width: 100%;
  height: calc(100vh - 40px);
  height: calc(100dvh - 40px);
  max-height: 820px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: lbIn 0.3s ease;
  overflow: hidden; /* clips video, never clips info */
  overscroll-behavior: none;
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(0.93) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.lb-preview {
  flex: 1 1 0;      /* grows to fill remaining space */
  min-height: 0;    /* crucial: allows flex child to shrink below content size */
  position: relative;
  overflow: hidden;
  background: var(--bg3);
  touch-action: none;
  /* border-radius: 20px 20px 0 0; */
}
/* ── Loader ── */
.lb-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.3s ease;
  touch-action: none;
}
.lb-loader.hidden {
  opacity: 0;
  pointer-events: none;
}
.lb-spinner {
  width: 40px;
  height: 40px;
  animation: lb-spin 0.9s linear infinite;
}
.lb-spinner circle {
  stroke: light-dark(rgb(122 122 122 / 45%), rgb(190 190 190 / 50%));
  stroke-dasharray: 80, 200;
  stroke-dashoffset: 0;
  stroke-linecap: round;
}
@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

.lb-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}
.lb-bg-video.ready {
  opacity: 1;
}
.lb-card-wrap {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0px 0px 8px 0px rgb(0 0 0 / 20%), 0px 20px 20px 0px rgb(0 0 0 / 21%);
  border: 0.5px solid rgba(255,255,255,0.08);
  height: calc(100% - 40px);
  margin-top: 25px;
  width: max-content;
  margin-left: auto;
  margin-right: auto;
  z-index: 1;
  position: relative;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.lb-card-wrap.ready {
  opacity: 1;
}
.lb-card-video {
  height: 100%;
  object-fit: contain;
}

.lb-fav-btn {
  position: absolute; top: 14px; left: 14px;
  width: 36px; height: 36px;
  background: light-dark(rgba(255,255,255,0.92), rgba(40,38,50,0.92));
  border: 1px solid light-dark(transparent, rgba(255,255,255,0.1));
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  transition: all 0.2s; z-index: 5;
}
.lb-fav-btn:hover { transform: scale(1.12); }
.lb-fav-btn svg { width: 18px; height: 18px; }
.lb-fav-btn.active svg { fill: var(--pink); stroke: var(--pink); }
.lb-fav-btn:not(.active) svg { fill: none; stroke: light-dark(#888, #aaa); }

.lb-close-btn {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: light-dark(rgba(255,255,255,0.92), rgba(40,38,50,0.92));
  border: 1px solid light-dark(transparent, rgba(255,255,255,0.1));
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  transition: all 0.2s; z-index: 5;
  color: light-dark(#555, #aaa);
}
.lb-close-btn:hover {
  transform: scale(1.1);
  background: light-dark(rgba(255,255,255,1), rgba(55,52,68,0.98));
  color: light-dark(#222, #fff);
}
.lb-close-btn svg { width: 16px; height: 16px; }

/* swipe pill indicator */
.lb-swipe-pill {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.5);
  border-radius: 100px;
  z-index: 5;
  pointer-events: none;
}

/* Info panel — fixed height, never scrolls away */
.lb-info {
  flex: 0 0 auto;   /* never shrinks */
  padding: 18px 24px 22px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 1;
  backdrop-filter: blur(5px);
  touch-action: none;
}
.lb-name {
  font-family: 'Raleway', sans-serif;
  font-size: 22px; font-weight: 200;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.lb-sub { font-size: 13px; color: var(--text2); margin-bottom: 12px; }

/* ── Lightbox price ── */
.lb-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.lb-price {font-size: 18px;font-weight: 700;color: var(--pink);letter-spacing: 0.01em;}
.lb-price.free { color: var(--text3); font-weight: 400; font-size: 18px; }
.lb-price-sale {font-size: 18px;font-weight: 700;color: #ff5e5e;letter-spacing: 0.01em;}
.lb-price-old { font-size: 14px; font-weight: 400; color: var(--text3); text-decoration: line-through; }
.lb-price-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; color: #ff5e5e;
  background: rgba(255,94,94,0.10); border: 1px solid rgba(255,94,94,0.25);
  padding: 3px 8px; border-radius: 100px; letter-spacing: 0.05em;
}
.lb-price-badge svg { width: 10px; height: 10px; }

/* ── Lightbox meta pills ── */
.lb-meta-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.lb-meta-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; color: var(--text2);
  letter-spacing: 0.03em; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 100px; white-space: nowrap;
}
.lb-meta-pill svg { width: 11px; height: 11px; flex-shrink: 0; color: var(--text3); }
.lb-meta-hint {
  font-size: 10.5px; color: var(--text3); margin-top: -8px; margin-bottom: 12px;
  line-height: 1.3;
}

/* ─── CONSENT CHECKBOX ─── */
.lb-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.lb-consent:hover {
  border-color: rgba(106,92,255,0.25);
  background: var(--gold-subtle);
}
.lb-consent.checked {
  border-color: rgba(106,92,255,0.30);
  background: rgba(106,92,255,0.05);
}

.lb-consent-box {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
  margin-top: 1px;
}
.lb-consent.checked .lb-consent-box {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(106,92,255,0.30);
}
.lb-consent-box svg {
  width: 11px; height: 11px;
  stroke: #fff;
  stroke-width: 2.5;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease;
}
.lb-consent.checked .lb-consent-box svg {
  opacity: 1;
  transform: scale(1);
}

.lb-consent-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.55;
  font-weight: 400;
}
.lb-consent-text a {
  color: var(--text3);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(106,92,255,0.25);
  transition: border-color 0.15s;
}
.lb-consent-text a:hover { border-color: var(--purple); }

/* disabled state for create button */
.btn-primary:disabled {
  background: var(--bg3);
  color: var(--text3);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
  transform: none;
}
.btn-primary:disabled:hover { filter: none; transform: none; }

.lb-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── C3: MY INVITES ─── */
.invites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 14px;
}
@media (min-width: 480px) {
  .invites-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
}
@media (min-width: 900px) {
  .invites-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
}
.invite-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none; color: inherit;
  display: block;
  box-shadow: 0 2px 10px rgba(39,22,70,0.07);
}
.invite-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(106,92,255,0.30);
}
.invite-card-preview {
  aspect-ratio: 3/4;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-style: italic;
  color: var(--text2);
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}
.invite-card-footer { padding: 14px 16px; }
.invite-name {
  font-family: 'Raleway', sans-serif;
  font-size: 14px; font-weight: 500;
  font-style: normal;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.invite-date { font-size: 12px; color: var(--text3); }
.invite-edit-hint {
  font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--purple); margin-top: 8px;
  opacity: 0; transition: opacity 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.invite-card:hover .invite-edit-hint { opacity: 1; }

.new-invite-card {
  border: 2px dashed rgba(106,92,255,0.28);
  border-radius: 16px;
  min-height: 220px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s;
  background: rgba(106,92,255,0.03); gap: 12px;
  color: var(--text3);
  width: 100%;
}
.new-invite-card:hover { border-color: var(--purple); color: var(--purple); background: var(--gold-subtle); }
.new-invite-card svg { width: 28px; height: 28px; }
.new-invite-card span { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* ─── EMPTY STATE ─── */
.empty-state {
  padding: 80px 32px;
  text-align: center;
  color: var(--text2);
}
.empty-state svg { width: 64px; height: 64px; opacity: 0.25; margin-bottom: 24px; stroke: var(--purple); }
.empty-state h3 {
  font-family: 'Raleway', sans-serif;
  font-size: 22px; font-weight: 200;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px; color: var(--text);
}
.empty-state p { font-size: 14px; max-width: 320px; margin: 0 auto 24px; }

/* ─── TOAST ─── */
.toast {
  position: fixed; top: 32px; left: 50%; transform: translateX(-50%) translateY(-150px);
  background: linear-gradient(135deg, rgba(106,92,255,.96), rgba(255,94,167,.96));
  color: #fff;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 300;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(106,92,255,0.35);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ─── DECORATIVE ─── */
.ornament {
  display: inline-block;
  width: 40px; height: 1px;
  background: var(--gold);
  margin: 0 12px;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; padding: 32px 16px 28px; gap: 28px; }
  .hero-visual { height: 220px; }
  .hero-card:nth-child(1) { width: 150px; height: 200px; left: 20px; }
  .hero-card:nth-child(2) { width: 160px; height: 216px; top: 28px; left: 100px; }
  .hero-card:nth-child(3) { width: 140px; height: 190px; top: 56px; left: 180px; }
  .stats-row { gap: 20px; flex-wrap: wrap; padding: 20px 16px 32px; }
  .gallery-page { padding: 20px 12px; }
  .gallery-header { margin-bottom: 20px; }
  .gallery-header h2 { font-size: 26px; }
  .lb-info { padding: 14px 16px 18px; }
  .lb-name { font-size: 18px; }
  .lightbox-overlay { padding: 8px; }
  .lightbox-inner { height: calc(100vh - 16px); height: calc(100dvh - 16px); border-radius: 16px; }
  .lb-actions { flex-direction: column; }
  .hero-text h1 { font-size: 24px; letter-spacing: 0.06em; }
  .card-meta-info {display: none;}
}
@media (max-width: 1000px) {
  .card-meta-info {display: none;}
}
/* Preview patterns */
.pv-wedding {
  background: linear-gradient(160deg, #f5ede0 0%, #e8d4c0 100%);
  position: relative;
}
.pv-wedding::before {
  content: '✦'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px; color: rgba(180,140,80,0.25);
}
.pv-garden { background: linear-gradient(160deg, #e8f0e4 0%, #cce0c8 100%); }
.pv-noir { background: linear-gradient(160deg, #1c1a18 0%, #28241e 100%); }
.pv-blush { background: linear-gradient(160deg, #f5e0e4 0%, #e8c8d0 100%); }
.pv-azure { background: linear-gradient(160deg, #e0eaf5 0%, #c8d8e8 100%); }
.pv-sage { background: linear-gradient(160deg, #e0ece4 0%, #c4d8c8 100%); }
.pv-terra { background: linear-gradient(160deg, #f0e4d8 0%, #e0ccc0 100%); }
.pv-midnight { background: linear-gradient(160deg, #181820 0%, #20202c 100%); }
.pv-gold { background: linear-gradient(160deg, #f8f0d8 0%, #ecddb8 100%); }

.pv-text {
  position: absolute; bottom: 20px; left: 0; right: 0;
  text-align: center;
  font-family: 'Raleway', sans-serif;
  font-style: normal;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(80,60,40,0.4);
}
.pv-noir .pv-text, .pv-midnight .pv-text { color: rgba(200,180,140,0.35); }
.pv-line {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  text-align: center;
  font-family: 'Raleway', sans-serif;
  white-space: nowrap;
}
.pv-line .big { display: block; font-size: 13px; font-weight: 300; font-style: normal; letter-spacing: 0.20em; text-transform: uppercase; color: rgba(100,70,40,0.30); }
.pv-line .small { display: block; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(100,70,40,0.20); font-weight: 400; margin-top: 8px; }
.pv-noir .pv-line .big, .pv-midnight .pv-line .big { color: rgba(200,170,110,0.3); }
.pv-noir .pv-line .small, .pv-midnight .pv-line .small { color: rgba(200,170,110,0.25); }
/* ─── FOOTER ─── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 36px 28px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px 48px;
  align-items: start;
}
.footer-owner {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
}
.footer-owner .person {
  display: block;
  font-size: 13px; 
  color: var(--text3); letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.footer-owner .inn {
  font-size: 12px;
  color: var(--text3);
  letter-spacing: 0.04em;
  text-decoration: none;
}
.footer-links {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 14px;
}
.footer-link {
  font-size: 11px; font-weight: 500; letter-spacing: 0.05em;
  color: var(--text3);
  text-decoration: none;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  font-family: 'Jost', sans-serif;
}
.footer-link:hover { color: var(--purple); border-color: rgba(106,92,255,0.3); }

.footer-contacts {
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
}
.footer-email {
  font-size: 13px; font-weight: 500;
  color: var(--text2); text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}
.footer-email:hover { color: var(--purple); }

.footer-socials { display: flex; gap: 8px; }
.footer-social-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; color: var(--text2);
}
.footer-social-btn:hover {
  border-color: rgba(106,92,255,0.3);
  background: var(--gold-subtle);
  color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106,92,255,0.15);
}
.footer-social-btn svg { width: 18px; height: 18px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 14px 28px;
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.footer-copy {
  font-size: 11px; color: var(--text3); letter-spacing: 0.04em;
}

@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 28px 16px 20px; }
  .footer-contacts { align-items: flex-start; }
  .footer-bottom { padding: 14px 16px; flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ─── LEGAL PAGE ─── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.topbar-inner {
  max-width: 780px; margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center;
  gap: 16px;
}
.topbar-logo {
  font-family: 'Raleway', sans-serif;
  font-size: 18px; font-weight: 200;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--purple);
  text-decoration: none;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: none;
  font-family: 'Jost', sans-serif;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text2);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.back-btn:hover {
  color: var(--purple);
  border-color: rgba(106,92,255,0.35);
  background: rgba(106,92,255,0.05);
}
.back-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.doc-wrap {
  max-width: 780px; margin: 0 auto;
  padding: 56px 24px 80px;
}
.doc-type {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.doc-type::after {
  content: '';
  flex: 0 0 32px; height: 1px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  opacity: 0.5;
}
.doc-title {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 200;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
  margin-bottom: 8px;
}
.doc-meta {
  font-size: 12px; color: var(--text3);
  letter-spacing: 0.05em;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.doc-body { max-width: 680px; }
.doc-body h2 {
  font-family: 'Raleway', sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text);
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.7;
}
.doc-body ul {
  margin: 0 0 16px 0;
  padding-left: 0;
  list-style: none;
}
.doc-body ul li {
  font-size: 14px;
  color: var(--text);
  padding: 6px 0 6px 20px;
  position: relative;
  border-bottom: 1px solid var(--border);
  line-height: 1.7;
}
.doc-body ul li::before {
  content: '—';
  position: absolute; left: 0;
  color: var(--text3);
  font-weight: 300;
}
.doc-owner-card {
  margin-top: 48px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.doc-owner-card .label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text3);
  margin-bottom: 12px;
}
.doc-owner-card .name {
  font-family: 'Raleway', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 4px;
}
.doc-owner-card .inn {
  font-size: 13px;
  color: var(--text2);
}
.doc-footer-cta {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.doc-footer-cta p { font-size: 13px; color: var(--text3); }
.doc-footer-email {
  color: var(--text2);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(106,92,255,0.25);
  transition: border-color 0.15s, color 0.15s;
}
.doc-footer-email:hover { color: var(--purple); border-color: var(--purple); }

@media (max-width: 600px) {
  .doc-wrap { padding: 40px 16px 60px; }
  .topbar-inner { padding: 0 16px; }
  .doc-owner-card { padding: 18px 20px; }
}

/* ─── LEGAL IFRAME MODAL ─── */
.legal-iframe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  animation: legalFadeIn 0.2s ease;
}
.legal-iframe-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: legalSlideUp 0.25s ease;
}
.legal-iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.legal-iframe-close {
  border: none;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 10px 32px;
  cursor: pointer;
  transition: background 0.15s;
}
.legal-iframe-close:hover {
  background: rgba(255, 255, 255, 0.25);
}
.legal-iframe-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: light-dark(rgba(0,0,0,0.06), rgba(255,255,255,0.1));
  color: var(--text2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.legal-iframe-x:hover {
  background: light-dark(rgba(0,0,0,0.12), rgba(255,255,255,0.18));
  color: var(--text);
}
@keyframes legalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes legalSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
