/* =============================================================
   creatif.tools — design system
   Dark theme, teal accent, fully responsive, zero dependencies.
   ============================================================= */

:root {
  /* Surfaces */
  --bg:           #050505;
  --surface:      #0f0f0f;
  --surface-2:    #161616;
  --surface-3:    #1c1c1c;
  --border:       #1a1a1a;
  --border-2:     #2a2a2a;

  /* Text */
  --text:         #ffffff;
  --text-dim:     #a1a1a1;
  --text-mute:    #6b6b6b;

  /* Accent */
  --accent:       #00d4aa;
  --accent-dim:   #00b38f;
  --accent-soft:  rgba(0, 212, 170, 0.10);
  --accent-line:  rgba(0, 212, 170, 0.25);

  /* Status */
  --success:      #10b981;
  --success-bg:   rgba(16, 185, 129, 0.12);
  --pending:      #f59e0b;
  --pending-bg:   rgba(245, 158, 11, 0.12);

  /* Effects */
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg:    0 20px 50px rgba(0, 0, 0, 0.5);
  --glow-accent:  0 0 0 1px var(--accent-line), 0 12px 40px rgba(0, 212, 170, 0.10);

  /* Geometry */
  --radius:       20px;
  --radius-sm:    12px;
  --radius-pill:  999px;
  --nav-h:        64px;

  /* Type */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* =============================================================
   NAV
   ============================================================= */
header.site-nav {
  position: fixed;
  top: 20px;
  z-index: 100;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 1.8rem;
  box-shadow: var(--shadow-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: #000;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 900;
  letter-spacing: 0;
}

nav.primary ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0; padding: 0;
}

nav.primary a {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  transition: color 0.2s;
  cursor: pointer;
}

nav.primary a:hover { color: var(--accent); }

/* =============================================================
   MAIN
   ============================================================= */
main {
  max-width: 1180px;
  width: 92%;
  margin: 0 auto;
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 5rem;
  text-align: center;
}

/* HERO */
.hero { margin-bottom: 4.5rem; }
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2.5px;
  margin: 0 0 1.2rem;
  background: linear-gradient(180deg, #fff 0%, #777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.6;
}

.hero-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-badges::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* SECTION HEAD */
.section-head {
  text-align: center;
  margin-bottom: 1.8rem;
}
.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}
.section-head p {
  margin: 0;
  color: var(--text-mute);
  font-size: 0.9rem;
}

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.filter-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-2); }
.filter-chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Two-tier filter: niches (primary) + status (secondary) */
.filter-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.filter-bar-secondary {
  opacity: 0.85;
}
.filter-bar-secondary .filter-chip {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
}
.filter-chip .chip-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: inherit;
}
.filter-chip.active .chip-count {
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
}

/* =============================================================
   APP GRID
   ============================================================= */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
}

.card {
  --app-color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s,
              box-shadow 0.3s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--app-color);
  opacity: 0.85;
  transition: opacity 0.2s, height 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
}
.card:hover::before { opacity: 1; height: 4px; }

.card.coming-soon { opacity: 0.6; }
.card.coming-soon:hover { transform: none; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}
.monogram {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--app-color);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.card-title-block { min-width: 0; }
.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-tag {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--text-mute);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.card-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 1.2rem;
  flex: 1;
}

