:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1c1c1c;
  --border: #242424;
  --border-hover: #3a3a3a;
  --accent: #8b5cf6;
  --accent-dim: rgba(139, 92, 246, 0.15);
  --accent-bright: #a78bfa;
  --text: #f0f0f0;
  --text-muted: #888;
  --text-dim: #555;
  --radius: 14px;
  --radius-sm: 9px;
  --transition: 0.18s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

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

.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.site-logo .dot { color: var(--accent-bright); }

nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: color var(--transition), background var(--transition);
}

nav a:hover { color: var(--text); background: var(--surface-hover); }
nav a.active { color: var(--accent-bright); background: var(--accent-dim); }

/* ── Hero ── */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
  margin-bottom: 1.25rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  background: var(--accent-dim);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.1;
  background: linear-gradient(140deg, #fff 30%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.1rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ── Page cards (index) ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 5rem;
}

.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.page-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.18);
}

.page-card .card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.page-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-card .card-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.page-card .arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 500;
  transition: gap var(--transition);
}

.page-card:hover .arrow { gap: 0.55rem; }

/* ── Content pages ── */
.content-wrap {
  padding: 3.5rem 0 6rem;
}

.content-wrap .container { max-width: 780px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover { color: var(--accent-bright); }

.breadcrumb .sep { color: var(--text-dim); }

.page-header { margin-bottom: 2.5rem; }

.page-header .page-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
  margin-bottom: 0.75rem;
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.page-header .lead {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 580px;
}

/* ── Article content ── */
.article-content h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 3rem 0 0.6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-content h1:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.article-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-bright);
  margin: 2.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-content h2::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  border-radius: 99px;
  flex-shrink: 0;
}

.article-content > p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* ── Link cards ── */
.link-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.link-cards.grid-2 {
  gap: 1rem;
}

@media (min-width: 580px) {
  .link-cards.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.link-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateX(3px);
}

/* Image card variant */
.link-card.has-img {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.link-thumb {
  width: 52px;
  height: 52px;
  min-width: 52px;
  max-width: 52px;
  flex: 0 0 52px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-hover);
  display: block;
  transition: transform var(--transition);
}

.link-card.has-img:hover .link-thumb {
  transform: scale(1.06);
}

.link-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.link-card .link-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: color var(--transition);
  display: block;
  margin-bottom: 0.2rem;
}

.link-card:hover .link-title { color: var(--accent-bright); }

.link-card .link-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.link-card .link-domain {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── URL-only cards (no link text) ── */
.url-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.url-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  transition: border-color var(--transition);
}

.url-card:hover { border-color: var(--border-hover); }

.url-card a {
  color: var(--accent-bright);
  text-decoration: none;
  font-size: 0.875rem;
  word-break: break-all;
  display: block;
  transition: opacity var(--transition);
}

.url-card a:hover { opacity: 0.75; }

.url-card .url-domain {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}

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

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

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color var(--transition);
}

.site-footer a:hover { color: var(--accent-bright); }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 4rem 0 2.5rem; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ── Dot grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ── Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa, #60a5fa);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 200;
}

/* ── Cursor glow ── */
.cursor-glow {
  position: fixed;
  pointer-events: none;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.055) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0;
}

/* ── Ambient orbs ── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 650px;
  height: 650px;
  background: rgba(124, 58, 237, 0.2);
  top: -220px;
  left: -80px;
  animation: orb-drift 14s ease-in-out infinite;
}

.orb-2 {
  width: 520px;
  height: 520px;
  background: rgba(59, 130, 246, 0.13);
  top: -120px;
  right: -120px;
  animation: orb-drift 18s ease-in-out infinite reverse;
  animation-delay: -5s;
}

.orb-3 {
  width: 340px;
  height: 340px;
  background: rgba(167, 139, 250, 0.12);
  bottom: -80px;
  left: 40%;
  animation: orb-drift 10s ease-in-out infinite;
  animation-delay: -8s;
}

@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(25px, -30px) scale(1.04); }
  66%       { transform: translate(-20px, 20px) scale(0.97); }
}

/* ── Hero overflow + z-index ── */
.hero { overflow: hidden; }
.hero .container { position: relative; z-index: 1; }

/* ── Shimmer gradient on hero h1 ── */
.hero h1 {
  background-size: 200% auto;
  animation: text-shimmer 6s linear infinite;
}

@keyframes text-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ── Section glow divider ── */
.divider {
  transform-origin: left;
}

/* ── Animation initial states (JS adds .js class to html) ── */
.js .hero-eyebrow,
.js .hero h1,
.js .hero p,
.js .section-label,
.js .page-card,
.js .breadcrumb,
.js .page-tag,
.js .page-header h1,
.js .page-header .lead,
.js .article-content h1,
.js .article-content h2,
.js .article-content > p,
.js .link-card,
.js .url-card,
.js .divider {
  opacity: 0;
}
