/* ============================================================
   AI History Museum — Styles
   Bygger på tokens.css. Lyst, rent museumstema.
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-body);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--color-ink); }
h1 { font-size: var(--text-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
h2 { font-size: var(--text-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); }
h3 { font-size: var(--text-h3); line-height: var(--lh-h3); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--dur-fast) ease; }
a:hover { text-decoration: underline; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; top: -100px; left: 16px;
  background: var(--color-primary); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-md);
  font-weight: 600; z-index: 999;
}
.skip-link:focus { top: 8px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: var(--gradient-cta); z-index: 200;
  transition: width 50ms linear;
}

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-glass-border);
  height: var(--nav-height);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.125rem; color: var(--color-ink); text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo svg { width: 26px; height: 26px; flex-shrink: 0; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--color-body); text-decoration: none;
  font-size: 0.9375rem; font-weight: 500;
  transition: color var(--dur-fast) ease;
}
.nav-links a:hover { color: var(--color-primary); text-decoration: none; }
.nav-links .btn-nav {
  font-size: 0.875rem; padding: 10px 20px;
}
.hamburger {
  display: none; flex-direction: column; gap: 5px; background: none; border: none;
  cursor: pointer; padding: 8px; z-index: 101;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--color-ink); border-radius: 2px;
  transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-fast) ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9375rem;
  border-radius: var(--radius-lg); padding: 14px 28px;
  transition: all var(--dur-fast) ease; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--color-primary); color: #fff;
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-secondary {
  background: var(--color-bg-alt); color: var(--color-primary);
  border: 1px solid var(--color-hairline);
}
.btn-secondary:hover { background: var(--color-bg-tint); }

/* ---------- Section header ---------- */
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.centered { text-align: center; margin-left: auto; margin-right: auto; }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--text-eyebrow);
  font-weight: 600; letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--color-primary);
  display: inline-block; margin-bottom: var(--space-sm);
}
.section-head h2 { margin-bottom: var(--space-md); }
.section-head .lede { font-size: var(--text-body-lg); color: var(--color-body); max-width: 60ch; }

