@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --dbn-red: #ba0c2f;
  --dbn-red-dark: #9a0a26;
  --dbn-blue: #00205b;
  --dbn-blue-dark: #001540;
  --dbn-soft-blue: #003d7a;
  --dbn-white: #fff;
  --dbn-warm: #f5f3f0;
  --dbn-paper: #f6f2ea;
  --dbn-ivory: #fffaf3;
  --dbn-ink: #16130f;
  --dbn-text: #3a3a3a;
  --dbn-muted: #5a544d;
  --dbn-line: rgba(0, 32, 91, 0.11);
  --dbn-font-display: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --dbn-font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --dbn-font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --dbn-radius-sm: 6px;
  --dbn-radius-md: 8px;
  --dbn-radius-lg: 12px;
  --dbn-radius-xl: 16px;
  --dbn-shadow-sm: 0 2px 8px rgba(0, 32, 91, 0.10);
  --dbn-shadow-md: 0 10px 30px rgba(0, 32, 91, 0.10);
  --dbn-shadow-lg: 0 18px 48px rgba(0, 32, 91, 0.15);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--dbn-white);
  color: var(--dbn-text);
  font-family: var(--dbn-font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::selection {
  background: rgba(186, 12, 47, 0.16);
  color: var(--dbn-blue);
}

h1,
h2,
h3,
h4,
.display,
.section-header h2,
.featured-header h2,
.mission-card h3,
.home-card h2,
.home-card h3,
.hero-story-title,
.petition-hero-title {
  color: var(--dbn-blue);
  font-family: var(--dbn-font-display);
  letter-spacing: 0;
}

h1,
.hero-story-title {
  line-height: 1.04;
}

a {
  color: var(--dbn-red);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(186, 12, 47, 0.24);
  outline-offset: 3px;
}

.site-header,
body > header {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid rgba(0, 32, 91, 0.08);
  box-shadow: 0 2px 14px rgba(0, 32, 91, 0.08) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header.scrolled {
  box-shadow: 0 8px 28px rgba(0, 32, 91, 0.13) !important;
}

.header-container,
body > header .container {
  max-width: 1400px !important;
  min-height: 70px;
}

.site-logo,
.legacy-brand-logo,
#branding a {
  align-items: center;
  border-radius: var(--dbn-radius-sm);
  display: inline-flex;
  min-width: 8.25rem;
  transition: opacity 180ms ease, transform 180ms ease;
}

.site-logo:hover,
.legacy-brand-logo:hover,
#branding a:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.site-logo img,
.legacy-brand-logo img,
#branding img {
  filter: drop-shadow(0 2px 7px rgba(0, 32, 91, 0.14));
  height: auto;
  max-width: 10rem;
  width: 100%;
}

.main-nav,
body > header nav ul {
  align-items: center;
  gap: clamp(0.35rem, 1vw, 1.25rem);
}

