/* BandFlow landing page — design foundation adapted from Beautiful UI
 * (beautifului.dev, MIT): solid hairlines, layered shadow rings, tight radii,
 * dashed separators, mono numerals, strong easings. Identity stays BandFlow:
 * dark cockpit surfaces + amber accent (DESIGN.md).
 */

/* ── fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter_variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── tokens ────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* surfaces */
  --page: #0e0e11;
  --surface: #1a1a1f;
  --inset: #111115;
  --field: #16161c;
  --hover: #1e1e25;
  --hover-2: #26262f;

  /* ink ramp */
  --ink: #f0f0f0;
  --ink-2: #888898;
  --ink-3: #555568;

  /* borders — solid and crisp, not alpha */
  --line: #2a2a36;
  --line-strong: #363644;
  --line-soft: #1e1e2a;

  /* accent */
  --accent: #ef9f27;
  --accent-bright: #f5b551;
  --accent-tint: rgba(239, 159, 39, .16);
  --on-accent: #1a0e00;

  /* semantic */
  --green: #97c459;
  --red: #e24b4a;
  --blue: #85b7eb;

  /* shadows — hairline ring + layered stacks (dark recipes) */
  --shadow-hairline: 0 0 0 1px var(--line);
  --shadow-btn: 0 0 0 1px rgba(255, 255, 255, .08), 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .24), 0 2px 8px rgba(0, 0, 0, .24);
  --shadow-raised: 0 0 0 1px rgba(255, 255, 255, .1), 0 2px 12px rgba(0, 0, 0, .34);
  --shadow-overlay: 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 28px rgba(0, 0, 0, .44);

  /* radii — chip 6 · control 8 · card 10 · window 14 · pill */
  --radius-chip: 6px;
  --radius-control: 8px;
  --radius-card: 10px;
  --radius-window: 14px;

  /* easing — strong curves; built-ins are too weak */
  --ease-out-strong: cubic-bezier(.23, 1, .32, 1);
  --ease-link: cubic-bezier(.16, 1, .3, 1);

  --font-sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── base ──────────────────────────────────────────────── */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

a {
  text-underline-position: from-font;
  text-decoration-skip-ink: auto;
}

button:not(:disabled),
[role="button"],
a { cursor: pointer; }

::selection { background: rgba(239, 159, 39, .25); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

[hidden] { display: none !important; }

/* ── nav ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: rgba(14, 14, 17, .86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
}
.brand img { border-radius: 8px; }
.links { display: flex; gap: 2px; margin-left: auto; }
.links a {
  padding: 6px 10px;
  color: var(--ink-2); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  border-radius: var(--radius-control);
  transition: color .15s ease, background-color .15s ease;
}
.links a:hover { color: var(--ink); background: var(--hover); }

/* segmented language pill — sliding thumb */
.seg {
  position: relative;
  display: inline-flex; align-items: center;
  background: var(--field);
  border-radius: 999px;
  padding: 2px;
  box-shadow: var(--shadow-hairline);
}
.seg button {
  position: relative; z-index: 1;
  min-width: 38px; height: 26px;
  border: 0; padding: 0 10px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  border-radius: 999px;
  transition: color .15s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.on,
.seg button.on:hover { color: var(--on-accent); }
.seg-thumb {
  position: absolute; top: 2px; left: 0; z-index: 0;
  width: 38px; height: 26px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .35);
  transition: transform .25s var(--ease-out-strong), width .25s var(--ease-out-strong);
}

/* ── atmosphere ────────────────────────────────────────── */
.bg {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
}
.bg::before { /* dotted grid, fades down the viewport */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background-image: radial-gradient(circle, rgba(240, 240, 240, .03) 1px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 520px, transparent 1500px);
  mask-image: linear-gradient(to bottom, #000 0, #000 520px, transparent 1500px);
}
.bg-mesh { /* warm color field — opacity shifts per section */
  position: absolute; inset: -12%; z-index: 0;
  opacity: 1;
  transition: opacity 1.6s var(--ease-out-strong);
  background:
    radial-gradient(46rem 30rem at 14% 6%, rgba(239, 159, 39, .13), transparent 68%),
    radial-gradient(44rem 28rem at 88% 4%, rgba(239, 68, 68, .11), transparent 68%),
    radial-gradient(46rem 30rem at 30% 102%, rgba(239, 159, 39, .09), transparent 68%);
  animation: mesh-drift-a 48s ease-in-out infinite alternate, hue-cycle 47s ease-in-out infinite alternate;
}
.bg-mesh-cool { /* violet + indigo color field */
  opacity: .3;
  background:
    radial-gradient(42rem 28rem at 82% 34%, rgba(168, 85, 247, .14), transparent 68%),
    radial-gradient(42rem 28rem at 4% 58%, rgba(99, 102, 241, .12), transparent 68%);
  animation: mesh-drift-b 62s ease-in-out infinite alternate, hue-cycle 53s ease-in-out infinite alternate;
}
.bg-mesh-deep { /* rose + crimson color field */
  opacity: .15;
  background:
    radial-gradient(44rem 30rem at 88% 80%, rgba(244, 63, 94, .14), transparent 68%),
    radial-gradient(42rem 30rem at 24% 104%, rgba(185, 28, 28, .13), transparent 68%);
  animation: mesh-drift-c 55s ease-in-out infinite alternate, hue-cycle 59s ease-in-out infinite alternate;
}
.bg-grain { /* fine film noise */
  position: absolute; inset: 0; z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: .06;
}

/* ── layout ────────────────────────────────────────────── */
main { max-width: 960px; margin: 0 auto; padding: 0 24px 64px; }
section { padding: 48px 0; }
section + section { border-top: 1px dashed var(--line); }
h2 {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.lead { color: var(--ink-2); font-size: 14.5px; max-width: 640px; margin: 0 0 16px; }

/* ── hero ──────────────────────────────────────────────── */
.hero { position: relative; text-align: center; padding: 64px 0 56px; }
.hero::before {
  content: "";
  position: absolute;
  top: -90px; left: 50%;
  width: min(880px, 100%);
  height: min(560px, 90vw);
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side at 40% 32%, rgba(239, 159, 39, .15), transparent 72%),
    radial-gradient(closest-side at 62% 26%, rgba(224, 76, 61, .11), transparent 72%);
  animation: glow-breathe 7s ease-in-out infinite alternate;
  pointer-events: none;
}
html.js .hero > * { animation: fade-up .6s var(--ease-out-strong) both; }
html.js .hero > :nth-child(2) { animation-delay: 60ms; }
html.js .hero > :nth-child(3) { animation-delay: 120ms; }
html.js .hero > :nth-child(4) { animation-delay: 180ms; }
html.js .hero > :nth-child(5) { animation-delay: 240ms; }
.hero-logo { border-radius: 20px; box-shadow: var(--shadow-overlay); }
.hero h1 {
  font-size: clamp(40px, 8vw, 58px);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 20px 0 10px;
}
.tag { color: var(--ink-2); font-size: 17px; max-width: 700px; margin: 0 auto 28px; }
.cta-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta-row.left { justify-content: flex-start; }
.req { color: var(--ink-3); font-size: 12.5px; margin-top: 18px; }
.req a { color: inherit; }
.req + .req { margin-top: 8px; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius-card);
  text-decoration: none;
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
  transition: transform .15s var(--ease-out-strong), background-color .15s ease,
              filter .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:active { transform: scale(.96); }
.btn.primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .35);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost {
  background: var(--hover); color: var(--ink);
  box-shadow: var(--shadow-btn);
}
.btn.ghost:hover { background: var(--hover-2); }
.btn.big { font-size: 15.5px; padding: 13px 36px; }
.pill-soon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-card);
  background: var(--inset);
  color: var(--ink-2);
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  box-shadow: var(--shadow-hairline);
  user-select: none;
}
.pill-soon svg { flex: none; color: var(--ink-3); }

