/* debugmd.dev landing page - single stylesheet, no build step.
   Design tokens are kept in sync with docs/assets/styles.css so the landing
   page and the documentation read as one site. Dark is the default theme;
   light applies via prefers-color-scheme or the manual toggle. */

/* ---------------------------------------------------------------- tokens */

:root {
  --nav-h: 3.5rem;
  --site-w: 68rem;
  --radius: 10px;
  --radius-sm: 6px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  color-scheme: dark;
  --bg: #17181c;
  --bg-alt: #121316;
  --bg-elev: #1e2026;
  --fg: #dfdfd6;
  --fg-2: #9a9aa2;
  --fg-3: #6a6a71;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.17);
  --accent: #a8b1ff;
  --accent-strong: #5c73e7;
  --accent-soft: rgba(100, 108, 255, 0.16);
  --green: #3dd68c;
  --yellow: #f9b44e;
  --red: #f66f81;
  --inline-code-bg: rgba(142, 150, 170, 0.14);

  --tok-c: #7d8590;
  --tok-k: #c8abfa;
  --tok-s: #3dd68c;
  --tok-t: #f9b44e;
  --tok-f: #a8b1ff;
  --tok-n: #f6907f;

  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
  --glow: radial-gradient(60rem 32rem at 50% -8rem, rgba(100, 108, 255, 0.18), transparent 70%);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ffffff;
    --bg-alt: #f6f6f7;
    --bg-elev: #ffffff;
    --fg: #3c3c43;
    --fg-2: #67676c;
    --fg-3: #929295;
    --border: #e2e2e3;
    --border-strong: #c8c8ca;
    --accent: #3451b2;
    --accent-strong: #3a5ccc;
    --accent-soft: rgba(100, 108, 255, 0.14);
    --green: #18794e;
    --yellow: #915930;
    --red: #b8272c;
    --inline-code-bg: rgba(142, 150, 170, 0.16);
    --tok-c: #6e7781;
    --tok-k: #8250df;
    --tok-s: #18794e;
    --tok-t: #915930;
    --tok-f: #3451b2;
    --tok-n: #b8272c;
    --glow: radial-gradient(60rem 32rem at 50% -8rem, rgba(100, 108, 255, 0.12), transparent 70%);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f6f6f7;
  --bg-elev: #ffffff;
  --fg: #3c3c43;
  --fg-2: #67676c;
  --fg-3: #929295;
  --border: #e2e2e3;
  --border-strong: #c8c8ca;
  --accent: #3451b2;
  --accent-strong: #3a5ccc;
  --accent-soft: rgba(100, 108, 255, 0.14);
  --green: #18794e;
  --yellow: #915930;
  --red: #b8272c;
  --inline-code-bg: rgba(142, 150, 170, 0.16);
  --tok-c: #6e7781;
  --tok-k: #8250df;
  --tok-s: #18794e;
  --tok-t: #915930;
  --tok-f: #3451b2;
  --tok-n: #b8272c;
  --glow: radial-gradient(60rem 32rem at 50% -8rem, rgba(100, 108, 255, 0.12), transparent 70%);
}

/* ------------------------------------------------------------------ base */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

p code,
li code,
td code {
  background: var(--inline-code-bg);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
}

kbd {
  font-family: var(--font-sans);
  font-size: 0.78em;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0.1em 0.45em;
  background: var(--bg-alt);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--site-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
}

/* ---------------------------------------------------------------- navbar */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

@supports (backdrop-filter: blur(12px)) {
  .navbar {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px);
  }
}

.navbar[data-scrolled="true"] {
  border-bottom-color: var(--border);
}

