/*
  The Side Quest marketing site. One stylesheet, no build step, no external requests.
  System font stack only. Navy + teal are placeholder brand colors (spec section 16).
  All text pairs meet WCAG AA in both themes; focus rings are 3px and always visible.
*/

:root {
  color-scheme: light dark;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0b1f3a;
  --muted: #43536a;
  --link: #0a6560;
  --accent: #0b7a75;
  --on-accent: #ffffff;
  --soft: #e2f4f2;
  --border: #d3dce8;          /* hairlines: decorative only */
  --border-strong: #74869e;   /* controls: 3:1 against the page */
  --focus: #0b5fff;
  --notice-bg: #fff6dd;
  --notice-text: #4a3500;
  --notice-border: #d9b44a;
  --mark-bg: #0b1f3a;
  --mark-fg: #2dd4bf;
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.06), 0 8px 24px rgba(11, 31, 58, 0.08);

  --radius: 1rem;
  --radius-sm: 0.625rem;
  --gutter: 1rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07142a;
    --surface: #0e2340;
    --text: #eaf2fa;
    --muted: #a9b9ce;
    --link: #5eead4;
    --accent: #2dd4bf;
    --on-accent: #04202a;
    --soft: #0f3340;
    --border: #223a5e;
    --border-strong: #5c7595;
    --focus: #8ab4ff;
    --notice-bg: #2e2609;
    --notice-text: #f4e3a6;
    --notice-border: #8a6f1c;
    --mark-bg: #2dd4bf;
    --mark-fg: #07142a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--focus);
  border-radius: var(--radius-sm);
  transition: top 0.15s;
}

.skip-link:focus {
  top: 0.5rem;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 68rem);
  margin-inline: auto;
}

.wrap-narrow {
  width: min(100% - 2 * var(--gutter), 46rem);
  margin-inline: auto;
}

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.mark-bg {
  fill: var(--mark-bg);
}

.mark-star {
  fill: var(--mark-fg);
}

.site-header nav ul,
.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header nav a,
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-header nav a:hover,
.site-footer nav a:hover,
.site-header nav a[aria-current="page"],
.site-footer nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.site-footer {
  margin-top: 4rem;
  padding-block: 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

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

@media (min-width: 48rem) {
  .footer-grid {
    grid-template-columns: 1fr auto;
  }
  .footer-grid .fine-print {
    grid-column: 1 / -1;
  }
}

.footer-brand {
  margin: 0;
  font-weight: 700;
}

/* ---------- Type ---------- */

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 6.5vw, 3.4rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.lead {
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  color: var(--muted);
  max-width: 38rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--link);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

address {
  font-style: normal;
  margin: 0 0 1em;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--soft);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border: 2px solid transparent;
  border-radius: 0.8rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--soft);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.5rem;
}

/* ---------- Home ---------- */

.hero {
  padding-block: clamp(2rem, 7vw, 4.5rem);
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-facts li::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

.demo {
  margin: 0;
}

.demo-stack {
  position: relative;
  padding: 0 0.75rem 0.75rem 0;
}

.qcard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.qcard-back {
  position: absolute;
  inset: 0.75rem 0 0 0.75rem;
  z-index: 0;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
}

.demo .qcard:not(.qcard-back) {
  z-index: 1;
}

.qcard-kicker {
  margin: 0 0 0.5rem;
  color: var(--link);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qcard-title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.demo figcaption {
  margin-top: 0.5rem;
  padding-left: 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.section {
  padding-block: clamp(2rem, 6vw, 3.5rem);
}

.section > .wrap > h2 {
  margin-bottom: 1.25rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem;
}

.card h3 {
  margin-top: 0.25rem;
}

.card-flat {
  padding-bottom: 1.25rem;
}

.steps {
  counter-reset: step;
}

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.9rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.4em;
  width: 0.9rem;
  height: 0.5rem;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- Content pages ---------- */

.page {
  padding-block: clamp(1.5rem, 5vw, 3rem);
}

.page h1 {
  margin-bottom: 0.4em;
}

.page h2 {
  margin-top: 2.25rem;
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
}

.page h3 {
  margin-top: 1.5rem;
}

.page ul,
.page ol {
  padding-left: 1.4rem;
  margin: 0 0 1em;
}

.page li {
  margin-bottom: 0.4em;
}

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

.notice {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-left-width: 6px;
  border-left-color: var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.notice > :last-child {
  margin-bottom: 0;
}

.notice-warn {
  background: var(--notice-bg);
  color: var(--notice-text);
  border-color: var(--notice-border);
  border-left-color: var(--notice-border);
}

.notice-warn a {
  color: inherit;
}

.notice h2,
.notice h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.table-wrap {
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.table-wrap:focus-visible {
  outline-offset: 0;
}

table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

th {
  background: var(--soft);
  font-weight: 700;
}

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

/* Narrow screens: tables become stacked, labeled cards (labels come from data-label). */
@media (max-width: 40rem) {
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  tbody {
    display: block;
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  tr {
    display: block;
    margin-bottom: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }

  tbody th,
  tbody td {
    display: block;
    border-bottom: 0;
  }

  tbody th {
    border-bottom: 1px solid var(--border);
  }

  tbody td {
    padding-block: 0.6rem;
  }

  tbody td + td {
    padding-top: 0;
  }

  td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

/* FAQ */

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
}

summary {
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
}

details[open] > summary {
  border-bottom: 1px solid var(--border);
}

details > :not(summary) {
  margin-inline: 1rem;
}

details > :nth-child(2) {
  margin-top: 0.9rem;
}

details > :last-child {
  margin-bottom: 1rem;
}

/* ---------- Join page ---------- */

.join {
  text-align: center;
  padding-block: clamp(1.5rem, 6vw, 3.5rem);
}

.code {
  display: block;
  margin: 0.5rem auto 1.25rem;
  padding: 0.75rem 1rem;
  max-width: 100%;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: clamp(2rem, 11vw, 3.25rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  user-select: all;
}

.join .btn-row {
  justify-content: center;
}

.join ol {
  display: inline-block;
  max-width: 100%;
  text-align: left;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-block: 1rem;
}

input[type="text"] {
  min-height: 48px;
  width: 12rem;
  max-width: 100%;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--border-strong);
  border-radius: 0.8rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.status {
  min-height: 1.6em;
  margin: 0.25rem 0 1rem;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

/* ---------- Print (legal pages get printed) ---------- */

@media print {
  .site-header nav,
  .site-footer nav,
  .skip-link,
  .btn-row {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  a {
    color: inherit;
  }
}
