/* Modern Restructuring Theme - Premium Dark/Light Hybrid */
:root {
  /* Palette - Deep Blue & Gold */
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-highlight: #334155;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  
  --color-primary: #fbbf24; /* Amber 400 */
  --color-primary-hover: #f59e0b; /* Amber 500 */
  --color-accent: #38bdf8; /* Sky 400 */
  
  --font-sans: "Manrope", system-ui, -apple-system, sans-serif;
  --font-display: "Manrope", system-ui, -apple-system, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(251, 191, 36, 0.15);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1rem 0;
  color: #fff;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1.5rem; color: var(--color-text-muted); max-width: 65ch; }
a { color: inherit; text-decoration: none; }

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 6rem 0; position: relative; overflow: hidden; }
.section-sm { padding: 4rem 0; }

.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

/* Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-primary);
  color: #0f172a;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.3);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
}

/* Navbar */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s ease;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #0f172a;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--color-primary); }

/* Hero Section */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px; /* nav offset */
  background: 
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.15), transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(251, 191, 36, 0.08), transparent 40%);
}
.hero-content {
  max-width: 900px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--color-primary);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Features / Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  grid-auto-rows: minmax(200px, auto);
}
.bento-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 1px solid rgba(255,255,255,0.05);
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}
.bento-item.large { grid-column: span 8; } /* Spans 2/3 width */
.bento-item.tall { grid-row: span 2; }

.bento-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  margin-bottom: auto;
}

/* Footer */
.site-footer {
  background: #020617;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 4rem 0;
  margin-top: 4rem;
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--color-text-muted); }
.footer-links a:hover { color: #fff; }

/* Utilities */
.text-highlight { color: var(--color-primary); }
.text-gradient {
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Blog Post */
.post-hero {
  padding: 8rem 0 3rem;
  background: linear-gradient(to bottom, #0f172a 0%, #13203a 45%, #1e293b 100%);
}
.post-breadcrumbs {
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 1.25rem;
}
.post-breadcrumbs a { color: #94a3b8; transition: color 0.2s ease; }
.post-breadcrumbs a:hover { color: #fff; }
.post-breadcrumbs .sep { margin: 0 0.5rem; color: #334155; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.post-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.08);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-title {
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  margin: 0 0 1rem;
  color: #fff;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.post-lead {
  font-size: 1.2rem;
  color: #cbd5e1;
  margin: 0 0 1.5rem;
  max-width: 70ch;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 600;
}
.post-meta .dot { color: #334155; }

.post-cover {
  margin-top: -2.75rem;
  margin-bottom: 2.5rem;
}
.post-cover img {
  width: 100%;
  height: auto;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  background: rgba(255,255,255,0.02);
}

.post-section {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  overflow: visible;
}
.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
.post-article {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 2.5rem;
}

.post-aside { display: block; }
.post-aside-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 1.75rem;
}
.post-aside-card h3 { font-size: 1.25rem; margin: 0 0 0.75rem; }
.post-aside-card p { margin: 0 0 1.25rem; color: #cbd5e1; max-width: none; }
.post-aside-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.post-aside-actions .btn { padding: 0.75rem 1.25rem; font-size: 0.95rem; }

@media (min-width: 1024px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 3rem; }
  .post-aside { display: block; position: sticky; top: 110px; }
}

/* Markdown / Article */
.article-content {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.8;
}
.article-content p { color: #cbd5e1; }
.article-content strong { color: #fff; }
.article-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(251, 191, 36, 0.35);
  text-underline-offset: 3px;
}
.article-content a:hover { text-decoration-color: rgba(251, 191, 36, 0.75); }

.article-content h2 {
  font-size: clamp(1.6rem, 2.8vw, 2rem);
  margin-top: 2.75rem;
}
.article-content h3 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
}
.article-content h4 {
  font-size: 1.1rem;
  margin-top: 2rem;
}
.article-content h2:first-child,
.article-content h3:first-child,
.article-content h4:first-child { margin-top: 0; }

.article-content ul,
.article-content ol {
  margin: 1rem 0 1.5rem;
  padding-left: 1.25rem;
  color: #cbd5e1;
}
.article-content li { margin: 0.55rem 0; }
.article-content li::marker { color: var(--color-primary); }

.article-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid rgba(56, 189, 248, 0.7);
  background: rgba(56, 189, 248, 0.08);
  border-radius: 0 16px 16px 0;
}
.article-content blockquote p { margin: 0; color: #e2e8f0; }

.article-content code {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95em;
}
.article-content pre {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 1.25rem;
  border-radius: 18px;
  overflow-x: auto;
  margin: 1.75rem 0;
}
.article-content pre code { background: transparent; border: 0; padding: 0; }

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
}

.article-content a[id] { scroll-margin-top: 110px; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  margin: 1.75rem 0;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.article-content th,
.article-content td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: top;
}
.article-content th {
  color: #fff;
  font-weight: 800;
  background: rgba(255,255,255,0.05);
}
.article-content td { color: #cbd5e1; }
.article-content tr:last-child td { border-bottom: 0; }

/* FAQ */
.faq-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  list-style: none;
  padding-right: 2rem;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 0.25rem;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255,255,255,0.75);
  border-bottom: 2px solid rgba(255,255,255,0.75);
  transform: rotate(45deg);
  transition: transform 0.2s ease, top 0.2s ease;
}
.faq-item[open] summary::after {
  transform: rotate(225deg);
  top: 0.65rem;
}
.faq-answer { margin-top: 0.85rem; color: #cbd5e1; }
.faq-answer p { margin: 0 0 1rem; max-width: none; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Related Posts */
.post-related {
  background: radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.10), transparent 55%),
              radial-gradient(circle at 0% 80%, rgba(56, 189, 248, 0.08), transparent 45%);
}
.post-related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.25rem;
}
.post-related-kicker {
  color: var(--color-primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.related-card {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.related-card:hover {
  transform: translateY(-5px);
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(255,255,255,0.03);
}
.related-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
}
.related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.related-card:hover .related-img img { transform: scale(1.05); }
.related-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 10px;
}
.related-content {
  padding: 1.5rem 1.5rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.related-title {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  line-height: 1.2;
  color: #fff;
}
.related-desc {
  color: #94a3b8;
  margin: 0 0 1.25rem;
  line-height: 1.6;
  max-width: none;
  flex: 1;
}
.related-link { color: #fff; font-weight: 800; }
.post-related-cta { margin-top: 2.25rem; text-align: center; }
.post-related-cta .btn { padding: 0.85rem 1.5rem; }

@media (max-width: 1024px) {
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .post-hero { padding: 7rem 0 2.25rem; }
  .post-cover { margin-top: -2.25rem; }
  .post-article { padding: 1.5rem; }
  .related-grid { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links { display: none; } /* Hide nav on mobile for now */
  .bento-item { grid-column: span 12 !important; }
  h1 { font-size: 2.5rem; }
}
