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

:root {
  --ff-heading: 'Cormorant Garamond', Georgia, serif;
  --ff-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --clr-bg: #0e0d0b;
  --clr-surface: #161410;
  --clr-surface-2: #1e1b16;
  --clr-border: rgba(255, 255, 255, 0.07);
  --clr-border-hover: rgba(255, 255, 255, 0.16);

  --clr-text: #f0ebe2;
  --clr-text-light: #cfc3af;
  --clr-text-muted: #8a8070;

  --clr-accent: #c8922a;
  --clr-accent-light: #e0aa50;
  --clr-accent-dark: #8a5f18;

  --clr-white: #f0ebe2;
  --clr-overlay: rgba(14, 13, 11, 0.75);
  --color-gold: var(--clr-accent);
  --color-charcoal: #0e0d0b;
  --color-warm-grey: #8a8070;
  --color-sand: var(--clr-surface-2);
  --nav-height: 68px;
}

[data-theme='light'] {
  --clr-bg: #f7f4ef;
  --clr-surface: #ffffff;
  --clr-surface-2: #ece6da;
  --clr-border: rgba(0, 0, 0, 0.1);
  --clr-border-hover: rgba(0, 0, 0, 0.2);

  --clr-text: #1c1810;
  --clr-text-light: #3f3527;
  --clr-text-muted: #6b5f52;

  --clr-accent: #a06818;
  --clr-accent-light: #b87e1e;
  --clr-accent-dark: #7a4d12;

  --clr-white: #1c1810;
  --clr-overlay: rgba(247, 244, 239, 0.8);
  --color-charcoal: #f7f4ef;
}

[data-theme='sepia'] {
  --clr-bg: #1c1508;
  --clr-surface: #241b0a;
  --clr-surface-2: #2c220e;
  --clr-border: rgba(255, 210, 100, 0.1);
  --clr-border-hover: rgba(255, 210, 100, 0.25);

  --clr-text: #f2e4c0;
  --clr-text-light: #ccb690;
  --clr-text-muted: #9a8762;

  --clr-accent: #d49230;
  --clr-accent-light: #ecb648;
  --clr-accent-dark: #a56d21;

  --clr-white: #f2e4c0;
  --clr-overlay: rgba(28, 21, 8, 0.78);
  --color-charcoal: #1c1508;
}

[data-theme='green'] {
  --clr-bg: #0d1a12;
  --clr-surface: #112018;
  --clr-surface-2: #172b1f;
  --clr-border: rgba(100, 220, 140, 0.1);
  --clr-border-hover: rgba(100, 220, 140, 0.24);

  --clr-text: #e0f0e6;
  --clr-text-light: #b7d7c3;
  --clr-text-muted: #7aaa8a;

  --clr-accent: #3a9e6a;
  --clr-accent-light: #52c882;
  --clr-accent-dark: #2a7a50;

  --clr-white: #e0f0e6;
  --clr-overlay: rgba(13, 26, 18, 0.78);
  --color-charcoal: #0d1a12;
}

body {
  font-family: var(--ff-body);
  background: var(--clr-bg);
  color: var(--clr-text);
}

h1,
h2,
h3,
h4,
h5,
.logo-text {
  font-family: var(--ff-heading);
}

.theme-switcher {
  position: relative;
  margin-right: 0.6rem;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.55rem;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  background: var(--clr-surface);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  z-index: 1000;
}

.theme-switcher.open .theme-toggle-panel {
  display: grid;
}

