/* Arjun Keshav OLA — the hub.
   Bijli is the power source. Current runs from Bijli along two traces into the two apps,
   painted in the Paint Range: Coral Glam for Billing, Stellar Blue for Stock. */
:root {
  color-scheme: light dark;
  --ground: #f2f1ec; --ink: #0b0b0c; --ink-2: #4a4a52; --ink-3: #6b6b74;
  --dot: rgba(11, 11, 12, .1); --trace: #d6d4cc; --socket: #f2f1ec;
  --bubble: #fff; --bubble-line: rgba(11, 11, 12, .08);
  --bolt: #FFC83D; --coral: #E4826F; --coral-ink: #0b0b0c; --blue: #3D72C4; --blue-ink: #fff;
  --glow-a: .22;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none; -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b0b0c; --ink: #f5f5f7; --ink-2: #b5b5bd; --ink-3: #8e8e96;
    --dot: rgba(255, 255, 255, .085); --trace: #36363c; --socket: #0b0b0c;
    --bubble: #1c1c1e; --bubble-line: rgba(255, 255, 255, .08); --glow-a: .14;
  }
}
:root[data-theme="dark"] {
  --ground: #0b0b0c; --ink: #f5f5f7; --ink-2: #b5b5bd; --ink-3: #8e8e96;
  --dot: rgba(255, 255, 255, .085); --trace: #36363c; --socket: #0b0b0c;
  --bubble: #1c1c1e; --bubble-line: rgba(255, 255, 255, .08); --glow-a: .14;
}
* { box-sizing: border-box; }
html { background: var(--ground); }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column; position: relative;
  color: var(--ink); background: var(--ground); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
/* the board: a dot grid that fades out toward the bottom */
body::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 95%); mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 95%);
  animation: board-in 1.2s ease both;
}
@keyframes board-in { from { opacity: 0; } }
::selection { background: var(--bolt); color: #0b0b0c; }

/* light follows the pointer, a little behind it */
.glow {
  position: fixed; left: 0; top: 0; z-index: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 200, 61, var(--glow-a)) 0%, rgba(255, 200, 61, 0) 62%);
  opacity: 0; transition: opacity .6s ease; will-change: transform;
}
.glow.on { opacity: 1; }

