/* Tokens from the app (ui/src/app.css): graphite and glass, from the logo. */
:root {
  --bg: #f3f3f5;
  --panel: #ffffff;
  --raised: #f7f7f9;
  --line: #e3e3e8;
  --fg: #1c1c1e;
  --muted: #56565d;
  --glass: rgb(28 28 30 / 0.055);
  --rim: rgb(28 28 30 / 0.13);
  --primary: #1c1c1e;
  --on-primary: #ffffff;
  --focus: rgb(28 28 30 / 0.5);
  --code-bg: #1c1c1e;
  --code-fg: #f2f2f4;
  --code-muted: #939399;
  --clear: #17703f;
  /* Severity colours, as the window shows them. */
  --critical: #dc2626;
  --high: #ea580c;
  --medium: #d97706;
  --info: #8e8e96;
  --shadow: 0 1px 2px rgb(16 16 20 / 0.05), 0 6px 18px -8px rgb(16 16 20 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.7);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --panel: #232326;
    --raised: #2a2a2d;
    --line: #313135;
    --fg: #f2f2f4;
    --muted: #b2b2b9;
    --glass: rgb(255 255 255 / 0.06);
    --rim: rgb(255 255 255 / 0.15);
    --primary: #f2f2f4;
    --on-primary: #1c1c1e;
    --focus: rgb(255 255 255 / 0.6);
    --code-bg: #161618;
    --clear: #3dd68c;
    --critical: #f05252;
    --high: #f97316;
    --medium: #fbbf24;
    --info: #8e8e96;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 24px -12px rgb(0 0 0 / 0.5), inset 0 1px 0 rgb(255 255 255 / 0.05);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }

/* Header */
header { padding: 20px 0; }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
/* A wider area around the logo and name for the lenses to follow the pointer
   in (mark.js): padding, taken back by the margins so nothing moves. */
.brand { padding: 24px 32px; margin: -24px -32px; }
/* The logo and name, then where Lenstica is in its life: a label, not a link. */
.identity { display: flex; align-items: center; gap: 12px; }
.stage { position: relative; display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--rim); color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; cursor: default; user-select: none; }
/* The logo's lenses alone, inline, in the text colour (no tile: on either
   theme they stand on the page itself). */
.mark { color: var(--fg); --mx: 0; --my: 0; --spread: 0; display: block; overflow: visible; }
.brand .mark { width: 36px; height: 34px; flex: none; }
/* Moving lenses may leave the drawing's frame (overflow above): they're drawn whole anyway. */
/* Over the logo, each lens moves toward the pointer by its depth (lengths in the logo's own
   units: 560 across, so about 15 is a pixel at this size). */
.mark .lens { transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.mark .back { --depth: 18; --side: -1; }
.mark .middle { --depth: 36; --side: 0; }
.mark .front { --depth: 60; --side: 1; }
.mark .lens {
  transform: translate(
    calc((var(--mx) * var(--depth) + var(--spread) * var(--side) * 46) * 1px),
    calc(var(--my) * var(--depth) * 0.6px)
  );
}
.brand:hover .mark { --spread: 1; }
@media (prefers-reduced-motion: reduce) { .mark .lens { transform: none; transition: none; } }
nav { display: flex; align-items: center; gap: 20px; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--fg); }
/* GitHub's logo, then the star count, filled in when the site is built (scripts/site.ts). */
nav .github { display: inline-flex; align-items: center; gap: 7px; color: var(--fg); }
nav .github svg { width: 18px; height: 18px; }
.stars { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
nav .github:hover .stars { color: var(--fg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* On a phone, only what the footer doesn't repeat. */
@media (max-width: 560px) { nav .wide { display: none; } }

/* Hero */
.hero { padding: 56px 0 80px; text-align: center; }
h1 { font-size: clamp(38px, 7vw, 64px); line-height: 1.05; letter-spacing: -0.035em; margin: 0; font-weight: 700; text-wrap: balance; }
.tagline { font-size: clamp(18px, 2.6vw, 22px); color: var(--muted); margin: 18px auto 0; max-width: 640px; line-height: 1.45; letter-spacing: -0.01em; text-wrap: balance; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
/* Pills, as the app's buttons are (ui/src/lib/components/Button.svelte): the
   main action filled, the rest a panel with a line and a soft shadow. */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  font: 500 15px/1 var(--sans); text-decoration: none;
  border: 1px solid transparent; box-shadow: var(--shadow);
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { opacity: 0.9; }
.btn.secondary { background: var(--panel); color: var(--fg); border-color: var(--line); }
.btn.secondary:hover { background: var(--raised); border-color: var(--rim); }
.btn svg { width: 18px; height: 18px; }

/* The window, as a screenshot in a frame (scripts/screenshot.ts) */
.shot {
  position: relative; margin: 56px auto 0; max-width: 1040px;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--rim);
  box-shadow: 0 2px 4px rgb(16 16 20 / 0.06), 0 30px 70px -20px rgb(16 16 20 / 0.35);
}
.shot img { display: block; width: 100%; height: auto; }
/* The macOS window buttons, where the window leaves room for them. */
/* 12px buttons 8px apart, 20px in, on the 1200px-wide screenshot. */
.lights { position: absolute; top: 2.25%; left: 1.67%; display: flex; gap: 15.4%; width: 4.33%; }
.lights i { flex: 1; aspect-ratio: 1; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.15); }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
@media (prefers-color-scheme: dark) {
  .shot { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.04), 0 30px 80px -20px rgb(0 0 0 / 0.8); }
}

/* Sections */
section { padding: 72px 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(28px, 4vw, 36px); line-height: 1.15; letter-spacing: -0.025em; margin: 0; }
.lede { color: var(--muted); font-size: 18px; max-width: 680px; margin: 14px 0 0; }

/* Features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: -0.01em; margin: 0 0 14px; }
.card h3 svg { width: 19px; height: 19px; color: var(--muted); }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* Findings, as the window lists them: a severity dot, a name, a few words */
.finds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.finds li {
  display: grid; grid-template-columns: 8px 1fr; column-gap: 10px; align-items: baseline;
  padding: 10px 12px; border-radius: 11px; background: var(--raised); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.4;
}
.finds li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--info); transform: translateY(-1px); }
.finds .critical::before { background: var(--critical); }
.finds .high::before { background: var(--high); }
.finds .medium::before { background: var(--medium); }
.finds b { font: 600 13.5px/1.4 var(--mono); overflow-wrap: anywhere; }
.finds span { grid-column: 2; color: var(--muted); }
.plus { margin: 28px 0 0; color: var(--muted); font-size: 15px; }
.plus code { font: 13.5px var(--mono); background: var(--glass); border: 1px solid var(--rim); border-radius: 6px; padding: 1px 6px; color: var(--fg); }