/* ── features ──────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.grid article {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-card);
  transition: background-color .2s ease, box-shadow .2s ease, transform .2s var(--ease-out-strong);
}
.grid article:hover {
  background: var(--inset);
  box-shadow: var(--shadow-raised);
  transform: translateY(-1px);
}
.fnum {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em; color: var(--ink-3);
  margin-bottom: 10px;
}
.grid h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.grid p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }

/* ── screens gallery ───────────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery figure {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius-window);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-out-strong), box-shadow .25s ease;
}
.gallery figure:hover { transform: translateY(-2px); box-shadow: var(--shadow-raised); }
.gallery img {
  width: 100%; aspect-ratio: 60 / 103; object-fit: cover;
  display: block; background: #000;
}
.gallery figcaption { padding: 9px 10px; text-align: center; color: var(--ink-2); font-size: 12px; }

/* ── download ──────────────────────────────────────────── */
.dl-card {
  background: var(--surface);
  border-radius: var(--radius-window);
  padding: 24px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.dl-info {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 26px; margin-bottom: 16px;
  color: var(--ink-2); font-size: 13.5px;
}
.dl-version { font-size: 13px; color: var(--ink); }
.dl-changelog { color: var(--ink-2); font-size: 13px; }
.dl-empty { color: var(--ink-2); }
.dl-card .req { margin-top: 14px; }

/* pixel-grid loader — from Beautiful UI's Loading State */
.loader { display: inline-flex; align-items: center; gap: 10px; }
.loader-grid {
  display: grid; flex-shrink: 0;
  grid-template-columns: repeat(3, 4px);
  gap: 1.5px;
}
.loader-grid span {
  width: 4px; height: 4px; border-radius: 1px;
  background: var(--accent);
  opacity: .15;
  animation: pixel-on .65s ease-in-out infinite;
}
.loader-grid span:nth-child(1) { animation-delay: 90ms; }
.loader-grid span:nth-child(2) { animation-delay: 180ms; }
.loader-grid span:nth-child(3) { animation-delay: 270ms; }
.loader-grid span:nth-child(4) { animation-delay: 0ms; }
.loader-grid span:nth-child(5) { animation-delay: 90ms; }
.loader-grid span:nth-child(6) { animation-delay: 180ms; }
.loader-grid span:nth-child(7) { animation-delay: 90ms; }
.loader-grid span:nth-child(8) { animation-delay: 180ms; }
.loader-grid span:nth-child(9) { animation-delay: 270ms; }
.loader-label {
  font-size: 13px; font-weight: 500;
  background-image: linear-gradient(90deg, var(--ink-3) 35%, var(--ink) 50%, var(--ink-3) 65%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer-text 1.4s linear infinite;
}
.loader-time {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--ink-3);
}

/* ── support / pro ─────────────────────────────────────── */
#support h3 { margin: 28px 0 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pro { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: 640px; }
.pro li {
  display: flex; align-items: center; gap: 10px;
  background: var(--inset);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  box-shadow: var(--shadow-hairline);
  color: var(--ink-2); font-size: 13.5px;
}
.pro li::before {
  content: "";
  flex: 0 0 5px; width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
}

/* ── footer ────────────────────────────────────────────── */
footer {
  text-align: center; padding: 32px;
  color: var(--ink-3); font-size: 12.5px;
  border-top: 1px solid var(--line);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }

/* ── legal page ────────────────────────────────────────── */
.legal { max-width: 720px; margin: 0 auto; padding: 52px 0 8px; }
.legal h1 { font-size: clamp(30px, 5vw, 40px); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 8px; }
.legal .updated { color: var(--ink-3); font-size: 13px; margin: 0 0 4px; }
.legal h2 { font-size: 20px; letter-spacing: -0.02em; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.legal a {
  color: var(--accent); text-decoration: underline;
  text-decoration-color: rgba(239, 159, 39, .4);
  text-underline-offset: 3px;
}
.legal a:hover { color: var(--accent-bright); text-decoration-color: currentColor; }

/* ── scroll reveal ─────────────────────────────────────── */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s var(--ease-out-strong), transform .6s var(--ease-out-strong);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
html.js [data-reveal].in { opacity: 1; transform: none; }
.grid [data-reveal]:nth-child(2), .gallery [data-reveal]:nth-child(2) { --reveal-delay: 60ms; }
.grid [data-reveal]:nth-child(3), .gallery [data-reveal]:nth-child(3) { --reveal-delay: 120ms; }
.grid [data-reveal]:nth-child(4), .gallery [data-reveal]:nth-child(4) { --reveal-delay: 180ms; }
.grid [data-reveal]:nth-child(5), .gallery [data-reveal]:nth-child(5) { --reveal-delay: 240ms; }
.grid [data-reveal]:nth-child(6), .gallery [data-reveal]:nth-child(6) { --reveal-delay: 300ms; }

/* ── language ripple ───────────────────────────────────── */
.lang-out {
  opacity: 0 !important;
  transform: translateY(6px) !important;
  transition: opacity .14s ease, transform .14s ease;
}
.lang-in {
  opacity: 1;
  transform: none;
  transition: opacity .2s ease, transform .2s ease;
}
.lang-scan {
  position: fixed; left: 0; right: 0; top: -35vh; height: 30vh; z-index: 60;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent,
    rgba(239, 159, 39, .07) 45%, rgba(239, 159, 39, .11) 55%, transparent);
  transform: translateY(0);
  transition: transform .65s cubic-bezier(.3, .7, .3, 1);
}
.lang-scan.go { transform: translateY(175vh); }

/* ── keyframes ─────────────────────────────────────────── */
@keyframes shimmer-text {
  from { background-position: 150% center; }
  to { background-position: -50% center; }
}
@keyframes pixel-on {
  0%, 100% { opacity: .15; }
  18%, 42% { opacity: 1; }
  62% { opacity: .15; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes glow-breathe {
  from { opacity: .7; }
  to { opacity: 1; }
}
@keyframes mesh-drift-a {
  from { transform: translate3d(-2%, 2%, 0) scale(1.02); }
  to { transform: translate3d(2.5%, -3%, 0) scale(1.1); }
}
@keyframes mesh-drift-b {
  from { transform: translate3d(2%, -2%, 0) scale(1.08); }
  to { transform: translate3d(-2.5%, 3%, 0) scale(1); }
}
@keyframes mesh-drift-c {
  from { transform: translate3d(0, 3%, 0) scale(1.04); }
  to { transform: translate3d(-2%, -2.5%, 0) scale(1.1); }
}
@keyframes hue-cycle {
  from { filter: hue-rotate(-16deg); }
  to { filter: hue-rotate(16deg); }
}

/* ── responsive ────────────────────────────────────────── */
@media (min-width: 560px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .links { display: none; }
  .seg { margin-left: auto; }
  .nav { padding: 10px 18px; }
  main { padding: 0 18px 56px; }
  section { padding: 40px 0; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 40px; }
  .dl-card { padding: 20px 16px; }
}

/* ── reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  html.js .hero > * { animation: none !important; }
  .hero::before { animation: none !important; }
  .bg-mesh { animation: none !important; transition: none !important; }
  .loader-grid span, .loader-label { animation: none !important; }
  .loader-label { -webkit-background-clip: initial; background-clip: initial; background-image: none; color: var(--ink-2); }
  .gallery figure:hover, .grid article:hover { transform: none; }
}
