/* Dhyan Pay — marketing site.
   Tokens copied verbatim from the app's globals.css so the site and the app are
   one brand. State colour means the same thing here as there: normal is
   unemotional, amber only ever means 80%, clay only ever means over. */

:root {
  --ground: #fbfaf7;
  --surface: #ffffff;
  --sunken: #f4f2ed;
  --ink: #191814;
  --ink-muted: #6b6862;
  --ink-faint: #736e63;
  --line: #e6e2d9;
  --line-strong: #d5d0c4;
  --brand: #0d5d56;
  --brand-ink: #ffffff;
  --brand-soft: #e2efed;
  --warn: #8f4d06;
  --warn-fill: #d8952f;
  --warn-soft: #fbf1dd;
  --over: #9d3018;
  --over-fill: #c9573a;
  --over-soft: #fae7e0;
  --track: #e9e5dc;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121210;
    --surface: #1b1b18;
    --sunken: #232320;
    --ink: #f3f1ea;
    --ink-muted: #a6a198;
    --ink-faint: #928d82;
    --line: #302f2a;
    --line-strong: #413f38;
    --brand: #3fa79a;
    --brand-ink: #08201d;
    --brand-soft: #16302c;
    --warn: #e6b160;
    --warn-fill: #d8952f;
    --warn-soft: #33270f;
    --over: #ef9077;
    --over-fill: #c9573a;
    --over-soft: #35190f;
    --track: #2c2b26;
  }
}

:root[data-theme="dark"] {
  --ground: #121210;
  --surface: #1b1b18;
  --sunken: #232320;
  --ink: #f3f1ea;
  --ink-muted: #a6a198;
  --ink-faint: #928d82;
  --line: #302f2a;
  --line-strong: #413f38;
  --brand: #3fa79a;
  --brand-ink: #08201d;
  --brand-soft: #16302c;
  --warn: #e6b160;
  --warn-fill: #d8952f;
  --warn-soft: #33270f;
  --over: #ef9077;
  --over-fill: #c9573a;
  --over-soft: #35190f;
  --track: #2c2b26;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 47rem;
  margin: 0 auto;
  padding: 0 clamp(1.15rem, 5vw, 2rem);
}

/* ── in-app browser banner: hidden until site.js proves we're in one ── */
#webview-warning {
  display: none;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--line);
  color: var(--warn);
}

#webview-warning.show { display: block; }

#webview-warning .wrap {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  font-size: 0.92rem;
}

#webview-warning b { color: var(--ink); }

/* ── header ── */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }

.brand .tile {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  flex: none;
}

.brand .tile svg { width: 34px; height: 34px; display: block; }

.brand span { font-weight: 640; letter-spacing: -0.01em; font-size: 1.02rem; }

.site-head nav { display: flex; gap: 1.1rem; font-size: 0.92rem; }
.site-head nav a { color: var(--ink-muted); text-decoration: none; }
.site-head nav a:hover { color: var(--ink); }

/* ── type ── */
h1 {
  font-size: clamp(2.1rem, 6.5vw, 3.4rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 640;
  margin: 0 0 1.15rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 640;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}

h3 { font-size: 1.02rem; font-weight: 640; letter-spacing: -0.01em; margin: 0 0 0.35rem; }

p { margin: 0 0 1rem; color: var(--ink-muted); max-width: 60ch; }

.lede { font-size: clamp(1.06rem, 2.3vw, 1.22rem); line-height: 1.5; }

strong, b { color: var(--ink); font-weight: 600; }

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

section { padding: clamp(3.25rem, 8vw, 5rem) 0; border-top: 1px solid var(--line); }

section.hero { border-top: 0; padding-top: clamp(2.5rem, 7vw, 4rem); }

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.85rem;
  font-weight: 600;
}

/* ── buttons ── */
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 140ms ease, background 140ms ease;
}

.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { opacity: 0.9; }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--sunken); }

.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

/* ── the illusion-buster figure ── */
.tally {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 1.5rem;
}

.tally .label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 0 0 0.9rem;
}

.tally .dots { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 1.1rem; }
.tally .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); opacity: 0.55; }

.tally .sum {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
}

.tally .sum small { display: block; font-size: 0.92rem; font-weight: 400; color: var(--ink-muted); letter-spacing: 0; margin-top: 0.4rem; }

/* ── the layered diagram ── */
.layers { margin: 2rem 0 0; max-width: 22rem; }

.layers .top {
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-radius: 20px;
  padding: 0.95rem 1rem;
  box-shadow: 0 12px 30px rgb(13 93 86 / 0.18);
}

.layers .row { display: flex; align-items: center; gap: 0.5rem; }
.layers .chip { width: 24px; height: 24px; border-radius: 7px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.layers .chip svg { width: 24px; height: 24px; display: block; }
.layers .name { font-size: 0.86rem; font-weight: 640; }

.layers .bars { margin-top: 0.7rem; display: grid; gap: 0.4rem; }
.layers .bar { display: flex; align-items: center; gap: 0.5rem; }
.layers .bar span { font-size: 0.66rem; color: var(--ink-muted); width: 3.6rem; flex: none; }
.layers .bar i { height: 6px; border-radius: 999px; background: var(--track); flex: 1; overflow: hidden; display: block; }
.layers .bar i b { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

.layers .arrow { position: relative; z-index: 2; display: flex; justify-content: center; margin: -6px 0; }
.layers .arrow span {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--brand);
}

.layers .bottom {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem 0.8rem 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.layers .bottom em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
}

/* ── step list ── */
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.4rem; }

@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2rem; } }

.steps li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0 0.85rem; }

.steps .num {
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.steps p { margin: 0; font-size: 0.95rem; }

/* ── generic cards ── */
.cards { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 40rem) { .cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.3rem 1.4rem;
}

.card p { margin: 0; font-size: 0.95rem; }
.card p + p { margin-top: 0.6rem; }

/* ── never-touch list ── */
.never { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 0.75rem; }
.never li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--ink-muted); max-width: 60ch; }
.never li svg { width: 18px; height: 18px; flex: none; margin-top: 0.28rem; color: var(--brand); }

/* ── install ── */
.platform { display: none; }
.platform.show { display: block; }

.ios-steps { list-style: none; counter-reset: s; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0.8rem; }
.ios-steps li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0 0.75rem; align-items: start; color: var(--ink-muted); }
.ios-steps li::before {
  counter-increment: s;
  content: counter(s);
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  background: var(--sunken);
  color: var(--ink);
  display: grid; place-items: center;
  font-size: 0.74rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── footer ── */
footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3.5rem; }
footer .inner { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: space-between; align-items: baseline; }
footer nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: 0.9rem; }
footer a { color: var(--ink-muted); text-decoration: none; }
footer a:hover { color: var(--ink); }
footer .made { font-size: 0.9rem; color: var(--ink-faint); margin: 0; }

/* ── legal pages ── */
.doc { padding: clamp(2.5rem, 7vw, 4rem) 0 4rem; }
.doc h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
.doc h2 { font-size: 1.22rem; margin-top: 2.5rem; }
.doc h2:first-of-type { margin-top: 2rem; }
.doc ul { color: var(--ink-muted); max-width: 60ch; padding-left: 1.15rem; }
.doc li { margin-bottom: 0.45rem; }
.doc li::marker { color: var(--ink-faint); }
.doc .updated { font-size: 0.86rem; color: var(--ink-faint); }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.94rem; margin-bottom: 1rem; }
.doc th, .doc td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-muted); }
.doc th { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.doc td:first-child { color: var(--ink); font-weight: 560; }
.table-scroll { overflow-x: auto; }

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