.card-features {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-features li {
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 0;
}
.card-features li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--app-color);
  flex-shrink: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.price {
  font-size: 0.75rem;
  color: var(--text-mute);
  letter-spacing: 0.2px;
}
.price strong {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  margin-right: 2px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.status-badge.live {
  background: var(--success-bg);
  color: var(--success);
}
.status-badge.coming {
  background: var(--pending-bg);
  color: var(--pending);
}
.status-badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  flex: 1;
}
.btn-accent {
  background: var(--app-color);
  color: #fff;
  border-color: var(--app-color);
}
.btn-accent:hover { filter: brightness(1.08); }
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-2); }
.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-icon {
  width: 14px; height: 14px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =============================================================
   EMPTY STATE
   ============================================================= */
.empty-state {
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 4rem 2rem;
  text-align: center;
  background: var(--surface);
}
.empty-state .pulse {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  display: grid; place-items: center;
  margin: 0 auto 1.2rem;
  color: var(--accent);
}
.empty-state h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
}
.empty-state p {
  margin: 0 auto;
  max-width: 380px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.empty-state .reset-link {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}
.empty-state .reset-link:hover { filter: brightness(1.08); }

/* =============================================================
   MODAL
   ============================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  --app-color: var(--accent);
  position: relative;
  background: var(--surface);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  gap: 12px;
}
.modal-bar-left {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1;
}
.modal-bar-left .monogram {
  width: 36px; height: 36px;
  font-size: 14px;
  border-radius: 8px;
}
.modal-title {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-sub {
  font-size: 0.7rem;
  color: var(--text-mute);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
}
.modal-bar-right {
  display: flex; gap: 8px; flex-shrink: 0;
}
.modal-bar .btn { padding: 8px 14px; font-size: 0.8rem; flex: 0 0 auto; }
.modal-bar .btn-ghost { padding: 8px 12px; }

.modal-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  display: block;
}
.modal-empty {
  flex: 1;
  display: none;
  place-items: center;
  padding: 40px;
  text-align: center;
  color: var(--text-dim);
}
.modal-empty.show { display: grid; }
.modal-empty h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 700;
}
.modal-empty p { margin: 0; max-width: 420px; }

.modal-loader {
  flex: 1;
  display: grid;
  place-items: center;
  background: var(--surface);
}
.modal-loader .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- DEMO LIMIT: banner + overlay --- */
.modal-demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-line);
  font-size: 0.78rem;
  color: var(--accent);
  flex-shrink: 0;
  z-index: 5;
  position: relative;
}
.modal-demo-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.modal-demo-banner-text strong {
  color: var(--accent);
  font-weight: 700;
}
.btn-mini {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: var(--accent);
  color: #000;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: filter 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}
.btn-mini:hover { filter: brightness(1.08); }

.modal-demo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  place-items: center;
  z-index: 4;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
.modal-demo-overlay.show { display: grid; }
.modal-demo-overlay-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 36px 32px 32px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.overlay-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  display: grid;
  place-items: center;
  color: var(--accent);
  margin: 0 auto 16px;
}
.modal-demo-overlay-card h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.modal-demo-overlay-card p {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
}
.overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.overlay-actions .btn { width: 100%; }
.overlay-actions .btn-ghost { color: var(--text-dim); }

/* =============================================================
   FOOTER
   ============================================================= */
footer.site-foot {
  width: 100%;
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-mute);
  font-size: 0.8rem;
  margin-top: auto;
}
footer.site-foot .foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1180px;
  width: 92%;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 12px;
}
footer.site-foot a {
  color: var(--text-dim);
  margin-left: 18px;
  transition: color 0.2s;
}
footer.site-foot a:hover { color: var(--accent); }
footer.site-foot a:first-of-type { margin-left: 0; }

/* =============================================================
   TOAST
   ============================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
  header.site-nav {
    width: 92%;
    flex-direction: column;
    gap: 0.6rem;
    border-radius: 20px;
    padding: 0.7rem 1rem;
  }
  nav.primary ul { gap: 0.9rem; }
  nav.primary a { font-size: 0.7rem; }
  .hero { margin-bottom: 3rem; }
  main { padding-top: calc(var(--nav-h) + 100px); }
  .section-head { flex-direction: column; align-items: flex-start; }
  .modal-bar { padding: 10px 12px; }
  .modal-bar .btn { padding: 7px 10px; font-size: 0.72rem; }
  .modal-sub { display: none; }
  footer.site-foot .foot-row { justify-content: center; text-align: center; }
}

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

/* =============================================================
   A11Y
   ============================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
