/* ============================================================
   DOLZ — style.css
   Dark, minimal, premium web template hub
   ============================================================ */

:root {
  --bg: #07080c;
  --bg-soft: #0c0e15;
  --surface: #11141d;
  --surface-2: #161a25;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text: #f2f4f8;
  --text-dim: #9aa3b2;
  --text-faint: #5b6472;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --green: #34d399;
  --blue: #38bdf8;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }

section { scroll-margin-top: 84px; }

::selection { background: rgba(99, 102, 241, 0.4); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #262b38; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #333a4c; }

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(7, 8, 12, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(7, 8, 12, 0.88);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.02em; }

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.logo-text { font-size: 1.3rem; }

.nav { display: flex; align-items: center; gap: 6px; }

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.nav-link.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.header-right { display: flex; align-items: center; gap: 10px; }

.search-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.search-toggle:hover { color: var(--text); border-color: var(--border-hover); background: rgba(255, 255, 255, 0.05); }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.menu-toggle span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform 0.25s ease, opacity 0.25s ease; }

.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  padding: 170px 0 120px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(99, 102, 241, 0.14) 0%, transparent 100%),
    radial-gradient(45% 45% at 50% 100%, rgba(34, 211, 238, 0.07) 0%, transparent 100%);
  pointer-events: none;
}

.hero-glow { pointer-events: none; position: absolute; inset: -200px 50% auto; width: 700px; height: 700px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(99, 102, 241, 0.28), transparent); filter: blur(20px); }

.hero-inner { position: relative; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 7px 16px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.06);
  margin-bottom: 28px;
}

.hero-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }

.hero-title {
  font-size: clamp(4rem, 14vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 8px 40px rgba(99, 102, 241, 0.35));
}

.hero-subtitle { margin-top: 22px; font-size: clamp(1.15rem, 3vw, 1.65rem); font-weight: 600; }

.hero-desc { margin: 14px auto 0; max-width: 560px; color: var(--text-dim); font-size: 1.02rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 13px;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

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

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(99, 102, 241, 0.5); }

.btn-block { width: 100%; }

.btn-ghost { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-hover); color: var(--text); }

.btn-ghost:hover { background: rgba(255, 255, 255, 0.11); }

.hero .btn { margin-top: 38px; }

/* ============================================================
   TEMPLATES SECTION
   ============================================================ */

.templates { padding: 40px 0 90px; }

.section-head { text-align: center; margin-bottom: 34px; position: relative; }

.section-head h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }

.section-sub { color: var(--text-dim); margin-top: 8px; }

.template-count {
  position: absolute;
  right: 0;
  bottom: 8px;
  font-size: 0.82rem;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 640px) { .template-count { position: static; display: inline-block; margin-top: 10px; } }

/* Toolbar: categories + search */
.toolbar { display: flex; flex-direction: column; gap: 18px; margin-bottom: 30px; }

.categories {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: center;
}

.cat-btn {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.cat-btn:hover { color: var(--text); border-color: var(--border-hover); transform: translateY(-1px); }

.cat-btn.active {
  color: #fff;
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.search-box {
  position: relative;
  max-width: 460px;
  margin-inline: auto;
  width: 100%;
}

.search-box svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 13px 44px 13px 44px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-box input::placeholder { color: var(--text-faint); }

.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.search-box input:focus { border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14); }

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-faint);
  font-size: 1.1rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.search-clear:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, 1fr); } }

@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

/* ============================================================
   CARDS
   ============================================================ */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.28s ease, box-shadow 0.28s ease;
}

.card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0c11;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-media img { transform: scale(1.05); }

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(7, 8, 12, 0.72) 100%);
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
}

.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.badge-available { background: rgba(16, 185, 129, 0.14); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); }
.badge-new { background: rgba(167, 139, 250, 0.14); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.4); box-shadow: 0 0 18px rgba(167, 139, 250, 0.15); }
.badge-soon { background: rgba(251, 191, 36, 0.12); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.35); }
.badge-beta { background: rgba(56, 189, 248, 0.14); color: var(--blue); border: 1px solid rgba(56, 189, 248, 0.4); }

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }

.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.card-title { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }

.chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.09);
  border: 1px solid rgba(34, 211, 238, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.card-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-open {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  transition: all 0.22s ease;
}

.card:hover .card-open,
.card-open:hover {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-faint);
}

.empty svg { margin-inline: auto; opacity: 0.6; }

.empty h3 { color: var(--text); font-size: 1.2rem; margin-top: 16px; }

.empty p { margin: 8px 0 22px; }

/* ============================================================
   ABOUT
   ============================================================ */

.about {
  padding: 90px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.about-inner { text-align: center; max-width: 720px; }

.about-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 20px;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 14px 40px rgba(99, 102, 241, 0.4);
}

.about h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; }

.about-text {
  margin: 16px auto 0;
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 640px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer { border-top: 1px solid var(--border); padding-top: 56px; }

.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 44px; }

.footer-brand p { color: var(--text-faint); font-size: 0.85rem; margin-top: 10px; }

.footer-nav { display: flex; gap: 8px; flex-wrap: wrap; }

.footer-nav a { color: var(--text-dim); font-size: 0.88rem; padding: 7px 13px; border-radius: 999px; transition: color 0.2s ease, background 0.2s ease; }

.footer-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.footer-bottom { border-top: 1px solid var(--border); padding: 22px 0; }

.footer-bottom p { text-align: center; color: var(--text-faint); font-size: 0.82rem; }

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: popIn 0.32s cubic-bezier(0.2, 0.8, 0.3, 1.1);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 1.25rem;
  color: #fff;
  background: rgba(7, 8, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.modal-close:hover { background: rgba(7, 8, 12, 0.85); }

.modal-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0c11;
}

.modal-preview img { width: 100%; height: 100%; object-fit: cover; }

.modal-preview .badge { position: absolute; top: 14px; left: 14px; }

.modal-body { padding: 26px 28px 30px; }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.modal-head h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }

.modal-desc { color: var(--text-dim); margin: 14px 0 20px; font-size: 0.98rem; }

.features { list-style: none; margin-bottom: 26px; display: grid; gap: 10px; }

.features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.features li::before {
  content: "";
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5 10.5 17 18 8'/%3E%3C/svg%3E") center / 11px no-repeat;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }

.reveal.visible { opacity: 1; transform: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes popIn { from { opacity: 0; transform: scale(0.92) translateY(14px); } to { opacity: 1; transform: none; } }

@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

.card { animation: cardIn 0.45s ease both; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 860px) {
  .nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 20px 20px;
    background: rgba(7, 8, 12, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
    visibility: hidden;
  }

  .nav.open { transform: none; visibility: visible; }

  .nav-link { padding: 13px 16px; font-size: 1rem; border-radius: 12px; }

  .menu-toggle { display: flex; }

  .hero { padding: 140px 0 100px; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}