/* QAdesk — qadesk.net  |  brand-matched dark theme
   ------------------------------------------------------------------
   Design tokens (Phase 2). Everything below references these, so the
   site stays visually consistent and is easy to retune in one place.
   ------------------------------------------------------------------ */
:root {
  /* --- surfaces (flat → elevated) --- */
  --bg: #0e0e14;          /* documented brand "Canvas" — keep exact */
  --bg-2: #14141d;
  --panel: #171722;
  --panel-2: #1d1d2a;
  --elevated: #21212f;
  --border: #2a2a38;
  --border-strong: #3a3a4e;

  /* --- text --- */
  --ink: #e9e9f1;
  --dim: #a3a3b6;          /* lifted for AA body contrast */
  --faint: #7c7c90;        /* lifted from #6c6c7e for small-text contrast */

  /* --- brand + status --- */
  --accent: #4a9bff;
  --accent-strong: #2f8bff;
  --accent-2: #9b7bff;
  --critical: #ff6b6b;
  --major: #ffa94d;
  --minor: #ffd43b;
  --warning: #74c0fc;
  --ok: #63e6be;
  --success: #63e6be;
  --error: #ff6b6b;

  /* --- tints (status + accent washes) --- */
  --accent-tint: rgba(74,155,255,0.13);
  --accent-ring: rgba(74,155,255,0.55);

  /* --- radius scale --- */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* --- spacing scale (4px base) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 88px;
  --space-10: 120px;

  /* --- elevation (controlled, low-opacity) --- */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,0.55);
  --shadow-lg: 0 30px 80px -30px rgba(0,0,0,0.8);

  /* --- type scale --- */
  --fs-display: clamp(2.3rem, 5vw, 3.5rem);
  --fs-h1: clamp(2rem, 4.4vw, 3rem);
  --fs-h2: clamp(1.7rem, 3.4vw, 2.4rem);
  --fs-h3: 1.18rem;
  --fs-small: 0.9rem;
  --fs-label: 0.78rem;

  /* --- motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 130ms;
  --t-med: 220ms;

  --maxw: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";  /* Inter: single-storey a, stylistic set */
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.021em; font-weight: 800; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
img { max-width: 100%; }

/* Accessible focus ring — visible for keyboard users, quiet for mouse */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--dim); }
.small { font-size: 0.9rem; }
.big { font-size: 1.15rem; }

.skip-link {
  position: absolute; left: -999px; top: 8px; background: var(--accent); color: #071;
  padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; color: #05122e; }

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem;
  font-weight: 700; color: var(--accent); margin-bottom: 14px;
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 0.98rem; line-height: 1;
  padding: 14px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #05122e; box-shadow: 0 1px 0 rgba(255,255,255,0.14) inset, var(--shadow-sm); }
.btn-primary:hover { background: #6aacff; box-shadow: 0 6px 20px -8px rgba(74,155,255,0.7); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.btn-text { background: transparent; color: var(--accent); padding-left: 6px; padding-right: 6px; }
.btn-text:hover { color: #6aacff; }
.btn-sm { padding: 9px 16px; font-size: 0.9rem; }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }
.btn svg { width: 1.05em; height: 1.05em; }

/* ---- header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,14,20,0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-mark { display: inline-flex; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) {
  position: relative; color: var(--dim); font-weight: 500; font-size: 0.95rem;
  transition: color var(--t-fast) var(--ease);
}
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px;
  background: var(--accent); border-radius: 2px; transition: right var(--t-med) var(--ease);
}
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-links a:not(.btn):hover::after { right: 0; }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { right: 0; }
.nav-links .btn { color: #05122e; }
.nav-toggle { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---- hero ---- */
.hero { padding: 88px 0 64px; position: relative; }
/* technical grid — a faint precision motif, masked so it fades into the page */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(760px 520px at 72% 18%, #000 0%, transparent 72%);
  mask-image: radial-gradient(760px 520px at 72% 18%, #000 0%, transparent 72%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(680px 340px at 78% 8%, rgba(74,155,255,0.16), transparent 60%),
    radial-gradient(560px 320px at 12% 40%, rgba(155,123,255,0.10), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 52px; align-items: center; }
.hero-copy h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 20px; }
.lede { font-size: 1.18rem; color: var(--dim); max-width: 560px; margin-bottom: 30px; }
.lede strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.center-cta { justify-content: center; }
.hero-note { margin-top: 18px; color: var(--faint); font-size: 0.9rem; }

/* screenshot frames (real app captures) */
.shot {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8);
}
.shot-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.shot-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #33333f; }
.shot-title { margin-left: 10px; color: var(--faint); font-size: 0.82rem; }
.shot img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.shot-hero { transform: rotate(0.4deg); }
.shot figcaption { padding: 14px 16px; color: var(--dim); font-size: 0.92rem; border-top: 1px solid var(--border); background: var(--bg-2); }
.shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* click-to-zoom lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 4vmin; background: rgba(6,6,12,0.93); cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; width: auto; height: auto; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 24px 80px rgba(0,0,0,0.6); }

/* ---- trust strip ---- */
.strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 34px 24px; text-align: center; }
.stat { display: block; font-size: 2.2rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.stat-label { color: var(--dim); font-size: 0.92rem; }

/* ---- sections ---- */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 48px; }
.section-head h2, .problem h2, .narrow h2, .download h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; }
.section-head.center { max-width: 680px; margin-left: auto; margin-right: auto; }
.problem h2 { margin-bottom: 18px; }

