/* ============ FlacCompagnon landing — design tokens from the handoff ======== */
:root {
  --bg: #0d0e13;
  --card: rgba(21, 24, 35, 0.92);
  --border: #2c3140;
  --border-soft: #262c3b;
  --text: #e6e8ee;
  --text-2: #aab2c5;
  --text-3: #8b93a7;
  --text-4: #6b7387;
  --accent: linear-gradient(135deg, #4b82f0, #7b4ff0);
  --link: #8fb0f5;
  --link-h: #b39cf7;
  --up: #ef5b6a; /* upscaled  */
  --ups: #f0b849; /* upsampled */
  --tr: #e08b3b; /* transcoded */
  --clean: #3ecf8e;
  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-h); }

/* Full-screen animated spectrum background */
#bgc { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nav, main, .footer { position: relative; z-index: 1; }

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50; /* stay above the scrolling content */
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 24px;
  background: rgba(13, 14, 19, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 20px; margin-left: 8px; font-size: 14px; }
.nav-links a { color: var(--text-3); }
.nav-links a:hover { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang button {
  background: transparent; color: var(--text-3); border: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; padding: 6px 11px; transition: color 0.15s;
}
.lang button.on { background: var(--accent); color: #fff; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 10px;
  cursor: pointer; transition: filter 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn-grad { background: var(--accent); color: #fff; }
.btn-grad:hover { filter: brightness(1.12); color: #fff; }
.btn-outline { border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: #4b82f0; color: var(--text); }

/* ---- Hero ---- */
.hero { max-width: 1100px; margin: 0 auto; padding: 96px 24px 70px; text-align: center; }
.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2.4px;
  text-transform: uppercase; color: var(--link); margin-bottom: 20px;
}
.hero h1 { font-size: clamp(42px, 6.4vw, 84px); line-height: 1.04; letter-spacing: -0.02em; font-weight: 700; }
.hero h1 span { display: block; }
.grad {
  background: var(--accent); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.sub { max-width: 680px; margin: 24px auto 0; color: var(--text-2); font-size: 17px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 10px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.note { margin-top: 24px; font-family: var(--mono); font-size: 12px; color: var(--text-4); }
.scroll-cue { display: inline-block; margin-top: 46px; font-size: 22px; color: var(--text-3); animation: cuePulse 2.2s ease-in-out infinite; }

/* Entrance animation — opt-in only. The content is ALWAYS visible by default;
   the fade-up only applies when motion is allowed, so nothing can ever stay
   hidden if animations don't run. */
@media (prefers-reduced-motion: no-preference) {
  .up { opacity: 0; animation: heroUp 0.7s ease both; }
  .hero h1 .up:nth-child(1) { animation-delay: 0.08s; }
  .hero h1 .up:nth-child(2) { animation-delay: 0.16s; }
  .hero .sub.up { animation-delay: 0.24s; }
  .hero .hero-cta.up { animation-delay: 0.32s; }
  .hero .hero-badges.up { animation-delay: 0.4s; }
  .hero .note.up { animation-delay: 0.46s; }
}
@keyframes heroUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cuePulse { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(6px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { animation: none; } }

/* ---- Sections ---- */
.section { max-width: 1100px; margin: 0 auto; padding: 90px 24px; }
.section h2 { font-size: 34px; font-weight: 700; margin: 10px 0 0; letter-spacing: -0.01em; }
.lead { max-width: 720px; color: var(--text-2); margin-top: 16px; }
.cap { margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--text-4); }
.note-box {
  margin-top: 30px; padding: 16px 20px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: rgba(21, 24, 35, 0.5); color: var(--text-3); font-size: 14px;
}
.note-inline { color: var(--text-3); font-size: 13.5px; margin-top: 10px; }
.note-inline.center { text-align: center; margin-top: 20px; }

/* ---- Tags & tooltips ---- */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px;
  font-weight: 600; border: 1px solid transparent;
}
.t-ok { color: var(--clean); background: rgba(62, 207, 142, 0.13); border-color: rgba(62, 207, 142, 0.4); }
.t-up { color: var(--up); background: rgba(239, 91, 106, 0.13); border-color: rgba(239, 91, 106, 0.4); }
.t-ups { color: var(--ups); background: rgba(240, 184, 73, 0.13); border-color: rgba(240, 184, 73, 0.4); }
.t-tr { color: var(--tr); background: rgba(224, 139, 59, 0.13); border-color: rgba(224, 139, 59, 0.4); }
.t-sus { color: var(--tr); background: rgba(224, 139, 59, 0.09); border-color: rgba(224, 139, 59, 0.3); }
[data-tip], [data-path] { cursor: help; }

/* inline code (e.g. flac -t) */
code {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em; padding: 1px 6px; border-radius: 5px;
  background: rgba(123, 79, 240, 0.14); border: 1px solid rgba(123, 79, 240, 0.28);
  color: var(--text-1);
}

/* inline tooltip on the detection cards */
.tip-anchor { position: relative; cursor: help; outline: none; }
.tip {
  position: absolute; bottom: calc(100% + 10px); left: 0;
  width: max(220px, 100%); max-width: 320px;
  background: #171a24; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; font-weight: 400;
  line-height: 1.5; color: var(--text-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: 0.15s; z-index: 5;
}
.tip-anchor:hover .tip, .tip-anchor:focus .tip { opacity: 1; visibility: visible; transform: none; }

/* floating tooltip for the app-preview table tags */
#floattip {
  position: fixed; z-index: 200; max-width: 320px; pointer-events: none;
  background: #171a24; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.5; color: var(--text-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.12s;
}

/* ---- Cards ---- */
.cards { display: grid; gap: 20px; margin-top: 34px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 26px 22px;
}
.card h3 { font-size: 18px; font-weight: 600; margin: 2px 0 10px; }
.card p { color: var(--text-2); font-size: 14px; margin-bottom: 2px; }
.card.det .tag { margin-bottom: 10px; }
.det-canvas { width: 100%; height: 150px; margin-top: 16px; display: block; }

/* ---- App window mockup ---- */
.app-window {
  margin-top: 34px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: #12141b; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.titlebar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: #171a24; border-bottom: 1px solid var(--border);
}
.titlebar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.tb-title { margin-left: 8px; font-size: 12.5px; color: var(--text-3); }
.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.count { font-weight: 600; font-size: 13px; }
.chip { font-size: 11.5px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border); }
.c-clean { color: var(--clean); } .c-ups { color: var(--ups); }
.c-tr { color: var(--tr); } .c-sus { color: var(--tr); }
.table-wrap { overflow-x: auto; }
table.results { width: 100%; border-collapse: collapse; font-size: 13px; }
table.results th {
  text-align: left; padding: 10px 14px; color: var(--text-3); font-weight: 500;
  border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12px;
}
table.results td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.results tr:last-child td { border-bottom: none; }
table.results tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.fname { color: var(--text); cursor: help; }
.c-ok { color: var(--clean); }

/* ---- Spectrograms ---- */
.spec-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 30px; align-items: center; margin-top: 30px; }
.spec-canvas {
  width: 100%; height: 300px; border: 1px solid var(--border); border-radius: 12px; background: #0a0b0f; display: block;
}

/* ---- Pipeline ---- */
.pipeline { display: flex; align-items: stretch; gap: 6px; margin-top: 48px; flex-wrap: nowrap; }
.pstage {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 14px 16px; text-align: center;
}
.pstage.wide { flex: 1.8; }
.pnum {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 5px 14px rgba(75, 130, 240, 0.45);
}
.plabel { font-size: 13.5px; font-weight: 500; }
.psub { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.psub span {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border-soft); border-radius: 6px; padding: 3px 7px;
}
.parrow { display: flex; align-items: center; justify-content: center; flex: 0 0 26px; }
.parrow::before { content: "→"; color: #7b4ff0; font-size: 22px; font-weight: 700; }

/* ---- Download ---- */
.dl .dlcard {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--text);
}
.dl .dlcard:hover { border-color: #4b82f0; }
.os { font-size: 18px; font-weight: 700; }
.osx { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.dl .btn { margin-top: 6px; }
.refs { margin-top: 44px; border-top: 1px solid var(--border-soft); padding-top: 24px; }
.refs h4 { font-family: var(--mono); font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.refs p { color: var(--text-4); font-size: 13px; margin-bottom: 8px; max-width: 900px; }

/* ---- Footer ---- */
.footer {
  max-width: 1100px; margin: 0 auto; padding: 30px 24px 50px;
  border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; color: var(--text-4); font-size: 13px;
}
.ft-links { display: flex; gap: 18px; }

/* MD5 preview cell */
table.results .c-mut { color: var(--text-4); }
table.results .nosig { font-size: 11px; color: var(--text-4); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .cards-3 { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
  .pipeline { flex-direction: column; }
  .pstage.wide { flex: 1; }
  .parrow { flex: 0 0 auto; padding: 4px 0; }
  .parrow::before { content: "↓"; }
  .section { padding: 64px 20px; }
}
