/* ==========================================================================
   Step Exchange — landing styles
   Plain CSS, mobile-first. All colors come from the tokens in :root.
   Breakpoints: 640px (tablet), 960px (desktop).
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
/* Color — dark (default). Theme is set by data-theme on <html>: "dark" | "light". */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0F17;            /* page background */
  --surface: #121824;       /* cards, widget, footer */
  --surface-2: #19202E;     /* notice bar, raised / secondary */
  --border: #263042;        /* hairlines, card borders */
  --border-strong: #3A4660; /* hover borders, dashed placeholders */
  --text: #E9EDF4;          /* primary text  (16:1 on --bg) */
  --text-muted: #9AA5B8;    /* secondary text (7.7:1 on --bg) */
  --accent: #5CB8FF;        /* the single accent: links, primary button, icons */
  --accent-hover: #8DCEFF;
  --accent-contrast: #06131F; /* text/icons on accent fills (8.7:1) */
  --accent-soft: rgba(92, 184, 255, 0.12); /* icon tiles, ghost hover */
  --success: #3DD68C;
  --warning: #F5B94A;
  --error: #FF7A7A;
}

/* Color — light. Same roles, accent darkened to keep AA on white. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #E9EDF3;
  --border: #D9DFE8;
  --border-strong: #B4BDCB;
  --text: #0E1420;          /* 17:1 on --bg */
  --text-muted: #525D6F;    /* 6.2:1 on --bg */
  --accent: #0B6BC4;        /* 5.0:1 on --bg, 5.4:1 on white */
  --accent-hover: #0A5AA6;
  --accent-contrast: #FFFFFF; /* 5.4:1 on accent */
  --accent-soft: rgba(11, 107, 196, 0.10);
  --success: #12804A;
  --warning: #9A5A00;
  --error: #C62F2F;
}

:root {
  /* Shape */
  --radius: 16px;           /* cards, widget container */
  --radius-sm: 10px;        /* buttons, inputs, tiles */
  --radius-pill: 999px;

  /* Type */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;           /* H1 mobile; 52px on desktop */

  /* Layout */
  --container: 1200px;
  --gutter: 16px;
  --header-h: 56px;
  --widget-w: 420px;
  --widget-h: 740px;
  --widget-h-mobile: 740px;
}
@media (max-width: 374px) { :root { --gutter: 12px; } }
@media (min-width: 960px) {
  :root { --gutter: 32px; --header-h: 72px; --fs-2xl: 36px; --fs-3xl: 52px; }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; font-weight: 600; }
p { margin: 0; }
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.ico { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  padding: 10px 14px; background: var(--accent); color: var(--accent-contrast);
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }
.mono { font-family: var(--font-mono); }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-base); font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .ico { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------- 4. Notice bar ---------- */
.notice-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.notice-bar__inner { display: flex; align-items: flex-start; gap: 8px; padding-block: 7px; }
.notice-bar__icon { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.notice-bar a { color: var(--text); white-space: nowrap; }
.notice-bar a:hover { color: var(--accent-hover); }
.notice-bar__long { display: none; }
@media (min-width: 640px) {
  .notice-bar { font-size: var(--fs-xs); }
  .notice-bar__inner { align-items: center; justify-content: center; padding-block: 9px; }
  .notice-bar__icon { margin-top: 0; }
  .notice-bar__short { display: none; }
  .notice-bar__long { display: inline; }
}

/* ---------- 5. Header ---------- */
.site-header { position: relative; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.logo {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--text); text-decoration: none;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}
.logo:hover { color: var(--text); }
.logo__mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-contrast);
}
.logo__mark svg { width: 20px; height: 20px; }
.logo__mark .ico { stroke-width: 2.25; }
.logo__mark .dot { fill: currentColor; stroke: none; }
.logo__light { font-weight: 400; color: var(--text-muted); }