.theme-swatch {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

.theme-swatch:hover,
.theme-swatch.active {
  border-color: var(--clr-accent);
}

.theme-swatch[data-theme-option='dark'] { background: linear-gradient(135deg, #c8922a 45%, #0e0d0b 55%); }
.theme-swatch[data-theme-option='light'] { background: linear-gradient(135deg, #a06818 45%, #f7f4ef 55%); }
.theme-swatch[data-theme-option='sepia'] { background: linear-gradient(135deg, #d49230 45%, #1c1508 55%); }
.theme-swatch[data-theme-option='green'] { background: linear-gradient(135deg, #3a9e6a 45%, #0d1a12 55%); }

/* Asbl-style visual rhythm tightening */
.navbar {
  min-height: var(--nav-height);
  border-bottom: 1px solid var(--clr-border);
  background: rgba(14, 13, 11, 0.86);
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1260px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 3vw, 2.2rem);
}

.nav-links {
  gap: 1rem;
}

.nav-links a {
  font-family: var(--ff-ui);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(3.2rem, 7.5vw, 6.1rem);
  line-height: 0.94;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--clr-text-light);
}

.section {
  padding: clamp(4.6rem, 7.5vw, 6.3rem) 0;
}

.section-title {
  font-size: clamp(2.1rem, 4.4vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.section-header > h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.btn {
  border-radius: 2px;
  font-family: var(--ff-ui);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.78rem 1.45rem;
}

.btn-primary {
  background: var(--clr-accent);
  color: var(--color-charcoal);
}

.btn-primary:hover {
  background: var(--clr-accent-light);
  color: #16120b;
}

.btn-outline {
  border-color: var(--clr-border-hover);
}

.btn-outline:hover {
  background: var(--clr-accent);
  border-color: var(--clr-accent);
  color: #16120b;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(2.45rem, 11vw, 3.45rem);
  }

  .hero-subtitle {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .theme-switcher {
    margin-right: 0.3rem;
  }
}

/* History chapter editorial system */
.is-history-page .article-full {
  max-width: 880px;
  margin: 0 auto;
}

.is-history-page .article-header {
  position: relative;
  margin-bottom: clamp(2.4rem, 5vw, 3.8rem);
  padding: clamp(1.3rem, 3vw, 2.1rem) clamp(1.2rem, 3vw, 2rem) 0;
}

.is-history-page .article-header::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--clr-accent) 70%, transparent), transparent);
}

.is-history-page .article-header h1 {
  max-width: 15ch;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 1.1rem;
}

.is-history-page .article-lead {
  max-width: 64ch;
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.28rem);
  line-height: 1.86;
  color: var(--clr-text-light);
  padding-left: 1.05rem;
  border-left: 3px solid color-mix(in srgb, var(--clr-accent) 35%, transparent);
}

.is-history-page .article-body {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.8rem, 3vw, 2.45rem) clamp(1.1rem, 2.4vw, 1.8rem);
  background: color-mix(in srgb, var(--clr-surface) 86%, transparent);
  border: 1px solid var(--clr-border);
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.is-history-page .article-body::before {
  content: '';
  position: absolute;
  inset: 16px;
  border: 1px solid color-mix(in srgb, var(--clr-accent) 18%, transparent);
  border-radius: 22px;
  pointer-events: none;
}

.is-history-page .article-body > h2,
.is-history-page .article-body > p,
.is-history-page .article-body > ul,
.is-history-page .article-body > ol,
.is-history-page .article-body > blockquote {
  position: relative;
  z-index: 1;
}

.is-history-page .article-body > h2 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: clamp(2.3rem, 4vw, 3.3rem);
  margin-bottom: 1.05rem;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.95rem);
  line-height: 1.22;
}

.is-history-page .article-body > h2:first-child {
  margin-top: 0;
}

.is-history-page .article-body > h2::before {
  content: '';
  width: 34px;
  height: 1px;
  flex-shrink: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--clr-accent) 80%, transparent), transparent);
}

.is-history-page .article-body > p {
  max-width: 66ch;
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--clr-text-light);
  text-wrap: pretty;
}

.is-history-page .article-body > h2 + p::first-letter {
  float: left;
  font-family: var(--ff-heading);
  font-size: 3.05rem;
  line-height: 0.9;
  padding-top: 0.22rem;
  padding-right: 0.45rem;
  color: var(--clr-accent);
}

.is-history-page .article-body > ul,
.is-history-page .article-body > ol {
  display: grid;
  gap: 0.72rem;
  margin: 0.4rem 0 1.65rem;
  padding: 0;
  list-style: none;
}

.is-history-page .article-body > ul li,
.is-history-page .article-body > ol li {
  position: relative;
  padding: 0.95rem 0.95rem 0.95rem 2.8rem;
  background: color-mix(in srgb, var(--clr-surface-2) 90%, transparent);
  border: 1px solid var(--clr-border);
  border-radius: 14px;
  color: var(--clr-text-light);
  line-height: 1.75;
}

.is-history-page .article-body > ul li::before,
.is-history-page .article-body > ol li::before {
  content: '';
  position: absolute;
  left: 1.05rem;
  top: 1.25rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--clr-accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--clr-accent) 16%, transparent);
}

.is-history-page .article-quote {
  margin: 1.4rem 0 1.65rem;
  padding: 1.05rem 1.1rem 1.05rem 1.25rem;
  border-left: 3px solid color-mix(in srgb, var(--clr-accent) 58%, transparent);
  background: color-mix(in srgb, var(--clr-surface-2) 72%, transparent);
  border-radius: 0 12px 12px 0;
  color: var(--clr-text-light);
  font-size: 1.04rem;
  line-height: 1.78;
  font-style: italic;
}

