/* ============================================================
   mcp.horizenitservices.com — onboarding
   Brand system lifted directly from horizenitservices.com
   ("eigenjoey" converged): Archivo / Fraunces / JetBrains Mono,
   near-black canvas, warm-gold synth, the horizon-sun mark.
   ============================================================ */
:root {
  --void: #020204; --deep: #060610; --mid: #0a0a14; --center: #10101c;
  --bone: #ddd0b4; --bone-faint: #a89d88; --bone-ghost: #6a6050;
  --synth: #f0c868; --synth-bright: #fad580; --blue: #4a8fef; --cyan: #68dce6; --ember: #d08a48;
  --green: #5dde9b; --pink: #ff9ec4; --violet: #8b5cf6;
  --hair: rgba(232,184,88,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--void);
  color: var(--bone);
  font-family: 'Archivo', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ---- SURFACE LAYERS (fixed, behind everything) ---- */
.surface { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.grain { position: absolute; inset: 0; opacity: .03; background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); background-size: 128px; }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 30%, rgba(2,2,4,.7) 100%); }
#lattice { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .6; }
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.particle { position: absolute; border-radius: 50%; animation: floatUp var(--dur) linear var(--delay) infinite; }
@keyframes floatUp { 0%{transform:translateY(0) scale(.7);opacity:0} 12%{opacity:.7} 88%{opacity:.7} 100%{transform:translateY(-100vh) scale(.5);opacity:0} }

.page { position: relative; z-index: 2; }

/* ============================================================
   MASTHEAD (shared with hzn.com)
   ============================================================ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  padding: 22px 6vw 18px; display: flex; justify-content: space-between; align-items: center;
  max-width: 1440px; margin: 0 auto; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(to bottom, rgba(2,2,4,.85), rgba(2,2,4,0));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.masthead .wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.masthead .name { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 15px; letter-spacing: -.01em; color: var(--bone); }
.masthead .name span { color: var(--synth); }
.masthead .nav { display: flex; align-items: center; gap: 24px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.masthead .nav a { color: var(--bone-ghost); text-decoration: none; transition: color 160ms; }
.masthead .nav a:hover { color: var(--synth); }
.masthead .nav a.active { color: var(--bone); }
.mark-orb { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle,#ffe6a0,#e8b858 40%,rgba(232,184,88,.15) 70%,transparent); box-shadow: 0 0 8px rgba(232,184,88,.4),0 0 20px rgba(232,184,88,.1); animation: heartbeat 4s ease-in-out infinite; }
@keyframes heartbeat { 0%,100%{transform:scale(1)} 14%{transform:scale(1.05)} 28%{transform:scale(1)} 42%{transform:scale(1.03)} }

/* ============================================================
   SHARED COMPONENTS (shared with hzn.com)
   ============================================================ */
.eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--synth);
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 24px; opacity: .8;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--synth); box-shadow: 0 0 10px var(--synth); animation: breathe 4s ease-in-out infinite; flex-shrink: 0; }
.eyebrow.center { justify-content: center; }
@keyframes breathe { 0%,100%{transform:scale(1);opacity:.9} 50%{transform:scale(1.04);opacity:1} }

h1, h2, h3 { font-family: 'Archivo', sans-serif; letter-spacing: -.02em; color: var(--bone); }
.flourish { color: var(--synth-bright); }

p.body { font-family: 'Archivo', sans-serif; font-weight: 400; font-size: 16px; line-height: 1.7; color: var(--bone-faint); max-width: 58ch; margin-bottom: 1.1em; }
p.lede { font-family: 'Fraunces', serif; font-weight: 300; font-style: italic; font-variation-settings: "opsz" 36; font-size: clamp(16px, 1.8vw, 21px); line-height: 1.6; color: var(--bone-faint); max-width: 46ch; }

/* glass panel — premium tier */
.glass {
  position: relative; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)), rgba(255,255,255,.015);
  box-shadow: 0 34px 110px rgba(0,0,0,.4), 0 10px 34px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.glass::after {
  content: ''; position: absolute; inset: 0; border-radius: 18px; pointer-events: none; z-index: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.06) 0%, transparent 40%, transparent 60%, rgba(78,201,212,.03) 85%, rgba(255,158,196,.02) 100%);
}
.glass.warm {
  background: radial-gradient(ellipse 130% 100% at 50% 0%, rgba(232,184,88,.1), transparent 60%), linear-gradient(180deg, rgba(255,221,138,.05), rgba(255,221,138,.015)), rgba(255,255,255,.01);
  box-shadow: 0 34px 110px rgba(0,0,0,.35), 0 10px 34px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,236,190,.1), inset 0 0 0 1px rgba(232,184,88,.12);
}
.glass.warm::after {
  background: linear-gradient(135deg, rgba(255,236,190,.08) 0%, transparent 40%, transparent 60%, rgba(232,184,88,.04) 100%);
}
.glass > * { position: relative; z-index: 1; }

