:root {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: rgba(15, 23, 42, 0.08);
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --success: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "DM Sans", "Inter", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --bg: #070b14;
  --bg-elevated: #0f1629;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.14);
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.15);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.persist-bar {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  font-size: 0.88rem;
}

.persist-bar .persist-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  padding: 0.45rem 0;
}

.persist-bar a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.persist-bar a:hover {
  text-decoration: underline;
}

.link-columns {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .link-columns.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.resource-list a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.resource-list a:hover {
  text-decoration: underline;
}

.resource-list span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.88rem;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
  margin-right: 0.25rem;
}

.logo span {
  color: var(--accent);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.nav-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  overflow-x: auto;
  padding: 0.1rem 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.nav-scroll a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

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

.nav-scroll a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-elevated);
  border-color: var(--border);
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}

.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #a855f7));
  border: none;
  color: #fff;
}

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

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 5rem) 0 3rem;
}

.hero-bg {
  position: absolute;
  inset: -40% -20% auto;
  height: 120%;
  background:
    radial-gradient(closest-side at 20% 20%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    radial-gradient(closest-side at 80% 0%, rgba(56, 189, 248, 0.2), transparent 55%),
    radial-gradient(closest-side at 60% 80%, rgba(244, 114, 182, 0.18), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

html[data-theme="dark"] .hero-bg {
  opacity: 0.55;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 1.25rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.hero-stat {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.hero-stat:first-of-type {
  border-top: none;
  padding-top: 0;
}

.hero-stat strong {
  display: block;
  font-size: 1.35rem;
  font-family: var(--display);
}

.muted {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.section {
  padding: 2.5rem 0;
}

.section h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 0 0 0.5rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.card h3,
.card h2 {
  margin-top: 0;
  font-family: var(--display);
}

.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
}

.band {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-block: 1px solid var(--border);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.steps li {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.form {
  display: grid;
  gap: 0.85rem;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
}

input[type="text"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.field-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .field-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

th {
  background: color-mix(in srgb, var(--bg-elevated) 92%, var(--accent-soft));
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.ok {
  background: rgba(5, 150, 105, 0.15);
  color: var(--success);
}

.badge.warn {
  background: rgba(217, 119, 6, 0.18);
  color: var(--warn);
}

.badge.bad {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.swatch {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.type-sample {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
  margin: 0.25rem 0 0.75rem;
}

.accordion details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  margin-bottom: 0.5rem;
}

.accordion summary {
  cursor: pointer;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
  background: color-mix(in srgb, var(--bg-elevated) 70%, var(--bg));
}

.footer-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-grid h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg-elevated);
  color: var(--text);
  max-width: min(420px, 100% - 2rem);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.chip {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  background: var(--bg);
}

.chip.visible {
  display: inline-flex;
}

a.chip,
a.chip:visited {
  color: var(--text);
}

a.chip:hover {
  color: var(--accent);
}

.brand-chip.visible {
  max-width: min(220px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-panel {
    position: fixed;
    inset: 56px 0 auto 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.75rem 1rem 1rem;
    flex-direction: column;
    align-items: stretch;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  body.nav-open .nav-panel {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-scroll {
    flex-direction: column;
    overflow: visible;
  }

  .nav-scroll a {
    white-space: normal;
  }
}

@media print {
  .site-header,
  .site-footer,
  .no-print,
  .nav-toggle,
  .nav-actions .btn {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .accordion details {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
