/*
 * The landing page of the demonstration. Same tokens as the wallet and the recoverer pages (packages/ui/src/styles.css):
 * the owner's teal and the recoverer's amber, system fonts, light and dark following the device.
 */

:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --sunken: #eef1f5;
  --ink: #17212b;
  --muted: #586675;
  --line: #d3dae2;
  --owner: #0b7a6e;
  --owner-soft: #e1f2ef;
  --recoverer: #a8540a;
  --recoverer-soft: #fbeedf;
  --app: #3d5a99;
  --app-soft: #e7ecf7;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --focus: #1f5fbf;
  --shadow: 0 1px 2px rgb(23 33 43 / 6%), 0 1px 1px rgb(23 33 43 / 4%);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #10151b;
    --surface: #19212a;
    --sunken: #141b22;
    --ink: #e5eaf0;
    --muted: #9ba8b6;
    --line: #2f3a46;
    --owner: #4fd1c0;
    --owner-soft: #173330;
    --recoverer: #f0a657;
    --recoverer-soft: #35260f;
    --app: #94b0ef;
    --app-soft: #1c2640;
    --warn: #f0b85a;
    --warn-soft: #33270f;
    --focus: #7fb0ff;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--owner); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
q { quotes: '“' '”'; font-weight: 600; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.92em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ------------------------------------------------------------------ top bar */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { display: block; }
.top-nav { display: flex; gap: 20px; font-size: 15px; }
.top-nav a { color: var(--muted); text-decoration: none; }
.top-nav a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ hero */

.hero { padding: 56px 0 48px; border-bottom: 1px solid var(--line); background: var(--surface); }
.hero-grid { display: grid; gap: 40px; grid-template-columns: 1.25fr 1fr; align-items: center; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--owner); margin-bottom: 12px; }
h1 { font-size: 40px; letter-spacing: -0.02em; margin-bottom: 18px; max-width: 18ch; }
.lead { font-size: 19px; color: var(--muted); margin-bottom: 12px; max-width: 56ch; }
.testnet { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

.promise { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: promise; }
.promise li {
  counter-increment: promise;
  position: relative;
  padding: 16px 16px 16px 60px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.promise li strong { color: var(--ink); display: block; }
.promise li::before {
  content: counter(promise);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  background: var(--owner-soft);
  color: var(--owner);
}
.promise li:nth-child(3)::before { background: var(--recoverer-soft); color: var(--recoverer); }

/* ------------------------------------------------------------------ sections */

.section { padding: 56px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: 30px; letter-spacing: -0.01em; margin-bottom: 10px; }
.section-lead { color: var(--muted); max-width: 70ch; margin-bottom: 28px; font-size: 17px; }
h3 { font-size: 19px; }

/* ------------------------------------------------------------------ the four pages */

.cards { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--tone);
  border-radius: 12px;
  box-shadow: var(--shadow);
  --tone: var(--app);
  --tone-soft: var(--app-soft);
}
.card.owner { --tone: var(--owner); --tone-soft: var(--owner-soft); }
.card.recoverer { --tone: var(--recoverer); --tone-soft: var(--recoverer-soft); }
.card p { color: var(--muted); font-size: 15px; }
.card-head { display: grid; gap: 4px; }
.role { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--tone); }
.qr-row { display: flex; gap: 12px; align-items: center; }
.qr-row p { min-width: 0; }
.qr-row .mono { font-size: 12px; }
.qr { width: 100px; height: 100px; border-radius: 8px; border: 1px solid var(--line); flex: none; background: #fff; }
.open {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--tone-soft);
  color: var(--tone);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}
.open:hover { background: color-mix(in srgb, var(--tone) 18%, var(--surface)); }

/* ------------------------------------------------------------------ devices */

.devices { display: grid; gap: 16px; grid-template-columns: 1fr 1.4fr 1fr; }
.device { padding: 20px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.device h3 { margin: 10px 0 6px; }
.device p { color: var(--muted); font-size: 15px; }
.device-icon { width: 36px; height: 36px; }
.device.phone .device-icon { color: var(--owner); }
.device.desktop .device-icon { color: var(--recoverer); }
.device.second { border-style: dashed; }
.device.second .device-icon { color: var(--muted); }
.note { margin-top: 16px; color: var(--muted); font-size: 15px; max-width: 80ch; }

/* ------------------------------------------------------------------ steps */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 20px 20px 20px 72px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--owner);
  color: var(--surface);
}
.steps p { color: var(--muted); max-width: 78ch; }
.steps h3 { margin-bottom: 2px; }
.tip { padding: 10px 14px; border-radius: 8px; background: var(--sunken); font-size: 15px; }
.tip.warn { background: var(--warn-soft); color: var(--warn); }

.more { margin-top: 28px; padding: 20px; border-radius: 12px; border: 1px dashed var(--line); }
.more ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); }
.more strong { color: var(--ink); }

/* ------------------------------------------------------------------ waiting period */

.timeline { display: grid; grid-template-columns: 1.3fr 1fr 3fr 1.3fr; gap: 4px; }
.seg { padding: 12px 14px; display: grid; gap: 2px; background: var(--sunken); }
.seg:first-child { border-radius: 10px 0 0 10px; }
.seg:last-child { border-radius: 0 10px 10px 0; }
.seg-title { font-weight: 700; font-size: 15px; }
.seg-sub { font-size: 13px; color: var(--muted); }
.seg-block { background: var(--recoverer-soft); }
.seg-wait {
  background: repeating-linear-gradient(135deg, var(--recoverer-soft) 0 10px, color-mix(in srgb, var(--recoverer-soft) 60%, var(--surface)) 10px 20px);
}
.seg-done { background: var(--owner-soft); }
.seg-done .seg-title { color: var(--owner); }
.refuse-bar {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr;
  margin-right: calc(1.3 / 6.6 * 100%);
}
.refuse-bar span {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--owner-soft);
  color: var(--owner);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.facts { margin-top: 32px; display: grid; gap: 24px 32px; grid-template-columns: repeat(2, 1fr); }
.facts h3 { margin-bottom: 6px; }
.facts p { color: var(--muted); }

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

.foot { padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ narrower screens */

@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .top-nav { display: none; }
  .hero { padding: 36px 0 32px; }
  h1 { font-size: 30px; }
  .lead { font-size: 17px; }
  h2 { font-size: 25px; }
  .section { padding: 40px 0; }
  .cards, .devices, .facts { grid-template-columns: 1fr; }
  .steps > li { padding: 18px 16px 18px 60px; }
  .steps > li::before { left: 14px; width: 30px; height: 30px; }
  .timeline { grid-template-columns: 1fr; gap: 3px; }
  .seg:first-child { border-radius: 10px 10px 0 0; }
  .seg:last-child { border-radius: 0 0 10px 10px; }
  .refuse-bar { margin-right: 0; }
}
