:root {
  --bg: #0d0f12;
  --bg-2: #14171c;
  --bg-3: #1c2027;
  --fg: #f5f6f8;
  --fg-dim: #a8aeba;
  --fg-muted: #6c7280;
  --line: #262a32;
  --accent: #ffd166;
  --accent-2: #6ea8fe;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --max: 1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.15rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 1rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: var(--max); margin: 0 auto;
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.05rem; }
.brand:hover { color: var(--fg); }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.nav-link { color: var(--fg-dim); font-size: 0.95rem; }
.nav-link:hover { color: var(--fg); }
@media (max-width: 540px) {
  .nav-link:not(.cta) { display: none; }
  .site-header { padding: 0.75rem 1rem; }
}

/* CTA */
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
  border: 0;
}
.cta-primary {
  background: transparent;
  padding: 0;
}
.cta-primary img { display: block; }
.cta-primary:hover { transform: translateY(-1px); }
.cta-ghost {
  color: var(--fg-dim);
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line);
  background: transparent;
}
.cta-ghost:hover { color: var(--fg); border-color: var(--fg-dim); }
.cta-sm {
  background: var(--accent);
  color: #0d0f12;
  padding: 0.55rem 1rem;
  font-size: 0.92rem;
}
.cta-sm:hover { color: #0d0f12; background: #ffe091; }

/* Hero */
.hero {
  position: relative;
  padding: 3rem 1.5rem 4rem;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero-accent {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  color: var(--fg-dim);
  font-size: 1.1rem;
  max-width: 36rem;
  margin: 0 0 2rem;
}
.hero-ctas { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-meta { display: flex; gap: 2rem; flex-wrap: wrap; color: var(--fg-dim); font-size: 0.95rem; }
.hero-meta strong { color: var(--fg); font-weight: 700; font-size: 1.05rem; }

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 480px;
  margin-left: auto;
}
.hero-glow {
  position: absolute; inset: -10%;
  background: radial-gradient(circle at 50% 50%, rgba(110, 168, 254, 0.25), transparent 60%);
  filter: blur(20px);
}
.hero-stack {
  position: relative; width: 100%; height: 100%;
}
.hero-stack img {
  position: absolute;
  width: 56%; height: auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5));
}
.hero-stack img:nth-child(1) { top: 0; left: 0; transform: rotate(-6deg); }
.hero-stack img:nth-child(2) { bottom: 4%; right: 0; transform: rotate(8deg); }
.hero-stack img:nth-child(3) { top: 22%; left: 28%; z-index: 1; transform: scale(1.05); }

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 320px; margin: 1rem auto 0; }
}

/* Collection */
.collection {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.collection-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 2rem;
}
.filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.filter {
  background: var(--bg-2);
  color: var(--fg-dim);
  border: 1px solid var(--line);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter:hover { color: var(--fg); border-color: var(--fg-muted); }
.filter.is-active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  isolation: isolate;
  padding: 0;
  background: transparent;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 255, 255, 0.18);
}
.tile-bg {
  position: absolute; inset: 0;
  background: var(--tile-bg, var(--bg-2));
  z-index: -1;
}
.tile-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
              linear-gradient(to bottom, transparent 45%, rgba(0, 0, 0, 0.7) 100%);
}
.tile-preview {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.tile-preview img {
  width: 80%;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}
.tile-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.75rem 0.95rem 0.85rem;
  z-index: 1;
}
.tile-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.tile-chips {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
}
.chip {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
}
.chip.chip-free {
  background: var(--accent);
  color: #0d0f12;
  font-weight: 600;
}

.grid-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--fg-dim);
}

/* Closer */
.closer {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  padding: 4rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
}
.closer-inner {
  max-width: 720px;
  margin: 0 auto;
}
.closer h2 { margin-bottom: 1rem; }
.closer p { color: var(--fg-dim); margin-bottom: 2rem; font-size: 1.1rem; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fade-in 0.2s ease;
}
.modal[hidden] { display: none; }
.grid-empty[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: lift 0.25s ease;
}
@keyframes lift { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  z-index: 2;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.7); }
.modal-preview {
  aspect-ratio: 16 / 10;
  background: var(--modal-bg, var(--bg-3));
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.modal-preview::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 50% 30%, rgba(255, 255, 255, 0.18), transparent 70%);
}
.modal-preview img {
  width: 60%; max-width: 320px;
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5));
  position: relative;
}
.modal-body {
  padding: 1.5rem 1.75rem 1.75rem;
  overflow-y: auto;
}
.modal-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.modal-chips .chip { background: var(--bg-3); color: var(--fg-dim); }
.modal-chips .chip.chip-free { background: var(--accent); color: #0d0f12; }
.modal-body h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.modal-description {
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--fg-dim);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  max-height: 14rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Generic page */
.page { padding: 3rem 1.5rem 4rem; }
.page-inner { max-width: var(--max); margin: 0 auto; }
.page-inner.narrow { max-width: 720px; }
.page-inner.center { text-align: center; }
.page h1 { margin-bottom: 1.5rem; }
.page h2 { margin-top: 2.5rem; margin-bottom: 1rem; font-size: 1.4rem; }
.page p, .page li { color: var(--fg-dim); }
.page p { margin: 0 0 1rem; }
.page .lede { color: var(--fg); font-size: 1.15rem; margin-bottom: 2rem; }
.page ul, .page ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.page li { margin-bottom: 0.5rem; }
.page a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.page a:hover { color: var(--accent); }
.page-meta { color: var(--fg-muted); font-size: 0.9rem; margin: -0.75rem 0 2rem; }
.page-cta { margin: 2.5rem 0 0; }
.contact-card { margin: 2rem 0; }

.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.6rem;
  background: var(--bg-2);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute; right: 0; top: 0;
  color: var(--fg-dim);
  font-size: 1.3rem;
  line-height: 1;
}
.faq[open] summary::after { content: '−'; }
.faq p { margin: 0.75rem 0 0; color: var(--fg-dim); }

.error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 1rem;
}

/* App page features grid */
.app-hero { padding: 1rem 0 3rem; }
.app-copy { max-width: 720px; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 4rem;
}
.feature {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.feature h3 { color: var(--accent); margin-bottom: 0.5rem; }
.feature p { color: var(--fg-dim); margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.5rem 3rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; color: var(--fg-dim); font-size: 0.9rem; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--fg-dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--fg); }
.footer-meta { color: var(--fg-muted); font-size: 0.85rem; }
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand, .footer-meta { justify-content: center; }
}

/* Code/inline */
code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85em;
  background: var(--bg-3);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
