/* Mobile splash intro for the home page (_intro.html, intro.js): four beats. Each one eases in, holds, then flies out through
   the camera as the next rises in underneath; the last is the logo, which the camera flies through while the page fades up.
   Nothing here shows unless <html> has .intro-on. One easing everywhere, no overshoot: calm, not busy. */
#intro{display:none}
html.intro-on,html.intro-on body{overflow:hidden}
html.intro-on header.top,html.intro-on main,html.intro-on footer{opacity:0;transform:translateY(28px) scale(.985)}
html.intro-done header.top,html.intro-done main,html.intro-done footer{opacity:1;transform:none;
  transition:opacity 1.1s cubic-bezier(.2,.7,.2,1) .2s,transform 1.1s cubic-bezier(.2,.7,.2,1) .2s}
html.intro-on #intro{display:block}
#intro{--ease:cubic-bezier(.2,.7,.2,1);position:fixed;inset:0;z-index:100;background:var(--bg);color:var(--text);overflow:hidden;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;height:100vh;height:100dvh}
#intro.through{animation:intro-fade 1s ease .3s forwards}
@keyframes intro-fade{to{opacity:0;visibility:hidden}}
#intro h2{font-size:clamp(24px,6.8vw,33px);font-weight:800;letter-spacing:-.02em;line-height:1.14;margin:20px 0 8px}
#intro p{margin:0;color:var(--muted);font-size:14.5px;line-height:1.5;max-width:330px}
#intro p b{color:var(--text);font-weight:800}

