/* ===========================================================
   Clavix — landing page
   Dark "vault" theme, Bitwarden-blue accent (#175ddc).
   Hand-written, no framework, no third-party requests.
   =========================================================== */

/* --- Self-hosted variable font (honours the no-telemetry promise) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-latin.woff2') format('woff2');
}

/* --- Design tokens --- */
:root {
  --brand: #175ddc;
  --brand-light: #4d8bf0;
  --brand-lighter: #8fb6f6;
  --brand-dark: #1148ad;
  --brand-glow: rgba(23, 93, 220, 0.45);

  --bg: #070b16;
  --bg-2: #0b1222;
  --surface: #111a30;
  --surface-2: #16203a;
  --surface-3: #1d2a49;
  --border: rgba(143, 170, 220, 0.14);
  --border-strong: rgba(143, 170, 220, 0.28);

  --text: #eef2fb;
  --text-soft: #c2cce0;
  --muted: #8593b0;
  --muted-dim: #5f6c89;

  --green: #3fb950;
  --amber: #d9a23a;
  --red: #f06868;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'SFMono-Regular', 'JetBrains Mono', Consolas, 'Liberation Mono', Menlo, monospace;

  --header-h: 64px;
  --maxw: 1160px;
  --radius: 14px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--brand-light); text-decoration: none; transition: color .18s; }
a:hover { color: var(--brand-lighter); }
ul { list-style: none; }
strong { color: #fff; font-weight: 650; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(143, 170, 220, 0.12);
  color: var(--brand-lighter);
  padding: 0.12em 0.42em;
  border-radius: 5px;
}

