/* Hermes Mobile website: shared styles. No build step. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --surface: #ffffff;
  --border: #e3e5ee;
  --text: #13151c;
  --text-muted: #555b6e;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --on-accent: #ffffff;
  --code-bg: #f1f2f7;
  --warn-bg: #fff7e6;
  --warn-border: #f0b429;
  --warn-text: #5c3d00;
  --shadow: 0 1px 2px rgb(16 20 40 / 6%), 0 8px 24px rgb(16 20 40 / 6%);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f15;
    --bg-soft: #131621;
    --surface: #171a26;
    --border: #2a2f40;
    --text: #eceef5;
    --text-muted: #a3a9bc;
    --accent: #8b8cf8;
    --accent-hover: #a5a6ff;
    --accent-soft: #1f2140;
    --on-accent: #0d0f15;
    --code-bg: #1d2130;
    --warn-bg: #2a2110;
    --warn-border: #c98f16;
    --warn-text: #f7dca0;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  overflow-x: hidden;
}

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

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--code-bg);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { top: 12px; }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 60px; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto;
}
.brand img { width: 28px; height: 28px; }
.also-h { margin-top: 40px; }
.nav ul {
  display: flex; flex-wrap: wrap; gap: 2px 4px;
  list-style: none; margin: 0; padding: 0;
}
.nav a.navlink {
  display: inline-block; padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; font-size: 0.95rem;
}
.nav a.navlink:hover { color: var(--text); background: var(--bg-soft); }
.nav a.navlink[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav a.navlink.gh { display: inline-flex; align-items: center; gap: 6px; }
.nav .gh svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .nav { justify-content: center; }
  .brand { margin-right: 0; width: 100%; justify-content: center; }
  .nav ul { justify-content: center; }
  .nav a.navlink { padding: 6px 8px; font-size: 0.9rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm {
  min-height: 32px; padding: 4px 12px; font-size: 0.85rem; border-radius: 999px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.btn-sm:hover { background: var(--bg-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Sections */
main { display: block; }
.section { padding: 64px 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 62ch; }
.muted { color: var(--text-muted); }

.page-head { padding: 56px 0 24px; }
.page-head .lead { margin-bottom: 0; }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero .lead { margin-bottom: 28px; }
.hero-note { margin-top: 16px; font-size: 0.9rem; color: var(--text-muted); }
.phone {
  width: 100%; max-width: 300px; margin: 0 auto; display: block;
  filter: drop-shadow(0 20px 40px rgb(30 30 80 / 18%));
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding-top: 48px; }
  .phone { max-width: 220px; }
}

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 32px; }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.feature .icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.feature .icon svg { width: 22px; height: 22px; }
.feature p { color: var(--text-muted); }
.feature ul { margin: 0; padding-left: 1.1em; color: var(--text-muted); }
.feature li { margin: 0.25em 0; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.chips li {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 0.92rem;
}

/* How it works diagram */
.flow {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  list-style: none; padding: 0; margin: 32px 0 0; counter-reset: flow;
}
.flow li {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 18px;
}
.flow li strong { display: block; margin-bottom: 4px; }
.flow li span { color: var(--text-muted); font-size: 0.93rem; }
.flow li svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 10px; }
.flow li:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -12px; width: 12px; height: 2px;
  background: var(--accent);
}
@media (max-width: 820px) {
  .flow { grid-template-columns: 1fr; }
  .flow li:not(:last-child)::after { top: auto; bottom: -12px; right: auto; left: 32px; width: 2px; height: 12px; }
}

