/* Global reset / base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-soft: #020617;
  --bg-softer: #020617;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --accent-strong: #818cf8;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.35);
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease-out;
}

/* Light theme overrides */
html[data-theme="light"] {
  --bg: #f9fafb;
  --bg-elevated: #ffffff;
  --bg-soft: #f3f4f6;
  --bg-softer: #e5e7eb;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --accent-strong: #4f46e5;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-subtle: rgba(148, 163, 184, 0.4);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, #0b1120 0, #020617 55%, #000 100%);
  color: var(--text-main);
  min-height: 100vh;
}

/* Make background adapt in light mode */
html[data-theme="light"] body {
  background: radial-gradient(circle at top, #e5e7eb 0, #f9fafb 40%, #e5e7eb 100%);
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: #f9fafb;
}

/* Layout helpers */
.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

main {
  padding-bottom: 4rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(20px);
  background:
    linear-gradient(to bottom,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.85),
    transparent);
}

html[data-theme="light"] .site-header {
  background:
    linear-gradient(to bottom,
    rgba(249, 250, 251, 0.96),
    rgba(249, 250, 251, 0.92),
    transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.85rem;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.logo-mark {
  font-size: 0.9rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.4), transparent);
}

.logo-text {
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.9rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width var(--transition-fast);
}

.nav a:hover {
  color: var(--text-main);
}

.nav a:hover::after {
  width: 100%;
}

/* Theme toggle */
.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  width: 46px;
  height: 24px;
  padding: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.75));
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  cursor: pointer;
}

html[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, #f9fafb, #e5e7eb);
}

.theme-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.9);
  transform: translateX(4px);
  transition: transform var(--transition-fast);
}

html[data-theme="light"] .theme-toggle::before {
  transform: translateX(22px);
}

.theme-toggle-icon {
  position: absolute;
  right: 7px;
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

html[data-theme="light"] .theme-toggle-icon {
  right: auto;
  left: 8px;
}

/* Hero */
.hero {
  padding: 3.5rem 0 3rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent-strong);
  margin-bottom: 0.75rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 2.9rem);
  line-height: 1.1;
}

.hero-subtitle {
  margin-top: 1rem;
  margin-bottom: 1.75rem;
  color: var(--text-muted);
  max-width: 36rem;
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-meta .divider {
  opacity: 0.6;
}

/* Buttons */
.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: background-color var(--transition-med),
    color var(--transition-med),
    border-color var(--transition-med),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  background: transparent;
  color: var(--text-main);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f9fafb;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.55);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(79, 70, 229, 0.7);
}

.btn.ghost {
  border-color: var(--border-subtle);
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] .btn.ghost {
  background: rgba(243, 244, 246, 0.9);
}

.btn.ghost:hover {
  background: rgba(15, 23, 42, 0.65);
}

html[data-theme="light"] .btn.ghost:hover {
  background: rgba(229, 231, 235, 1);
}

.btn.secondary {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.btn.secondary:hover {
  background: rgba(99, 102, 241, 0.28);
}

.btn.small {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
}

.btn.full-width {
  width: 100%;
}

/* Hero preview card */
.hero-preview {
  display: flex;
  justify-content: flex-end;
}

.hero-preview-card {
  width: min(360px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.15), transparent 60%),
    rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

html[data-theme="light"] .hero-preview-card {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 55%),
    radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.16), transparent 60%),
    #ffffff;
}

.hero-preview-header {
  display: flex;
  gap: 0.3rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.8));
}

.hero-preview-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.hero-preview-header .red {
  background: #f97373;
}

.hero-preview-header .yellow {
  background: #facc15;
}

.hero-preview-header .green {
  background: #4ade80;
}

.hero-preview-body {
  padding: 1rem 1.1rem 1rem;
}

.hero-preview-line {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  margin-bottom: 0.55rem;
  width: 75%;
}

.hero-preview-line.wide {
  width: 90%;
  margin-bottom: 0.65rem;
}

.hero-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;
}

.hero-preview-pill {
  height: 40px;
  border-radius: 1rem;
  background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.6), transparent),
    rgba(15, 23, 42, 0.9);
}

html[data-theme="light"] .hero-preview-pill {
  background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.2), transparent),
    #e5e7eb;
}

.hero-preview-footer {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-preview-tag {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hero-preview-tag.secondary {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(129, 140, 248, 0.55);
}

/* Templates section */
.templates {
  padding: 2.75rem 0 2.5rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.75rem;
  align-items: flex-end;
}

.section-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
}

.section-header p {
  margin: 0;
  max-width: 32rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.section-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Inputs */
.search-input,
.select-input,
.contact-form input,
.contact-form textarea {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-main);
  padding: 0.55rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}

html[data-theme="light"] .search-input,
html[data-theme="light"] .select-input,
html[data-theme="light"] .contact-form input,
html[data-theme="light"] .contact-form textarea {
  background: rgba(249, 250, 251, 0.95);
}

.search-input {
  width: min(240px, 100%);
}

.select-input {
  padding-right: 2.25rem;
}

.search-input:focus,
.select-input:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4);
}

/* Template grid */
.templates-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.template-card {
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0) scale(1);
  transition: transform var(--transition-med), box-shadow var(--transition-med),
    border-color var(--transition-med), background var(--transition-med);
}

html[data-theme="light"] .template-card {
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.06), transparent 60%),
    #ffffff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.13);
}

.template-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.95);
}

html[data-theme="light"] .template-card:hover {
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
}

.template-thumb-wrapper {
  position: relative;
  overflow: hidden;
}

.template-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform var(--transition-med), filter var(--transition-med);
  filter: saturate(1.15) contrast(1.05);
}

.template-card:hover .template-thumb {
  transform: scale(1.05);
}

.template-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent 50%);
}

.template-body {
  padding: 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.template-pill {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.8);
}

.template-pill.subtle {
  border-style: dashed;
  opacity: 0.85;
}

.template-title {
  margin: 0.25rem 0 0;
  font-size: 1rem;
}

.template-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

html[data-theme="light"] .tag {
  background: #f3f4f6;
}

.template-actions {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Empty state */
.empty-state {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* How it works */
.how-it-works {
  padding: 2.75rem 0 2.5rem;
}

.how-it-works h2 {
  margin-bottom: 1.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

.step {
  position: relative;
  padding: 1.1rem 1rem 1.1rem 1.1rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.98));
  font-size: 0.9rem;
}

html[data-theme="light"] .step {
  background: linear-gradient(145deg, #f9fafb, #e5e7eb);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

/* Contact */
.contact {
  padding: 2.75rem 0 2.5rem;
}

.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 2.25rem;
  align-items: flex-start;
}

.contact-copy h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.contact-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-form {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.2rem 1.1rem;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.8);
}

html[data-theme="light"] .contact-form {
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.contact-form input,
.contact-form textarea {
  border-radius: 0.7rem;
  width: 100%;
  margin-top: 0.3rem;
}

.contact-form textarea {
  border-radius: 0.9rem;
  resize: vertical;
  min-height: 110px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, min(220px, 100%)));
  gap: 0.9rem;
  margin-bottom: 0.35rem;
}

.contact-note {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1.2rem 0 1.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.back-to-top {
  text-decoration: none;
  font-size: 0.8rem;
}

.back-to-top:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-preview {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .header-inner {
    align-items: center;
  }

  .nav {
    display: none;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .section-header {
    align-items: flex-start;
  }

  .contact-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-form {
    order: 2;
  }

  .contact-copy {
    order: 1;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
