@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;700&family=Outfit:wght@300;400;500;600;700&display=swap');


:root,
[data-theme=dark] {
  /* Brand tokens */
  --bg:           #04010c;
  --surface:      #180931;
  --surface2:     #0c041e;
  --border:       rgba(255, 255, 255, 0.06);
  --border-hover: rgba(105, 58, 183, 0.4);
  --text:         #eeebf9;
  --muted:        #beb2e6;
  --accent:       #693ab7;
  --accent-light: #9d78e2;
  --accent-glow:  rgba(105, 58, 183, 0.15);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;

  /* Pico variable overrides */
  --pico-primary:                      #693ab7;
  --pico-primary-background:           #693ab7;
  --pico-primary-border:               #693ab7;
  --pico-primary-hover:                #9d78e2;
  --pico-primary-hover-background:     #7d4acc;
  --pico-primary-hover-border:         #7d4acc;
  --pico-primary-focus:                rgba(105, 58, 183, 0.35);
  --pico-primary-inverse:              #fff;
  --pico-background-color:             #04010c;
  --pico-secondary-background:         #180931;
  --pico-secondary-border:             #180931;
  --pico-secondary-inverse:            #eeebf9;
  --pico-secondary-hover-background:   #0c041e;
  --pico-secondary-hover-border:       #0c041e;
  --pico-color:                        #eeebf9;
  --pico-h1-color:                     #eeebf9;
  --pico-h2-color:                     #eeebf9;
  --pico-h3-color:                     #eeebf9;
  --pico-h4-color:                     #eeebf9;
  --pico-h5-color:                     #eeebf9;
  --pico-h6-color:                     #beb2e6;
  --pico-muted-color:                  #beb2e6;
  --pico-muted-border-color:           rgba(255, 255, 255, 0.06);
  --pico-card-background-color:        #180931;
  --pico-card-border-color:            rgba(255, 255, 255, 0.06);
  --pico-card-box-shadow:              none;
  --pico-border-radius:                12px;
  --pico-border-color:                 rgba(255, 255, 255, 0.06);
  --pico-font-family:                  'Outfit', system-ui, sans-serif;
  --pico-font-size:                    16px;
  --pico-line-height:                  1.75;
  --pico-form-element-background-color: #0c041e;
  --pico-form-element-border-color:    rgba(255, 255, 255, 0.1);
  --pico-form-element-color:           #eeebf9;
  --pico-form-element-placeholder-color: #beb2e6;
  --pico-form-element-active-background-color: #0c041e;
  --pico-form-element-active-border-color: #693ab7;
  --pico-form-element-focus-color:     rgba(105, 58, 183, 0.35);
  --pico-contrast:                     #eeebf9;
  --pico-table-border-color:           rgba(255, 255, 255, 0.06);
  --pico-accordion-border-color:       rgba(255, 255, 255, 0.06);
  --pico-accordion-close-summary-color: #eeebf9;
  --pico-accordion-open-summary-color: #beb2e6;
  --pico-accordion-active-summary-color: #9d78e2;
  --pico-code-background-color:        #0c041e;
  --pico-code-color:                   #9d78e2;
  --pico-blockquote-border-color:      #693ab7;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  scrollbar-width: none;
}
html::-webkit-scrollbar { display: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}


/* ── Header nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(4, 1, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.nav-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link { min-width: 0; }

.nav-drawer {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-drawer a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

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

.nav-cta {
  border-radius: 999px !important;
  padding: 0.5rem 1.2rem !important;
  font-size: 0.88rem !important;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Desktop nav */
@media (min-width: 769px) {
  .site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .nav-brand-row  { flex: 0 0 auto; }
  .nav-drawer     { flex: 0 0 auto; display: flex !important; }
  .nav-toggle     { display: none !important; }
}

/* Mobile nav */
@media (max-width: 768px) {
  .site-nav {
    display: block;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  .brand-link svg { width: 148px; height: auto; }

  .nav-toggle { display: inline-flex; }

  .nav-drawer {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(12, 4, 30, 0.98);
    border: 1px solid var(--border);
    border-radius: 14px;
  }

  .nav-drawer.open { display: flex; }

  .nav-drawer a {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
    background: transparent;
  }

  .nav-drawer a:hover { background: rgba(105, 58, 183, 0.08); }

  .nav-drawer .nav-cta {
    width: 100%;
    text-align: center;
    margin-top: 0.25rem;
  }
}


/* ── Badge ── */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: var(--accent-glow);
  border: 1px solid rgba(105, 58, 183, 0.3);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
}


/* ── Cards grid ── */
.cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: border-color 0.18s, transform 0.15s, background 0.18s;
  width: calc(50% - 0.625rem);
  max-width: 320px;
  box-sizing: border-box;
}

.card-link:hover {
  border-color: var(--border-hover);
  background: rgba(105, 58, 183, 0.05);
  transform: translateY(-2px);
}

.card-link h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card-link p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border: 1px solid rgba(105, 58, 183, 0.2);
}

@media (max-width: 640px) {
  .card-link { width: 100%; max-width: 100%; }
}


/* ── Ad slots ── */
.ad-slot {
  background: var(--surface2);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.15);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
}

.ad-slot-leaderboard {
  width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.ad-slot-rect {
  width: 300px;
  height: 300px;
  margin: 1.5rem auto;
}

@media (max-width: 600px) {
  .ad-slot-rect { width: 100%; }
}


/* ── Sticky back button (app mode) ── */
.app-back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  align-items: center;
  gap: 0.4rem;
  background: rgba(24, 9, 49, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}

.app-back:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

/* ── App mode content padding (account for back button) ── */
.app-content {
  padding-top: 60px;
}


/* ── Sticky CTA banner (website mode) ── */
.cta-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(12px);
}

.cta-banner-text {
  flex: 1;
  min-width: 0;
}

.cta-banner p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.cta-banner strong {
  color: var(--text);
  display: block;
  font-size: 0.88rem;
}

.cta-banner a[role="button"] {
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  margin: 0;
}

.cta-banner-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.4rem;
  padding: 0.2rem 0.4rem;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.cta-banner-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

body.show-banner main { padding-bottom: 80px; }

@media (max-width: 540px) {
  .cta-banner {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    gap: 0.5rem;
  }
  /* Close button top-right, text below it */
  .cta-banner-text         { flex: 1 1 100%; order: 2; }
  .cta-banner a[role="button"] {
    flex: 1 1 100%;
    order: 3;
    text-align: center;
  }
  .cta-banner-close        { order: 1; margin-left: auto; }
}
