@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  /* Modern warm dark palette */
  --background: hsl(30 15% 6%);
  --foreground: hsl(35 20% 92%);

  --card: hsl(30 12% 10%);
  --card-foreground: hsl(35 20% 92%);

  /* Warm terracotta accent */
  --primary: hsl(18 75% 58%);
  --primary-foreground: hsl(30 15% 6%);

  /* Muted warm tones */
  --secondary: hsl(30 10% 16%);
  --secondary-foreground: hsl(35 20% 85%);

  --muted: hsl(30 8% 18%);
  --muted-foreground: hsl(35 15% 55%);

  /* Teal accent */
  --accent: hsl(170 45% 50%);
  --accent-foreground: hsl(30 15% 6%);

  --border: hsl(30 10% 18%);

  /* Typography */
  --font-serif: 'Outfit', 'Space Grotesk', -apple-system, sans-serif;
  --font-sans: 'Space Grotesk', 'Outfit', -apple-system, sans-serif;
}

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

/* Base Styles */
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

::selection {
  background: hsla(18, 75%, 58%, 0.3);
  color: hsl(35 20% 92%);
}

/* Layout */
.min-h-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

/* Container */
.c-ledger-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 1024px) {
  .c-ledger-container {
    padding: 0 2rem;
  }
}

/* Grid */
.ledger-grid {
  display: grid;
  gap: 4rem;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .ledger-grid {
    grid-template-columns: 1fr 300px;
  }
}

/* Header */
.editorial-header {
  border-bottom: 1px solid hsla(30, 10%, 18%, 0.4);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  background: hsla(30, 15%, 6%, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .site-title {
    font-size: 1.5rem;
  }
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }
}

.c-ledger-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsla(35, 20%, 92%, 0.6);
  transition: color 0.3s;
  position: relative;
}

.c-ledger-nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s;
}

.c-ledger-nav-link:hover,
.c-ledger-nav-link.active {
  color: var(--foreground);
}

.c-ledger-nav-link:hover::after,
.c-ledger-nav-link.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  color: hsla(35, 20%, 92%, 0.6);
  cursor: pointer;
  transition: color 0.3s;
}

.mobile-menu-btn:hover {
  color: var(--foreground);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Typography */
.editorial-headline {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .editorial-headline {
    font-size: 3.5rem;
  }
}

@media (min-width: 1024px) {
  .editorial-headline {
    font-size: 4.5rem;
  }
}

.editorial-dek {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted-foreground);
}

@media (min-width: 768px) {
  .editorial-dek {
    font-size: 1.25rem;
  }
}

.editorial-byline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted-foreground);
  font-weight: 500;
}

.editorial-body {
  font-size: 1rem;
  line-height: 1.8;
  color: hsla(35, 20%, 92%, 0.85);
  font-family: var(--font-sans);
  font-weight: 300;
}

@media (min-width: 768px) {
  .editorial-body {
    font-size: 1.125rem;
  }
}

.editorial-body p {
  margin-bottom: 1.75rem;
}

.editorial-subhead {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 400;
  margin-top: 4rem;
  margin-bottom: 2rem;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .editorial-subhead {
    font-size: 2.25rem;
  }
}

/* Pull Quote */
.editorial-pullquote {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.3;
  padding: 3rem 0 3rem 2rem;
  margin: 3.5rem 0;
  position: relative;
  color: hsla(35, 20%, 92%, 0.9);
}

@media (min-width: 768px) {
  .editorial-pullquote {
    font-size: 1.875rem;
  }
}

@media (min-width: 1024px) {
  .editorial-pullquote {
    font-size: 2.25rem;
  }
}

.editorial-pullquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), hsla(18, 75%, 58%, 0.5), transparent);
}

/* Key Takeaways */
.editorial-takeaways {
  background: linear-gradient(135deg, var(--secondary), hsla(30, 10%, 16%, 0.5));
  padding: 2rem;
  margin: 3.5rem 0;
  border: 1px solid hsla(30, 10%, 18%, 0.5);
}

@media (min-width: 768px) {
  .editorial-takeaways {
    padding: 2.5rem;
  }
}

.editorial-takeaways-title {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--primary);
}

.takeaway-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.takeaway-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.takeaway-number {
  color: var(--primary);
  font-size: 1.125rem;
  font-weight: 300;
  margin-top: 0.125rem;
}

.takeaway-text {
  color: hsla(35, 20%, 92%, 0.8);
  font-size: 0.875rem;
  line-height: 1.6;
  font-weight: 300;
}

/* Hero Image */
.editorial-hero-image {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

.editorial-hero-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 2 / 1;
  filter: grayscale(20%) contrast(1.05);
}

.editorial-hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsla(30, 15%, 6%, 0.2), transparent);
  pointer-events: none;
}

.hero-caption {
  font-size: 0.6875rem;
  color: hsla(35, 15%, 55%, 0.6);
  letter-spacing: 0.05em;
}

/* Article Header */
.article-header {
  margin-bottom: 4rem;
}

.article-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--primary);
  font-weight: 500;
  display: block;
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.meta-divider {
  color: var(--border);
}

.reading-time {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Sidebar */
.article-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .article-sidebar {
    display: block;
  }
}

.sidebar-sticky {
  position: sticky;
  top: 2rem;
}

.c-ledger-sidebar-module {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid hsla(30, 10%, 18%, 0.4);
}

