/* mctl-alice landing page components. Built on @mctlhq/css design tokens. */

:root {
  --accent: var(--mctl-color-lilac);
  --accent-highlight: var(--mctl-color-lilac-highlight);
  --accent-deep: var(--mctl-color-lilac-deep);
  --accent-soft: var(--mctl-color-lilac-soft);
  --accent-soft-dark: var(--mctl-color-lilac-soft-dark);
}

/* Contrast (WCAG AA, 4.5:1 for body text): the token "subtle" grey is 3.6:1
   on dark cards, and the light lilac accent is 2.5:1 on the light surface,
   so this site uses a lighter grey on dark and the deep lilac on light. */
:root {
  --surface-fg-subtle: #8a8f97;
}
:root[data-theme="light"] {
  --surface-fg-subtle: #5c6169;
  --accent: var(--mctl-color-lilac-deep);
  --accent-highlight: var(--mctl-color-lilac-deeper);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --surface-fg-subtle: #5c6169;
    --accent: var(--mctl-color-lilac-deep);
    --accent-highlight: var(--mctl-color-lilac-deeper);
  }
}

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

body {
  margin: 0;
  background: var(--surface-bg);
  color: var(--surface-fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--mctl-radius-sm);
}

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--mctl-radius-sm);
  background: var(--surface-card);
  color: var(--surface-fg);
  border: 2px solid var(--accent);
}
.skip-link:focus {
  top: 12px;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 24px;
}

/* ── top bar ─────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  border-bottom: 1px solid var(--surface-line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--surface-fg);
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.topbar-links a {
  color: var(--surface-fg-muted);
}
.topbar-links a:hover {
  color: var(--surface-fg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--surface-line-strong);
  border-radius: var(--mctl-radius-md);
  background: var(--surface-elevated);
  color: var(--surface-fg-muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--surface-fg);
  border-color: var(--accent);
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--surface-line-strong);
  border-radius: var(--mctl-radius-md);
  background: var(--surface-elevated);
  padding: 2px;
  gap: 2px;
  height: 32px;
}

.lang-btn {
  background: transparent;
  border: none;
  border-radius: calc(var(--mctl-radius-md) - 2px);
  color: var(--surface-fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--surface-fg);
}

/* Text on accent fills uses the page background colour: dark text on the
   light lilac of the dark theme, light text on the deep lilac of the light
   theme (white on #b07aff was 2.9:1). */
.lang-btn.is-active {
  background: var(--accent);
  color: var(--surface-bg);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--surface-line-strong);
  border-radius: var(--mctl-radius-md);
  background: var(--surface-elevated);
  color: var(--surface-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: border-color 0.15s, color 0.15s;
}
.lang-toggle:hover {
  color: var(--surface-fg);
  border-color: var(--accent);
}

.form-card {
  max-width: 680px;
  margin: 48px auto;
  padding: 32px;
  background: var(--surface-card);
  border: 1px solid var(--surface-line);
  border-radius: var(--mctl-radius-lg);
}
.form-textarea {
  width: 100%;
  height: 100px;
  padding: 12px 14px;
  margin-top: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--surface-line-strong);
  border-radius: var(--mctl-radius-md);
  background: var(--surface-elevated);
  color: var(--surface-fg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}
.form-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.alert {
  padding: 14px 18px;
  border-radius: var(--mctl-radius-md);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 20px;
}
.alert-success {
  background: var(--surface-elevated);
  border: 1px solid #16a34a;
  color: #22c55e;
}
.alert-error {
  background: var(--surface-elevated);
  border: 1px solid #dc2626;
  color: #ef4444;
}
.alert-info {
  background: var(--surface-elevated);
  border: 1px solid var(--surface-line-strong);
  color: var(--surface-fg-muted);
}


.theme-toggle[hidden],
.btn[hidden] {
  display: none;
}

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

/* ── sections ────────────────────────────────────────────────────────── */

