/* Brainbean SSO · V2 landing page. Builds on the tokens and buttons in v2.css. */

body.v2-welcome { background: var(--bg); overflow-x: hidden; }

/* ---------- nav ---------- */

.wnav { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; transition: background-color .3s, border-color .3s; }
.wnav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.wnav__inner { max-width: 1200px; height: 68px; margin: 0 auto; padding: 0 var(--pad); display: flex; align-items: center; gap: 32px; }
.wnav__links { margin-right: auto; display: flex; gap: 4px; font-size: 14px; }
.wnav__links a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color .2s, background-color .2s; }
.wnav__links a:hover { color: var(--text); background: var(--veil-2); }
@media (max-width: 639.98px) {
  .wnav__inner { height: 60px; justify-content: space-between; }
  .wnav__links { display: none; }
  .wnav .brand__name { display: inline; } /* v2.css hides it in the app's mobile top bar */
}

/* ---------- hero ---------- */

.whero { position: relative; isolation: isolate; overflow: hidden; margin-top: -69px; padding-top: 69px; }
@media (max-width: 639.98px) { .whero { margin-top: -61px; padding-top: 61px; } }
.whero__grid {
  position: absolute; inset: 0; z-index: -2;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 66% 38%, #000 18%, transparent 74%);
  mask-image: radial-gradient(ellipse 80% 70% at 66% 38%, #000 18%, transparent 74%);
}
.whero__spot {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(560px circle at var(--mx, 72%) var(--my, 42%), rgb(99 102 241 / .15), transparent 65%);
}

.whero__inner {
  max-width: 1200px;
  min-height: min(820px, 100dvh);
  margin: 0 auto;
  padding: 56px var(--pad) 88px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}
.whero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  color: var(--label);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04);
  transition: color .2s, border-color .2s, box-shadow .3s;
}
.eyebrow:hover { color: var(--text); border-color: var(--accent-soft-2); box-shadow: 0 8px 20px -10px rgb(67 56 202 / .4); }
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: ping 2.2s ease-out infinite; }
.eyebrow__arrow { transition: transform .3s var(--ease-spring); }
.eyebrow:hover .eyebrow__arrow { transform: translateX(3px); }

.whero__title { font-size: clamp(46px, 6.6vw, 88px); font-weight: 600; letter-spacing: -.048em; line-height: .98; }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .03em .12em; margin: 0 -.03em -.12em; }
.word > span { display: inline-block; animation: word-up 1s var(--ease-out) both; animation-delay: calc(var(--w, 0) * 85ms + 80ms); }
.whero__accent {
  background: linear-gradient(100deg, var(--grad-a) 0%, var(--grad-b) 40%, var(--grad-c) 60%, var(--grad-a) 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: word-up 1s var(--ease-out) both, shimmer 8s linear 1.4s infinite;
  animation-delay: calc(var(--w, 0) * 85ms + 80ms), 1.4s;
}
.whero__lede { max-width: 520px; font-size: 18px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.whero__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.whero__meta { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 13.5px; }
.whero__meta li { display: flex; align-items: center; gap: 7px; }
.whero__meta svg { color: var(--ok); }

.btn--xl { --h: 54px; padding: 0 28px; font-size: 16px; }
.btn--xl svg { transition: transform .3s var(--ease-spring); }
.btn--xl:hover svg { transform: translateX(3px); }
.btn--link { --spin: var(--accent-fg); color: var(--text); padding: 0 20px; }
.btn--link:hover { color: var(--accent-fg); background: var(--accent-soft); }
.btn--light { --spin: var(--accent); background: #fff; color: var(--accent); font-weight: 600; }
.btn--light:hover { background: var(--accent-soft); color: var(--accent-hover); box-shadow: 0 14px 34px -12px rgb(0 0 0 / .45); }

@media (max-width: 1099.98px) {
  .whero__inner { min-height: 0; padding: 40px var(--pad) 72px; grid-template-columns: minmax(0, 1fr); gap: 36px; text-align: center; }
  .whero__copy { align-items: center; }
  .whero__lede { margin: 0 auto; }
  .whero__ctas, .whero__meta { justify-content: center; }
}
@media (max-width: 639.98px) {
  .whero__lede { font-size: 16.5px; }
  .whero__ctas .btn { flex: 1 1 100%; }
}

/* ---------- the hub: systems orbiting the Brainbean core ---------- */

.whero__visual { display: grid; place-items: center; perspective: 1100px; }
.hub {
  --size: min(540px, 44vw);
  --r: calc(var(--size) * .38);
  position: relative;
  width: var(--size); height: var(--size);
  transform-style: preserve-3d;
  transform:
    rotateX(calc(var(--py, 0) * -7deg))
    rotateY(calc(var(--px, 0) * 9deg))
    translate3d(calc(var(--px, 0) * 10px), calc(var(--py, 0) * 10px), 0);
  transition: transform .7s var(--ease-out);
}
@media (max-width: 1099.98px) { .hub { --size: min(500px, 80vw); } }
@media (max-width: 639.98px) { .hub { --size: min(370px, 90vw); } }

.hub__glow {
  position: absolute; inset: 16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(99 102 241 / .3), rgb(99 102 241 / 0) 70%);
  filter: blur(24px);
  animation: breathe 6s ease-in-out infinite;
}
.hub__ring { position: absolute; border-radius: 50%; }
.hub__ring--outer { inset: 3%; border: 1px dashed var(--hub-ring); animation: spin 140s linear infinite reverse; }
.hub__ring--inner { inset: 27%; border: 1px solid var(--hub-ring-soft); background: radial-gradient(circle, color-mix(in srgb, var(--surface) 75%, transparent), transparent 70%); }

.hub__orbit { position: absolute; inset: 0; animation: spin 100s linear infinite; }
.hub__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hub__line { stroke: var(--hub-line); stroke-width: .25; stroke-dasharray: .8 .9; }
.hub__pulse {
  stroke: var(--accent-fg);
  stroke-width: .8;
  stroke-linecap: round;
  stroke-dasharray: 12 188;
  stroke-dashoffset: 12;
  opacity: 0;
  animation: travel 2.8s cubic-bezier(.45, 0, .25, 1) infinite;
  animation-delay: calc(var(--i, 0) * .35s + 1s);
}

.hub__node { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a))); }
.hub__counter { animation: spin 100s linear infinite reverse; }
.hub__tile {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translate(-50%, -30px);
  animation: node-in .9s var(--ease-spring) both;
  animation-delay: calc(var(--i, 0) * 70ms + 450ms);
}
.hub__tile .tile {
  width: 56px; height: 56px;
  border-radius: 16px;
  font-size: 17px;
  box-shadow: 0 0 0 5px var(--surface), 0 14px 30px -14px rgb(23 24 26 / .4);
  transition: transform .4s var(--ease-spring), box-shadow .4s;
}
.hub__tile:hover .tile { transform: translateY(-4px) scale(1.08); box-shadow: 0 0 0 5px var(--surface), 0 22px 36px -14px rgb(67 56 202 / .5); }
.hub__name {
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--label);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
}
@media (max-width: 639.98px) {
  .hub__tile { gap: 6px; transform: translate(-50%, -22px); }
  .hub__tile .tile { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; box-shadow: 0 0 0 4px var(--surface), 0 10px 22px -12px rgb(23 24 26 / .4); }
  .hub__name { font-size: 10.5px; padding: 1px 7px; }
}