.c-ledger-sidebar-module:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.c-ledger-sidebar-title {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Popular Articles */
.popular-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.popular-item {
  display: flex;
  gap: 1rem;
}

.popular-number {
  font-size: 1.5rem;
  font-weight: 300;
  color: hsla(35, 15%, 55%, 0.3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.popular-link {
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.4;
  color: hsla(35, 20%, 92%, 0.7);
  transition: color 0.3s;
}

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

/* Author Bio */
.author-bio {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.author-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, hsla(18, 75%, 58%, 0.2), hsla(170, 45%, 50%, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid hsla(30, 10%, 18%, 0.5);
}

.author-initials {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: hsla(35, 20%, 92%, 0.7);
}

.author-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.author-description {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  font-weight: 300;
}

/* Fact Box */
.fact-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fact-item {
  font-size: 0.75rem;
  color: hsla(35, 20%, 92%, 0.7);
  font-weight: 300;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.6;
}

.fact-arrow {
  color: var(--primary);
  margin-top: 0.125rem;
}

/* Recommended Reading */
.recommended-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recommended-card {
  display: block;
  padding: 1.25rem;
  background: hsla(30, 10%, 16%, 0.3);
  border: 1px solid transparent;
  transition: all 0.3s;
}

.recommended-card:hover {
  background: hsla(30, 10%, 16%, 0.6);
  border-color: hsla(30, 10%, 18%, 0.3);
}

.recommended-category {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.recommended-title {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  line-height: 1.4;
  color: hsla(35, 20%, 92%, 0.8);
}

/* CTA Section */
.article-cta {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid hsla(30, 10%, 18%, 0.4);
  text-align: center;
}

.cta-text {
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .cta-buttons {
    flex-direction: row;
    justify-content: center;
  }
}

.editorial-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--primary);
  color: var(--primary-foreground);
  transition: all 0.3s;
}

.editorial-cta-primary:hover {
  background: hsla(18, 75%, 58%, 0.9);
  gap: 1rem;
}

.editorial-cta-secondary {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
  transition: color 0.3s;
}

.editorial-cta-secondary:hover {
  color: var(--primary);
}

/* Footer */
.editorial-footer {
  border-top: 1px solid hsla(30, 10%, 18%, 0.4);
  margin-top: 6rem;
  padding: 5rem 0 4rem;
  background: hsla(30, 12%, 10%, 0.3);
}

.footer-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }
}

.footer-brand {
  grid-column: 1;
}

@media (min-width: 768px) {
  .footer-brand {
    grid-column: 1;
  }
}

.footer-brand-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-brand-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  font-weight: 300;
}

.editorial-footer-heading {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.editorial-footer-link {
  display: block;
  font-size: 0.875rem;
  color: hsla(35, 20%, 92%, 0.6);
  padding: 0.5rem 0;
  transition: color 0.3s;
}

.editorial-footer-link:hover {
  color: var(--foreground);
}

.editorial-disclaimer {
  font-size: 0.75rem;
  color: hsla(35, 15%, 55%, 0.7);
  line-height: 1.6;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid hsla(30, 10%, 18%, 0.3);
}

.editorial-disclaimer strong {
  color: hsla(35, 20%, 92%, 0.6);
}

.copyright {
  margin-top: 1.5rem;
  color: hsla(35, 15%, 55%, 0.5);
}

/* Stories Page */
.page-header {
  margin-bottom: 4rem;
}

.stories-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

.editorial-card {
  background: hsla(30, 12%, 10%, 0.5);
  border: 1px solid hsla(30, 10%, 18%, 0.4);
  padding: 2rem;
  transition: all 0.5s;
  position: relative;
  overflow: hidden;
}

.editorial-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsla(18, 75%, 58%, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.5s;
}

.editorial-card:hover {
  background: var(--card);
  border-color: hsla(18, 75%, 58%, 0.3);
}

.editorial-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-category {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  font-weight: 500;
}

.card-arrow {
  color: hsla(35, 15%, 55%, 0.3);
  transition: color 0.3s;
}

.editorial-card:hover .card-arrow {
  color: var(--primary);
}

.editorial-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  transition: color 0.3s;
}

@media (min-width: 768px) {
  .editorial-card-title {
    font-size: 1.5rem;
  }
}

.editorial-card:hover .editorial-card-title {
  color: var(--primary);
}

.card-excerpt {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-weight: 300;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.6875rem;
  color: hsla(35, 15%, 55%, 0.6);
  letter-spacing: 0.05em;
}

/* Notes Page */
.notes-container {
  max-width: 42rem;
}

.notes-list {
  display: flex;
  flex-direction: column;
}

.note-item {
  padding: 2.5rem 0;
  border-bottom: 1px solid hsla(30, 10%, 18%, 0.3);
}

.note-content {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  font-family: var(--font-serif);
  color: hsla(35, 20%, 92%, 0.9);
}

@media (min-width: 768px) {
  .note-content {
    font-size: 1.25rem;
  }
}

.note-date {
  font-size: 0.625rem;
  color: hsla(35, 15%, 55%, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* Info Pages */
.info-page {
  max-width: 42rem;
}

.info-page .editorial-body ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.info-page .editorial-body ul li {
  margin-bottom: 0.5rem;
}

.contact-box {
  background: var(--secondary);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.contact-label {
  display: block;
  font-family: var(--font-serif);
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.contact-email {
  color: var(--muted-foreground);
}

.last-updated {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 2rem;
}

/* Utility Classes */
.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .py-md-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

.py-16 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .py-md-24 {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }

.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-up {
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