/* ---- features ---- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
/* Centre a lone card on the last row (e.g. a 7th) in the 3-col grid */
.feature-grid > .card:last-child:nth-child(3n+1) { grid-column: 2 / 3; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 26px; transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--accent-ring); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-bottom: 18px;
  border-radius: 12px; background: var(--accent-tint);
  border: 1px solid rgba(74,155,255,0.22); color: var(--accent);
}
.card-icon svg { width: 24px; height: 24px; }
.card:hover .card-icon { background: rgba(74,155,255,0.2); }
.card h3 { font-size: 1.18rem; margin-bottom: 10px; }
.card p { color: var(--dim); font-size: 0.97rem; }

/* Shared inline-SVG icon defaults — one coherent stroke language */
.icon { display: inline-block; vertical-align: middle; width: 24px; height: 24px; flex: none; }
svg.icon { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* ---- steps ---- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: s; }
.steps li { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px; position: relative; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 10px; background: rgba(74,155,255,0.14); color: var(--accent);
  font-weight: 800; font-size: 1.1rem; margin-bottom: 16px;
}
.steps h3 { font-size: 1.1rem; margin-bottom: 8px; }
.steps p { color: var(--dim); font-size: 0.94rem; }

/* ---- formats ---- */
.format-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 860px; margin: 0 auto 26px; }
.format-list li {
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 18px; font-size: 0.92rem; font-weight: 500; color: var(--ink);
}

/* ---- privacy ---- */
.pill-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.pill { display: inline-flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 10px 18px; font-size: 0.92rem; font-weight: 500; }
.pill svg { width: 17px; height: 17px; color: var(--accent); }

/* ---- maker ---- */
.maker blockquote { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; margin-bottom: 18px; }
.maker { background: radial-gradient(600px 300px at 50% 0%, rgba(74,155,255,0.10), transparent 65%); }

/* ---- download ---- */
.download { background: var(--bg-2); border-top: 1px solid var(--border); }
.download h2 { margin-bottom: 14px; }
.download .hero-cta { margin-top: 26px; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0 30px; background: var(--bg); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.footer-grid p { margin-top: 12px; max-width: 320px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 10px; }
.footer-grid nav a { color: var(--dim); font-size: 0.95rem; }
.footer-grid nav a:hover { color: var(--ink); }
.footer-base { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; color: var(--faint); font-size: 0.88rem; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  /* centering rule is desktop-only; don't force a column in 2-/1-col layouts */
  .feature-grid > .card:last-child:nth-child(3n+1) { grid-column: auto; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .strip-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .shot-grid { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 4px; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 14px 24px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 10px 0; }
  .nav-links .btn { margin-top: 8px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .hero { padding: 56px 0 48px; }
}

/* scroll reveal — only when JS is on AND the user allows motion */
@media (prefers-reduced-motion: no-preference) {
  html.js-reveal [data-reveal] {
    opacity: 0; transform: translateY(16px);
    transition: opacity .55s var(--ease), transform .55s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
  }
  html.js-reveal [data-reveal].in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
  .btn, .card, .card-icon, .nav-links a { transition: none; }
}

/* ============ interior pages ============ */
.page-hero { padding: 64px 0 40px; position: relative; border-bottom: 1px solid var(--border); }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(620px 300px at 50% -10%, rgba(74,155,255,0.12), transparent 60%);
}
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; margin-bottom: 14px; }
.page-hero p { color: var(--dim); font-size: 1.12rem; max-width: 640px; }
.page-hero p + p { margin-top: 12px; }
.breadcrumb { color: var(--faint); font-size: 0.9rem; margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--accent); }