.is-history-page .article-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--ff-ui);
  font-size: 0.74rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clr-text-muted);
}

.is-history-page .article-fact {
  margin-top: 1.25rem;
  padding: 0.92rem 0.95rem;
  background: color-mix(in srgb, var(--clr-surface-2) 84%, transparent);
  border: 1px solid color-mix(in srgb, var(--clr-accent) 20%, var(--clr-border));
  border-radius: 14px;
}

.is-history-page .article-fact-title {
  font-family: var(--ff-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--clr-accent);
  margin-bottom: 0.3rem;
}

.is-history-page .article-fact p {
  margin: 0;
  color: var(--clr-text-light);
  font-size: 0.98rem;
  line-height: 1.72;
}

.is-history-page .article-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.1rem 0 1.7rem;
}

.is-history-page .article-stat-card {
  padding: 0.88rem 0.82rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--clr-surface-2) 90%, transparent);
  border: 1px solid var(--clr-border);
}

.is-history-page .article-stat-value {
  display: block;
  font-family: var(--ff-heading);
  font-size: clamp(1.35rem, 1.15rem + 0.85vw, 1.82rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--clr-text);
}

.is-history-page .article-stat-label {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--ff-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--clr-text-muted);
}

.is-history-page .article-figure {
  max-width: 760px;
  margin: 2.4rem auto;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.is-history-page .article-figure figcaption {
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--clr-surface-2) 90%, transparent);
  border-top: 1px solid var(--clr-border);
  font-family: var(--ff-ui);
  font-size: 0.78rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
  text-align: center;
}

.is-history-page .chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem;
  max-width: 760px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--clr-border);
}

.is-history-page .chapter-nav-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1rem;
  background: color-mix(in srgb, var(--clr-surface-2) 88%, transparent);
  border: 1px solid var(--clr-border);
  border-radius: 14px;
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.is-history-page .chapter-nav-link:hover {
  transform: translateY(-2px);
  border-color: var(--clr-border-hover);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.is-history-page .chapter-nav-link--next {
  text-align: right;
  justify-content: flex-end;
}

.is-history-page .chapter-nav-arrow {
  font-size: 1.28rem;
  color: var(--clr-accent);
  flex-shrink: 0;
  line-height: 1;
}

.is-history-page .chapter-nav-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.is-history-page .chapter-nav-label {
  font-family: var(--ff-ui);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--clr-text-muted);
}

.is-history-page .chapter-nav-title {
  font-family: var(--ff-heading);
  font-size: 1.02rem;
  color: var(--clr-text);
  line-height: 1.25;
}

.is-history-page .chapter-nav-link:hover .chapter-nav-title {
  color: var(--clr-accent-light);
}

@media (max-width: 768px) {
  .is-history-page .article-header {
    padding-left: 0;
    padding-right: 0;
  }

  .is-history-page .article-header h1 {
    max-width: none;
  }

  .is-history-page .article-lead {
    padding-left: 0.9rem;
    font-size: 1rem;
    line-height: 1.8;
  }

  .is-history-page .article-body {
    padding: 1.3rem 0.95rem;
    border-radius: 22px;
  }

  .is-history-page .article-body::before {
    inset: 12px;
  }

  .is-history-page .article-body > h2 {
    gap: 0.65rem;
  }

  .is-history-page .article-body > h2::before {
    width: 22px;
  }

  .is-history-page .article-body > p {
    font-size: 1rem;
    line-height: 1.84;
  }

  .is-history-page .article-body > h2 + p::first-letter {
    font-size: 2.65rem;
    padding-right: 0.35rem;
  }

  .is-history-page .article-body > ul li,
  .is-history-page .article-body > ol li {
    padding: 0.9rem 0.85rem 0.9rem 2.45rem;
  }

  .is-history-page .article-body > ul li::before,
  .is-history-page .article-body > ol li::before {
    left: 0.9rem;
  }

  .is-history-page .article-quote {
    margin: 1rem 0 1.3rem;
    padding: 0.95rem 0.85rem 0.95rem 1rem;
    font-size: 0.98rem;
  }

  .is-history-page .article-stat-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .is-history-page .chapter-nav {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  .is-history-page .chapter-nav-link,
  .is-history-page .chapter-nav-link--next {
    text-align: left;
    justify-content: flex-start;
  }
}