/* ---------- Sections ---------- */
section { padding-block: var(--section-pad); }
section.alt { background: var(--color-bg-alt); }
/* content-visibility for performance below fold */
#tidslinje, #pionerer, #gennembrud, #moderne-ai, #fremtiden, #etik { content-visibility: auto; contain-intrinsic-size: 800px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--color-bg); min-height: 100svh;
  display: flex; align-items: center;
}
.hero-bg { position: absolute; inset: 0; opacity: 0.55; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px);
  opacity: 0.40; pointer-events: none; will-change: transform;
}
.orb-1 { width: 540px; height: 540px; background: #BFDBFE; top: -180px; right: -140px; }
.orb-2 { width: 440px; height: 440px; background: #C4B5FD; bottom: -160px; left: -120px; }
.orb-3 { width: 300px; height: 300px; background: #A7F3D0; top: 40%; right: -80px; opacity: 0.25; }
.hero-grid {
  position: relative; display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px; align-items: center;
  padding-block: 40px; width: 100%;
}
.hero-text { position: relative; z-index: 2; }
.hero-text h1 { margin-bottom: 20px; max-width: 14ch; }
.hero-text .lede { font-size: var(--text-body-lg); line-height: var(--lh-body-lg); max-width: 52ch; margin-bottom: 32px; }
.cta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }
.counters { display: flex; gap: 48px; flex-wrap: wrap; }
.counter-item { text-align: left; }
.counter-num {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 600;
  color: var(--color-ink); line-height: 1.2;
}
.counter-label { font-size: var(--text-body-sm); color: var(--color-muted); max-width: 16ch; }
.hero-visual { position: relative; z-index: 1; }
.hero-card {
  background: var(--color-bg); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 32px;
  border: 1px solid var(--color-hairline);
}
.hero-card .chip-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-card svg { width: 100%; height: auto; border-radius: var(--radius-md); }
.hero-card .figcaption { font-size: var(--text-body-sm); color: var(--color-muted); margin-top: 12px; }
.scroll-cue {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--color-muted); font-size: 0.75rem;
  animation: bounce 2s ease infinite; z-index: 2;
}
.scroll-cue svg { width: 20px; height: 20px; stroke: var(--color-muted); stroke-width: 2; fill: none; }
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-bg); color: var(--color-body);
  border-radius: var(--radius-xl); padding: var(--space-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--color-hairline);
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), background var(--dur-med) ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); background: var(--color-bg-tint); }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-md);
}
.card-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.card h4, .card .card-title {
  font-family: var(--font-body); font-size: var(--text-card); font-weight: 600;
  margin-bottom: var(--space-sm); letter-spacing: 0;
}
.card p { font-size: 0.9375rem; line-height: 1.6; }
.card .card-meta { margin-top: 12px; font-size: 0.8125rem; color: var(--color-muted); }
.card .card-tags { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ---------- Pioneer cards ---------- */
.avatar {
  width: 64px; height: 64px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.375rem;
  color: #fff; margin-bottom: var(--space-md);
}
.avatar-blue { background: var(--gradient-cta); }
.avatar-purple { background: linear-gradient(135deg, #8B5CF6, #3B82F6); }
.avatar-teal { background: linear-gradient(135deg, #14B8A6, #2563EB); }
.pioneer-role { font-size: 0.8125rem; color: var(--color-muted); margin-bottom: 12px; }
.pioneer-quote { font-family: var(--font-body); font-size: var(--text-quote); font-style: italic; line-height: 1.5; color: var(--color-body); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-primary-soft); color: var(--color-primary);
  border-radius: var(--radius-pill); padding: 6px 14px;
  font-size: 0.8125rem; font-weight: 600;
}
.chip-teal { background: var(--color-turquoise-soft); color: var(--color-turquoise); }
.chip-purple { background: var(--color-purple-soft); color: var(--color-purple); }
.chip-slate { background: #F1F5F9; color: #475569; }

/* ---------- Fact boxes ---------- */
.fact-box {
  display: flex; gap: var(--space-md); align-items: flex-start;
  background: var(--color-turquoise-soft); color: var(--color-turquoise);
  border-radius: var(--radius-lg); padding: 20px 24px;
  max-width: 640px; margin: 24px 0;
}
.fact-box.fact-purple { background: var(--color-purple-soft); color: var(--color-purple); }
.fact-box svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.fact-box strong { display: block; font-size: 0.9375rem; margin-bottom: 4px; }
.fact-box p { font-size: 0.9375rem; color: var(--color-body); }

/* ---------- Timeline ---------- */
.timeline-wrap { max-width: 960px; margin: 0 auto; padding: 24px 0; }
.timeline {
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; transform: translateX(-50%);
  background: var(--gradient-cta); border-radius: 2px;
}
.timeline-era-label {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 8px 0 32px;
  position: relative;
}
.timeline-era-label span {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--color-muted);
}
.tl-node {
  position: relative; width: 50%; padding: 0 48px 48px 0;
  opacity: 0; transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.tl-node.visible { opacity: 1; transform: translateY(0); }
.tl-node:nth-child(even) { margin-left: 50%; padding: 0 0 48px 48px; }
.tl-dot {
  position: absolute; top: 6px; width: 14px; height: 14px;
  border-radius: var(--radius-pill); background: #fff;
  border: 3px solid var(--color-primary);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
  z-index: 2;
}
.tl-node.active .tl-dot {
  box-shadow: var(--shadow-glow);
  border-color: #3B82F6;
}
.tl-node:nth-child(odd) .tl-dot { right: -7px; }
.tl-node:nth-child(even) .tl-dot { left: -7px; }
.tl-card {
  background: var(--color-bg); border-radius: var(--radius-xl);
  padding: 24px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-hairline);
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.tl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.tl-node.active .tl-card { box-shadow: var(--shadow-glow); }
.tl-year {
  font-family: var(--font-mono); font-size: var(--text-mono);
  font-weight: 600; color: var(--color-primary);
  display: block; margin-bottom: 6px;
}
.tl-card h4 {
  font-family: var(--font-display); font-size: var(--text-h3);
  font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px;
}
.tl-card p { font-size: 0.9375rem; line-height: 1.6; }
.tl-tags { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tl-footer-note {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 24px 0 8px;
}
.tl-footer-note span {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--color-muted);
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: var(--gradient-hero); border-radius: var(--radius-xl);
  padding: 48px; text-align: center; color: #fff;
  margin-top: var(--space-2xl);
}
.cta-banner h2 { color: #fff; margin-bottom: 12px; }
.cta-banner p { font-size: var(--text-body-lg); opacity: 0.9; max-width: 48ch; margin: 0 auto 24px; }
.cta-banner .btn {
  background: #fff; color: var(--color-primary);
}
.cta-banner .btn:hover { background: var(--color-bg-tint); }

/* ---------- Footer ---------- */
.footer {
  background: var(--color-ink); color: #CBD5E1;
  padding: 56px 0 40px;
}
.footer a { color: #E2E8F0; text-decoration: none; margin-right: 24px; font-size: 0.875rem; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.footer-mid { margin-bottom: 16px; font-size: 0.8125rem; color: #94A3B8; }
.footer-credit { font-size: 0.8125rem; color: #64748B; }
.footer-sources { margin-top: 24px; }
.footer-sources p { font-size: 0.75rem; color: #64748B; margin-bottom: 2px; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  background: var(--color-glass); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-glass-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-med) ease, transform var(--dur-fast) ease;
  box-shadow: var(--shadow-md);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.back-to-top svg { width: 20px; height: 20px; stroke: var(--color-primary); stroke-width: 2; fill: none; }

/* ---------- Mobile overlay ---------- */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 99;
  background: var(--color-glass); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 32px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-med) ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-overlay a {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 600;
  color: var(--color-ink); text-decoration: none;
}
.mobile-overlay a:hover { color: var(--color-primary); text-decoration: none; }

/* ---------- Particle nodes (hero) ---------- */
.particle {
  position: absolute; border-radius: 50%; pointer-events: none; will-change: transform;
  background: var(--color-primary);
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(20px, -30px); }
  50% { transform: translate(-10px, -15px); }
  75% { transform: translate(-20px, 10px); }
}

/* ---------- Animations ---------- */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; max-width: 480px; margin: 0 auto; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .timeline::before { left: 12px; transform: none; }
  .tl-node, .tl-node:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 40px 44px; }
  .tl-node:nth-child(odd) .tl-dot, .tl-node:nth-child(even) .tl-dot { left: 5px; right: auto; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .counters { gap: 24px; }
}

@media (max-width: 639px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-block: 40px; }
  .hero-text h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .counters { gap: 16px; }
  .counter-num { font-size: 1.5rem; }
  .cta-banner { padding: 32px 24px; }
  .back-to-top { bottom: 16px; right: 16px; }
  .section-head { margin-bottom: 36px; }
}
