/* Purity Ghost theme — matches app.thepurityapp.com (dark zinc + indigo) */
:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-raised: #18181b;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --muted-dim: #71717a;
  --accent: #6366f1;
  --accent-light: #a5b4fc;
  --accent-dim: rgba(99, 102, 241, 0.14);
  --accent-glow: rgba(99, 102, 241, 0.22);
  --radius: 10px;
  --radius-lg: 13px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;
  --max: 1120px;
  --content: 720px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

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

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Ambient background — same feel as login panel */
.site-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 50% -20%, var(--accent-glow), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 0%, rgba(67, 56, 202, 0.12), transparent),
    var(--bg);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo:hover { text-decoration: none; opacity: 0.92; }

.logo-icon {
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

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

.nav a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

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

.btn-app {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}

.btn-app:hover {
  border-color: var(--border-hover);
  background: var(--surface-raised);
  text-decoration: none;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  margin-top: 1.75rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 45%, #4338ca 100%);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 24px rgba(99, 102, 241, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 12px 32px rgba(99, 102, 241, 0.32);
  text-decoration: none;
}

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

.hero-inner {
  max-width: 640px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.hero-badge img { border-radius: 6px; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 540px;
  margin: 0;
  line-height: 1.6;
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 0 0 4rem;
}

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.post-card-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.post-card-body { padding: 1.25rem; }

.tag {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.post-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent-light); text-decoration: none; }

.post-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.post-card time {
  font-size: 0.75rem;
  color: var(--muted-dim);
}

/* Single post */
.post-single { padding: 3rem 0 5rem; max-width: var(--content); }

.post-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 1rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 2rem;
}

.post-feature {
  margin: 0 0 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-feature img { width: 100%; display: block; }

.gh-content { font-size: 1.0625rem; }

.gh-content h2, .gh-content h3 {
  margin-top: 2rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.gh-content p { margin: 0 0 1.25rem; }

.gh-content img, .gh-content iframe {
  max-width: 100%;
  border-radius: var(--radius);
}

.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin-left: auto;
  margin-right: auto;
  transform: translateX(calc(50% - 50vw));
}

.kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.gh-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--muted);
}

.gh-content a { color: var(--accent-light); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 2rem;
}

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

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-brand img { border-radius: 8px; }
.footer-brand:hover { text-decoration: none; opacity: 0.9; }

.footer-copy {
  margin: 0;
  color: var(--muted-dim);
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

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

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0 0 4rem;
}

.pagination a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  background: var(--surface);
  text-decoration: none;
}

.pagination a:hover {
  border-color: var(--border-hover);
  text-decoration: none;
}

@media (max-width: 768px) {
  .nav { display: none; }
  .hero { padding-top: 2.5rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