::selection { background: var(--brand); color: #fff; }

/* --- Accessibility --- */
.skip-link {
  position: absolute; top: -120%; left: 1rem; z-index: 1000;
  background: var(--brand); color: #fff;
  padding: 0.5rem 1rem; border-radius: 0 0 8px 8px;
  font-size: 0.875rem; font-weight: 600;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 3px; border-radius: 4px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Layout helpers --- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 6rem 0; position: relative; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brand-light);
  margin-bottom: 0.9rem;
}
.section-head { max-width: 660px; margin: 0 auto 3.5rem; text-align: center; }
.section-title {
  font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem);
  font-weight: 750; line-height: 1.12; letter-spacing: -0.02em;
}
.section-sub { color: var(--text-soft); font-size: 1.12rem; margin-top: 0.9rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.8rem 1.5rem; border-radius: 10px;
  font-size: 1rem; font-weight: 650; font-family: inherit;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .12s, background .18s, border-color .18s, box-shadow .18s, color .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
  color: #fff; box-shadow: 0 8px 24px -8px var(--brand-glow);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 34px -10px var(--brand-glow); }

.btn-ghost {
  background: rgba(143, 170, 220, 0.06);
  border-color: var(--border-strong); color: var(--text);
}
.btn-ghost:hover { background: rgba(143, 170, 220, 0.12); color: #fff; border-color: var(--brand-light); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* --- Alpha banner --- */
.alpha-bar {
  background: linear-gradient(90deg, rgba(217,162,58,.16), rgba(217,162,58,.08));
  border-bottom: 1px solid rgba(217,162,58,.28);
  color: #f2d9a6; font-size: 0.86rem; text-align: center;
  padding: 0.5rem 1rem;
}
.alpha-bar strong { color: var(--amber); }
.alpha-bar a { color: #f2d9a6; text-decoration: underline; text-underline-offset: 2px; }
.alpha-bar a:hover { color: #fff; }

/* --- Header --- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 11, 22, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }
.logo:hover { color: var(--text); }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo .accent { color: var(--brand-light); }

.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a:not(.btn) { color: var(--text-soft); font-size: 0.95rem; font-weight: 500; }
.nav-links a:not(.btn):hover, .nav-links a.active { color: #fff; }
.nav-ico { display: inline-flex; color: var(--text-soft); }
.nav-ico:hover { color: #fff; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 0.35rem; color: var(--text); cursor: pointer;
}

/* --- Backgrounds / glow --- */
.glow {
  position: absolute; border-radius: 50%; filter: blur(90px);
  pointer-events: none; z-index: 0; opacity: 0.5;
}

/* --- Hero --- */
.hero { padding: 5.5rem 0 5rem; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 50% at 50% -10%, rgba(23,93,220,0.28), transparent 70%),
    radial-gradient(40% 40% at 85% 20%, rgba(77,139,240,0.14), transparent 70%);
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 3rem; align-items: center;
}
.hero-copy { max-width: 560px; }
.hero h1 {
  font-size: clamp(2.2rem, 1.3rem + 3.6vw, 3.5rem);
  line-height: 1.07; letter-spacing: -0.03em; font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-lighter), var(--brand-light) 60%, #a98bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { font-size: 1.2rem; color: var(--text-soft); margin-top: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.1rem; margin-top: 2rem; color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-dim); }
.hero-meta b { color: var(--text-soft); font-weight: 600; }

/* --- App mockup (CSS art, no screenshot needed) --- */
.mockup {
  position: relative; z-index: 1;
  border-radius: 16px; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.02) inset;
}
.mockup-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 0.9rem; background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.mockup-bar .tl { display: flex; gap: 0.45rem; }
.mockup-bar .tl span { width: 11px; height: 11px; border-radius: 50%; background: #2c3550; }
.mockup-title { margin-left: auto; margin-right: auto; font-size: 0.78rem; color: var(--muted); font-weight: 500; padding-right: 30px; }
.mockup-body { display: grid; grid-template-columns: 184px 1fr; min-height: 360px; }

/* sidebar tree */
.mk-tree { background: var(--bg-2); border-right: 1px solid var(--border); padding: 0.7rem 0.5rem; font-size: 0.82rem; }
.mk-search {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.4rem 0.55rem; color: var(--muted-dim);
  font-size: 0.76rem; margin-bottom: 0.7rem;
}
.mk-node { display: flex; align-items: center; gap: 0.45rem; padding: 0.32rem 0.5rem; border-radius: 7px; color: var(--text-soft); }
.mk-node.child { padding-left: 1.55rem; }
.mk-node.child2 { padding-left: 2.5rem; }
.mk-node .ic { color: var(--brand-light); display: inline-flex; }
.mk-node.drop { background: rgba(23,93,220,0.18); outline: 1px dashed var(--brand-light); color: #fff; }
.mk-node.sel { background: var(--surface-3); color: #fff; }
.mk-caret { color: var(--muted-dim); }

/* item list */
.mk-list { padding: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.mk-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.65rem; border-radius: 9px;
  background: var(--surface-2); border: 1px solid transparent;
}
.mk-item:nth-child(odd) { background: var(--surface); }
.mk-item.dragging { border-color: var(--brand-light); box-shadow: 0 10px 24px -10px var(--brand-glow); transform: translateX(4px); background: var(--surface-3); }
.mk-fav { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 0.8rem; flex-shrink: 0; color: #fff; }
.mk-meta { min-width: 0; }
.mk-meta .t { font-size: 0.84rem; color: var(--text); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-meta .s { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-badge { margin-left: auto; font-size: 0.66rem; color: var(--brand-lighter); background: rgba(23,93,220,0.16); padding: 0.1rem 0.4rem; border-radius: 5px; flex-shrink: 0; }
.mk-ghost { position: absolute; right: 16px; bottom: 16px; font-size: 0.7rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 0.25rem 0.55rem; border-radius: 6px; }

/* --- Trust strip --- */
.trust { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-2); padding: 1.6rem 0; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.4rem; }
.trust-row span { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.trust-row svg { color: var(--brand-light); }

/* --- Features --- */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
}
.fcard {
  background: linear-gradient(180deg, var(--surface), var(--surface) 60%, rgba(17,26,48,0.6));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.7rem; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.fcard:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(0,0,0,0.8); }
.fcard.wide { grid-column: span 1; }
.ficon {
  width: 46px; height: 46px; border-radius: 11px; margin-bottom: 1.1rem;
  display: grid; place-items: center; color: var(--brand-light);
  background: rgba(23,93,220,0.13); border: 1px solid rgba(23,93,220,0.22);
}
.fcard h3 { font-size: 1.12rem; font-weight: 650; margin-bottom: 0.4rem; }
.fcard p { font-size: 0.95rem; color: var(--text-soft); line-height: 1.6; }
.fcard .tag { color: var(--brand-lighter); font-weight: 600; }

/* --- Security section --- */
.security { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.sec-list { display: flex; flex-direction: column; gap: 1.1rem; }
.sec-item { display: flex; gap: 0.9rem; }
.sec-item .ck { flex-shrink: 0; color: var(--brand-light); margin-top: 3px; }
.sec-item h4 { font-size: 1rem; font-weight: 650; margin-bottom: 0.15rem; }
.sec-item p { font-size: 0.92rem; color: var(--text-soft); }
.sec-note {
  margin-top: 1.6rem; padding: 1rem 1.15rem; border-radius: 11px;
  background: rgba(217,162,58,.08); border: 1px solid rgba(217,162,58,.26);
  color: #e7d3a8; font-size: 0.88rem;
}
.sec-note strong { color: var(--amber); }
.code-card {
  background: #06090f; border: 1px solid var(--border-strong); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,0.8);
}
.code-card .ch { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.code-card .ch .tl { display: flex; gap: 0.4rem; }
.code-card .ch .tl span { width: 10px; height: 10px; border-radius: 50%; background: #2c3550; }
.code-card .ch .fn { font-size: 0.76rem; color: var(--muted); margin-left: 0.4rem; font-family: var(--font-mono); }
.code-card pre { padding: 1.2rem 1.3rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.75; }
.code-card .cm { color: var(--muted-dim); }
.code-card .kw { color: #d98bff; }
.code-card .fn2 { color: var(--brand-light); }
.code-card .str { color: #6fcf97; }
.code-card .ok { color: var(--green); }

/* --- Comparison --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 560px; }
thead th { padding: 1.1rem 1.3rem; text-align: left; font-weight: 600; color: var(--text-soft); border-bottom: 1px solid var(--border); }
thead th.col-clavix { color: var(--brand-light); }
thead th.col-clavix::before { content: ''; }
tbody td { padding: 0.9rem 1.3rem; border-bottom: 1px solid var(--border); color: var(--text-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody td:first-child { color: var(--text); font-weight: 500; }
.col-clavix-cell { background: rgba(23,93,220,0.07); }
tbody td strong { color: #fff; }
.ic-yes { color: var(--green); }
.ic-no { color: var(--muted-dim); }
.ic-part { color: var(--amber); }
.comp-note { text-align: center; margin-top: 1.3rem; font-size: 0.82rem; color: var(--muted-dim); font-style: italic; }

/* --- Download --- */
.dl-version { text-align: center; margin-bottom: 2.2rem; color: var(--muted); font-size: 0.95rem; }
.dl-version b { color: var(--brand-light); font-weight: 650; }
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.dl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.7rem; display: flex; flex-direction: column; gap: 0.55rem; transition: border-color .2s, transform .2s;
}
.dl-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.dl-os { display: flex; align-items: center; gap: 0.7rem; }
.dl-os svg { color: var(--brand-light); }
.dl-os h3 { font-size: 1.2rem; font-weight: 700; }
.dl-links { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.8rem; }
.dl-links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.85rem; border-radius: 9px; font-size: 0.9rem; font-weight: 550;
  background: rgba(143,170,220,0.05); border: 1px solid var(--border); color: var(--text-soft);
  transition: background .18s, border-color .18s, color .18s;
}
.dl-links a:hover { background: rgba(23,93,220,0.12); border-color: var(--brand-light); color: #fff; }
.dl-links a .fmt { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.dl-links a:hover .fmt { color: var(--brand-lighter); }
.dl-foot { text-align: center; margin-top: 2.2rem; color: var(--muted); font-size: 0.9rem; }
.dl-build { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; border-radius: 6px; background: rgba(143,170,220,0.08); font-size: 0.78rem; }

/* --- FAQ --- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: 11px; margin-bottom: 0.8rem; background: var(--surface); overflow: hidden; }
.faq-item[open] { border-color: var(--border-strong); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 1.3rem; cursor: pointer; font-weight: 600; font-size: 1.02rem;
  list-style: none; user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-chev { flex-shrink: 0; color: var(--muted); transition: transform .25s; }
.faq-item[open] .faq-chev { transform: rotate(180deg); color: var(--brand-light); }
.faq-a { padding: 0 1.3rem 1.25rem; color: var(--text-soft); font-size: 0.96rem; line-height: 1.7; }
.faq-a a { text-decoration: underline; text-underline-offset: 2px; }

/* --- CTA band --- */
.cta {
  text-align: center; border-radius: 20px; padding: 3.5rem 2rem; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #102449, #0b1426);
  border: 1px solid var(--border-strong);
}
.cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 120% at 50% 0%, rgba(23,93,220,0.3), transparent 70%); }
.cta > * { position: relative; z-index: 1; }
.cta h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); font-weight: 750; letter-spacing: -0.02em; }
.cta p { color: var(--text-soft); margin: 0.8rem auto 1.8rem; max-width: 540px; font-size: 1.08rem; }
.cta .hero-actions { justify-content: center; }

/* --- Footer --- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 3.5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-brand .logo { margin-bottom: 0.9rem; }
.footer-brand p { color: var(--muted); font-size: 0.9rem; max-width: 280px; }
.footer-col h4 { font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { color: var(--text-soft); font-size: 0.92rem; }
.footer-col a:hover { color: var(--brand-light); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1.8rem;
  display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; justify-content: space-between; align-items: center;
  color: var(--muted-dim); font-size: 0.85rem;
}
.footer-bottom a { color: var(--muted); }
.footer-bottom .priv { color: var(--muted-dim); }

/* --- Reveal on scroll --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-copy { max-width: none; }
  .mockup { max-width: 560px; margin: 0 auto; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .sec-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 720px) {
  section { padding: 4rem 0; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.4rem;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.4rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: 0.5rem 0; }
  .nav-links .nav-ico { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .hero-actions .btn { width: 100%; }
  .mockup-body { grid-template-columns: 140px 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
