/* VeilMX — one system for the marketing splash and the portal.
 *
 * Identity: mail infrastructure itself. Monospace is the voice of the
 * artifact (addresses, records, headers); the airmail stripe is the one
 * decorative signature, used at the page's top edge and one divider.
 * Everything else stays quiet: paper, ink, one indigo. */

:root {
  --bg: #f6f5f1;
  --fg: #21242e;
  --muted: #686a72;
  --card: #ffffff;
  --line: #e2e0d8;
  --accent: #3d4ec9;
  --accent-fg: #ffffff;
  --ink: #21242e;        /* honesty strip surface */
  --ink-fg: #f0efe9;
  --ok: #2a7a4d;
  --bad: #b23c2c;
  --warn: #91650a;
  --am-red: #bf4535;     /* airmail pair */
  --am-blue: #2f549e;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161b;
    --fg: #e9e8e2;
    --muted: #999a94;
    --card: #1d1f26;
    --line: #33353e;
    --accent: #93a2f4;
    --accent-fg: #12131a;
    --ink: #0e0f13;
    --ink-fg: #e9e8e2;
    --ok: #63c08c;
    --bad: #e0755f;
    --warn: #d9a83f;
    --am-red: #cf6558;
    --am-blue: #6d8ed6;
  }
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.55 var(--font-body);
  background: var(--bg);
  color: var(--fg);
}
/* The airmail edge: the page's postal signature. */
body::before {
  content: "";
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 10;
  background: repeating-linear-gradient(135deg,
    var(--am-red) 0 12px, var(--bg) 12px 17px,
    var(--am-blue) 17px 29px, var(--bg) 29px 34px);
}

main { max-width: 920px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

h1 { font-size: 1.4rem; letter-spacing: -0.015em; margin: 1.1rem 0; }
h2 { font-size: 1.02rem; margin: 1.4rem 0 .5rem; }
h3 { margin-top: 0; }
a { color: var(--accent); }

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

/* ---------- wordmark + app chrome ---------- */

.wordmark { font-weight: 800; letter-spacing: -0.01em; font-size: 1.05rem; }
.wordmark .mx { font-family: var(--font-mono); font-weight: 600; color: var(--accent); letter-spacing: .04em; }

#topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .8rem 1.25rem; margin-top: 4px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
#topbar nav { display: flex; gap: .25rem; flex: 1; }
#topbar nav a {
  color: var(--fg); text-decoration: none; opacity: .75;
  padding: .3rem .65rem; border-radius: 7px; font-size: .92rem;
}
#topbar nav a:hover { opacity: 1; background: color-mix(in srgb, var(--accent) 9%, transparent); }

/* ---------- shared components (portal + splash) ---------- */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.1rem 1.3rem; margin: .8rem 0;
}
.muted { color: var(--muted); }
.error { color: var(--bad); }
.notice { color: var(--warn); }
.mono { font-family: var(--font-mono); font-size: .86em; word-break: break-all; }

table { width: 100%; border-collapse: collapse; margin: .5rem 0; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
th {
  font-family: var(--font-mono); font-weight: 500; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}

input, select {
  font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: .5rem .65rem; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
label { display: block; margin: .65rem 0 .2rem; font-size: .84rem; color: var(--muted); }

button, .btn {
  font: inherit; font-weight: 500; cursor: pointer;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem 1rem;
}
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary {
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.linklike { border: none; background: none; color: var(--muted); padding: .2rem; font-weight: 400; }
button.linklike:hover { color: var(--fg); }
button:disabled { opacity: .5; cursor: default; }

.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.grow { flex: 1; }

.chip {
  display: inline-block; padding: .12rem .6rem; border-radius: 99px;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--line); color: var(--muted);
  background: color-mix(in srgb, var(--muted) 8%, transparent);
}
.chip.ok   { color: var(--ok);   border-color: transparent; background: color-mix(in srgb, var(--ok) 13%, transparent); }
.chip.bad  { color: var(--bad);  border-color: transparent; background: color-mix(in srgb, var(--bad) 13%, transparent); }
.chip.warn { color: var(--warn); border-color: transparent; background: color-mix(in srgb, var(--warn) 15%, transparent); }

.auth-box { max-width: 410px; margin: 10vh auto 0; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; margin: 1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

dialog {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--fg);
  max-width: 380px; padding: 1.3rem 1.5rem;
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }

.copy { cursor: pointer; opacity: .55; }
.copy:hover { opacity: 1; }

/* ---------- splash ---------- */

.splash { --pad: 1.25rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em; color: var(--accent);
  margin: 0 0 .8rem;
}

.s-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 0 .4rem;
}

.hero {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  gap: 2.5rem; align-items: center; padding: 3.2rem 0 3.6rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.9rem); font-weight: 800;
  line-height: 1.06; letter-spacing: -0.025em; margin: 0 0 1rem;
}
.hero .lede { font-size: 1.06rem; color: var(--muted); max-width: 34em; margin: 0; }
.hero .row { margin-top: 1.4rem; }