/* Background: the honeycomb, brighter than the page's, and a gold glow that breathes. */
.intro-bg{position:absolute;inset:0;pointer-events:none}
.intro-hive{position:absolute;inset:-10%;opacity:.09;animation:intro-drift 40s linear infinite;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0 56 16v32L28 64 0 48V16zM28 64v33' fill='none' stroke='%23ffbe1a' stroke-width='1.5'/%3E%3C/svg%3E")}
@keyframes intro-drift{to{background-position:0 194px}}
.intro-glow{position:absolute;left:50%;top:50%;width:150vmax;height:150vmax;transform:translate(-50%,-50%);
  background:radial-gradient(circle,#ffbe1a2e 0%,#ffbe1a0c 26%,transparent 55%);animation:intro-breathe 4s ease-in-out infinite}
@keyframes intro-breathe{0%,100%{transform:translate(-50%,-50%) scale(.9);opacity:.8}50%{transform:translate(-50%,-50%) scale(1.08);opacity:1}}

/* Story-style progress: one segment per beat, filling over the beat's hold. */
.intro-prog{position:absolute;left:16px;right:16px;max-width:560px;margin:0 auto;top:calc(12px + env(safe-area-inset-top));display:flex;gap:5px;z-index:2}
.intro-prog i{flex:1;height:3px;border-radius:3px;background:#ffffff24;overflow:hidden;position:relative}
.intro-prog i::after{content:"";position:absolute;inset:0;background:var(--accent);transform:scaleX(0);transform-origin:left}
.intro-prog i.full::after{transform:none}
.intro-prog i.run::after{animation:intro-fill linear both}
@keyframes intro-fill{from{transform:scaleX(0)}to{transform:none}}

.intro-skip{position:absolute;left:50%;bottom:calc(22px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:3;
  font:inherit;font-size:13px;font-weight:700;letter-spacing:.3px;color:var(--muted);background:#ffffff10;border:1px solid #ffffff22;border-radius:999px;padding:9px 18px;cursor:pointer;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.intro-skip span{margin-left:2px}

/* Beats: the one leaving grows past the camera and thins out as it goes; the one arriving rises up from slightly small. */
.intro-step{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  padding:44px 24px 70px;opacity:0;visibility:hidden;will-change:transform,opacity}
.intro-step.in{visibility:visible;animation:intro-in 1.1s var(--ease) .35s both}
.intro-step.in.out,#intro.through .intro-step.in{visibility:visible;animation:intro-out 1.2s cubic-bezier(.45,0,.75,.25) both;pointer-events:none}
@keyframes intro-in{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:none}}
@keyframes intro-out{from{opacity:1;transform:none}40%{opacity:.75}to{opacity:0;transform:scale(3.4)}}
@keyframes intro-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes intro-pop{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:none}}
@keyframes intro-show{from{opacity:0}to{opacity:1}}
@keyframes intro-draw{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}

/* 1. W·A·S·P: the gold letters settle one by one, then the words slide out beside them; the badge and the venue follow. */
.iw-line{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin:0;font-size:clamp(30px,10.5vw,48px);font-weight:800;letter-spacing:-.02em;line-height:1.12}
.iw{display:flex;align-items:baseline;white-space:nowrap}
.iw b{display:inline-block;color:var(--text);opacity:0}
.iw i{display:inline-block;font-style:normal;opacity:0;clip-path:inset(0 100% 0 0)}
.in .iw b{animation:intro-letter .8s var(--ease) both,intro-gold .9s var(--ease) both}
.in .iw i{animation:intro-unfold .9s var(--ease) both}
.iw:nth-child(1) b{animation-delay:.2s,1.6s}.iw:nth-child(2) b{animation-delay:.5s,1.72s}.iw:nth-child(3) b{animation-delay:.8s,1.84s}.iw:nth-child(4) b{animation-delay:1.1s,1.96s}
@keyframes intro-gold{from{color:var(--text);text-shadow:none}50%{text-shadow:0 0 22px #ffbe1a99}to{color:var(--accent);text-shadow:0 0 10px #ffbe1a44}}
.iw:nth-child(1) i{animation-delay:1.6s}.iw:nth-child(2) i{animation-delay:1.72s}.iw:nth-child(3) i{animation-delay:1.84s}.iw:nth-child(4) i{animation-delay:1.96s}
@keyframes intro-letter{from{opacity:0;transform:translateY(14px) scale(1.12)}to{opacity:1;transform:none}}
@keyframes intro-unfold{from{opacity:0;clip-path:inset(0 100% 0 0);transform:translateX(-10px)}to{opacity:1;clip-path:inset(0 -2px 0 0);transform:none}}
.iw-tag{display:inline-block;margin-top:26px;font-size:15px;font-weight:800;letter-spacing:6px;padding:9px 18px 9px 24px;border-radius:999px;color:#120d02;background:var(--accent);
  box-shadow:0 0 28px #ffbe1a88,0 0 70px #ffbe1a44;opacity:0}
.in .iw-tag{animation:intro-tag .9s var(--ease) 2.5s both}
@keyframes intro-tag{from{opacity:0;transform:scale(.85) translateY(10px)}to{opacity:1;transform:none}}
.iw-for{display:block;margin-top:22px;font-size:14px;font-weight:600;letter-spacing:.3px;color:var(--muted);opacity:0}
.iw-for b{color:var(--text);font-weight:800}
.in .iw-for{animation:intro-rise .9s var(--ease) 2.6s both}

/* 2. The builder: a rule set in the app's own words, in four phases intro.js drives: Buy if, Sell if, Order settings, then
   the plain-English summary typing out. Each phase's lines slide in (the panel grows to fit), the caption under the panel
   crossfades. */
#intro [data-step=builder]{justify-content:flex-start;padding-top:max(92px,10vh)}
.ibd{position:relative;z-index:1;width:min(100%,350px);background:linear-gradient(180deg,var(--panel),#12151a);border:1px solid var(--border);border-radius:18px;padding:13px 13px 11px;text-align:left;
  box-shadow:0 30px 70px #000a;opacity:0;font-size:12.5px;line-height:1.35;overflow:hidden;box-sizing:border-box}
.in .ibd{animation:intro-pop 1s var(--ease) .25s both}
/* When the rule set outgrows the room on screen, it scrolls up inside the panel like a feed: newest lines in view,
   the top fading out (intro.js sets the panel's height and the inner offset). */
.ibd,.ibc{flex-shrink:0}
.ibd-in{transition:transform .65s cubic-bezier(.2,.7,.2,1);will-change:transform}
.ibd.scrolled{-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 46px);mask-image:linear-gradient(to bottom,transparent 0,#000 46px)}
.ibd [data-ph]{display:none;opacity:0}
.ibd [data-ph].on{display:block;animation:intro-rise .7s var(--ease) both}
.ibd .ibd-sec[data-ph].on{display:flex}
.ibd-sec{align-items:center;gap:9px;margin:6px 0 4px}
.ibd-sec:first-child{margin-top:0}
.ibd-sec span{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:800;color:#0c0e11;flex:none}
.ibd-sec b{display:block;font-size:13.5px;font-weight:800;line-height:1.2}.ibd-sec small{display:block;color:var(--muted);font-size:11px}
.ibd-sec.buy span{background:var(--accent)}.ibd-sec.sell span{background:#c4a7ff}.ibd-sec.order span{background:#7cc4ff}
.ibd-row{padding:4px 10px;border-radius:9px;background:var(--inset);border:1px solid var(--border-soft);color:var(--text)}
.ibd-row+.ibd-row,.ibd-and+.ibd-row{margin-top:0}
.ibd-row em{font-style:normal;font-weight:700;padding:1px 7px;border-radius:6px;background:#1a1e24;border:1px solid var(--border);color:var(--text);white-space:nowrap}
.ibd-and{font-style:normal;font-size:9px;font-weight:800;letter-spacing:1.6px;text-transform:uppercase;color:var(--accent);padding:0 0 0 10px;line-height:13px}
.ibd-and.or{color:#c4a7ff}
.ibd-sum{margin:10px 0 0!important;padding:9px 12px;border-radius:10px;border:1px dashed var(--accent-border);background:var(--accent-soft);color:var(--text)!important;
  font-size:12.5px!important;line-height:1.45!important;min-height:calc(3 * 1.45em + 20px);max-width:none!important}
.ibd-sum span::after{content:"";display:inline-block;width:2px;height:1em;margin-left:2px;vertical-align:-2px;background:var(--accent);animation:intro-caret 1s steps(2) infinite}
.ibd-sum span.done::after{display:none}
@keyframes intro-caret{to{opacity:0}}
.ibc{position:relative;z-index:2;width:100%;height:150px;margin-top:46px}
#intro .ibc h2,#intro .ibc p{text-shadow:0 0 10px var(--bg),0 0 22px var(--bg),0 0 36px var(--bg)}
.ibc::before{content:"";position:absolute;left:-12%;right:-12%;top:-28px;bottom:-28px;pointer-events:none;
  background:radial-gradient(ellipse 60% 55% at 50% 50%,rgba(12,14,17,.92) 45%,rgba(12,14,17,.6) 70%,transparent 100%)}
.ibc>div{position:absolute;inset:0;opacity:0}
.ibc>div.on{animation:intro-rise .8s var(--ease) both}
.ibc>div.off{animation:intro-fall .45s var(--ease) both}
@keyframes intro-fall{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-10px)}}
#intro .ibc h2{margin:0 0 8px;font-size:clamp(22px,6.4vw,29px)}
#intro .ibc p{margin:0 auto}

/* 3. Money: the equity line draws itself upward, the bankroll card fills in beneath it, then the words. */
.ip-chart{position:relative;width:min(100%,260px);margin-bottom:14px}
.ip-chart svg{display:block;width:100%;height:auto;overflow:visible}
.ip-area{opacity:0}.in .ip-area{animation:intro-show .8s ease 1.3s both}
.ip-line{stroke-dasharray:100;stroke-dashoffset:100}.in .ip-line{animation:intro-draw 1.5s var(--ease) .3s both}
.ip-dot{opacity:0;transform-box:fill-box;transform-origin:center}.in .ip-dot{animation:intro-dot 1.6s ease-out 1.6s infinite,intro-show .3s ease 1.6s both}
.ip-gain{position:absolute;right:-8px;top:-26px;font-size:14px;font-weight:800;color:#7ee08a;background:#7ee08a1a;border:1px solid #7ee08a44;border-radius:999px;padding:3px 9px;opacity:0}
.in .ip-gain{animation:intro-pop .7s var(--ease) 1.7s both}
@keyframes intro-dot{0%{filter:drop-shadow(0 0 0 #ffbe1a)}50%{filter:drop-shadow(0 0 10px #ffbe1a)}100%{filter:drop-shadow(0 0 0 #ffbe1a)}}
.ib-card{width:min(100%,340px);background:linear-gradient(180deg,var(--panel),#12151a);border:1px solid var(--border);border-radius:18px;padding:14px 14px 11px;text-align:left;
  box-shadow:0 30px 70px #000a;opacity:0}
.in .ib-card{animation:intro-pop .9s var(--ease) .9s both}
.ib-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px}
.ib-head small{font-size:11px;font-weight:800;letter-spacing:1.5px;text-transform:uppercase;color:var(--muted)}
.ib-head strong{font-size:24px;font-weight:800;letter-spacing:-1px;color:var(--accent)}
.ib-bar{display:flex;gap:3px;height:14px;border-radius:999px;overflow:hidden;background:var(--inset)}
.ib-bar i{display:block;height:100%;transform:scaleX(0);transform-origin:left}
.in .ib-bar i{animation:intro-grow .9s var(--ease) both}
.ib-bar .s1{width:30%;animation-delay:1.4s}.ib-bar .s2{width:20%;animation-delay:1.55s}.ib-bar .s3{width:12%;animation-delay:1.7s}.ib-bar .s4{width:8%;animation-delay:1.85s}
.ib-bar .avail{width:30%;animation-delay:2s}
@keyframes intro-grow{from{transform:scaleX(0)}to{transform:none}}
.ib-rows{display:flex;flex-direction:column;gap:5px;margin-top:10px}
.ib-rows div{display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:9px;align-items:center;font-size:12.5px;padding:6px 10px;border-radius:9px;background:var(--inset);color:var(--muted);opacity:0}
.in .ib-rows div{animation:intro-rise .7s var(--ease) both}
.ib-rows div:nth-child(1){animation-delay:1.7s}.ib-rows div:nth-child(2){animation-delay:1.85s}.ib-rows div:nth-child(3){animation-delay:2s}.ib-rows div:nth-child(4){animation-delay:2.15s}
.ib-rows i{width:10px;height:10px;border-radius:3px;display:block}
.ib-rows b{color:var(--text);font-variant-numeric:tabular-nums}
#intro [data-step=money] h2{margin-top:18px}
.in[data-step=money] h2{animation:intro-rise .9s var(--ease) 2.3s both}
.in[data-step=money] p{animation:intro-rise .9s var(--ease) 2.5s both}
.im-free{display:inline-block;margin-top:14px;font-size:12.5px;font-weight:800;letter-spacing:.4px;color:var(--accent);padding:7px 14px;border-radius:999px;
  background:var(--accent-soft);border:1px solid var(--accent-border);opacity:0}
.in .im-free{animation:intro-rise .9s var(--ease) 2.9s both}

/* 4. The logo: the cell draws, the wasp appears, the name settles in; then the camera flies through it. */
.il-logo{display:flex;flex-direction:column;align-items:center;gap:22px;will-change:transform}
.il-logo svg{width:150px;height:150px;overflow:visible;filter:drop-shadow(0 0 24px #ffbe1a55)}
.il-hex{stroke-dasharray:100;stroke-dashoffset:100}.in .il-hex{animation:intro-draw 1.1s var(--ease) .2s both}
.il-wasp{opacity:0;transform-box:fill-box;transform-origin:center}.in .il-wasp{animation:intro-pop .8s var(--ease) 1s both}
.il-word{font-size:20px;font-weight:800;letter-spacing:5px;color:var(--text);opacity:0}
.il-word b{color:var(--accent);font-weight:800}
.in .il-word{animation:intro-word .9s var(--ease) 1.3s both}
@keyframes intro-word{from{opacity:0;letter-spacing:14px;transform:translateY(8px)}to{opacity:1;letter-spacing:5px;transform:none}}
#intro.through .intro-step[data-step=logo].in{animation:none;opacity:1}
#intro.through .il-logo{animation:intro-through 1.1s cubic-bezier(.6,0,.85,.5) both}
#intro.through .il-logo svg{animation:intro-flare 1.1s ease-in both}
@keyframes intro-through{from{transform:none;opacity:1}70%{opacity:1}to{transform:scale(34);opacity:0}}
@keyframes intro-flare{from{filter:drop-shadow(0 0 24px #ffbe1a55)}to{filter:drop-shadow(0 0 80px #ffbe1acc)}}

@media(max-height:800px){#intro [data-step=builder]{padding-top:74px}.ibd-and[data-ph].on{display:none}.ibd-row+.ibd-row{margin-top:3px}}
@media(max-height:760px){.ibc{height:130px;margin-top:40px}#intro .ibc h2{font-size:clamp(20px,5.8vw,26px)}.ib-rows div:nth-child(4){display:none}.ip-chart{width:min(100%,220px)}}
@media(max-height:680px){.intro-step{padding-top:36px;padding-bottom:64px}#intro h2{margin-top:12px}.il-logo svg{width:120px;height:120px}
  .ibd-row{padding:4px 9px}.ibc{height:96px;margin-top:22px}#intro .ibc p{display:none}[data-step=money] p{display:none}}
/* Larger screens: the same show, scaled up so it fills a laptop window the way it fills a phone. */
@media(min-width:761px) and (min-height:700px){
  #intro h2{font-size:36px}#intro p{font-size:17px;max-width:460px}
  .iw-line{font-size:62px}.iw-tag{font-size:18px;padding:11px 22px 11px 30px;margin-top:32px}.iw-for{font-size:16px;margin-top:26px}
  .ibd{width:440px;font-size:14.5px;padding:16px 16px 14px}.ibd-sec b{font-size:15.5px}.ibd-sec small{font-size:12px}.ibd-sec span{width:24px;height:24px}
  .ibd-row{padding:7px 12px}.ibd-sum{font-size:14.5px!important}
  .ibc{width:520px;height:160px;margin-top:52px}#intro .ibc h2{font-size:32px}
  .ip-chart{width:320px;margin-bottom:18px}.ib-card{width:400px;padding:16px 16px 13px}.ib-head strong{font-size:28px}.ib-rows div{font-size:14px;padding:7px 12px}
  .im-free{font-size:14px;padding:8px 18px}
  .il-logo svg{width:190px;height:190px}.il-word{font-size:24px;letter-spacing:7px}
}
@media(prefers-reduced-motion:reduce){#intro{display:none!important}html.intro-on header.top,html.intro-on main,html.intro-on footer{opacity:1;transform:none}}