.top, main, footer { position: relative; z-index: 2; width: 100%; max-width: 60rem; margin-inline: auto; padding-inline: 1.5rem; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: calc(env(safe-area-inset-top) + 1.25rem); animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.brand { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; }
.brand strong { font-weight: 800; }
.today { font-size: .8125rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

/* ── hero ── */
.hero { padding: 2.25rem 0 0; }
.perch { display: flex; align-items: flex-end; gap: .875rem; min-height: 92px; }
.bj-home { flex: none; width: 84px; height: 84px; }
.say { user-select: none; -webkit-user-select: none;
  position: relative; margin: 0 0 1.5rem; padding: .625rem .875rem; border-radius: 1.125rem 1.125rem 1.125rem .375rem;
  background: var(--bubble); box-shadow: 0 0 0 1px var(--bubble-line), 0 8px 24px rgba(0, 0, 0, .08);
  font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; max-width: 17rem;
  transform-origin: 0% 100%;
}
.js .say:not(.pop) { opacity: 0; }
.say.pop { animation: pop .55s cubic-bezier(.3, 1.45, .5, 1) both; }
@keyframes pop { 0% { opacity: 0; transform: scale(.6) translateY(6px); } 100% { opacity: 1; transform: none; } }

h1 { margin: 1.5rem 0 .875rem; font-size: clamp(2.25rem, 9.5vw, 4.25rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 780; text-wrap: balance; }
h1 .ln { display: block; overflow: hidden; padding-bottom: .06em; }
h1 .ln > span { display: inline-block; animation: line-up .9s cubic-bezier(.2, .85, .2, 1) both; }
h1 .ln:nth-child(2) > span { animation-delay: .09s; color: var(--ink-3); }
@keyframes line-up { from { transform: translateY(105%); filter: blur(6px); } }
.lede { margin: 0; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.5; animation: rise .8s cubic-bezier(.2, .8, .2, 1) .22s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ── the traces ── */
.wires { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; pointer-events: none; }
.wires .trace { fill: none; stroke: var(--trace); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.wires .pulse { fill: none; stroke: var(--bolt); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(255, 200, 61, .9)); opacity: 0; }
.wires .pulse.on { opacity: 1; }
.wires .tether { fill: none; stroke: var(--trace); stroke-width: 2.5; stroke-linecap: round; }
.wires .socket { fill: var(--socket); stroke: var(--trace); stroke-width: 2.5; transition: fill .3s ease, stroke .3s ease; }
.wires .socket.live { fill: var(--bolt); stroke: var(--bolt); }
.wires .joint { fill: var(--trace); }

/* ── the apps ── */
.apps { display: grid; gap: 1rem; margin-top: 2.5rem; perspective: 900px; }
.app {
  --paint: var(--coral); --on: var(--coral-ink);
  position: relative; display: flex; align-items: center; gap: 1.125rem; min-height: 9.25rem; padding: 1.5rem 1.375rem;
  border-radius: 1.75rem; background: var(--paint); color: var(--on); text-decoration: none; overflow: hidden; isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 2px rgba(0, 0, 0, .08), 0 14px 34px -14px color-mix(in srgb, var(--paint) 70%, transparent);
  transform-style: preserve-3d; will-change: transform; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.js .app:not(.in) { opacity: 0; transform: translateY(28px) scale(.97); }
.app.stock { --paint: var(--blue); --on: var(--blue-ink); }
.app.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .75s cubic-bezier(.25, 1.35, .45, 1); }
.app.in.held { transition: none; }
.app:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.app .sheen {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 55%);
}
.app:hover .sheen, .app.hot .sheen { opacity: 1; }
/* power-on: a flash runs across when the current arrives */
.app::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-100%);
}
.app.flash::after { animation: flash .75s cubic-bezier(.3, .7, .3, 1) both; }
@keyframes flash { 0% { opacity: 1; transform: translateX(-100%); } 100% { opacity: 1; transform: translateX(100%); } }

.app-icon {
  flex: none; display: grid; place-items: center; width: 3.75rem; height: 3.75rem; border-radius: 1.125rem;
  background: color-mix(in srgb, var(--on) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on) 14%, transparent);
}
.app-icon svg { width: 2rem; height: 2rem; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.app.flash .app-icon svg { animation: flicker .5s steps(1) both; }
@keyframes flicker { 0%, 40% { opacity: .25; } 20%, 60%, 100% { opacity: 1; } }
/* the receipt writes itself, the box bobs */
.billing .line { stroke-dasharray: 9; stroke-dashoffset: 0; }
.billing:hover .line, .billing.hot .line { animation: write .6s cubic-bezier(.3, .7, .3, 1) both; }
.billing:hover .l2, .billing.hot .l2 { animation-delay: .12s; }
@keyframes write { from { stroke-dashoffset: 9; } }
.stock .box { transform-box: fill-box; transform-origin: 50% 100%; }
.stock:hover .box, .stock.hot .box { animation: bob .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes bob { 30% { transform: translateY(-3px) rotate(-6deg); } 60% { transform: translateY(0) rotate(3deg); } }

.app-copy { flex: 1; min-width: 0; }
h2 { margin: 0 0 .375rem; font-size: 1.75rem; line-height: 1.1; letter-spacing: -.035em; font-weight: 780; }
.app-copy > span { display: block; max-width: 26ch; font-size: .9375rem; line-height: 1.4; font-weight: 500; }
.go {
  flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--on); color: var(--paint); transition: transform .45s cubic-bezier(.3, 1.5, .5, 1);
}
.go svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.app:hover .go, .app.hot .go { transform: translateX(4px); }

.sign-in-note { display: flex; align-items: flex-start; justify-content: center; gap: .5rem; margin: 1.5rem 0 0; color: var(--ink-2); font-size: .8125rem; line-height: 1.5; text-align: center; animation: rise .8s ease .9s both; }
.sign-in-note svg { flex: none; width: 1.125rem; height: 1.125rem; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
footer { padding-top: 2rem; padding-bottom: calc(env(safe-area-inset-bottom) + 1.75rem); margin-top: auto; font-size: .75rem; color: var(--ink-3); text-align: center; }
footer span { margin: 0 .375rem; }

/* ── Bijli ── */
.pal {
  position: absolute; left: 0; top: 0; z-index: 5; width: 84px; height: 84px; padding: 0; margin: 0; border: 0; border-radius: 50%;
  background: none; color: inherit; cursor: grab; touch-action: none; will-change: transform; opacity: 0;
}
.pal.ready { opacity: 1; }
.pal.grabbed { cursor: grabbing; }
.pal:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.pal .bijli { width: 100%; height: 100%; pointer-events: none; }
.pal.dizzy .bijli { animation: dizzy .9s cubic-bezier(.3, .7, .3, 1); }
@keyframes dizzy { 0%, 100% { filter: none; } 50% { filter: hue-rotate(40deg) saturate(1.4); } }
/* the charge ring */
.pal::before {
  content: ''; position: absolute; inset: -8px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 200, 61, .45) 0%, rgba(255, 200, 61, 0) 65%); opacity: 0; transform: scale(.6);
  transition: opacity .35s ease, transform .5s cubic-bezier(.3, 1.4, .5, 1);
}
.pal.charged::before, .pal.grabbed::before { opacity: 1; transform: scale(1.15); }
.zap { position: absolute; inset: 0; pointer-events: none; }
.zap i { position: absolute; left: 50%; top: 50%; width: 3px; height: 12px; margin: -6px 0 0 -1.5px; border-radius: 2px; background: var(--bolt); box-shadow: 0 0 6px rgba(255, 200, 61, .9); opacity: 0; transform: rotate(var(--a)) translateY(-44px); }
.zap.on i { animation: ray .45s cubic-bezier(.2, .7, .3, 1) both; }
.zap.on i:nth-child(even) { animation-delay: 45ms; }
@keyframes ray { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-30px) scaleY(.4); } 35% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-58px) scaleY(1); } }
.bijli { display: block; overflow: visible; transform-origin: 50% 55%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .22)); }
.bijli .bj-lid { transform-box: fill-box; transform-origin: center; transition: transform 70ms ease-in; }
.bijli.shut .bj-lid { transform: scaleY(.12); }

