/* swgoh-api marketing site. No JavaScript, no external fonts: the CSP in _headers allows
   only same-origin styles and images. */

:root {
  --bg: #f7f8fc;
  --bg-alt: #eef1f9;
  --surface: #ffffff;
  --text: #161a2b;
  --muted: #545b77;
  --border: #dadfee;
  --brand: #3451b2;
  --brand-strong: #263f94;
  --on-brand: #ffffff;
  --accent: #f0b429;
  --code-bg: #0f1324;
  --code-text: #dfe4f6;
  --code-key: #8fb4ff;
  --code-str: #a8e3a1;
  --code-num: #f7c873;
  --code-kw: #f39bc2;
  --code-muted: #7d86a8;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 64 / 6%), 0 8px 24px rgb(16 24 64 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e1a;
    --bg-alt: #11152a;
    --surface: #161b33;
    --text: #e8ebf7;
    --muted: #a3aac6;
    --border: #262d4d;
    --brand: #7f9cff;
    --brand-strong: #a3b8ff;
    --on-brand: #0b0e1a;
    --code-bg: #070912;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
}

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

a:hover {
  color: var(--brand-strong);
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .wrap {
    padding: 0 24px;
  }
}

.narrow {
  max-width: 760px;
}

.center {
  text-align: center;
}

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

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-radius: 8px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

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

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
}

.brand:hover {
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.97rem;
}

.nav a:not(.btn):hover {
  color: var(--text);
}

@media (max-width: 639px) {
  .header-row {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  .nav li:not(:last-child):nth-child(-n + 3) {
    display: none;
  }
}

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

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: var(--on-brand);
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand-strong);
}

.btn-small {
  padding: 0.45rem 0.9rem;
  font-size: 0.93rem;
}

/* --- Hero --------------------------------------------------------------------------- */

.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
    var(--bg);
}

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

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 3rem;
  }
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  max-width: 36rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.fine {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* --- Code sample --------------------------------------------------------------------- */

.code {
  margin: 0;
  min-width: 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--code-muted);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  font-family: var(--mono);
}

.code pre {
  margin: 0;
  padding: 1.1rem 1.2rem 1.3rem;
  overflow-x: auto;
  color: var(--code-text);
  font: 0.86rem/1.6 var(--mono);
}

.c-prompt {
  color: var(--code-muted);
  user-select: none;
}

.c-key {
  color: var(--code-key);
}

.c-str {
  color: var(--code-str);
}

.c-num {
  color: var(--code-num);
}

.c-kw {
  color: var(--code-kw);
}

/* --- Sections ----------------------------------------------------------------------- */

.section {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

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

.section-lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 2.25rem;
  max-width: 44rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card p {
  margin: 0;
  color: var(--muted);
}

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 3.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

/* --- Pricing ------------------------------------------------------------------------ */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.plan {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.plan-featured {
  border: 2px solid var(--brand);
}

.plan .price {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.25rem 0 1rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}

.plan li {
  padding: 0.35rem 0 0.35rem 1.6rem;
  position: relative;
  color: var(--muted);
}

.plan li::before,
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.85rem;
  height: 0.45rem;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: translateY(-50%) rotate(-45deg);
}

.plan .btn {
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border: 1px solid var(--accent);
}

/* --- Players ------------------------------------------------------------------------ */

.two-col {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 860px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
  }
}

.two-col p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.checks {
  list-style: none;
  margin: 0;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.checks li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.8rem;
}

.checks li::before {
  top: 1.05em;
}

/* --- FAQ ---------------------------------------------------------------------------- */

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

details:first-of-type {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

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

summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: -0.1rem;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand);
}

details[open] summary::after {
  content: "−";
}

details p {
  color: var(--muted);
  margin: 0.75rem 0 0;
}

/* --- Footer ------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3rem;
}

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

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

.footer-grid .fine {
  max-width: 34rem;
}

.footer-navs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.footer-heading {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

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

.footer-links li {
  padding: 0.25rem 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

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

/* --- 404 ---------------------------------------------------------------------------- */

.not-found {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 0;
}

.not-found p {
  color: var(--muted);
}

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

/* --- Legal and policy pages ---------------------------------------------------------- */

.legal {
  max-width: 760px;
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.legal h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
}

.legal h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
}

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

.legal p,
.legal li {
  color: var(--text);
}

.legal ul,
.legal ol {
  padding-left: 1.4rem;
}

.legal li {
  margin: 0.3rem 0;
}

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

.legal .summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
}

.legal .summary ul {
  margin: 0.5rem 0 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

.legal th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.draft-banner {
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.placeholder {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 4px;
  padding: 0 0.25rem;
  font-weight: 600;
}

/* Tables marked .stack become one card per row on narrow screens; each cell shows its
   column name from data-label. */
@media (max-width: 639px) {
  .legal table.stack thead {
    position: absolute;
    left: -9999px;
  }

  .legal table.stack,
  .legal table.stack tbody,
  .legal table.stack tr,
  .legal table.stack td {
    display: block;
    width: 100%;
  }

  .legal table.stack tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0.5rem 0.9rem;
    margin-bottom: 0.9rem;
  }

  .legal table.stack td {
    border: 0;
    padding: 0.35rem 0;
  }

  .legal table.stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
  }
}

/* --- Coming soon ---------------------------------------------------------------------- */

.lede-sm {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

/* .legal ul would indent the cards; this selector outranks it. */
.legal .soon-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.soon-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  scroll-margin-top: 88px;
}

.soon-list h2 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}

.soon-list p {
  margin: 0;
  color: var(--muted);
}

/* The service the visitor was heading to (/coming-soon#account) stands out; no JavaScript. */
.soon-list li:target {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.soon-list li:target h2::after {
  content: "You were heading here";
  display: inline-block;
  white-space: nowrap;
  margin: 0.2rem 0 0 0.6rem;
  vertical-align: middle;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  border: 1px solid var(--accent);
}
