/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:            #070714;
  --card-bg:       rgba(10, 14, 40, 0.82);
  --card-border:   rgba(100, 120, 220, 0.22);
  --card-hover:    rgba(80, 100, 200, 0.12);
  --text:          #d8ddf0;
  --text-muted:    #7a86bb;
  --heading:       #eef0ff;
  --accent:        #6979d4;
  --accent-glow:   rgba(105, 121, 212, 0.35);
  --link:          #7eb8f7;
  --link-hover:    #aacffa;
  --border:        rgba(100, 120, 220, 0.18);
  --hero-grad:     linear-gradient(160deg, rgba(50,60,160,0.18) 0%, transparent 60%);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Canvas & Nebula ===== */
#stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.nebula-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 25%, rgba(60, 80, 200, 0.13) 0%, transparent 100%),
    radial-gradient(ellipse 50% 60% at 85% 70%, rgba(120, 60, 190, 0.09) 0%, transparent 100%),
    radial-gradient(ellipse 80% 30% at 50% 90%, rgba(20, 50, 150, 0.07) 0%, transparent 100%);
}

/* ===== Layout ===== */
.site-header,
.main-content,
.site-footer {
  position: relative;
  z-index: 10;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 780px;
}

/* ===== Header ===== */
.site-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(7, 7, 20, 0.6);
  position: sticky;
  top: 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.logo-symbol {
  font-size: 1.4rem;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent));
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.main-nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--link-hover);
  background: rgba(100, 130, 240, 0.1);
}

/* ===== Hero ===== */
.hero {
  padding: 90px 0 70px;
  text-align: center;
  background: var(--hero-grad);
}

.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 0 0 60px rgba(100, 130, 255, 0.3);
}

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

/* ===== Section block ===== */
.section-block {
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}

.section-block:last-child {
  border-bottom: none;
}

.section-header {
  margin-bottom: 36px;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 8px;
}

.section-title a {
  color: inherit;
  text-decoration: none;
}

.section-title a:hover {
  color: var(--link-hover);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Cards grid ===== */
.cards-grid,
.cards-grid--wide {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  height: 270px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(105, 121, 212, 0.45);
  box-shadow: 0 8px 32px rgba(70, 90, 200, 0.18), 0 0 0 1px rgba(105, 121, 212, 0.2);
}

.card-inner {
  padding: 22px 24px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.card-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.card-time {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--heading);
  flex-shrink: 0;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

.card-excerpt {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.card-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
  margin-top: auto;
  flex-shrink: 0;
}

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

.section-more {
  margin-top: 28px;
  text-align: right;
}

/* ===== Buttons ===== */
.btn-outline {
  display: inline-block;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--link-hover);
  background: rgba(105, 121, 212, 0.08);
}

/* ===== Page Header (sections) ===== */
.page-header {
  padding: 30px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--heading);
  margin-bottom: 10px;
}

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

/* ===== Article ===== */
.article {
  padding: 48px 0 80px;
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-section {
  margin-bottom: 12px;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--link-hover);
}

.article-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--heading);
  margin-bottom: 10px;
}

.article-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.article-time {
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.article-lead {
  font-size: 1.12rem;
  color: var(--text);
  line-height: 1.7;
  font-style: italic;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
}

/* ===== Article Body ===== */
.article-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}

.article-body h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--heading);
  margin: 56px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--heading);
  margin: 36px 0 14px;
}

.article-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}

.article-body p {
  margin-bottom: 18px;
}

.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(126, 184, 247, 0.4);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.article-body a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.article-body ul,
.article-body ol {
  margin: 0 0 18px 24px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body blockquote {
  margin: 28px 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent);
  background: rgba(105, 121, 212, 0.07);
  border-radius: 0 8px 8px 0;
  color: var(--text);
  font-style: italic;
}

.article-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: rgba(105, 121, 212, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  color: #b3c8ff;
}

.article-body pre {
  background: rgba(0, 0, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.9rem;
}

.article-body th {
  background: rgba(105, 121, 212, 0.15);
  color: var(--heading);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.article-body td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(100, 120, 220, 0.1);
}

.article-body tr:hover td {
  background: rgba(105, 121, 212, 0.04);
}

.article-body strong {
  color: var(--heading);
  font-weight: 600;
}

.article-body em {
  color: var(--text);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.article-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ===== Footer ===== */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  backdrop-filter: blur(8px);
}

.footer-star {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(122, 134, 187, 0.55);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .cards-grid,
  .cards-grid--wide {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 60px 0 48px;
  }

  .main-nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}