/* the strike Bijli arrives on */
.strike { position: fixed; inset: 0; z-index: 6; pointer-events: none; width: 100vw; height: 100vh; overflow: visible; }
.strike path { fill: none; stroke: var(--bolt); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(255, 200, 61, .95)); }
.flashbang { position: fixed; inset: 0; z-index: 6; pointer-events: none; background: rgba(255, 220, 120, .22); opacity: 0; }

/* paint thrown out from a point (shared with the apps) */
.gd-burst { position: absolute; z-index: 7; width: 0; height: 0; pointer-events: none; }
.gd-burst i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; animation: gd-fly .9s cubic-bezier(.15, .7, .3, 1) both; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
@keyframes gd-fly { 0% { transform: translate(0, 0) scale(.4); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--tx), calc(var(--ty) + 40px)) scale(1); opacity: 0; } }

/* ── opening an app: its paint grows from the tile to fill the screen ── */
.launch { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; visibility: hidden; pointer-events: none; background: var(--paint, var(--coral)); color: var(--on, #0b0b0c); }
.launch.on { visibility: visible; pointer-events: auto; transition: clip-path .55s cubic-bezier(.2, .85, .2, 1); }
.launch-in { display: grid; justify-items: center; gap: 1rem; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .3s ease .18s, transform .5s cubic-bezier(.3, 1.4, .5, 1) .18s; }
.launch.open .launch-in { opacity: 1; transform: none; }
.launch-bj { width: 96px; height: 96px; }
.launch-txt { margin: 0; font-size: 1.375rem; font-weight: 750; letter-spacing: -.025em; }
.launch-txt::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ── wider screens: the two apps side by side ── */
@media (min-width: 48rem) {
  .top, main, footer { padding-inline: 2.5rem; }
  .hero { padding-top: 3.5rem; }
  .bj-home, .pal { width: 104px; height: 104px; }
  .perch { min-height: 112px; gap: 1.25rem; }
  .say { font-size: 1.0625rem; max-width: 22rem; }
  .apps { grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 4rem; }
  .app { flex-direction: column; align-items: flex-start; min-height: 17rem; padding: 1.75rem; gap: 0; }
  .app-icon { width: 4.25rem; height: 4.25rem; border-radius: 1.25rem; }
  .app-copy { margin-top: auto; padding-top: 2rem; }
  h2 { font-size: 2.25rem; }
  .go { position: absolute; right: 1.5rem; top: 1.5rem; }
  .sign-in-note { justify-content: flex-start; text-align: left; }
}
@media (max-width: 22.5rem) {
  .top, main, footer { padding-inline: 1.25rem; }
  .app { gap: .875rem; padding: 1.25rem 1rem; }
  .app-icon { width: 3.25rem; height: 3.25rem; }
  h2 { font-size: 1.5rem; }
}
@media (hover: none) { .app:hover .sheen { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
@media (prefers-contrast: more) {
  :root { --trace: #8e8e96; }
  .app { box-shadow: 0 0 0 2px var(--ink); }
}
