.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  z-index: 100;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.skip-link:focus-visible {
  top: 20px;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 60px) 60px;
}


.site-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-emphasis);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.site-nav {
  display: flex;
  flex-grow: 1;
  justify-content: center;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-list a:hover {
  background: var(--nav-hover);
  color: var(--text-emphasis);
}

.nav-list a.is-active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-border);
  color: var(--text-emphasis);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-soft);
  height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.theme-toggle:hover {
  background: var(--nav-hover);
  color: var(--text-emphasis);
  border-color: var(--border-2);
}

.hero {
  border: none;
  border-radius: var(--radius-2);
  padding: clamp(32px, 6vw, 64px) clamp(24px, 5vw, 48px);
  background: linear-gradient(135deg, var(--panel), transparent 80%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  max-width: 24ch;
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-emphasis);
  background: linear-gradient(to right, var(--text-emphasis), var(--text-subtle));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 600px;
  color: var(--text-soft);
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.page-grid {
  display: grid;
  gap: 24px;
}

.page-grid-with-sidebar {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.tool-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tool-sidebar .card {
  padding: 20px;
}

.sidebar-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin: 0 0 12px 0;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-1);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--timing-fast) var(--easing-standard),
              color var(--timing-fast) var(--easing-standard);
}

.sidebar-nav a:hover {
  background: var(--surface-3);
  color: var(--text-emphasis);
  text-decoration: none;
}

.sidebar-nav a.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav a .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-category {
  margin-bottom: 8px;
}

.sidebar-category-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 4px 12px;
  margin-bottom: 2px;
}

.sidebar-quick-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-quick-links a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-1);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--timing-fast) var(--easing-standard);
}

.sidebar-quick-links a:hover {
  background: var(--surface-3);
  border-color: var(--border-1);
  color: var(--text-emphasis);
  text-decoration: none;
}

.sidebar-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-1);
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--calm-500)));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform var(--timing-fast) var(--easing-standard),
              box-shadow var(--timing-fast) var(--easing-standard);
}

.sidebar-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-decoration: none;
  color: #fff;
}

.sidebar-cta small {
  font-weight: 400;
  opacity: 0.85;
  font-size: 0.8rem;
}

.tool-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

@media (max-width: 1024px) {
  .page-grid-with-sidebar {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .tool-sidebar .card {
    flex: 1;
    min-width: 250px;
  }
}

@media (max-width: 640px) {
  .tool-sidebar {
    flex-direction: column;
  }

  .tool-sidebar .card {
    min-width: 100%;
  }
}

.page-grid {
  display: grid;
  gap: 24px;
}

.card {
  border: none;
  border-radius: var(--radius-2);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
  background: var(--panel-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card h2 {
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-emphasis);
  font-weight: 700;
}

.card p {
  color: var(--text-soft);
  font-size: 1.05rem;
}

.card ul,
.card ol {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.card li {
  margin-bottom: 0.5rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-1);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--surface-3);
}

.badge.good {
  border-color: color-mix(in srgb, var(--success-500) 40%, transparent);
  color: var(--success-500);
  background: color-mix(in srgb, var(--success-500) 10%, transparent);
}

.badge.warn {
  border-color: color-mix(in srgb, var(--warning-500) 40%, transparent);
  color: var(--warning-500);
  background: color-mix(in srgb, var(--warning-500) 10%, transparent);
}

.badge.risk {
  border-color: color-mix(in srgb, var(--risk-500) 40%, transparent);
  color: var(--risk-500);
  background: color-mix(in srgb, var(--risk-500) 10%, transparent);
}

.cta-primary,
.cta-secondary,
button {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  height: 48px;
  padding: 0 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cta-primary:active,
.cta-secondary:active,
button:active {
  transform: scale(0.98);
}

.cta-primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4);
}

.cta-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 12px 24px -4px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.cta-secondary {
  background: var(--surface-2);
  border-color: var(--border-1);
  color: var(--text-emphasis);
}

.cta-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
  transform: translateY(-2px);
  color: var(--text-emphasis);
}

.footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-subtle);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text-emphasis);
}

.footer p {
  color: var(--text-subtle);
  font-size: 0.95rem;
}

.fade-stagger > * {
  animation: rise-in var(--timing-med) var(--easing-standard) both;
}

.fade-stagger > *:nth-child(2) {
  animation-delay: 100ms;
}

.fade-stagger > *:nth-child(3) {
  animation-delay: 200ms;
}

.fade-stagger > *:nth-child(4) {
  animation-delay: 300ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .topbar {
    justify-content: space-between;
    border-radius: var(--radius-2);
    padding: 16px;
  }
  .site-nav {
    order: 3;
    width: 100%;
    margin-top: 8px;
  }
  .nav-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 8px;
  }
  .nav-list a {
    width: 100%;
    padding: 0;
  }
}

@media (max-width: 640px) {
  .shell {
    width: 100%;
    padding: 16px 0;
  }
  .site-header {
    padding: 0 16px;
  }
  .nav-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions > * {
    width: 100%;
  }
  .card {
    padding: 24px 16px;
    border-radius: 0;
    margin-bottom: 8px;
  }
}