/* download */
.dl-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px; text-align: center; max-width: 620px; margin: 0 auto 20px;
}
.dl-card .os {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; margin: 0 auto 14px;
  border-radius: 16px; background: var(--accent-tint);
  border: 1px solid rgba(74,155,255,0.22); color: var(--accent);
}
.dl-card .os svg { width: 30px; height: 30px; }
.dl-card h2 { font-size: 1.5rem; margin-bottom: 6px; }
.dl-meta { color: var(--faint); font-size: 0.9rem; margin: 14px 0 22px; }
.dl-badge { display: inline-block; background: rgba(99,230,190,0.14); color: var(--ok); font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin-bottom: 18px; letter-spacing: .03em; }
.req-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 12px; }
.req-grid .card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.req-grid ul { list-style: none; }
.req-grid li { color: var(--dim); font-size: 0.95rem; padding: 4px 0 4px 22px; position: relative; }
.req-grid li::before { content: "✓"; color: var(--accent); position: absolute; left: 0; }
.note { background: rgba(255,169,77,0.09); border: 1px solid rgba(255,169,77,0.3); border-radius: 10px; padding: 16px 18px; color: var(--dim); font-size: 0.94rem; max-width: 620px; margin: 22px auto 0; }
.note strong { color: var(--ink); }

/* docs */
.doc-layout { display: grid; grid-template-columns: 220px 1fr; gap: 44px; align-items: start; }
.doc-nav { position: sticky; top: 90px; }
.doc-nav h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin: 18px 0 8px; }
.doc-nav a { display: block; color: var(--dim); font-size: 0.94rem; padding: 5px 0; }
.doc-nav a:hover { color: var(--accent); }
.doc-content h2 { font-size: 1.5rem; margin: 40px 0 14px; scroll-margin-top: 90px; }
.doc-content h2:first-child { margin-top: 0; }
.doc-content h3 { font-size: 1.12rem; margin: 22px 0 8px; }
.doc-content p, .doc-content li { color: var(--dim); }
.doc-content p { margin-bottom: 12px; }
.doc-content ul, .doc-content ol { margin: 0 0 14px 22px; }
.doc-content li { margin-bottom: 6px; }
.doc-content strong { color: var(--ink); }
.doc-content code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 0.88em; color: var(--accent); }
.kbd { background: var(--panel-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; font-size: 0.85em; font-weight: 600; color: var(--ink); }

/* changelog */
.log { max-width: 760px; margin: 0 auto; }
.log-entry { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--border); }
.log-ver { font-weight: 800; font-size: 1.15rem; }
.log-date { color: var(--faint); font-size: 0.88rem; margin-top: 4px; }
.log-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 5px; margin-right: 8px; }
.log-tag.new { background: rgba(99,230,190,0.14); color: var(--ok); }
.log-tag.fix { background: rgba(116,192,252,0.14); color: var(--warning); }
.log-tag.imp { background: rgba(155,123,255,0.16); color: var(--accent-2); }
.log-body ul { list-style: none; }
.log-body li { color: var(--dim); padding: 6px 0; font-size: 0.96rem; }

/* about */
.about-lead { font-size: 1.25rem; color: var(--ink); font-weight: 500; line-height: 1.6; }
.about-body p { color: var(--dim); margin-bottom: 16px; font-size: 1.02rem; }

/* inline framed screenshots inside content */
.doc-content .shot { margin: 18px 0 30px; }
.dl-shot { max-width: 780px; margin: 56px auto 0; }
.dl-shot figcaption { text-align: center; }

@media (max-width: 820px) {
  .doc-layout { grid-template-columns: 1fr; gap: 24px; }
  .doc-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px 16px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
  .doc-nav h4 { width: 100%; margin: 8px 0 2px; }
  .req-grid { grid-template-columns: 1fr; }
  .log-entry { grid-template-columns: 1fr; gap: 10px; }
}

.brand-name .ac { color: var(--accent); }
