/* ===========================================================================
   Mimir Portal — Academic Editorial Design System
   Matches Mimir's paper-and-ink heritage with modern visual excellence.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --paper: #F8F7F4;
  --paper-card: #FFFFFF;
  --paper-sunk: #EFECE6;
  --ink: #111114;
  --ink-soft: #4A494D;
  --ink-muted: #828087;
  --rule: #E2DFD8;
  --rule-dark: #C9C5BC;
  --signal: #C8320A;
  --signal-bg: #FDF2EF;
  --accent: #D97706;
  --accent-bg: #FEF3C7;
  --success: #15803D;
  --success-bg: #DCFCE7;
  --shadow-sm: 0 1px 3px rgba(17,17,20,0.05);
  --shadow-md: 0 4px 12px rgba(17,17,20,0.07);
  --shadow-lg: 0 12px 32px rgba(17,17,20,0.09);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, .font-serif {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.font-display {
  font-family: 'Outfit', 'Inter', sans-serif;
}

/* Nav */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(248, 247, 244, 0.88);
  border-bottom: 1px solid var(--rule);
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 10px;
  border-radius: 4px;
}

.brand-tag {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #25252A;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-dark);
}

.btn-outline:hover {
  background: var(--paper-sunk);
  border-color: var(--ink);
}

.btn-lg {
  padding: 12px 26px;
  font-size: 15px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-signal {
  background: var(--signal-bg);
  color: var(--signal);
  border: 1px solid rgba(200, 50, 10, 0.2);
}

.badge-accent {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(21, 128, 61, 0.2);
}

/* Container */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero Section */
.hero {
  padding: 84px 0 68px;
  text-align: center;
}

.hero-tagline {
  margin-bottom: 20px;
}

.hero-title {
  font-size: 54px;
  line-height: 1.12;
  color: var(--ink);
  max-width: 920px;
  margin: 0 auto 24px;
}

.hero-title em {
  font-style: italic;
  color: var(--signal);
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 60px;
}

/* Hero Stat Grid */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  max-width: 980px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
  border-right: 1px solid var(--rule);
  padding: 0 12px;
}

.stat-item:last-child {
  border-right: none;
}

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-num.signal {
  color: var(--signal);
}

.stat-lbl {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section Common */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--signal);
  margin-bottom: 10px;
}

.section-title {
  font-size: 36px;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 14px;
}

.section-desc {
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Tracks Grid */
.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.track-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.track-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--rule-dark);
}

.track-card.active-track {
  border-top: 3px solid var(--signal);
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.track-icon {
  width: 48px;
  height: 48px;
  background: var(--paper-sunk);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Newsreader', serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}

.track-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.track-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 24px;
}

.track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.meta-pill {
  font-size: 11.5px;
  font-weight: 500;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 4px 9px;
  border-radius: 4px;
  color: var(--ink-soft);
}

/* Feature Pillars */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.pillar-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

.pillar-num {
  font-family: 'Newsreader', serif;
  font-size: 28px;
  font-style: italic;
  color: var(--signal);
  margin-bottom: 12px;
}

.pillar-title {
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--ink);
}

.pillar-text {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Demonstration Box */
.demo-box {
  background: #0B0B0C;
  color: #F8F7F4;
  border-radius: var(--radius-lg);
  padding: 44px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-lg);
  margin-top: 40px;
}

.demo-quote {
  font-family: 'Newsreader', serif;
  font-size: 24px;
  font-style: italic;
  line-height: 1.45;
  color: #EFECE6;
  margin-bottom: 20px;
  border-left: 2px solid var(--signal);
  padding-left: 20px;
}

.demo-caption {
  font-size: 13.5px;
  color: #9D9CA3;
  line-height: 1.6;
}

.demo-preview-card {
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: var(--radius-md);
  padding: 24px;
}

.demo-chalk {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 15px;
  line-height: 1.65;
  color: #EFECE6;
  margin-bottom: 16px;
}

.demo-chalk .err-highlight {
  color: #FF6B4A;
  text-decoration: underline wavy #C8320A;
  font-weight: 500;
}

/* Footer */
.portal-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 48px 0 36px;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}

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

.footer-link {
  color: var(--ink-soft);
  text-decoration: none;
}

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

/* Responsive */
@media (max-width: 860px) {
  .hero-title { font-size: 38px; }
  .stat-bar { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .stat-item:nth-child(2) { border-right: none; }
  .pillars-grid { grid-template-columns: 1fr; }
  .demo-box { grid-template-columns: 1fr; padding: 28px; }
  .nav-links { display: none; }
}
