:root {
  --bg: #07070c;
  --bg-elev: #0e0e16;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f4f8;
  --muted: #a1a1b5;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, sans-serif;
  --display: "Syne", "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
}

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

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

button,
input {
  font: inherit;
}

.bg-aurora {
  position: fixed;
  inset: -20% -10% auto;
  height: 70vh;
  background:
    radial-gradient(60% 50% at 20% 20%, rgba(124, 92, 255, 0.35), transparent 70%),
    radial-gradient(50% 40% at 80% 10%, rgba(34, 211, 238, 0.22), transparent 70%),
    radial-gradient(40% 30% at 50% 0%, rgba(236, 72, 153, 0.18), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: -2;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  backdrop-filter: blur(16px);
  background: rgba(7, 7, 12, 0.65);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b8cff);
  color: white;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

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

.btn-lg {
  padding: 0.95rem 1.5rem;
  font-size: 1.02rem;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  margin: 0 0 1.25rem;
  grid-column: 1 / -1;
}

.hero-gradient {
  background: linear-gradient(100deg, #c4b5fd, #67e8f9 40%, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 38rem;
  margin: 0 0 1.75rem;
  grid-column: 1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  grid-column: 1;
}

.hero-preview {
  grid-column: 2;
  grid-row: 2 / span 3;
}

.preview-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-elev);
  transform: rotate(2deg);
  transition: transform 0.35s ease;
}

.preview-card:hover {
  transform: rotate(0deg) translateY(-4px);
}

.preview-card img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
  background: #151522;
}

.preview-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.preview-meta strong {
  font-family: var(--display);
  font-size: 1.25rem;
}

.preview-meta span {
  color: #c7c7d8;
  font-size: 0.92rem;
}

.filters {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.chip.active {
  background: rgba(124, 92, 255, 0.18);
  border-color: rgba(124, 92, 255, 0.55);
  color: #e9e2ff;
}

.templates,
.how {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.55rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.template-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.template-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow);
}

.template-thumb {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background:
    linear-gradient(145deg, color-mix(in oklab, var(--card-accent, var(--accent)) 35%, #12121c), #0b0b12);
}

.template-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 70% at 20% 20%, color-mix(in oklab, var(--card-accent) 55%, transparent), transparent 60%),
    radial-gradient(70% 60% at 90% 80%, rgba(255, 255, 255, 0.12), transparent 55%);
}

.thumb-stack {
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 0.65rem;
  z-index: 1;
  align-items: end;
}

.thumb-desktop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 16, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.thumb-mobile {
  width: 100%;
  height: 88%;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 16, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  transform: translateY(6px);
}

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

.template-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.template-name {
  font-family: var(--display);
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  margin: 0;
}

.template-cat {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  white-space: nowrap;
}

.template-style {
  color: #cfcfe0;
  font-size: 0.92rem;
  margin: 0;
}

.template-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  flex: 1;
}

.template-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.template-actions .btn {
  flex: 1;
  padding: 0.7rem 0.95rem;
  font-size: 0.92rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.how-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.45rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.how-num {
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--accent-2);
  margin-bottom: 0.85rem;
  letter-spacing: 0.08em;
}

.how-card h3 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.how-card p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.site-footer strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}

.credit {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.9rem;
}

.credit a {
  color: #c4b5fd;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.credit a:hover {
  color: #e9d5ff;
}

.modal-card textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.85rem 0.95rem;
  outline: none;
  resize: vertical;
  font: inherit;
}

.modal-card textarea:focus {
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.modal-hint {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 1.15rem;
  align-items: center;
}

.footer-links a:hover {
  color: var(--text);
}

/* Modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  border-radius: 22px;
  border: 1px solid var(--border);
  background: #12121c;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  font-family: var(--display);
  margin: 0 0 0.45rem;
  letter-spacing: -0.02em;
}

.modal-lead {
  margin: 0 0 1.35rem;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.65rem;
  cursor: pointer;
  line-height: 1;
}

.modal-card label {
  display: block;
  margin-bottom: 0.95rem;
}

.modal-card label span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.modal-card input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.85rem 0.95rem;
  outline: none;
}

.modal-card input:focus {
  border-color: rgba(124, 92, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.input-wrap {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.input-wrap input {
  padding-left: 1.85rem;
}

.modal-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.modal-actions .btn {
  flex: 1;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }

  .hero-preview {
    grid-column: 1;
    grid-row: auto;
    max-width: 360px;
  }

  .hero-lead,
  .hero-actions {
    grid-column: 1;
  }

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