/* Design System & Variables */
:root {
  color-scheme: dark;
  
  /* Colors */
  --bg: #07090e;
  --bg-offset: rgba(17, 24, 39, 0.55);
  --card-bg: rgba(19, 24, 37, 0.7);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-hover: rgba(96, 165, 250, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --accent: #60a5fa;
  --accent-muted: rgba(96, 165, 250, 0.1);
  --accent-strong: #3b82f6;
  
  /* Layout & Spacing */
  --max-width: 1040px;
  --content-width: 720px;
  --radius: 12px;
  --radius-sm: 6px;
  
  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(96, 165, 250, 0.12), transparent 60%),
    radial-gradient(circle at 0% 40%, rgba(30, 41, 59, 0.3), transparent 40%),
    radial-gradient(circle at 100% 80%, rgba(30, 41, 59, 0.3), transparent 40%);
  background-attachment: fixed;
  color: var(--text-secondary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0.5em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  margin-bottom: 0.6em;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Layout Shell */
.site-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  padding: 48px 0 64px;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand:hover {
  color: var(--accent);
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav a {
  color: var(--text-muted);
}

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

/* Footer */
.site-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

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

/* Hero & Page Intro */
.home-hero,
.page-intro {
  max-width: var(--content-width);
  margin: 24px 0 64px;
}

.home-hero h1,
.page-intro h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.home-hero .lede,
.page-intro .lede {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}

/* Buttons */
.button-row {
  display: flex;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background-color: var(--bg-offset);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.button:hover {
  border-color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.05);
}

.button-primary {
  background-color: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg);
}

.button-primary:hover {
  background-color: var(--text-secondary);
  border-color: var(--text-secondary);
}

/* Blog Listing Section */
.listing-section {
  margin-bottom: 48px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
}

.section-heading a:hover {
  border-color: var(--accent);
}

/* Grid of "Boxes" (Cards) */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.post-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
}

.post-card time {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: block;
}

.post-card h3 {
  font-size: 1.2rem;
  line-height: 1.35;
  margin-bottom: 12px;
}

.post-card h3 a {
  color: var(--text-primary);
}

.post-card p {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post Detail View */
.post-panel {
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-panel .eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
  display: block;
}

.post-panel time {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: block;
}

.post-content {
  margin-top: 40px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content h2, 
.post-content h3 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.post-content h2 {
  font-size: 1.5rem;
}

.post-content h3 {
  font-size: 1.25rem;
}

.post-content ul, 
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 24px;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content a {
  color: var(--accent);
  border-bottom: 1px solid var(--card-border-hover);
}

.post-content a:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.post-content blockquote {
  border-left: 4px solid var(--accent);
  background-color: var(--bg-offset);
  padding: 16px 24px;
  margin: 24px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  background-color: var(--bg-offset);
  border: 1px solid var(--card-border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.post-content pre {
  background-color: #0d1117;
  border: 1px solid var(--card-border);
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background-color: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.post-content figure {
  margin: 32px 0;
}

.post-content figure img {
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

.post-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
}

/* About Page Custom Layout */
.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  margin-top: 16px;
}

.about-sidebar {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-profile-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(12px);
}

.about-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--card-border), var(--accent));
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-primary);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: bold;
}

.about-profile-card h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.about-profile-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-details-list {
  list-style: none;
  text-align: left;
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-details-list li {
  display: flex;
  justify-content: space-between;
}

.about-details-list span:first-child {
  color: var(--text-muted);
}

.about-details-list span:last-child {
  color: var(--text-secondary);
  font-weight: 500;
}

.about-narrative {
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-narrative h1 {
  margin-bottom: 24px;
}

.about-narrative h2 {
  margin-top: 40px;
  font-size: 1.4rem;
}

.about-narrative ul {
  margin-bottom: 24px;
  padding-left: 20px;
}

.about-narrative li {
  margin-bottom: 12px;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 420px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(12px);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.cookie-banner p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.cookie-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive Styling */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  
  .panel-image {
    order: -1;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
  
  .split-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  
  .split-grid .panel-image {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
  
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .about-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .about-sidebar {
    position: static;
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 24px 16px;
  }
  
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .nav {
    width: 100%;
    border-top: 1px solid var(--card-border);
    padding-top: 16px;
  }
  
  .post-grid {
    grid-template-columns: 1fr;
  }
  
  .site-footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .button-row {
    flex-direction: column;
    width: 100%;
  }
  
  .button {
    width: 100%;
  }
  
  .cookie-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}