.hub__core { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%) translateZ(40px); display: grid; place-items: center; }
.hub__mark {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, #7a70ff, var(--accent) 55%, #2c2590);
  color: #fff;
  font-size: calc(var(--size) * .085); font-weight: 700;
  box-shadow: 0 24px 60px -16px rgb(67 56 202 / .7), inset 0 1px 0 rgb(255 255 255 / .3);
  animation: core-in 1s var(--ease-spring) .15s both;
}
.hub__halo { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgb(99 102 241 / .5); animation: halo 2.8s ease-out 1s infinite; opacity: 0; }
.hub__halo + .hub__halo { animation-delay: 2.4s; }

/* ---------- sections ---------- */

.wsection { max-width: 1200px; margin: 0 auto; padding: 96px var(--pad); }
.wsection__head { max-width: 660px; margin: 0 auto 52px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-fg); }
.wsection__title { font-size: clamp(32px, 4.2vw, 50px); font-weight: 600; letter-spacing: -.038em; line-height: 1.04; text-wrap: balance; }
.wsection__sub { font-size: 17px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
@media (max-width: 639.98px) { .wsection { padding: 64px var(--pad); } .wsection__head { margin-bottom: 36px; } }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 899.98px) { .steps { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin: 0 auto; } }
.step { display: flex; flex-direction: column; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; transition: transform .5s var(--ease-out), box-shadow .5s, opacity .8s var(--ease-out); }
.step:hover { transform: translateY(-5px); box-shadow: 0 28px 56px -30px rgb(23 24 26 / .35); }
.step__art { position: relative; height: 196px; overflow: hidden; display: grid; place-items: center; border-radius: 15px; background: var(--bg); }
.step__art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 14px 14px; }
.step__body { padding: 20px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.step__num { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.step__title { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.step__text { font-size: 14.5px; line-height: 1.55; color: var(--muted); }

/* mini scenes inside the step cards (paused until scrolled into view) */
.mini { position: relative; width: 210px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -22px rgb(23 24 26 / .35); }
.js .reveal:not(.is-visible) .mini, .js .reveal:not(.is-visible) .mini * { animation-play-state: paused; }

.mini__field { position: relative; height: 28px; padding: 0 10px; display: flex; align-items: center; border: 1px solid var(--line-input); border-radius: 8px; font-size: 11.5px; color: var(--text); }
.mini__text { font-family: var(--mono); font-size: 10.5px; color: var(--label); }
.mini__dots { height: 6px; width: 0; background: radial-gradient(circle, var(--text) 2.3px, transparent 2.8px) 0 0 / 10px 6px repeat-x; animation: type-dots 3.6s steps(9, end) infinite; }
.mini__caret { width: 1.5px; height: 13px; margin-left: 2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.mini__btn { height: 30px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; animation: press 3.6s var(--ease-out) infinite; }

.mini--list { gap: 2px; padding: 8px; }
.mini__hl { position: absolute; top: 8px; left: 8px; right: 8px; height: 42px; border-radius: 9px; background: var(--selected); animation: pick 4.2s var(--ease-out) infinite; }
.mini__row { position: relative; height: 42px; padding: 0 8px; display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 500; }
.mini__row .tile { width: 26px; height: 26px; border-radius: 7px; font-size: 10px; }
.mini__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini__chev { color: var(--faint); font-size: 14px; }

.mini--browser { padding: 0; gap: 0; overflow: hidden; }
.mini__bar { height: 30px; padding: 0 10px; display: flex; align-items: center; gap: 5px; background: var(--line-soft); border-bottom: 1px solid var(--line); }
.mini__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-input); }
.mini__url { flex: 1; margin-left: 6px; height: 18px; padding: 0 8px; display: flex; align-items: center; border-radius: 6px; background: var(--surface); font-family: var(--mono); font-size: 9.5px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.mini__progress { height: 2px; width: 0; background: var(--accent); animation: load 3.6s var(--ease-out) infinite; }
.mini__page { padding: 16px 14px 18px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 10px; }
.mini__check { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); animation: check-pop 3.6s var(--ease-spring) infinite; }
.mini__ok { font-size: 13px; font-weight: 600; animation: fade-late 3.6s ease infinite; }
.mini__sk { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--line-soft); }
.mini__sk--short { width: 60%; }

/* feature cards with a pointer-following glow */
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1099.98px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .features { grid-template-columns: minmax(0, 1fr); } }
.fcard { position: relative; isolation: isolate; overflow: hidden; padding: 24px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.fcard::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(280px circle at var(--x, -200px) var(--y, -200px), rgb(99 102 241 / .14), transparent 62%);
  opacity: 0;
  transition: opacity .4s;
}
.features:hover .fcard::before { opacity: 1; }
.fcard__icon { width: 42px; height: 42px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-fg); transition: transform .45s var(--ease-spring); }
.fcard:hover .fcard__icon { transform: rotate(-8deg) scale(1.1); }
.fcard__title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.fcard__text { font-size: 14px; line-height: 1.55; color: var(--muted); }

