/* ===== Dark Theme ===== */
:root {
  --bg: #0B0C10;
  --fg: #F8FAFC;
  --muted: #8492A6;
  --accent: #8655f6;
  --surface: #15171E;
  --border: #1F222B;
  --accent-teal: #2DD4BF;
  --accent-rose: #FB7185;
  --max-width: 1200px;
  --content-width: 70ch;
  --nav-height: 64px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Typography ===== */
h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--fg);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
}

p, li {
  color: var(--muted);
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: filter 0.2s;
}

a:hover {
  filter: brightness(1.2);
}

strong, b {
  color: var(--fg);
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--surface);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
  color: var(--muted);
}

th {
  color: var(--fg);
  font-weight: 600;
}

/* ===== Lists ===== */
ul, ol {
  color: var(--muted);
  margin: 1rem 0;
  padding-left: 1.5rem;
}

/* ===== Blockquotes ===== */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  font-style: italic;
  color: var(--muted);
  margin: 1.5rem 0;
}

/* ===== Code ===== */
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ===== HR ===== */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ===== Layout ===== */
.site-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.layout-split {
  display: flex;
  gap: 4rem;
}

.layout-main {
  flex: 1;
  min-width: 0;
}

.layout-sidebar {
  width: 300px;
  flex-shrink: 0;
}

.layout-single {
  max-width: var(--content-width);
  margin: 0 auto;
}

.sticky-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 767px) {
  .site-content {
    padding: 1.5rem 1rem 3rem;
  }
  .layout-split {
    flex-direction: column;
    gap: 2.5rem;
  }
  .layout-sidebar {
    width: 100%;
  }
}

/* ===== Prose (markdown content) ===== */
.layout-main > * + *,
.layout-single > * + * {
  margin-top: 1.25rem;
}

.layout-main > h1,
.layout-single > h1 {
  margin-bottom: 0.25rem;
}

.layout-main > h2,
.layout-single > h2 {
  margin-top: 2.5rem;
}

.layout-main > h3,
.layout-single > h3 {
  margin-top: 2rem;
}

.layout-main > h2 + p,
.layout-single > h2 + p,
.layout-main > h3 + p,
.layout-single > h3 + p {
  margin-top: 0.5rem;
}

.layout-main > hr,
.layout-single > hr {
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
}

.layout-main > table,
.layout-single > table {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.layout-main > blockquote,
.layout-single > blockquote {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.layout-main > em:last-child,
.layout-single > em:last-child,
.layout-main > p:last-child em,
.layout-single > p:last-child em {
  font-size: 0.8125rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 0 40px -10px rgba(134, 85, 246, 0.15);
}

/* ===== Button ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 40px -10px rgba(134, 85, 246, 0.15);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* ===== Pill Tag ===== */
.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent-teal);
  border: 1px solid rgba(45, 212, 191, 0.2);
}

/* ===== CTA Card ===== */
.cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  transition: box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.cta-card:hover {
  border-color: var(--accent);
}

.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(134, 85, 246, 0.05);
  opacity: 0;
  transition: opacity 0.5s;
}

.cta-card:hover::before {
  opacity: 1;
}

.cta-card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.cta-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ===== Score Ring ===== */
.score-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.score-ring-visual {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.score-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-svg circle {
  transition: stroke-dashoffset 1s ease-in-out;
}

.score-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--fg);
}

.score-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.score-item-label {
  color: var(--muted);
}

.score-item-value {
  color: var(--fg);
  font-weight: 700;
}

.progress-bar {
  height: 0.3rem;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(134, 85, 246, 0.35);
}

/* ===== Navigation (Header) ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--fg);
}

.brand svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(134, 85, 246, 0.6));
}

.brand span {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ── Desktop Nav ── */
.site-nav-desktop {
  display: none;
}

.site-nav-desktop > a,
.nav-dropdown-trigger {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav-desktop > a:hover,
.nav-dropdown-trigger:hover {
  color: var(--fg);
  filter: none;
}

.nav-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

/* ── Dropdown wrapper ── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

/* ── Dropdown panel ── */
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 11rem;
  pointer-events: none;
  opacity: 0;
  translate: 0 4px;
  transition: opacity 0.2s ease, translate 0.2s ease;
  z-index: 60;
}

/* Invisible bridge so the cursor can travel from trigger to panel */
.nav-dropdown-panel::before {
  content: "";
  position: absolute;
  top: -0.75rem;
  left: 0;
  right: 0;
  height: 0.75rem;
}

.nav-dropdown-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(134, 85, 246, 0.06);
}

.nav-dropdown-inner a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-inner a:hover {
  background: rgba(134, 85, 246, 0.08);
  color: var(--fg);
  filter: none;
}

/* Show on hover */
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  pointer-events: auto;
  opacity: 1;
  translate: 0 0;
}

.nav-dropdown:hover .nav-chevron,
.nav-dropdown:focus-within .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger {
  color: var(--fg);
}

@media (min-width: 768px) {
  .site-nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.75rem;
  }
}

/* ===== Mobile Menu ===== */
.menu-checkbox {
  display: none;
}

.mobile-menu-btn {
  display: flex;
  cursor: pointer;
  color: var(--fg);
  padding: 0.5rem;
}

.hamburger-icon {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--fg);
  position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--fg);
  position: absolute;
  left: 0;
}

.hamburger-icon::before {
  top: -6px;
}

.hamburger-icon::after {
  top: 6px;
}

.site-nav-mobile {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(80vw, 20rem);
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s;
  z-index: 100;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.menu-checkbox:checked ~ .site-nav-mobile {
  transform: translateX(0);
}

.site-nav-mobile > a {
  display: block;
  padding: 0.75rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
}

.site-nav-mobile > a:hover {
  color: var(--fg);
}

/* ── Mobile accordion ── */
.accordion-check {
  display: none;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.accordion-trigger .nav-chevron {
  color: var(--muted);
  transition: transform 0.25s ease;
  padding: 0.5rem;
  width: 14px;
  height: 10px;
}

.accordion-label {
  color: var(--muted);
  font-size: 1rem;
  flex: 1;
}

.accordion-trigger:hover .accordion-label {
  color: var(--fg);
}

.accordion-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.accordion-check:checked ~ .accordion-panel {
  max-height: 30rem;
}

.accordion-check:checked ~ .accordion-trigger .nav-chevron {
  transform: rotate(180deg);
}

.accordion-panel a {
  display: block;
  padding: 0.5rem 0 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 34, 43, 0.5);
  opacity: 0.85;
}

.accordion-panel a:last-child {
  border-bottom: 1px solid var(--border);
}

.accordion-panel a:hover {
  color: var(--fg);
  filter: none;
}

.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.menu-checkbox:checked ~ .menu-backdrop {
  display: block;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
  .site-nav-mobile {
    display: none;
  }
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-copy {
  font-size: 0.8125rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ===== Utility ===== */
.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;
}

.text-accent {
  color: var(--accent);
}
