/* PairFlow — dark trading-desk theme (matches the design canvas) */
:root{
  --bg:#0B0F14; --bar:#0E131A; --panel:#121821; --panel2:#18202B; --line:#243042; --line2:#1B2330;
  --text:#E7ECF2; --muted:#A3AEBD; --dim:#7D8898;
  --ce:#5AA9FF; --pe:#FF9F43; --up:#34D399; --down:#F87171; --writer:#F5C451; --surge:#B794F6;
  --radius:14px;
  --m-absorb:#199e70; --m-div:#c98500; --m-surge:#9085e9;   /* chart markers, validated for colour-blind separation */
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  --display:'Space Grotesk',Inter,system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 Inter,system-ui,-apple-system,Segoe UI,sans-serif}
a{color:#9CC8FF}a:hover{color:#CFE4FF}
h1,h2,h3{font-family:var(--display);margin:0;letter-spacing:-.01em}
.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.lbl{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:600}
.muted{color:var(--muted)} .small{font-size:12px}
.up{color:var(--up)} .down{color:var(--down)} .ce{color:var(--ce)} .pe{color:var(--pe)}
.sr{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* header */
.top{display:flex;flex-wrap:wrap;align-items:center;gap:16px 24px;padding:12px 24px;border-bottom:1px solid var(--line);background:var(--bar)}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--text);font-family:var(--display);font-weight:700;font-size:20px}
.nav{display:flex;flex-wrap:wrap;gap:4px}
.nav a{padding:8px 14px;border-radius:8px;color:var(--muted);text-decoration:none}
.nav a.on{background:var(--panel2);color:var(--text);font-weight:600}
.spacer{flex:1 1 40px}
.badge{padding:5px 10px;border-radius:999px;background:#1C2A3F;color:#9CC8FF;font-size:12px;font-weight:600;white-space:nowrap}
.badge.warn{background:#3B3317;color:var(--writer)}

/* layout */
.wrap{max-width:1376px;margin:0 auto;padding:24px;display:flex;flex-direction:column;gap:20px}
.grid3{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:16px}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,560px),1fr));gap:16px}
#alerts{max-height:250px;overflow-y:auto}
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:20px;display:flex;flex-direction:column;gap:12px;min-width:0}
.card h2{font-size:16px;font-weight:600}
.row{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.between{justify-content:space-between}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile{background:var(--panel2);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:4px;min-width:0}
.tile .v{font-family:var(--mono);font-size:22px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.big{font-family:var(--mono);font-size:44px;font-weight:600;line-height:1.1}
.meter{flex:1;height:8px;background:var(--line2);border-radius:4px;overflow:hidden}
.meter>div{height:8px;border-radius:4px}
.strip{display:flex;height:18px;border-radius:5px;overflow:hidden;gap:1px;background:var(--line2)}
.chart{position:relative;height:240px}
.pf{margin:0;display:flex;flex-direction:column;gap:6px;border-top:3px solid var(--line);padding-top:10px;min-width:0}
.pf h3{font-size:15px;font-weight:600}
.chart.price{height:260px}
.chart.flow{height:140px}
.chk{display:inline-flex;align-items:center;gap:6px;cursor:pointer;color:var(--muted);min-height:32px}
.chk input{min-height:0;width:16px;height:16px;margin:0;accent-color:#9CC8FF}
.chk .sw{width:10px;height:10px;border-radius:2px;display:inline-block}

/* scorecard */
.bullet{position:relative;height:10px;width:220px;max-width:100%;background:var(--line2);border-radius:5px}
.bullet .band{position:absolute;top:0;bottom:0;background:#2A3546;border-radius:5px}
.bullet .fill{position:absolute;left:0;top:2px;bottom:2px;border-radius:4px;background:#7D8898}
.bullet .fill.better{background:var(--up)} .bullet .fill.worse{background:var(--down)}
.bullet .tick{position:absolute;top:-4px;bottom:-4px;width:2px;margin-left:-1px;background:var(--text);border-radius:1px}
.vchip{display:inline-block;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap;background:var(--panel2);color:var(--muted)}
.vchip.better{background:#123527;color:var(--up)} .vchip.worse{background:#3A1C1F;color:var(--down)}

/* controls */
button,.btn{font:inherit;cursor:pointer;border-radius:10px;min-height:44px;padding:0 16px;border:1px solid var(--line);background:var(--panel);color:var(--text);display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none}
button.primary,.btn.primary{background:var(--ce);border-color:var(--ce);color:#08131F;font-weight:700}
button.ghost{background:transparent}
button:disabled{opacity:.5;cursor:not-allowed}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #9CC8FF;outline-offset:2px}
input,select,textarea{font:inherit;color:var(--text);background:var(--bar);border:1px solid var(--line);border-radius:10px;min-height:44px;padding:0 12px}
label.field{display:flex;flex-direction:column;gap:6px}
.seg{display:flex;gap:4px;padding:4px;border-radius:10px;background:var(--panel);border:1px solid var(--line)}
.seg button{min-height:36px;border:0;background:transparent;color:var(--muted);padding:0 12px}
.seg button[aria-pressed=true]{background:var(--line);color:var(--text);font-weight:600}

/* tables */
.tablebox{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
th{color:var(--muted);font-weight:600;text-align:right;padding:8px;white-space:nowrap}
td{padding:8px;text-align:right;border-bottom:1px solid var(--line2);white-space:nowrap}
th:first-child,td:first-child{text-align:left}
tr.wz td{background:#3B3317}
tr.wz td:first-child{box-shadow:inset 3px 0 0 var(--writer)}
tr.sg td{background:#2A2140}
tr.sg td:first-child{box-shadow:inset 3px 0 0 var(--surge)}

/* alerts */
.alert{display:flex;gap:12px;align-items:flex-start;padding:10px 12px;border-radius:10px;background:var(--panel2)}
.dot{width:8px;height:8px;border-radius:50%;flex:none;margin-top:6px}

/* forms / auth */
.narrow{max-width:440px;margin:48px auto;padding:0 24px}
.error{color:var(--down);min-height:20px}
.notice{padding:12px 14px;border-radius:10px;background:#1C2A3F;color:#CFE4FF}
.notice.warn{background:#3B3317;color:#FBE7A6}

/* plans */
.plan{position:relative}
.plan.hot{border:2px solid var(--ce)}
.plan ul{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px}
.plan li::before{content:"✓";color:var(--up);margin-right:8px;font-weight:700}

footer.site{max-width:1376px;margin:0 auto;padding:16px 24px 40px;display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px;border-top:1px solid var(--line)}

@media (max-width:640px){
  .wrap{padding:16px}
  .grid2{grid-template-columns:1fr}
  .big{font-size:34px}
  .top{padding:10px 16px}
}

/* Glossary: term definitions + ⓘ link to the Metric guide */
.has-def { text-decoration: underline dotted rgba(255,255,255,.35); text-underline-offset: 3px; cursor: help; }
.defi { margin-left: 4px; font-size: .78em; vertical-align: super; line-height: 0; color: var(--ce); text-decoration: none; opacity: .75; cursor: pointer; }
.defi:hover, .defi:focus { opacity: 1; text-decoration: none; }

/* Firebase sign-in: Google button and "or" divider */
.gbtn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;font-weight:600}
.gbtn svg{flex:0 0 auto}
.gbtn:disabled{opacity:.5;cursor:not-allowed}
.or{display:flex;align-items:center;gap:12px;color:var(--dim);font-size:13px}
.or::before,.or::after{content:"";flex:1;height:1px;background:var(--line,#2A3342)}
#forgotPw{color:var(--dim)}

/* ============================================================= *
 *  UI/UX pass: hero visual, simple view, mobile nav, type scale *
 * ============================================================= */

/* Type scale (use instead of ad-hoc inline font sizes) */
.t-hero{font-size:clamp(32px,5vw,52px);line-height:1.05}
.t-h1{font-size:clamp(26px,3.4vw,38px)} .t-h2{font-size:clamp(22px,2.6vw,30px)}
.t-lead{font-size:clamp(16px,1.6vw,19px);color:var(--muted)}

/* Home hero: copy + product preview side by side */
.hero{display:grid;grid-template-columns:1.05fr .95fr;gap:44px;align-items:center;padding:40px 0 12px}
.hero-copy{display:flex;flex-direction:column;gap:18px;align-items:flex-start}
.hero-visual{min-width:0}
@media (max-width:880px){
  .hero{grid-template-columns:1fr;gap:28px;text-align:center}
  .hero-copy{align-items:center}
}

/* Fake "app window" preview (swap for a real screenshot <img> any time) */
.appwin{background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;
  box-shadow:0 24px 60px -24px rgba(0,0,0,.6);transform:perspective(1400px) rotateY(-4deg) rotateX(3deg)}
@media (max-width:880px){.appwin{transform:none}}
.appwin .winbar{display:flex;align-items:center;gap:7px;padding:11px 14px;border-bottom:1px solid var(--line);background:var(--bar)}
.appwin .winbar i{width:11px;height:11px;border-radius:50%;background:#2A3546;display:inline-block}
.appwin .winbar i:nth-child(1){background:#F87171}.appwin .winbar i:nth-child(2){background:#F5C451}.appwin .winbar i:nth-child(3){background:#34D399}
.appwin .winbar span{margin-left:8px;color:var(--dim);font-size:12px}
.appwin-body{padding:16px;display:flex;flex-direction:column;gap:12px;text-align:left}
.mini-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.mini{background:var(--panel2);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:3px}
.mini .k{font-size:10px;letter-spacing:.07em;text-transform:uppercase;color:var(--dim)}
.mini .v{font-family:var(--mono);font-size:20px;font-weight:600}
.mini-chart{height:120px;background:var(--panel2);border-radius:10px;padding:8px}
.mini-chart svg{width:100%;height:100%;display:block}

/* Trust strip + how-it-works */
.trust{display:flex;flex-wrap:wrap;justify-content:center;gap:10px 28px;color:var(--muted);font-size:13px}
.trust span{display:inline-flex;align-items:center;gap:7px}
.trust span::before{content:"✓";color:var(--up);font-weight:700}
.steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;counter-reset:step}
.step{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:20px;display:flex;flex-direction:column;gap:8px}
.step::before{counter-increment:step;content:counter(step);width:34px;height:34px;border-radius:50%;
  background:var(--panel2);color:var(--ce);font-family:var(--display);font-weight:700;display:grid;place-items:center}

/* Live screen: Simple vs Full view (hide advanced blocks in simple mode) */
body.view-simple .adv{display:none !important}
#viewToggle[aria-pressed=true]{border-color:var(--ce);color:#9CC8FF}

/* Plans: price suffix, savings pill, comparison table */
.price-suffix{font-family:Inter,sans-serif;font-size:15px;color:var(--muted);font-weight:500;margin-left:4px}
.save-pill{padding:4px 12px;border-radius:999px;background:#123527;color:var(--up);font-size:13px;font-weight:600}
.cmp{width:100%;border-collapse:collapse;font-size:14px}
.cmp th,.cmp td{padding:12px 14px;border-bottom:1px solid var(--line2);text-align:center}
.cmp th:first-child,.cmp td:first-child{text-align:left;color:var(--text)}
.cmp thead th{font-family:var(--display);font-size:16px;color:var(--text)}
.cmp td.no{color:var(--dim)} .cmp td.yes{color:var(--up);font-weight:700}
.cmp .hotcol{background:rgba(90,169,255,.06)}

/* Password show/hide toggle */
.pw-wrap{position:relative;display:flex;flex-direction:column;gap:6px}
.pw-wrap .pw-eye{position:absolute;right:8px;bottom:0;height:44px;width:40px;border:0;background:transparent;
  color:var(--dim);display:grid;place-items:center;cursor:pointer;min-height:0}
.pw-wrap .pw-eye:hover{color:var(--text)}
.pw-wrap input{padding-right:44px}

/* Mobile navigation: collapse the header nav behind a menu button */
.navtoggle{display:none;min-height:40px;padding:0 12px}
@media (max-width:760px){
  .navtoggle{display:inline-flex}
  .nav{display:none;flex-basis:100%;flex-direction:column;gap:2px;order:5}
  .top.open .nav{display:flex}
  .nav a{padding:12px 14px}
}

/* Smaller charts on phones */
@media (max-width:640px){
  .chart{height:200px}
  .chart.price{height:210px}
  .chart.flow{height:120px}
  .mini-cards{grid-template-columns:repeat(3,1fr)}
}

/* ============================================================= *
 *  Premium motion pass  (all gated behind prefers-reduced-motion) *
 * ============================================================= */
.hero { position: relative; isolation: isolate; }

/* Buttons: hover lift + a one-off sheen sweep on primary */
.btn, button { transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .15s ease; }
.btn:hover, button.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -12px rgba(0,0,0,.6); }
.btn:active, button.primary:active { transform: translateY(0); }
.btn.primary, button.primary { position: relative; overflow: hidden; }
.btn.primary::after, button.primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.4) 50%, transparent 65%);
  transform: translateX(-130%); }
.btn.primary:hover::after, button.primary:hover::after { animation: pf-sheen .8s ease; }
@keyframes pf-sheen { to { transform: translateX(130%); } }

/* Marketing card hover lift (home + plans only; the live screen stays still) */
body[data-page="/"] .grid3 .card, .plan, .step { transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease; }
body[data-page="/"] .grid3 .card:hover, .plan:hover, .step:hover {
  transform: translateY(-3px); box-shadow: 0 16px 40px -22px rgba(0,0,0,.7); border-color: #30405a; }

/* Scroll reveal — inert until JS adds .reveal-on to <html> (so no-JS shows everything) */
html.reveal-on [data-reveal] { opacity: 0; transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.2,.6,.2,1), transform .6s cubic-bezier(.2,.6,.2,1); }
html.reveal-on [data-reveal].in { opacity: 1; transform: none; }

/* Aurora glow behind the hero */
.hero::before {
  content: ""; position: absolute; left: 0; right: 0; top: -60px; height: 460px; z-index: -1; pointer-events: none;
  background: radial-gradient(45% 60% at 22% 35%, rgba(90,169,255,.18), transparent 70%),
              radial-gradient(42% 55% at 82% 20%, rgba(255,159,67,.14), transparent 72%);
  animation: pf-aurora 20s ease-in-out infinite alternate; }
@keyframes pf-aurora { to { transform: translate3d(3%, 1.5%, 0) scale(1.08); opacity: .85; } }

/* Hero app-window: slow float + sparklines that draw themselves in */
.appwin { will-change: transform; animation: pf-float 7s ease-in-out infinite alternate; }
@keyframes pf-float {
  from { transform: perspective(1400px) rotateY(-4deg) rotateX(3deg) translateY(0); }
  to   { transform: perspective(1400px) rotateY(-4deg) rotateX(3deg) translateY(-9px); } }
.mini-chart polyline { stroke-dasharray: 650; stroke-dashoffset: 650;
  animation: pf-draw 1.7s cubic-bezier(.3,.7,.2,1) .2s forwards; }
.mini-chart polyline:nth-of-type(2) { animation-delay: .45s; }
@keyframes pf-draw { to { stroke-dashoffset: 0; } }

/* Live status dot: a calm pulse only while connected live */
#liveDot.live { animation: pf-pulse 2.2s ease-in-out infinite; }
@keyframes pf-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  50%     { box-shadow: 0 0 0 7px rgba(52,211,153,0); } }

@media (max-width: 880px) { .appwin { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  .btn:hover, button.primary:hover,
  body[data-page="/"] .grid3 .card:hover, .plan:hover, .step:hover { transform: none; box-shadow: none; }
  .btn.primary:hover::after, button.primary:hover::after { animation: none; }
  html.reveal-on [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
  .hero::before, .appwin, #liveDot.live { animation: none; }
  .mini-chart polyline { stroke-dashoffset: 0; animation: none; }
}