/* closing call to action */
.wcta-wrap { max-width: 1200px; margin: 0 auto; padding: 24px var(--pad) 80px; }
.wcta {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 80px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  border-radius: 30px;
  background: var(--accent); color: #fff;
  text-align: center;
}
.wcta__title { font-size: clamp(34px, 4.6vw, 56px); font-weight: 600; letter-spacing: -.04em; line-height: 1.02; }
.wcta__sub { margin-bottom: 10px; font-size: 17px; color: #e0e7ff; }
@media (max-width: 639.98px) { .wcta { padding: 56px 20px; border-radius: 24px; } .wcta-wrap { padding-bottom: 56px; } }

.wfoot { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad) 40px; display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted-2); }

/* scroll reveal (only when JS is running, so content never stays hidden) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- keyframes ---------- */

@keyframes word-up { from { transform: translateY(110%) rotate(5deg); } }
@keyframes shimmer { to { background-position: -240% 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgb(34 197 94 / .55); } 100% { box-shadow: 0 0 0 10px rgb(34 197 94 / 0); } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .7; } }
@keyframes travel {
  0% { stroke-dashoffset: 12; opacity: 0; }
  12%, 82% { opacity: 1; }
  100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes node-in { from { opacity: 0; scale: .4; } }
@keyframes core-in { from { transform: scale(.3); opacity: 0; } }
@keyframes halo { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes type-dots { 0% { width: 0; } 45%, 100% { width: 90px; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes press { 0%, 55% { transform: none; filter: none; } 62% { transform: scale(.94); filter: brightness(.88); } 72%, 100% { transform: none; filter: none; } }
@keyframes pick { 0%, 22% { transform: translateY(0); } 33%, 55% { transform: translateY(44px); } 66%, 88% { transform: translateY(88px); } 100% { transform: translateY(0); } }
@keyframes load { 0% { width: 0; opacity: 1; } 40% { width: 100%; opacity: 1; } 50%, 100% { width: 100%; opacity: 0; } }
@keyframes check-pop { 0%, 40% { transform: scale(0); } 52% { transform: scale(1.15); } 60%, 92% { transform: none; } 100% { transform: scale(0); } }
@keyframes fade-late { 0%, 45% { opacity: 0; } 58%, 92% { opacity: 1; } 100% { opacity: 0; } }