.nav-desktop { display: none; gap: 4px; }
.nav-desktop a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--text-muted); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500; border-radius: var(--radius-sm);
}
.nav-desktop a:hover { color: var(--text); background: var(--surface); }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Theme toggle — shows the sun in dark mode (switch to light), the moon in light mode */
.theme-toggle {
  width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  background: transparent; color: var(--text); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.theme-toggle:hover { background: var(--surface); border-color: var(--border-strong); }
.theme-toggle .ico { width: 20px; height: 20px; }
.theme-toggle .icon-moon, [data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon, [data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-mobile summary {
  list-style: none; cursor: pointer;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile summary .ico { width: 22px; height: 22px; }
.nav-mobile .icon-close { display: none; }
.nav-mobile[open] .icon-close { display: block; }
.nav-mobile[open] .icon-menu { display: none; }
.nav-mobile__panel {
  position: absolute; left: 0; right: 0; top: 100%;
  padding: 4px var(--gutter) 16px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.nav-mobile__panel a {
  display: flex; align-items: center; justify-content: space-between; min-height: 52px;
  color: var(--text); text-decoration: none; font-size: var(--fs-lg); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.nav-mobile__panel a:last-child { border-bottom: 0; }
.nav-mobile__panel .ico { width: 18px; height: 18px; color: var(--text-muted); }

@media (min-width: 960px) {
  .site-header { position: sticky; top: 0; }
  .nav-desktop { display: flex; }
  .nav-mobile { display: none; }
  main section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
}

/* ---------- 6. Hero / swap ---------- */
.hero { padding-block: 16px 48px; }
.hero__grid { display: flex; flex-direction: column; gap: 32px; }
.hero__widget { order: -1; }           /* mobile: widget first, text below */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.hero h1 { font-size: var(--fs-3xl); margin-top: 14px; max-width: 14ch; }
.hero__sub { margin-top: 16px; font-size: var(--fs-lg); color: var(--text-muted); max-width: 36ch; }
.trust { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.trust li { display: flex; align-items: center; gap: 12px; font-size: var(--fs-sm); font-weight: 500; }
.trust__icon {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
}
.trust__icon .ico { width: 18px; height: 18px; }

/* Widget slot — LI.FI widget mounts into #swap-widget */
#swap-widget {
  width: 100%;
  height: var(--widget-h-mobile);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
#swap-widget:empty { display: grid; place-items: center; }
#swap-widget:empty::before {
  content: "LI.FI swap widget";
  padding: 10px 16px;
  font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
}
.widget-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px;
  margin-top: 10px; font-size: var(--fs-xs); color: var(--text-muted);
}

@media (min-width: 960px) {
  .hero { padding-block: 64px 96px; }
  .hero__grid {
    display: grid; grid-template-columns: minmax(0, 1fr) var(--widget-w);
    gap: 64px; align-items: center;
  }
  .hero__widget { order: 0; }
  #swap-widget { width: var(--widget-w); height: var(--widget-h); }
  .trust { grid-auto-flow: column; justify-content: start; gap: 28px; margin-top: 36px; }
}

/* ---------- 7. Sections (shared) ---------- */
.section { padding-block: 56px; border-top: 1px solid var(--border); }
.section__head { max-width: 640px; margin-bottom: 32px; }
.section h2 { font-size: var(--fs-2xl); margin-top: 12px; }
.section__lead { margin-top: 12px; color: var(--text-muted); font-size: var(--fs-base); }
.section__cta { margin-top: 32px; }
.section__cta .btn { width: 100%; }
.icon-tile {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
}
.icon-tile .ico { width: 22px; height: 22px; }
@media (min-width: 640px) { .section__cta .btn { width: auto; } }
@media (min-width: 960px) { .section { padding-block: 96px; } .section__head { margin-bottom: 48px; } }

/* ---------- 8. How it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step {
  display: flex; gap: 16px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.step__num { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.step h3 { font-size: var(--fs-lg); margin-top: 2px; }
.step p { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .step { flex-direction: column; gap: 20px; padding: 28px; position: relative; }
  .step:not(:last-child)::after {           /* connector between steps */
    content: ""; position: absolute; top: 50px; right: -25px; width: 26px; height: 1px;
    background: var(--border-strong);
  }
}

/* ---------- 9. Why / feature cards ---------- */
.cards { display: grid; gap: 12px; }
.card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card h3 { margin-top: 18px; font-size: var(--fs-lg); }
.card p { margin-top: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
.card__figure { font-family: var(--font-mono); color: var(--text); }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } .card { padding: 28px; } }

/* ---------- 10. Networks ---------- */
.networks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.network {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 500;
}
.network__logo { flex: none; width: 32px; height: 32px; }
.network__logo circle { fill: var(--surface-2); stroke: var(--border-strong); }
.network__logo text { fill: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.network--more { justify-content: center; color: var(--text-muted); border-style: dashed; background: transparent; }
@media (min-width: 640px) { .networks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .networks { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; } .network { min-height: 68px; padding: 14px 18px; } }

/* ---------- 11. FAQ (native details/summary) ---------- */
.faq-layout { display: grid; gap: 8px; }
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 12px 0;
  list-style: none; cursor: pointer; font-weight: 500; font-size: var(--fs-base);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent-hover); }
.faq-item__toggle {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-muted);
  transition: transform .2s;
}
.faq-item__toggle .ico { width: 16px; height: 16px; }
.faq-item[open] .faq-item__toggle { transform: rotate(45deg); color: var(--accent); border-color: var(--accent); }
.faq-item__answer { padding: 0 44px 20px 0; color: var(--text-muted); max-width: 68ch; }
.faq-item__answer p + p { margin-top: 10px; }
@media (min-width: 960px) {
  .faq-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 64px; align-items: start; }
  .faq-item summary { font-size: var(--fs-lg); min-height: 68px; }
}

/* ---------- 12. Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-block: 40px 24px; font-size: var(--fs-sm); }
.footer__top { display: grid; gap: 24px; }
.footer__desc { margin-top: 10px; color: var(--text-muted); max-width: 42ch; }
.footer__disclaimer {
  padding: 16px; font-size: var(--fs-xs); line-height: 1.6; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.footer__bottom {
  display: flex; flex-direction: column-reverse; gap: 12px;
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: var(--fs-xs); color: var(--text-muted);
}
.footer__links { display: flex; flex-wrap: wrap; margin: 0 -12px; padding: 0; list-style: none; }
.footer__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--text); text-decoration: none; font-size: var(--fs-sm);
}
.footer__links a:hover { color: var(--accent-hover); text-decoration: underline; }
@media (min-width: 960px) {
  .footer__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 64px; align-items: start; }
  .footer__bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* Mounted LI.FI widget: it draws its own card, so the slot becomes a transparent wrapper */
#swap-widget:not(:empty) {
  height: var(--widget-h-mobile); min-height: 0; background: transparent; border: 0; overflow: visible;
  display: flex; justify-content: center;
}
#swap-widget:not(:empty) > * { width: 100%; }
@media (min-width: 960px) { #swap-widget:not(:empty) { height: var(--widget-h); min-height: 0; } }

/* Simple content pages (terms, privacy, contact, guides) */
.page { border-top: 0; }
.prose { max-width: 760px; }
.prose h1 { font-size: var(--fs-2xl); margin-bottom: 8px; }
.prose h2 { font-size: var(--fs-lg, 1.25rem); margin: 32px 0 8px; }
.prose p, .prose li { color: var(--text-muted); line-height: 1.7; margin-top: 12px; }
.prose ul { padding-left: 1.2em; }
.prose a { color: var(--accent); }
.page__meta { font-size: var(--fs-sm); color: var(--text-muted); }
