/*
 * Shared look for bevibe.pro. The landing page (index.html) is authored with
 * inline styles and only needs the base, responsive and motion rules here;
 * the Worker-rendered pages (pricing, download, account, legal) use the
 * component classes below.
 */

:root {
  --bg: #09090b;
  --bg-deep: #050507;
  --surface: #151518;
  --surface-2: #1a1a1e;
  --line: #232328;
  --line-strong: #2e2e35;
  --fg: #f4f4f6;
  --fg-2: #c8c9cf;
  --muted: #a6a8b0;
  --subtle: #8b8d96;
  --accent: #3e63dd;
  --accent-light: #9db4ff;
  --success: #3dd68c;
  --danger: #ff7a90;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

/* Web fonts arrive after a reload restores the scroll position; anchoring
   would then nudge the page down by the change in text height. */
html {
  overflow-anchor: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--muted);
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

/* Landing page: responsive rules and the one-time hero motion. */

@keyframes lRay {
  from {
    opacity: 0;
    transform: rotate(var(--r)) scaleY(0.1);
  }
  to {
    opacity: 1;
    transform: rotate(var(--r)) scaleY(1);
  }
}

@keyframes lFlare {
  from {
    opacity: 0;
    transform: scaleX(0.2);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes lRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.l-ray {
  animation: lRay 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.l-flare {
  animation: lFlare 1.1s 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.l-rise {
  animation: lRise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Sections rise in once as they scroll into view; the script that adds
   .l-js runs only when IntersectionObserver exists, so without it all
   content shows. */
.l-js .l-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.l-js .l-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .l-ray,
  .l-flare,
  .l-rise {
    animation: none;
  }
  .l-js .l-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Anchored sections land below the sticky header. */
section[id] {
  scroll-margin-top: 64px;
}

/* The header stays reachable while scrolling. */
/* The hero runs up behind it (margin-top: -64px). At the top of the page the
   bar is invisible, so the light rays reach the top untouched; once the page
   scrolls it turns into frosted glass (.is-scrolled, set by the page script). */
.l-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  box-sizing: border-box;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    -webkit-backdrop-filter 0.25s ease,
    backdrop-filter 0.25s ease;
}

.l-header.is-scrolled {
  background-color: rgba(9, 9, 11, 0.8);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.l-header header {
  height: 100%;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.l-card {
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.l-card:hover {
  border-color: rgba(143, 166, 255, 0.28) !important;
}

.l-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #2e2e35;
  background: #151518;
}

/* The board mock in the landing page. */
.l-col {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 4px;
  color: #b0b4ba;
  font-size: 12px;
  font-weight: 500;
}

.l-col span {
  padding: 0 6px;
  border-radius: 999px;
  background: #212225;
  font-size: 11px;
}

.l-task {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #18191b;
  border: 1px solid #2a2a33;
}

.l-key,
.l-branch {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #8e929a;
}

.l-desc {
  color: #a6a8b0;
  font-size: 12px;
  line-height: 17px;
}

.l-run {
  display: flex;
  align-items: center;
  gap: 7px;
}

.l-run i {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 2px;
}

.l-run b {
  margin-left: auto;
  font-weight: 500;
}

/* The hero window is 1280px wide; below that it scales down so it stays whole. */
@media (max-width: 1340px) {
  .l-stage {
    zoom: 0.9;
  }
}

@media (max-width: 1200px) {
  .l-stage {
    zoom: 0.78;
  }
}

@media (max-width: 1040px) {
  .l-stage {
    zoom: 0.68;
  }
}

@media (max-width: 900px) {
  .l-stage {
    zoom: 0.56;
  }
}

@media (max-width: 760px) {
  .l-nav-links,
  .site-nav-links {
    display: none !important;
  }
  .l-header header {
    padding: 0 16px !important;
  }
  .l-stage {
    zoom: 0.28;
  }
}

/* Worker-rendered pages. */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page > .container {
  flex: 1;
  width: 100%;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 760px) {
  .container {
    padding: 0 16px;
  }
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.site-logo svg {
  width: 22px;
  height: 22px;
}

.site-nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
}

.site-logo {
  justify-self: start;
}

.site-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer {
  border-top: 1px solid #1f1f24;
  margin-top: 96px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 13px;
  color: var(--subtle);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  color: var(--fg);
  border-color: #3a3a42;
}

.btn-sm {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.btn-light {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.btn-light:hover {
  color: var(--bg);
  background: #ffffff;
}

.btn-accent {
  border: 0;
  background: linear-gradient(145deg, #5878e4, #3a57c2);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(62, 99, 221, 0.4);
}

.btn-accent:hover {
  color: #ffffff;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.kicker {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent-light);
}

.page-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding: 96px 0 48px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
}

.page-head p {
  margin: 0;
  max-width: 34em;
  font-size: 17px;
  color: var(--muted);
}

.tone-2 {
  color: var(--subtle);
}

.plans {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 32px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.card-featured {
  background: linear-gradient(180deg, #171a26, #131418);
  border-color: rgba(110, 142, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(110, 142, 255, 0.12),
    0 -8px 40px rgba(62, 99, 221, 0.25),
    0 40px 100px rgba(62, 99, 221, 0.18);
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg-2);
}

.badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(110deg, #ffb86b, #f4f4f6 45%, #a9bcff);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price strong {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.price span,
.fine {
  color: var(--subtle);
  font-size: 14px;
}

.includes {
  width: 100%;
  max-width: 880px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px 32px;
  font-size: 15px;
  color: var(--fg-2);
}

.includes span {
  display: flex;
  gap: 10px;
  align-items: center;
}

.notice {
  max-width: 880px;
  margin: 0 auto 24px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg-2);
  text-align: center;
}

.narrow {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 72px 0 0;
}

.narrow h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.narrow p {
  margin: 0;
  color: var(--muted);
}

.narrow form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.input {
  height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}

.input:focus {
  outline: none;
  border-color: rgba(110, 142, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(62, 99, 221, 0.2);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--subtle);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.downloads {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  color: var(--fg-2);
}

.prose h1 {
  font-size: 40px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 72px 0 8px;
  color: var(--fg);
}

.prose h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 40px 0 8px;
  color: var(--fg);
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose a {
  color: var(--accent-light);
}

.release {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.release header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.release h2 {
  margin: 0;
}

/* Landing feature sections: copy beside one large, layered visual. */
.l-sec {
  position: relative;
  overflow: hidden;
  border-top: 1px solid #1f1f24;
}

.l-wrap {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 128px 40px 120px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 64px 80px;
}

.l-copy {
  flex: 1 1 360px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.l-kicker {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #9db4ff;
}

.l-h2 {
  margin: 0;
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
}

.l-h2 span {
  color: #8b8d96;
}

.l-lead {
  margin: 0;
  max-width: 30em;
  font-size: 17px;
  color: #a6a8b0;
}

.l-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: #c8c9cf;
}

.l-list li {
  display: flex;
  gap: 12px;
}

.l-list li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 9px;
  border-radius: 2px;
  background: var(--dot, #8fa6ff);
  box-shadow: 0 0 10px var(--dot, #8fa6ff);
}

/* A fixed-size stage so overlapping windows keep their composition; it scales down on phones. */
.l-vis {
  flex: 1 1 640px;
  display: flex;
  justify-content: center;
}

.l-vis-stage {
  position: relative;
  width: 640px;
  height: 520px;
  flex: none;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: #fcfcfd;
}

.l-glow {
  position: absolute;
  inset: -80px -120px;
  background: radial-gradient(closest-side, var(--glow), transparent 100%);
  pointer-events: none;
}

.l-win {
  position: absolute;
  border-radius: 12px;
  background: #121216;
  border: 1px solid #2a2a33;
  box-shadow:
    0 0 0 1px rgba(143, 166, 255, 0.04),
    0 40px 110px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.l-win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #26262d;
  color: #b0b4ba;
  font-size: 12px;
}

.l-mono {
  font-family: "Geist Mono", ui-monospace, monospace;
}

.l-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #34343c;
  color: #fcfcfd;
  font-size: 12px;
  white-space: nowrap;
}

.l-btn-primary {
  border-color: transparent;
  background: linear-gradient(145deg, #5878e4, #3a57c2);
}

@media (max-width: 760px) {
  .l-wrap {
    padding: 96px 16px 88px;
  }
  .l-vis-stage {
    zoom: 0.55;
  }
}

/* The Anywhere diagram: devices joined by labelled links; it stacks on narrow screens. */
.l-net {
  display: grid;
  grid-template-columns: 1fr 120px auto 120px 1fr;
  align-items: center;
  gap: 16px;
}

.l-node {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.l-node-label {
  font-weight: 600;
  font-size: 15px;
  text-align: center;
}

.l-node-label span {
  color: #8b8d96;
  font-weight: 400;
  font-size: 13px;
}

.l-link {
  position: relative;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(143, 166, 255, 0.55) 0 6px,
    transparent 6px 12px
  );
}

.l-link span {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #9db4ff;
}

.l-machine {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #151518;
  border: 1px solid #2a2a33;
  font-size: 14px;
  line-height: 19px;
}

.l-machine b {
  font-weight: 600;
}

.l-machine span span {
  color: #8b8d96;
  font-size: 12px;
}

.l-machine-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
}

.l-surface {
  display: flex;
  align-items: center;
  padding: 7px 8px;
  border-radius: 5px;
}

.l-surface span {
  flex: 1;
}

.l-surface kbd {
  padding: 0 5px;
  border-radius: 3px;
  background: #26272b;
  color: #b0b4ba;
  font: inherit;
  font-size: 11px;
}

@media (max-width: 960px) {
  .l-net {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 28px;
  }
  .l-link {
    width: 2px;
    height: 48px;
    background: repeating-linear-gradient(
      180deg,
      rgba(143, 166, 255, 0.55) 0 6px,
      transparent 6px 12px
    );
  }
  .l-link span {
    left: 14px;
    bottom: 50%;
    transform: translateY(50%);
  }
}

/* A small server glyph: two lit drive bays and an empty one. */
.l-rack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 26px;
  flex: none;
  padding: 4px;
  border-radius: 5px;
  background: #1f2025;
  border: 1px solid #2f3037;
}

.l-rack i {
  height: 3px;
  border-radius: 2px;
  background: #34353c;
}

/* One-shot motion inside revealed blocks. --d orders the pieces; nothing loops. */
.l-js .l-reveal .l-pop {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 90ms + 150ms);
}

.l-js .l-reveal.is-in .l-pop {
  opacity: 1;
  transform: none;
}

.l-js .l-reveal .l-bar {
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 60ms + 350ms);
}

.l-js .l-reveal.is-in .l-bar {
  transform: none;
}

@keyframes lNeeds {
  50% {
    box-shadow:
      0 0 0 4px rgba(252, 211, 77, 0.16),
      0 0 26px rgba(252, 211, 77, 0.28);
  }
}

.l-js .l-reveal.is-in .l-needs {
  animation: lNeeds 1.6s ease-in-out 1.6s 2;
}

/* Links draw in, then a spark crosses them a few times. */
.l-js .l-reveal .l-link {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s;
}

.l-js .l-reveal.is-in .l-link {
  clip-path: inset(0 -40px -40px -40px);
}

.l-link::after {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfdcff;
  box-shadow: 0 0 12px #8fa6ff;
  opacity: 0;
}

@keyframes lSpark {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(112px);
  }
}

.l-js .l-reveal.is-in .l-link::after {
  animation: lSpark 1.6s ease-in-out 1.4s 3;
}

/* The hero's agent works through its steps once, on load. */
.l-step {
  animation: lRise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--d, 0) * 220ms + 1.3s);
}

@media (max-width: 960px) {
  .l-js .l-reveal .l-link {
    clip-path: inset(0 0 100% 0);
  }
  .l-js .l-reveal.is-in .l-link {
    clip-path: inset(0 -200px -40px -40px);
  }
  .l-link::after {
    left: -3px;
    top: 0;
  }
  @keyframes lSpark {
    0% {
      opacity: 0;
      transform: translateY(0);
    }
    15%,
    85% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: translateY(40px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .l-js .l-reveal .l-pop,
  .l-js .l-reveal .l-bar,
  .l-js .l-reveal .l-link {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }
  .l-step,
  .l-js .l-reveal.is-in .l-needs,
  .l-js .l-reveal.is-in .l-link::after {
    animation: none;
  }
}

.l-rail-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