/* buttons — shared with hzn.com */
.btn-primary {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; padding: 14px 28px; border-radius: 999px; border: none; cursor: pointer;
  text-decoration: none; color: var(--void);
  background: linear-gradient(135deg, var(--synth-bright), var(--synth));
  box-shadow: 0 0 0 1px rgba(232,184,88,.3), 0 12px 36px -10px rgba(232,184,88,.6);
  transition: transform 160ms, box-shadow 160ms;
  display: inline-flex; align-items: center; gap: 12px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(232,184,88,.2), 0 0 0 1px rgba(232,184,88,.5), 0 18px 44px -10px rgba(232,184,88,.75); }
.btn-ghost {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; padding: 13px 26px; border-radius: 999px; border: none; cursor: pointer;
  text-decoration: none; color: var(--bone-faint); background: rgba(255,255,255,.02);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: color 160ms, box-shadow 160ms;
  display: inline-flex; align-items: center; gap: 10px;
}
.btn-ghost:hover { color: var(--synth-bright); box-shadow: inset 0 0 0 1px rgba(232,184,88,.4); }
.btn-primary:disabled, .btn-ghost:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.cta-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }

/* sign-in (provider) buttons — full-width, brand-mark led */
.signin-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.btn-signin {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%; padding: 16px 24px; border-radius: 14px; cursor: pointer;
  font-family: 'Archivo', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  color: var(--bone); text-decoration: none; border: none;
  background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
  transition: transform 140ms, box-shadow 160ms, background 160ms;
}
.btn-signin:hover { transform: translateY(-2px); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(232,184,88,.35), 0 14px 34px -18px rgba(232,184,88,.5); }
.btn-signin:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-signin .provider-mark { width: 20px; height: 20px; flex-shrink: 0; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 44px 6vw 40px; max-width: 1060px; margin: 0 auto; position: relative;
  text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero::before { content:""; position:absolute; top:26%; left:50%; width:600px; height:400px; background:radial-gradient(ellipse,rgba(232,184,88,.06),transparent 70%); transform:translate(-50%,-50%); pointer-events:none; z-index:0; border-radius:50%; }
.hero-mark { width: clamp(72px, 10vw, 104px); height: clamp(72px, 10vw, 104px); margin: 0 auto 30px; position: relative; animation: bloomIn 1.5s cubic-bezier(.16,1,.3,1) both; }
.hero-mark-core { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle,#ffe6a0,#e8b858 35%,rgba(232,184,88,.2) 65%,transparent); box-shadow: 0 0 60px rgba(232,184,88,.4),0 0 120px rgba(232,184,88,.15),0 0 240px rgba(232,184,88,.05); animation: heartbeat 4s ease-in-out infinite; }
.hero-mark-ring { position: absolute; inset: -16px; border-radius: 50%; border: 1px solid rgba(232,184,88,.08); animation: breathe 8s ease-in-out infinite; }
.hero-mark-ring2 { position: absolute; inset: -36px; border-radius: 50%; border: 1px dashed rgba(255,158,196,.06); animation: slowRotate 40s linear infinite; }
@keyframes slowRotate { from{transform:rotate(0)} to{transform:rotate(360deg)} }

.hero h1 {
  font-weight: 900; font-size: clamp(32px, 5.2vw, 62px); line-height: 1.03;
  letter-spacing: -.03em; max-width: 18ch; margin: 0 auto 22px; color: #f2e9d6;
  text-shadow: 0 2px 22px rgba(2,2,4,.85), 0 0 64px rgba(2,2,4,.55);
}
.hero .deck {
  font-family: 'Fraunces', serif; font-weight: 300; font-style: italic; font-variation-settings: "opsz" 36;
  font-size: clamp(16px, 1.8vw, 21px); line-height: 1.65; color: #c9bea7; max-width: 50ch; margin: 0 auto;
  text-shadow: 0 1px 14px rgba(2,2,4,.8);
}
.bloom { opacity: 0; animation: bloomIn 1.1s cubic-bezier(.2,.7,.2,1) forwards; }
.eyebrow.bloom { animation-delay: .15s; }
h1.bloom { animation-delay: .3s; }
.deck.bloom { animation-delay: .5s; }
@keyframes bloomIn { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }

/* ============================================================
   ONBOARDING FLOW (cards)
   ============================================================ */
.flow { max-width: 640px; margin: 0 auto; padding: 8px 6vw 40px; position: relative; }
.card { padding: 34px 34px; border-radius: 20px; margin: 20px 0; }
.card h2 { font-weight: 800; font-size: clamp(21px, 2.6vw, 26px); line-height: 1.12; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.card p { font-family: 'Archivo', sans-serif; font-size: 15px; line-height: 1.65; color: var(--bone-faint); margin-bottom: 4px; }
.card p + p { margin-top: 10px; }

.step-badge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--synth-bright), var(--synth)); color: var(--void);
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; }

