/* ============================================================================
   BitBroom — bitbroom.app
   Dark, Fluent-adjacent design matching the app. Every animation is
   transform/opacity-based (GPU-cheap). Deliberately NO backdrop-filter/blur.
   ========================================================================== */

:root {
  --bg: #0a0d14;
  --bg-raise: #0e131d;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-solid: #111623;
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #e8edf6;
  --text-2: #9aa7bd;
  --text-3: #7c88a1; /* ≥4.5:1 on --bg for WCAG AA small text */
  --accent: #38bdf8;
  --accent-2: #7dd3fc;
  --success: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden; /* fallback */
  overflow-x: clip;   /* fully removes the horizontal scroll surface */
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(56, 189, 248, 0.35); }

/* Keyboard navigation: a clear, on-brand focus ring (mouse clicks stay clean). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-enter { animation: none; }
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}

/* ------------------------------------------------------------------ aurora */
/* Soft color washes done with pre-faded radial gradients moved by transform
   keyframes — zero filter cost, zero repaint (compositor-only animation).  */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.aurora__blob {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  opacity: 0.5;
  will-change: transform;
}
.aurora__blob--1 {
  top: -30vmax; left: -15vmax;
  background: radial-gradient(circle at center, rgba(37, 99, 168, 0.28) 0%, rgba(37, 99, 168, 0.08) 40%, transparent 70%);
  animation: drift-1 46s ease-in-out infinite alternate;
}
.aurora__blob--2 {
  bottom: -35vmax; right: -20vmax;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0.05) 40%, transparent 70%);
  animation: drift-2 58s ease-in-out infinite alternate;
}
.aurora__blob--3 {
  top: 20vh; left: 40vw;
  width: 50vmax; height: 50vmax;
  background: radial-gradient(circle at center, rgba(125, 91, 226, 0.10) 0%, transparent 65%);
  animation: drift-3 70s ease-in-out infinite alternate;
}
@keyframes drift-1 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(12vw, 8vh, 0) scale(1.15); } }
@keyframes drift-2 { from { transform: translate3d(0, 0, 0) scale(1.1); } to { transform: translate3d(-10vw, -6vh, 0) scale(0.95); } }
@keyframes drift-3 { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-14vw, 10vh, 0); } }

/* Static grain adds the "acrylic" texture without any live filter. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------- nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background-color 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
  background: transparent;
}
.nav.is-scrolled {
  background: rgba(10, 13, 20, 0.92); /* solid-ish — intentionally no backdrop blur */
  border-bottom-color: var(--border-soft);
}
.nav__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 17px;
  color: var(--text);
}
.nav__brand:hover { text-decoration: none; }
.nav__links {
  display: flex;
  gap: 22px;
  margin-left: 12px;
  flex: 1;
}
.nav__links a {
  color: var(--text-2);
  font-size: 14px;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--text); text-decoration: none; }
.nav__actions { display: flex; gap: 10px; align-items: center; }
.nav__stars {
  font-size: 12px;
  color: var(--text-2);
  border-left: 1px solid var(--border);
  padding-left: 8px;
  margin-left: 2px;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--sm { padding: 8px 14px; font-size: 13.5px; }
.btn--lg { padding: 14px 26px; font-size: 15.5px; }
.btn--primary {
  background: linear-gradient(180deg, #4cc5f9, #2eaee6);
  color: #06131c;
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.28);
}
.btn--primary:hover { box-shadow: 0 10px 30px rgba(56, 189, 248, 0.42); }
.btn--ghost {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.16); }

/* -------------------------------------------------------------------- hero */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 158px 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
  /* Fill a laptop viewport, but never balloon on tall/portrait monitors. */
  min-height: min(86vh, 780px);
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 26px;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--success);
  opacity: 0.6;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  from { transform: scale(0.6); opacity: 0.7; }
  to   { transform: scale(1.8); opacity: 0; }
}
.hero__title {
  font-size: clamp(40px, 5.2vw, 62px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(92deg, var(--accent) 0%, #8b7cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  font-size: 17.5px;
  color: var(--text-2);
  max-width: 46ch;
  margin-bottom: 34px;
}
.hero__sub strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__note { margin-top: 18px; font-size: 13px; color: var(--text-3); }

.hero__shot { position: relative; }

/* Above-the-fold entrance: pure CSS, transform-only. Deliberately no opacity
   fade — the hero is the LCP element, and fading in from 0 delays the "largest
   contentful paint" and hurts real-world load metrics. A rise reads just as
   intentional and paints instantly. */
.hero-enter { animation: hero-rise 0.8s var(--ease-out) both; }
.hero-enter--late { animation-delay: 0.1s; }
@keyframes hero-rise {
  from { transform: translateY(26px); }
  to   { transform: none; }
}
.hero__glow {
  position: absolute;
  inset: 8% -6% -10% -6%;
  z-index: -1;
  background: radial-gradient(60% 55% at 50% 60%, rgba(56, 189, 248, 0.17) 0%, transparent 70%);
  pointer-events: none;
}

/* App-window frame around screenshots */
.window {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  transform-style: preserve-3d;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #0c1019;
  border-bottom: 1px solid var(--border-soft);
}
.window__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.window__title {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-3);
}
[data-tilt] .window { transition: transform 0.25s var(--ease-out); will-change: transform; }

/* ------------------------------------------------------------------- stats */
.stats {
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stats__item {
  border: 1px solid var(--border-soft);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
}
.stats__num {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-2);
}
.stats__plus { font-size: 26px; font-weight: 700; color: var(--accent-2); }
.stats__label { display: block; margin-top: 4px; font-size: 13px; color: var(--text-2); }

/* ---------------------------------------------------------------- sections */
.section { max-width: 1180px; margin: 0 auto; padding: 110px 24px 30px; }
.section--alt {
  max-width: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.022) 18%, rgba(255, 255, 255, 0.022) 82%, transparent);
}
.section--alt > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.section__head { text-align: center; margin-bottom: 56px; }
.section__head h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.section__head p { color: var(--text-2); font-size: 16.5px; max-width: 62ch; margin: 0 auto; }