.main-nav a,
.library-toggle,
.dashboard-link,
.logout-link,
body > header nav a {
  color: var(--dbn-ink) !important;
  font-family: var(--dbn-font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.main-nav a,
body > header nav a {
  position: relative;
}

.main-nav a::after,
body > header nav a::after {
  background: var(--dbn-red);
  bottom: -5px;
  content: '';
  height: 2px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 240ms ease;
  width: 100%;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.library-toggle:hover,
.dashboard-link:hover,
.logout-link:hover,
body > header nav a:hover {
  color: var(--dbn-red) !important;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
body > header nav a:hover::after {
  transform: scaleX(1);
}

.main-nav a.nav-ai-tools,
body > header nav a.nav-ai-tools {
  color: var(--dbn-red) !important;
  font-size: 1.08rem;
  font-weight: 800;
}

.main-nav a.nav-ai-tools::after,
body > header nav a.nav-ai-tools::after {
  transform: scaleX(1);
  opacity: 0.28;
}

.main-nav a.nav-ai-tools:hover,
.main-nav a.nav-ai-tools:focus-visible,
body > header nav a.nav-ai-tools:hover,
body > header nav a.nav-ai-tools:focus-visible {
  color: var(--dbn-red-dark) !important;
}

.library-toggle,
.language-toggle,
.header-search-form,
.join-button,
.dashboard-link,
.logout-link {
  border-radius: var(--dbn-radius-md) !important;
}

.library-toggle {
  background: transparent !important;
  border: 0 !important;
  padding: 0.4rem 0.15rem !important;
}

.library-dropdown,
.language-dropdown {
  background: #fff !important;
  border: 1px solid rgba(0, 32, 91, 0.10) !important;
  border-radius: var(--dbn-radius-xl) !important;
  box-shadow: var(--dbn-shadow-lg) !important;
}

.library-dropdown-header,
.library-item-title {
  color: var(--dbn-blue) !important;
  font-family: var(--dbn-font-display);
}

.library-item {
  border-radius: var(--dbn-radius-lg);
  transition: background 160ms ease, transform 160ms ease;
}

.library-item:hover {
  background: var(--dbn-warm) !important;
  transform: translateX(6px);
}

.header-search-form {
  background: var(--dbn-warm) !important;
  border: 1px solid rgba(0, 32, 91, 0.08) !important;
}

.header-search-input {
  color: var(--dbn-ink) !important;
  font-family: var(--dbn-font-body) !important;
}

.header-search-btn,
.join-button,
.btn-primary,
.home-link.primary,
.petition-hero-link,
button[type='submit'],
input[type='submit'] {
  background: var(--dbn-red) !important;
  border-color: var(--dbn-red) !important;
  border-radius: var(--dbn-radius-sm) !important;
  box-shadow: 0 6px 20px rgba(186, 12, 47, 0.22);
  color: #fff !important;
  font-family: var(--dbn-font-body);
  font-weight: 700;
  text-decoration: none !important;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.header-search-btn:hover,
.join-button:hover,
.btn-primary:hover,
.home-link.primary:hover,
.petition-hero-link:hover,
button[type='submit']:hover,
input[type='submit']:hover {
  background: var(--dbn-red-dark) !important;
  box-shadow: 0 10px 24px rgba(186, 12, 47, 0.30);
  transform: translateY(-2px);
}

.btn-secondary,
.home-link.secondary,
.secondary-button {
  background: transparent !important;
  border: 2px solid var(--dbn-blue) !important;
  border-radius: var(--dbn-radius-sm) !important;
  color: var(--dbn-blue) !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.btn-secondary:hover,
.home-link.secondary:hover,
.secondary-button:hover {
  background: var(--dbn-blue) !important;
  color: #fff !important;
  transform: translateY(-2px);
}

.language-toggle,
.language-picker .lang-option,
.language-picker a {
  font-family: var(--dbn-font-body);
  font-weight: 700;
}

.language-toggle {
  background: #fff !important;
  border: 2px solid var(--dbn-warm) !important;
  color: var(--dbn-blue) !important;
}

main,
.page-wrapper,
.content-wrapper {
  background: transparent;
}

section {
  scroll-margin-top: 92px;
}

.section-label,
.home-kicker,
.hero-story-card .home-kicker,
.petition-hero-label,
.featured-tag,
.card-type,
.eyebrow {
  color: var(--dbn-red) !important;
  font-family: var(--dbn-font-mono) !important;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em !important;
  text-transform: uppercase;
}

.home-hero,
.hero-section,
.page-hero {
  background:
    radial-gradient(circle at 94% 12%, rgba(186, 12, 47, 0.06), transparent 25rem),
    linear-gradient(180deg, #fff 0%, var(--dbn-warm) 100%);
}

.hero-story-card,
.home-card,
.mission-card,
.featured-card,
.article-card,
.resource-card,
.guide-card,
.wiki-card,
.link-card,
.video-card,
.infographic-card,
.search-result,
.content-card,
.auth-card,
.account-card,
.form-container,
.card {
  background: #fff !important;
  border: 1px solid rgba(0, 32, 91, 0.10) !important;
  border-radius: var(--dbn-radius-xl) !important;
  box-shadow: 0 4px 18px rgba(0, 32, 91, 0.06) !important;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.home-card:hover,
.mission-card:hover,
.featured-card:hover,
.article-card:hover,
.resource-card:hover,
.guide-card:hover,
.wiki-card:hover,
.link-card:hover,
.video-card:hover,
.infographic-card:hover,
.search-result:hover,
.content-card:hover,
.card:hover {
  border-color: rgba(186, 12, 47, 0.24) !important;
  box-shadow: var(--dbn-shadow-lg) !important;
  transform: translateY(-5px);
}

.hero-story-card,
.petition-hero-callout {
  position: relative;
}

.hero-story-card::before,
.petition-hero-callout::before,
.mission-card::before,
.featured-card::before {
  background: var(--dbn-red);
  content: '';
  inset: 0 auto 0 0;
  position: absolute;
  width: 5px;
}

.hero-story-panel {
  background:
    radial-gradient(circle at 85% 0%, rgba(186, 12, 47, 0.32), transparent 22rem),
    linear-gradient(135deg, var(--dbn-blue), var(--dbn-blue-dark)) !important;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--dbn-radius-xl);
  box-shadow: var(--dbn-shadow-lg);
}

.hero-story-quote {
  color: #fff !important;
}

.hero-story-meta strong {
  color: #f4c542 !important;
  font-family: var(--dbn-font-mono);
}

.trust-bar,
.featured-section,
.resource-gallery-section,
.mission-section:nth-of-type(even) {
  background: var(--dbn-warm) !important;
}

.mission-section,
.section,
.featured-section {
  padding-block: clamp(3.5rem, 6vw, 5rem);
}

.mission-grid,
.featured-grid,
.card-grid,
.resources-grid,
.links-grid,
.wiki-grid {
  gap: clamp(1rem, 2vw, 2rem) !important;
}

input,
textarea,
select {
  border: 1px solid rgba(0, 32, 91, 0.16) !important;
  border-radius: var(--dbn-radius-md) !important;
  color: var(--dbn-ink);
  font-family: var(--dbn-font-body);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(186, 12, 47, 0.48) !important;
  box-shadow: 0 0 0 4px rgba(186, 12, 47, 0.10) !important;
}

.nordic-footer,
.main-footer {
  background:
    radial-gradient(circle at 14% 0%, rgba(186, 12, 47, 0.32), transparent 24rem),
    linear-gradient(135deg, var(--dbn-blue-dark), var(--dbn-soft-blue)) !important;
  color: rgba(255, 255, 255, 0.86) !important;
}

.nordic-footer h4,
.main-footer h4,
.nordic-footer .footer-brand p,
.main-footer p {
  color: rgba(255, 255, 255, 0.86) !important;
}

.nordic-footer a,
.main-footer a {
  color: rgba(255, 255, 255, 0.82) !important;
}

.nordic-footer a:hover,
.main-footer a:hover {
  color: #fff !important;
}

.footer-brand-logo img {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--dbn-radius-sm);
  padding: 4px 8px;
}

@media (max-width: 980px) {
  .site-logo img,
  .legacy-brand-logo img,
  #branding img {
    max-width: 8.25rem;
  }

  .main-nav,
  body > header nav ul {
    align-items: stretch;
  }

  .main-nav a::after,
  body > header nav a::after {
    bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