.reassure { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--bone-ghost); font-family: 'JetBrains Mono', monospace; letter-spacing: .02em; line-height: 1.55; }
.reassure svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; stroke: var(--green); }

/* identity chip */
.who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.who .avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: var(--void); background: radial-gradient(circle,#ffe6a0,#e8b858 60%,rgba(232,184,88,.2)); }
.who .who-name { font-weight: 700; font-size: 16px; color: var(--bone); }
.who .who-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--bone-ghost); letter-spacing: .04em; }
.pill { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; }
.pill.member { color: var(--cyan); border: 1px solid rgba(104,220,230,.3); }
.pill.user { color: var(--cyan); border: 1px solid rgba(104,220,230,.3); }
.pill.admin { color: var(--synth); border: 1px solid rgba(232,184,88,.35); box-shadow: 0 0 14px rgba(232,184,88,.1); }
.pill.superadmin { color: var(--synth); border: 1px solid rgba(232,184,88,.55); box-shadow: 0 0 18px rgba(232,184,88,.2); font-weight: 600; }

/* copy-out block (the connector string / secure-access details) */
.copybox { position: relative; margin: 16px 0 6px; }
.copybox pre {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.6; color: var(--bone);
  background: rgba(2,2,4,.6); border-radius: 12px; padding: 18px 18px; overflow-x: auto; white-space: pre;
  box-shadow: inset 0 0 0 1px rgba(232,184,88,.12);
}
.copybtn {
  position: absolute; top: 10px; right: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--void); background: linear-gradient(135deg, var(--synth-bright), var(--synth));
  border: none; border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: transform 140ms, opacity 140ms;
}
.copybtn:hover { transform: translateY(-1px); }
.copybtn.copied { background: linear-gradient(135deg, #a8f0cf, var(--green)); }

.howto { list-style: none; counter-reset: h; margin: 10px 0 0; padding: 0; }
.howto li { counter-increment: h; position: relative; padding: 8px 0 8px 34px; font-size: 14px; color: var(--bone-faint); line-height: 1.5; }
.howto li::before { content: counter(h); position: absolute; left: 0; top: 7px; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  color: var(--synth); background: rgba(232,184,88,.08); box-shadow: inset 0 0 0 1px rgba(232,184,88,.2); }

.msg { font-size: 13.5px; margin-top: 14px; line-height: 1.55; font-family: 'JetBrains Mono', monospace; letter-spacing: .01em; }
.msg.warn { color: var(--synth); }
.msg.ok { color: var(--green); }
.msg.err { color: var(--pink); }
.notice { margin-top: 14px; padding: 12px 16px; border-radius: 12px; font-size: 13px; line-height: 1.55;
  color: var(--bone-faint); background: rgba(232,184,88,.05); box-shadow: inset 0 0 0 1px rgba(232,184,88,.14); }
.notice strong { color: var(--synth-bright); font-weight: 700; }

/* M365 provider squares accent */
.ms-squares { display: inline-block; vertical-align: middle; }

/* ============================================================
   FOOTER (shared with hzn.com)
   ============================================================ */
footer { padding: 36px 6vw 48px; display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--bone-ghost); max-width: 1000px; margin: 40px auto 0; flex-wrap: wrap; gap: 14px; position: relative; }
footer::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(700px, 90vw); height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(232,184,88,.4) 30%, rgba(78,201,212,.2) 50%, rgba(232,184,88,.4) 70%, transparent 95%);
  box-shadow: 0 0 30px rgba(232,184,88,.12), 0 0 60px rgba(232,184,88,.05); }
footer a { color: var(--bone-ghost); text-decoration: none; transition: color 150ms; }
footer a:hover { color: var(--synth); }
.footer-signals { display: flex; gap: 8px; align-items: center; }
.f-dot { width: 5px; height: 5px; border-radius: 50%; animation: breathe 4s ease-in-out infinite; box-shadow: 0 0 8px currentColor; }

::selection { background: var(--synth); color: var(--void); }

/* reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.rv.visible { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .1s; } .rv-d2 { transition-delay: .2s; } .rv-d3 { transition-delay: .3s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 680px) {
  .masthead { padding: 18px 6vw 14px; }
  .masthead .nav { gap: 14px; font-size: 9px; }
  .hero { padding: 30px 6vw 26px; }
  .card { padding: 26px 22px; }
  footer { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-mark, .hero-mark-core, .mark-orb { animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .bloom { opacity: 1; animation: none; }
  #lattice, .particles { display: none; }
}

/* ── Return-leg waiting state (the exchange can take up to a minute; the page must look alive) ── */
.msg.wait { color: var(--synth, #e8b858); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg.wait .clock { opacity: .6; font-variant-numeric: tabular-nums; margin-left: auto; }
.spinner { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.18); border-top-color: currentColor;
  animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