.navbar__inner {
  height: 100%;
  max-width: var(--site-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.navbar__brand:hover {
  text-decoration: none;
}

.navbar__logo {
  width: 26px;
  height: 26px;
  flex: none;
}

.navbar__spacer {
  flex: 1;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.navbar__links a {
  color: var(--fg-2);
}

.navbar__links a:hover {
  color: var(--fg);
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--fg-2);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

.icon-sun {
  display: none;
}

:root[data-theme="light"] .icon-sun {
  display: block;
}

:root[data-theme="light"] .icon-moon {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun {
    display: block;
  }

  :root:not([data-theme="dark"]) .icon-moon {
    display: none;
  }
}

@media (max-width: 40rem) {
  .nav-hide-sm {
    display: none;
  }
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  padding: 4.5rem 0 3rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glow);
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg-2);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.5rem;
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  flex: none;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 auto 1rem;
  max-width: 20ch;
}

.grad {
  background: linear-gradient(120deg, var(--accent) 20%, var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__lead {
  font-size: 1.15rem;
  color: var(--fg-2);
  max-width: 44rem;
  margin: 0 auto 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--accent-strong);
  color: #fff;
}

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

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--fg);
  background: var(--bg-alt);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero__note {
  font-size: 0.85rem;
  color: var(--fg-3);
  margin: 0;
}

.hero__code {
  max-width: 40rem;
  margin: 2.5rem auto 0;
  text-align: left;
}

/* ------------------------------------------------------------ code block */

.codeblock {
  margin: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.codeblock figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-3);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}

.codeblock pre {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
}

.codeblock code {
  font-family: var(--font-mono);
}

.tk-c { color: var(--tok-c); font-style: italic; }
.tk-k { color: var(--tok-k); }
.tk-s { color: var(--tok-s); }
.tk-t { color: var(--tok-t); }
.tk-f { color: var(--tok-f); }
.tk-n { color: var(--tok-n); }

/* -------------------------------------------------------------- sections */

.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section--alt {
  background: var(--bg-alt);
}

.section__head {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section__head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.section__head p {
  color: var(--fg-2);
  margin: 0;
  font-size: 1.02rem;
}

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

/* ------------------------------------------------------------ split rows */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.split + .split {
  margin-top: 3.5rem;
}

.split h3 {
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  margin: 0.4rem 0 0.6rem;
}

.split p {
  color: var(--fg-2);
  margin: 0 0 1rem;
}

.split ul {
  color: var(--fg-2);
  margin: 0;
  padding-left: 1.15rem;
}

.split li {
  margin-bottom: 0.35rem;
}

.split li strong {
  color: var(--fg);
  font-weight: 600;
}

@media (min-width: 52rem) {
  .split--flip .split__media {
    order: -1;
  }
}

@media (max-width: 52rem) {
  .split {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* --------------------------------------------------------------- figures */

.figure {
  margin: 0;
}

.figure img,
.figure video {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  box-shadow: var(--shadow-card);
}

.figure figcaption {
  font-size: 0.83rem;
  color: var(--fg-3);
  margin-top: 0.6rem;
  text-align: center;
}

.figure--pending .figure__slot {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 15rem;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--fg-3);
  background: repeating-linear-gradient(
    45deg,
    var(--bg-alt),
    var(--bg-alt) 12px,
    var(--bg-elev) 12px,
    var(--bg-elev) 24px
  );
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.figure--tall .figure__slot {
  min-height: 22rem;
}

/* ----------------------------------------------------------------- cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.card {
  display: block;
  padding: 1.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
}

a.card {
  transition: transform 0.15s ease, border-color 0.15s ease;
}

a.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  a.card:hover {
    transform: none;
  }
}

.card svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.card h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.9rem;
  color: var(--fg-2);
  margin: 0;
}

/* ----------------------------------------------------------------- table */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 34rem;
}

.compare th,
.compare td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.compare thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  border-bottom-color: var(--border-strong);
}

.compare tbody th {
  font-weight: 600;
  color: var(--fg);
  width: 34%;
}

.compare td {
  color: var(--fg-2);
}

.compare td.yes {
  color: var(--green);
  font-weight: 600;
}

.table-scroll .compare tbody tr:last-child th,
.table-scroll .compare tbody tr:last-child td {
  border-bottom: none;
}

/* ----------------------------------------------------------------- specs */

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.spec {
  background: var(--bg);
  padding: 1.25rem;
  margin: 0;
}

.spec dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  margin-bottom: 0.35rem;
}

.spec dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.spec dd span {
  display: block;
  font-size: 0.83rem;
  font-weight: 400;
  color: var(--fg-2);
  margin-top: 0.15rem;
}

/* ------------------------------------------------------------------- faq */

.faq {
  max-width: 44rem;
  margin: 0 auto;
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.85rem 2rem 0.85rem 0;
  position: relative;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 0.75rem;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--fg-3);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  color: var(--fg-2);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* ------------------------------------------------------------------- cta */

.cta {
  text-align: center;
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.cta h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.cta p {
  color: var(--fg-2);
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  font-size: 0.88rem;
  color: var(--fg-3);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

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

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