/* Built on standard tools: a tile per tool or source, linking to it */
.tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 32px; }
@media (max-width: 980px) { .tools { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .tools { grid-template-columns: repeat(2, 1fr); } }
.tool {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none;
}
.tool:hover { border-color: var(--rim); }
.tool b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.tool span { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* Wherever you work */
.everywhere { display: grid; grid-template-columns: 1fr 1.35fr; gap: 48px; align-items: center; }
@media (max-width: 820px) { .everywhere { grid-template-columns: 1fr; gap: 28px; } }
.surfaces { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; font-size: 17px; font-weight: 500; }
.surfaces li { display: flex; align-items: center; gap: 12px; }
.surfaces svg {
  width: 38px; height: 38px; padding: 9px; border-radius: 11px; flex: none;
  background: var(--glass); border: 1px solid var(--rim);
}
.code .sev-critical { color: #f87171; font-weight: 600; }
.code .sev-high { color: #fb923c; font-weight: 600; }

/* Code */
.code {
  background: var(--code-bg); color: var(--code-fg);
  border-radius: 13px; padding: 18px 20px; overflow-x: auto;
  font: 14px/1.7 var(--mono); border: 1px solid var(--line);
}
.code pre { margin: 0; font: inherit; white-space: pre; }
.code .c { color: var(--code-muted); }
.code .p { color: var(--code-muted); user-select: none; }
.note { margin-top: 20px; font-size: 15px; color: var(--muted); }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }

/* Downloads (filled in by scripts/site.ts from the latest release) */
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
@media (max-width: 820px) { .downloads { grid-template-columns: 1fr; } }
.dl {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.dl.yours { border-color: var(--rim); outline: 2px solid var(--rim); }
.dl .os { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.dl .os svg { width: 20px; height: 20px; }
.dl .about { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.dl .files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.dl .btn { height: 36px; padding: 0 16px; font-size: 14px; }

/* Pages written in Markdown: the changelog and the roadmap */
.page { padding: 40px 0 72px; }
.page h1 { font-size: clamp(34px, 5vw, 48px); margin: 0; }
.prose { max-width: 760px; }
.prose > p:first-of-type { color: var(--muted); font-size: 18px; }
.prose h2 { font-size: 26px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.prose h2 a { text-decoration: none; }
.prose h2 a:hover { text-decoration: underline; }
.prose h3 { font-size: 17px; margin: 28px 0 0; }
.prose h4 { font-size: 15px; margin: 20px 0 0; color: var(--muted); }
.prose p, .prose ul, .prose ol { margin: 12px 0 0; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose code { font: 14px var(--mono); background: var(--glass); border: 1px solid var(--rim); border-radius: 6px; padding: 1px 6px; }
.prose pre { background: var(--code-bg); color: var(--code-fg); border-radius: 13px; padding: 16px 18px; overflow-x: auto; font: 14px/1.6 var(--mono); }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose blockquote { margin: 16px 0 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--rim); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* The roadmap: a board of Planned, Working on and Complete, a card per item (scripts/site.ts) */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; align-items: start; }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; gap: 36px; } }
.column h2 { display: flex; align-items: center; gap: 9px; font-size: 18px; letter-spacing: -0.01em; margin: 0; }
.column .count {
  font: 600 12px/1 var(--sans); color: var(--muted); letter-spacing: 0;
  padding: 4px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--rim);
}
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--info); flex: none; }
.complete .stage-dot { background: var(--clear); }
.working .stage-dot { background: var(--medium); box-shadow: 0 0 0 4px color-mix(in srgb, var(--medium) 22%, transparent); }
.roadmap { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.roadmap .card { padding: 18px 20px; }
.roadmap h3 { font-size: 16px; letter-spacing: -0.01em; margin: 0 0 6px; }
.roadmap p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.roadmap code { font: 12.5px var(--mono); background: var(--glass); border: 1px solid var(--rim); border-radius: 6px; padding: 1px 5px; }
.working .card { border-color: color-mix(in srgb, var(--medium) 45%, var(--line)); }
.planned .card { box-shadow: none; background: transparent; border-style: dashed; border-color: var(--rim); }
