/* Vibrary public site — editorial redesign (S27a; third pass adds the
   animated gradient hero, scroll reveals, and simpler copy — see
   assets/hero.js).

   Craft direction follows adaline.ai's shipped design system (verified from
   their production CSS bundles 2026-09-02): warm-paper ground, near-black ink,
   an editorial serif for display type with tight negative tracking, a quiet
   grotesk sans for body/UI, and a monospace for kickers/labels/technical
   detail (11px, uppercase, wide-tracked). Restrained radii, hairline rules,
   generous section rhythm, dark closing section.

   Color stays Vibrary's own: the paper/ink/teal palette per
   Vibrary/docs/program/brand/COLOR_SYSTEM.md ("warm gray, deep ink, or soft
   cream" neutral base + single teal accent) — we borrow Adaline's craft, not
   their sage/pink identity. The logomark keeps its fixed VU-meter palette and
   is never recolored. */

:root {
  /* paper ground */
  --paper: #fcfdfb;
  --wash: #f1f4f1;
  --ink: #0b0d12;
  --ink-soft: #40485a;
  --muted: #6a7280;
  --hairline: #e0e5e2;
  --hairline-strong: #cfd6d2;

  /* single brand accent — Vibrary teal */
  --accent: #10877b;      /* on paper: links, kickers, details */
  --accent-bright: #2ec4b6; /* on ink: dark-section accents */

  /* ink sections (V.3 teaser, footer) — shipped in-app dark tokens */
  --d-bg: #0b0d12;
  --d-surface: #131720;
  --d-border: #2a3142;
  --d-text: #e8eaef;
  --d-muted: #8b92a3;

  --serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --serif-body: "Newsreader", "Source Serif Pro", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;

  --radius: 8px;
  --maxw: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  letter-spacing: -0.011em;
  font-feature-settings: "calt" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: rgba(46, 196, 182, 0.28); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- type roles ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.kicker .no { color: var(--accent); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(252, 253, 251, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}
.site-nav a {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.nav-cta {
  color: var(--paper);
  background: var(--ink);
  padding: 9px 20px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.site-nav a.nav-cta:hover { background: var(--accent); color: #fff; }

/* ---------- hero ----------
   Simple at the top: a short centered block of type, then one wide panel
   where the animation carries the weight — a bright gradient field that
   resolves into the VU-meter logomark with its levels alive. */

.hero { padding: 56px 0 80px; text-align: center; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 7.2vw, 5.6rem);
  letter-spacing: -0.03em;
  line-height: 1.0;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.br-sm { display: none; }

.hero .tagline {
  margin: 22px auto 0;
  max-width: 36em;
  font-family: var(--serif-body);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.1vw, 1.4rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.wrap-wide { max-width: 1280px; }

.hero-canvas {
  position: relative;
  margin-top: 44px;
  height: clamp(340px, 56vh, 560px);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(46, 196, 182, 0.14), transparent 60%),
    radial-gradient(110% 90% at 75% 70%, rgba(248, 176, 52, 0.12), transparent 60%),
    var(--paper);
}
.hero-canvas-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* static layer for no-JS / no-canvas: the resolved mark on a soft wash */
.hero-canvas-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(38%, 300px);
  height: auto;
}
.hero-canvas.live .hero-canvas-fallback { display: none; }

@media (max-width: 820px) {
  .hero { padding: 52px 0 60px; }
  .br-sm { display: inline; }
  .hero-canvas { margin-top: 40px; height: clamp(260px, 42vh, 420px); }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { border: 1px solid var(--hairline-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

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

section { padding: 88px 0; }
section + section,
main > .hero + section { border-top: 1px solid var(--hairline); }

.section-head { margin-bottom: 12px; }

section h2 {
  margin-top: 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  letter-spacing: -0.02em;
  line-height: 1.04;
  text-wrap: balance;
}

.section-lede {
  margin-top: 18px;
  max-width: 60ch;
  font-family: var(--serif-body);
  font-weight: 300;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- cards ---------- */

.card-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 16px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px 24px 26px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover { border-color: var(--hairline-strong); background: #fff; }
.card h3 {
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.card .chip {
  display: inline-block;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- V.3 teaser (ink section) ---------- */

.teaser {
  background: var(--d-bg);
  color: var(--d-text);
  text-align: center;
  padding: 108px 0;
}
.teaser .soon {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.teaser h2 {
  margin-top: 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: -0.03em;
  line-height: 1;
}
.teaser p {
  margin: 22px auto 0;
  max-width: 34em;
  font-family: var(--serif-body);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--d-muted);
}

/* ---------- downloads page ---------- */

.dl-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.dl-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dl-card h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.dl-card .meta { color: var(--muted); font-size: 14.5px; }
.dl-card .btn { align-self: flex-start; margin-top: 10px; padding: 10px 22px; font-size: 15px; }
.dl-card.pending { background: var(--wash); border-color: var(--hairline); }
.dl-card .pending-label {
  align-self: flex-start;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dl-hash {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
  word-break: break-all;
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
  margin-top: 6px;
}

.notice {
  margin-top: 36px;
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 72ch;
}
.notice strong { color: var(--ink); }

.install-steps { margin-top: 44px; }
.install-steps h3 {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.install-steps ol { margin-left: 22px; color: var(--ink-soft); max-width: 72ch; }
.install-steps li { margin-bottom: 10px; }
.install-steps code {
  font-family: var(--mono);
  background: var(--wash);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 13.5px;
  color: var(--ink);
}

/* ---------- footer (ink) ---------- */

.site-footer {
  background: var(--d-bg);
  border-top: 1px solid var(--d-border);
  padding: 44px 0 52px;
  color: var(--d-muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}
.site-footer .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer img { height: 22px; width: auto; }
.site-footer .foot-links { margin-left: auto; display: flex; gap: 22px; }
.site-footer a { color: var(--d-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer a:hover { color: var(--d-text); }

@media (max-width: 640px) {
  .site-nav { gap: 16px; }
  .site-nav a.nav-hide-sm { display: none; }
  section { padding: 60px 0; }
  .teaser { padding: 76px 0; }
}

/* ---------- scroll reveals ----------
   Content is visible by default; only once JS marks the root with .js do
   .rv elements start hidden, and an IntersectionObserver reveals them as
   they enter the viewport (hero.js). Reduced-motion users skip the ride. */

.js .rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .rv.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}
