
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background: var(--gradient-mesh), var(--color-bg);
  background-attachment: fixed;
  color: var(--color-text);
  min-height: 100vh;
}

a {
  color: inherit;
}

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

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: transparent;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: var(--shadow-medium);
  backdrop-filter: blur(var(--glass-blur));
}

.mobile-nav-toggle {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  box-shadow: var(--shadow-medium);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  z-index: 1200;
}

.mobile-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 1100;
}

.sidebar-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
  overflow-y: auto;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar a {
  text-decoration: none;
  color: inherit;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.sidebar a.version-gated-link {
  position: relative;
  padding-right: 3.4rem;
}

.sidebar a.version-gated-link::after {
  content: attr(data-version-badge);
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  font-size: 0.65rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.sidebar a.version-gated-link-v2 {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.16);
}

.sidebar a.version-gated-link-v2::after {
  background: rgba(59, 130, 246, 0.22);
  color: #dbeafe;
  border-color: rgba(59, 130, 246, 0.6);
}

.sidebar a.version-gated-link-v2.active,
.sidebar a.version-gated-link-v2:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.62);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.22);
}

.sidebar a.version-gated-link-v3 {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: 0 8px 16px rgba(249, 115, 22, 0.15);
}

.sidebar a.version-gated-link-v3::after {
  background: rgba(249, 115, 22, 0.2);
  color: #ffedd5;
  border-color: rgba(249, 115, 22, 0.62);
}

.sidebar a.version-gated-link-v3.active,
.sidebar a.version-gated-link-v3:hover {
  background: rgba(249, 115, 22, 0.24);
  border-color: rgba(249, 115, 22, 0.65);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.22);
}

.sidebar a.active,
.sidebar a:hover {
  background: var(--sidebar-hover);
  border-color: rgba(20, 184, 166, 0.35);
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.18);
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.sidebar-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  padding: 6px;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid var(--sidebar-border);
}

.nav-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  margin-top: var(--space-2);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding-top: var(--space-2);
}

@media (max-width: 960px), (hover: none) and (pointer: coarse) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(320px, 86vw);
    transform: translateX(-110%);
    transition: transform 220ms ease;
    z-index: 1201;
  }
  .sidebar-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
  body[data-mobile-nav-open='true'] .sidebar {
    transform: translateX(0);
  }
  body[data-mobile-nav-open='true'] .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body[data-mobile-nav-open='true'] {
    overflow: hidden;
  }
}

.main-content {
  padding: clamp(1.5rem, 2.2vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  background: transparent;
}

.hero-card,
.section-card {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-2);
}

.insight-strip {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.25rem;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding: var(--space-2);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(var(--glass-blur));
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 1.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
}

.view-root {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
}