/* ---------------------------------------------------------------- features */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  border: 1px solid var(--border-soft);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s ease, background-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(255, 255, 255, 0.05);
}
.card__icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--tint, var(--accent));
  background: color-mix(in srgb, var(--tint, var(--accent)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint, var(--accent)) 25%, transparent);
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text-2); }

/* ------------------------------------------------------------------ safety */
.safety {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.safety__col {
  border: 1px solid var(--border-soft);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px;
}
.safety__title { font-size: 18px; font-weight: 650; margin-bottom: 18px; }
.safety__title--good { color: var(--success); }
.safety__title--bad { color: var(--danger); }
.safety__list { list-style: none; }
.safety__list li {
  position: relative;
  padding: 9px 0 9px 32px;
  font-size: 14.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-soft);
}
.safety__list li:last-child { border-bottom: none; }
.safety__list li strong { color: var(--text); }
.safety__list li::before {
  content: "✓";
  position: absolute;
  left: 4px;
  color: var(--success);
  font-weight: 700;
}
.safety__list--no li::before { content: "✕"; color: var(--danger); }
.safety__foot { text-align: center; margin-top: 30px; color: var(--text-3); font-size: 14px; }

/* ------------------------------------------------------------- screenshots */
.shots__tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.shots__tab {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.18s var(--ease-out);
}
.shots__tab:hover { color: var(--text); transform: translateY(-1px); }
.shots__tab.is-active {
  color: #06131c;
  background: linear-gradient(180deg, #4cc5f9, #2eaee6);
  border-color: transparent;
}
.shots__frame { max-width: 980px; margin: 0 auto; }
.shots__frame img { transition: opacity 0.28s ease; }
.shots__frame img.is-fading { opacity: 0; }

/* --------------------------------------------------------------------- cta */
.section--cta { padding-bottom: 130px; }
.cta {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 66px 30px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 50% -20%, rgba(56, 189, 248, 0.14) 0%, transparent 55%),
    var(--panel);
}
.cta__logo { margin: 0 auto 20px; }
.cta h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.cta > p { color: var(--text-2); margin-bottom: 30px; }
.cta__buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta__meta { margin-top: 22px; font-size: 13px; color: var(--text-3); }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--border-soft); }
.footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px 24px 46px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}
.footer__brand { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.footer__tag { color: var(--text-3); font-weight: 400; font-size: 13.5px; margin-left: 6px; }
.footer__links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.footer__links a { color: var(--text-2); font-size: 13.5px; }
.footer__links a:hover { color: var(--text); }
.footer__note { color: var(--text-3); font-size: 12.5px; }

/* ---------------------------------------------------------- scroll reveals */
/* Gated on .js so content is fully visible when scripts don't run. */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora__blob, .pulse-dot::after { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .hero {
    /* minmax(0, …) stops the 1400px screenshot from blowing the track out. */
    grid-template-columns: minmax(0, 1fr);
    padding-top: 120px;
    gap: 44px;
    min-height: 0;
    text-align: center;
  }
  .hero__title { font-size: clamp(30px, 9.4vw, 52px); }
  .hero__glow { inset: 8% 0 -10% 0; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__cta { justify-content: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr 1fr; }
  .safety { grid-template-columns: 1fr; }
  .nav__links { display: none; }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .section { padding-top: 80px; }
  .btn--lg { width: 100%; justify-content: center; }
  .hero__cta { flex-direction: column; }
  /* Let the headline wrap naturally on narrow screens instead of forcing lines. */
  .hero__title br { display: none; }
  .hero__title { font-size: clamp(26px, 10.5vw, 40px); overflow-wrap: anywhere; }
  .hero__sub { font-size: 16px; }
}