section {
  padding-block: 72px;
  border-bottom: 1px solid var(--surface-line);
}
section:last-of-type {
  border-bottom: 0;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.chip-beta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--mctl-radius-sm);
  background: var(--accent-soft-dark);
  color: var(--accent-highlight);
  border: 1px solid var(--accent);
  vertical-align: middle;
}
:root[data-theme="light"] .chip-beta,
[data-theme="light"] .chip-beta {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(32px, 5.5vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Page and section headings on the card pages: a real h1/h2 outline at the
   visual size of the h2/h3 they replaced. */
h1.page-title {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h2.section-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.01em;
}
.setup-sections {
  margin-top: 24px;
}
.setup-sections pre {
  margin: 12px 0 0;
  overflow-x: auto;
}

.lead {
  margin: 0;
  max-width: 65ch;
  font-size: clamp(17px, 2vw, 19px);
  color: var(--surface-fg-muted);
}

.section-head {
  max-width: 68ch;
  margin-bottom: 36px;
}
.section-head p {
  margin: 0;
  color: var(--surface-fg-muted);
}

.hero {
  padding-block-start: 84px;
  border-bottom: 1px solid var(--surface-line);
}

/* ── buttons & endpoint ──────────────────────────────────────────────── */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--mctl-radius-md);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface-bg);
}
.btn-primary:hover {
  background: var(--accent-highlight);
  border-color: var(--accent-highlight);
  color: var(--surface-bg);
}

.btn-secondary {
  background: transparent;
  border-color: var(--surface-line-strong);
  color: var(--surface-fg);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--surface-fg);
}

.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid var(--surface-line-strong);
  border-radius: var(--mctl-radius-md);
  background: var(--surface-elevated);
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.endpoint .label {
  color: var(--surface-fg-subtle);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── cards ───────────────────────────────────────────────────────────── */

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

.card {
  padding: 22px;
  border: 1px solid var(--surface-line);
  border-radius: var(--mctl-radius-lg);
  background: var(--surface-card);
}
.card p {
  margin: 0;
  color: var(--surface-fg-muted);
  font-size: 14px;
  line-height: 1.5;
}
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: var(--mctl-radius-md);
  background: var(--accent-soft-dark);
  color: var(--accent-highlight);
}
:root[data-theme="light"] .card-icon,
[data-theme="light"] .card-icon {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* ── tables ──────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--surface-line);
  border-radius: var(--mctl-radius-lg);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--surface-line);
}
th {
  background: var(--surface-elevated);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--surface-fg-subtle);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td code {
  color: var(--surface-fg);
}
td.muted {
  color: var(--surface-fg-muted);
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--surface-line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--surface-fg-muted);
  white-space: nowrap;
}
.chip.is-write {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── steps and FAQ ───────────────────────────────────────────────────── */

.steps {
  margin: 0;
  padding-left: 22px;
  color: var(--surface-fg-muted);
}
.steps li {
  margin-bottom: 16px;
}
.steps li strong {
  color: var(--surface-fg);
  font-weight: 600;
}

pre {
  margin: 12px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--surface-line);
  border-radius: var(--mctl-radius-md);
  background: var(--surface-elevated);
  color: var(--surface-fg);
  line-height: 1.5;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--surface-line);
  border-radius: var(--mctl-radius-lg);
  background: var(--surface-card);
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 500;
  cursor: pointer;
}
.faq-item summary::marker {
  color: var(--accent);
}
.faq-item p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--surface-fg-muted);
  font-size: 15px;
}

footer {
  padding-block: 32px 48px;
  color: var(--surface-fg-subtle);
  font-size: 14px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
footer a {
  color: var(--surface-fg-muted);
}

/* ── narrow screens ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .wrap {
    padding-inline: 18px;
  }
  section {
    padding-block: 48px;
  }
  .hero {
    padding-block-start: 52px;
  }
  .topbar-links {
    gap: 10px;
    font-size: 13px;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 6px;
  }
  .cta-row .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ── QR code auth ────────────────────────────────────────────────────── */

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 24px;
  background: var(--surface-card);
  border: 1px solid var(--surface-line);
  border-radius: var(--mctl-radius-lg);
  margin-block: 20px 28px;
}

.qr-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #ffffff;
  border-radius: var(--mctl-radius-md);
  border: 1px solid var(--surface-line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-block: 18px;
  width: 220px;
  height: 220px;
  overflow: hidden;
}

.qr-frame svg,
.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-failed {
  color: var(--surface-fg-muted);
  padding: 20px;
}

.qr-spinner {
  display: inline-block;
  width: 38px;
  height: 38px;
  border: 3px solid var(--surface-line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: qr-spin 0.85s linear infinite;
}

@keyframes qr-spin {
  to {
    transform: rotate(360deg);
  }
}