/* The veil card: a message header with the mask in action. */
.veil-card {
  margin: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); overflow: hidden;
  box-shadow: 0 12px 32px -18px rgba(20, 24, 48, .35);
}
.vc-bar {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em;
  color: var(--muted); padding: .55rem .9rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--line) 30%, var(--card));
}
.vc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.vc-lines { padding: 1rem 1.1rem 1.2rem; font-family: var(--font-mono); font-size: .84rem; line-height: 2; }
.vc-k { display: inline-block; width: 3.2em; color: var(--muted); }
.vc-alias { color: var(--accent); font-weight: 600; }
.vc-sep {
  color: var(--muted); font-size: .74rem; letter-spacing: .08em;
  display: flex; align-items: center; gap: .6rem; margin: .2rem 0;
}
.vc-sep::before { content: "└"; }
.vc-veiled {
  color: transparent; background: var(--muted); opacity: .5;
  border-radius: 3px; user-select: none;
}
.vc-note { color: var(--muted); font-size: .76rem; }

.s-section { padding: 2.6rem 0; border-top: 1px solid var(--line); }
.s-section h2 { font-size: 1.45rem; font-weight: 750; letter-spacing: -0.02em; margin: 0 0 1.4rem; }

/* Onboarding is a real sequence — the numbers carry information. */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.steps li {
  counter-increment: step; display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr); gap: 1rem; align-items: baseline;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 1rem; font-weight: 600;
  color: var(--accent); border-bottom: 2px solid var(--accent);
  text-align: center; padding-bottom: .15rem;
}
.steps h3 { font-size: 1rem; margin: 0 0 .25rem; }
.steps p { margin: 0; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.grid .card { margin: 0; }
.grid h3 { font-size: .95rem; margin: 0 0 .35rem; }
.grid p { margin: 0; font-size: .88rem; color: var(--muted); }

/* Honesty strip: ink-on-ink, set apart from every other section. */
.honesty {
  background: var(--ink); color: var(--ink-fg);
  border-radius: 14px; padding: 1.8rem 1.9rem; margin: 2.6rem 0;
}
.honesty .eyebrow { color: color-mix(in srgb, var(--ink-fg) 55%, transparent); }
.honesty p { margin: 0; max-width: 46em; font-size: 1rem; }
.honesty strong { color: var(--ink-fg); }

.s-footer {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline;
  justify-content: space-between; padding: 1.6rem 0 .5rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .84rem;
}
.s-footer .mono { font-size: .8rem; }
/* One reprise of the signature, then quiet. */
.s-footer::before {
  content: ""; display: block; width: 100%; height: 4px; margin-bottom: 1rem;
  background: repeating-linear-gradient(135deg,
    var(--am-red) 0 12px, transparent 12px 17px,
    var(--am-blue) 17px 29px, transparent 29px 34px);
  opacity: .8;
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding: 2.2rem 0 2.6rem; }
  .grid { grid-template-columns: 1fr; }
  #topbar { gap: .75rem; padding: .8rem 1rem; overflow-x: auto; }
}

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