.cta-band { text-align: center; }
.cta-band .btn-row { justify-content: center; }
.cta-band .lead { margin: 0 auto 24px; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step {
  position: relative; padding: 0 0 40px 60px;
  border-left: 2px solid var(--border); margin-left: 18px;
}
.step:last-child { border-left-color: transparent; padding-bottom: 8px; }
.step-num {
  position: absolute; left: -19px; top: -4px; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.step h2 { font-size: 1.45rem; padding-top: 2px; }
.step h3 { margin-top: 1.4em; }
@media (max-width: 520px) {
  .step { padding-left: 32px; margin-left: 14px; }
  .step-num { left: -15px; width: 28px; height: 28px; font-size: 0.9rem; }
}

ul.tight, ol.tight { padding-left: 1.2em; }
ul.tight li, ol.tight li { margin: 0.3em 0; }

/* Code blocks with copy */
.code {
  position: relative; background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin: 12px 0 16px;
}
.code pre {
  margin: 0; padding: 14px 16px; padding-right: 76px;
  overflow-x: auto; white-space: pre; line-height: 1.5;
}
.code .copy { position: absolute; top: 8px; right: 8px; }

/* Tabs */
.tabs { margin: 16px 0; }
.tablist {
  display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border);
}
.tablist [role="tab"] {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 10px 14px; min-height: 44px;
  font: 600 0.95rem var(--font); color: var(--text-muted); cursor: pointer;
}
.tablist [role="tab"]:hover { color: var(--text); }
.tablist [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabpanel { padding-top: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 12px 0 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--bg-soft); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { border: 0; padding: 4px 12px; }
  .stack-table td::before {
    content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  }
  .stack-table td code { white-space: normal; }
}

/* Callouts */
.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  background: var(--accent-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 16px 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.callout.warn a { color: inherit; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent);
  vertical-align: middle; margin-left: 6px;
}
.placeholder {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0;
}

/* FAQ / Q&A */
.qa { border-top: 1px solid var(--border); }
.qa details { border-bottom: 1px solid var(--border); }
.qa summary {
  cursor: pointer; padding: 18px 36px 18px 0; font-weight: 600; font-size: 1.05rem;
  list-style: none; position: relative;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; position: absolute; right: 6px; top: 14px; font-size: 1.4rem;
  color: var(--accent); font-weight: 400;
}
.qa details[open] summary::after { content: "\2212"; }
.qa .answer { padding: 0 0 18px; }
.qa .answer > :last-child { margin-bottom: 0; }

/* Security page */
.sec-list { display: grid; gap: 16px; margin-top: 24px; }
.sec-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.sec-item h2 { font-size: 1.2rem; }
.sec-item > :last-child { margin-bottom: 0; }

/* Pair page */
.pair-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; display: grid;
  grid-template-columns: auto 1fr; gap: 32px; align-items: start;
}
.qr-box {
  background: #ffffff; border-radius: 12px; padding: 0; line-height: 0;
  width: min(300px, 100%); margin: 0 auto;
}
.qr-box svg { width: 100%; height: auto; display: block; border-radius: 12px; }
.qr-caption { text-align: center; font-size: 0.9rem; color: var(--text-muted); margin-top: 10px; }
.fields { margin: 0 0 20px; display: grid; gap: 14px; }
.fields dt { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.fields dd { margin: 2px 0 0; font-family: var(--mono); font-size: 0.95rem; overflow-wrap: anywhere; }
.secret-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.secret-row .secret { margin-right: 4px; }
.status { min-height: 1.4em; font-size: 0.9rem; color: var(--text-muted); }
@media (max-width: 720px) {
  .pair-card { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 32px 0 40px; margin-top: 48px;
  font-size: 0.92rem; color: var(--text-muted);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Phone illustration (landing) */
.ph-frame { fill: var(--text); }
.ph-screen { fill: var(--bg-soft); }
.ph-bar { fill: var(--surface); stroke: var(--border); }
.ph-in { fill: var(--surface); stroke: var(--border); }
.ph-out { fill: var(--accent); }
.ph-line { fill: var(--border); }
.ph-line-out { fill: var(--on-accent); opacity: .55; }
.ph-tool { fill: var(--accent-soft); stroke: var(--accent); }
.ph-accent { fill: var(--accent); }
.ph-muted { fill: var(--text-muted); }
