:root {
  color-scheme: dark;
  --bg: #090b16;
  --bg-soft: #10142a;
  --panel: rgba(20, 24, 48, 0.82);
  --panel-strong: #171b36;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --border: rgba(190, 199, 255, 0.16);
  --border-strong: rgba(172, 151, 255, 0.38);
  --text: #f5f6ff;
  --muted: #b8bfd8;
  --muted-strong: #d2d7e9;
  --accent: #9f8cff;
  --accent-bright: #c6b9ff;
  --accent-deep: #7357d7;
  --cyan: #6ed8e5;
  --focus: #f5d76e;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --r: 18px;
  --bg0: #090b16;
  --bg1: #10142a;
  --panel2: rgba(255, 255, 255, 0.07);
  --accentA: #9f8cff;
  --accentB: #6ed8e5;
  --warn: #f5d76e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: 28px 18px 56px;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at 8% 8%, rgba(115, 87, 215, 0.28), transparent 34rem),
    radial-gradient(circle at 90% 14%, rgba(37, 149, 170, 0.17), transparent 30rem),
    linear-gradient(145deg, #080a14 0%, #0d1021 48%, #11132a 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: var(--accent-bright);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  color: #111;
  font-weight: 800;
  background: var(--focus);
  border-radius: 10px;
  transform: translateY(-160%);
}

.skip-link:focus {
  color: #111;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.shell {
  padding: clamp(22px, 4vw, 48px);
  overflow: hidden;
  background: linear-gradient(145deg, rgba(21, 24, 48, 0.88), rgba(10, 12, 27, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: clamp(38px, 6vw, 72px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.site-nav a {
  position: relative;
  padding: 8px 13px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 9px;
  transition: color 160ms ease, background-color 160ms ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.site-nav a.active {
  color: var(--text);
  background: rgba(159, 140, 255, 0.16);
}

.site-nav a.active::after {
  position: absolute;
  right: 13px;
  bottom: -17px;
  left: 13px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(30px, 6vw, 78px);
  align-items: center;
  padding: 10px 0 clamp(56px, 9vw, 104px);
}

.hero-copy {
  position: relative;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--text);
  font-size: clamp(3.2rem, 9vw, 6.8rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.page-header h1 {
  max-width: none;
  font-size: clamp(3rem, 8vw, 5.8rem);
}

.hero-lead {
  max-width: 26ch;
  margin: 24px 0 10px;
  color: var(--muted-strong);
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  font-weight: 700;
  line-height: 1.3;
}

.hero-intro,
.lead {
  max-width: 65ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.brand-button {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 18px 0 24px;
  padding: 8px;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.brand-button:hover {
  background: rgba(159, 140, 255, 0.12);
  border-color: var(--border-strong);
  transform: translateY(-2px) rotate(-2deg);
}

.brand-mark {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.82;
  filter: brightness(0) invert(1);
}

.brand-button.is-rainbow .brand-mark {
  opacity: 1;
  animation: donkey-rainbow 3.2s linear infinite;
}

@keyframes donkey-rainbow {
  from { filter: saturate(280%) hue-rotate(0deg) brightness(1.1); }
  to { filter: saturate(280%) hue-rotate(360deg) brightness(1.1); }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  padding: 11px 17px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button:hover {
  color: #fff;
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent-deep), #8a6dea);
  box-shadow: 0 12px 26px rgba(84, 57, 175, 0.3);
}

.button-secondary {
  background: var(--panel-soft);
  border-color: var(--border);
}

.hero-panel {
  position: relative;
  padding: clamp(24px, 4vw, 38px);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(159, 140, 255, 0.13), rgba(110, 216, 229, 0.045)),
    var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
}

.hero-panel::before {
  position: absolute;
  top: -72px;
  right: -72px;
  width: 180px;
  height: 180px;
  content: "";
  background: rgba(110, 216, 229, 0.13);
  border-radius: 50%;
  filter: blur(4px);
}

.hero-panel h2 {
  position: relative;
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.08;
}

.hero-panel p:not(.panel-kicker) {
  position: relative;
  margin: 0;
  color: var(--muted);
}

.topic-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-row {
  position: relative;
  margin-top: 26px;
}

.topic-row span,
.tag {
  padding: 5px 9px;
  color: var(--accent-bright);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(159, 140, 255, 0.12);
  border: 1px solid rgba(159, 140, 255, 0.2);
  border-radius: 999px;
}

.tag-muted {
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border);
}

.page-header {
  padding: 4px 0 clamp(48px, 7vw, 74px);
}

.page-header .lead {
  max-width: 62ch;
  margin-top: 22px;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.section-block + .section-block {
  margin-top: clamp(58px, 8vw, 92px);
}

.section-heading {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.12;
}

.section-heading > p {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-grid,
.resource-grid,
.compact-grid {
  display: grid;
  gap: 16px;
}

.card-grid-three,
.resource-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.resource-card,
.compact-card {
  position: relative;
  min-width: 0;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.card {
  display: flex;
  min-height: 240px;
  padding: 24px;
  flex-direction: column;
  color: var(--text);
}

.card:hover,
.resource-card:hover,
.compact-card:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
  transform: translateY(-4px);
}

.card-number {
  margin-bottom: auto;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.card-title {
  margin: 28px 0 8px;
  font-size: 1.35rem;
  font-weight: 850;
}

.card-desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-link {
  margin-top: 20px;
  color: var(--accent-bright);
  font-size: 0.84rem;
  font-weight: 800;
}

.resource-card {
  display: flex;
  min-height: 280px;
  padding: 26px;
  flex-direction: column;
}

.resource-card-featured {
  background: linear-gradient(145deg, rgba(115, 87, 215, 0.22), rgba(255, 255, 255, 0.045));
  border-color: rgba(159, 140, 255, 0.28);
}

.resource-card h3 {
  margin: 30px 0 10px;
  font-size: 1.42rem;
  line-height: 1.2;
}

.resource-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.resource-card > a,
.card-actions {
  margin-top: auto;
  padding-top: 28px;
  font-size: 0.86rem;
  font-weight: 800;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.secondary-link {
  color: var(--muted-strong);
}

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-card {
  display: flex;
  min-height: 100px;
  padding: 18px;
  flex-direction: column;
  justify-content: center;
  color: var(--text);
}

.compact-card span {
  font-size: 1rem;
  font-weight: 850;
}

.compact-card small {
  margin-top: 3px;
  color: var(--muted);
}

.empty-state {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 70px);
  text-align: center;
  background: linear-gradient(145deg, rgba(159, 140, 255, 0.1), rgba(110, 216, 229, 0.035));
  border: 1px solid var(--border-strong);
  border-radius: 24px;
}

.empty-state-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 22px;
  place-items: center;
  color: var(--cyan);
  font-size: 2rem;
  font-weight: 300;
  background: rgba(110, 216, 229, 0.08);
  border: 1px solid rgba(110, 216, 229, 0.22);
  border-radius: 50%;
}

.empty-state h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.empty-state > p:not(.eyebrow) {
  max-width: 56ch;
  margin: 16px auto 0;
  color: var(--muted);
}

.empty-state .hero-actions {
  justify-content: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -24px 0 28px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.breadcrumb span {
  color: rgba(255, 255, 255, 0.35);
}

.site-footer {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-top: clamp(60px, 9vw, 110px);
  padding-top: 22px;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
}

/* Shared list treatment retained for long-form guide pages. */
ul {
  padding-left: 1.25rem;
}

li {
  margin-block: 0.35rem;
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 640px;
  }

  .card-grid-three,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    padding: 0;
  }

  .shell {
    min-height: 100vh;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .site-nav {
    gap: 2px;
    justify-content: space-between;
    overflow-x: auto;
  }

  .site-nav a {
    padding-inline: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.045em;
  }

  .site-nav a.active::after {
    right: 8px;
    left: 8px;
  }

  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-grid-three,
  .resource-grid,
  .resource-grid-two,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .resource-card {
    min-height: auto;
  }

  .card-number {
    margin-bottom: 8px;
  }

  .card-title {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
