/* avelde.ch
   System fonts only and no third-party requests: the privacy page can say the
   site itself collects nothing, and mean it. The one script (app.js) is served
   from here and only draws the illustration. */

:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #f0f2ef;
  --text: #14181b;
  --muted: #5a6168;
  --line: #e1e4df;
  --accent: #0d7a66;
  --accent-strong: #095c4d;
  --accent-text: #ffffff;
  --glow: #ff3fa4;
  --code: #eef0ec;
  --shadow: 0 1px 2px rgba(20, 24, 27, .05), 0 8px 28px rgba(20, 24, 27, .07);
  --radius: 14px;
  --scope: #07090b;              /* the microscope: always dark */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1113; --surface: #161a1d; --surface-2: #1b2024; --text: #e8eae7;
  --muted: #a0a8ae; --line: #262c31; --accent: #4cc3a9; --accent-strong: #6fd6bf;
  --accent-text: #06120f; --code: #20262a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1113; --surface: #161a1d; --surface-2: #1b2024; --text: #e8eae7;
    --muted: #a0a8ae; --line: #262c31; --accent: #4cc3a9; --accent-strong: #6fd6bf;
    --accent-text: #06120f; --code: #20262a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
img, svg, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ── header ─────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700;
         font-size: 19px; letter-spacing: .01em; color: var(--text); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
nav.main { margin-left: auto; display: flex; gap: 22px; align-items: center; }
nav.main a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav.main a:hover { color: var(--text); }
nav.main .button { color: var(--accent-text); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.theme-toggle:hover { color: var(--text); }
@media (max-width: 720px) { nav.main a:not(.button) { display: none; } }

/* ── buttons ────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-text);
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 16px;
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.button:hover { background: var(--accent-strong); color: var(--accent-text); transform: translateY(-1px); }
.button.small { padding: 8px 14px; font-size: 14px; border-radius: 8px; }
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button.ghost:hover { background: var(--surface-2); color: var(--text); }
.button svg { width: 18px; height: 18px; }

/* ── hero ───────────────────────────────────────────────── */
.hero { padding: 72px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .hero { padding-top: 40px; } }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .08em;
           text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 18px; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-meta { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* the app window around the live illustration */
.window {
  background: var(--scope); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}
.window-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
              background: #15191c; border-bottom: 1px solid #22282d; }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.window-bar i:nth-child(1) { background: #ff5f57; }
.window-bar i:nth-child(2) { background: #febc2e; }
.window-bar i:nth-child(3) { background: #28c840; }
.window-bar span { margin-left: 10px; color: #8d969c; font-size: 12px; }
.scope { position: relative; aspect-ratio: 4 / 3; }
.scope canvas { width: 100%; height: 100%; }
.scope .tag {
  position: absolute; right: 10px; bottom: 10px; font-size: 11px; color: #9aa3a8;
  background: rgba(0, 0, 0, .55); padding: 3px 8px; border-radius: 6px;
}
.layers { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px;
          background: #101315; border-top: 1px solid #22282d; }
.layers button {
  font: inherit; font-size: 13px; color: #b9c1c6; background: #1a1f23;
  border: 1px solid #2a3136; border-radius: 999px; padding: 5px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.layers button .dot { width: 9px; height: 9px; border-radius: 50%; }
.layers button[aria-pressed="false"] { opacity: .45; }
.layers button:hover { border-color: #3a434a; color: #fff; }
.layers .spacer { flex: 1; }

/* ── sections ───────────────────────────────────────────── */
section { padding: 72px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 12px; }
.section-lead { color: var(--muted); font-size: 18px; margin: 0 0 40px; max-width: 40em; }
h3 { font-size: 18px; margin: 0 0 6px; }

.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
section:not(.alt) .feature { background: var(--surface); }
.feature p { margin: 0; color: var(--muted); font-size: 15.5px; }
.feature .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
                 background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
                 margin-bottom: 14px; }
.feature .icon svg { width: 22px; height: 22px; }

/* how it works: steps drive the illustration */
.steps-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .steps-grid { grid-template-columns: 1fr; } }
.steplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steplist button {
  width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; display: grid; grid-template-columns: 34px 1fr; gap: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.steplist button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.steplist button[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.steplist .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
                 font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--muted); }
.steplist button[aria-selected="true"] .num { background: var(--accent); color: var(--accent-text); }
.steplist strong { display: block; margin-bottom: 2px; }
.steplist span.d { color: var(--muted); font-size: 15px; }
.sticky { position: sticky; top: 88px; }

/* results: a workbook that fills as the illustration runs */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
         overflow: hidden; box-shadow: var(--shadow); }
.sheet-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px;
             border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 14px; color: var(--muted); }
.sheet-bar .xl { width: 22px; height: 22px; border-radius: 5px; background: #1f7a45; color: #fff;
                 display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.sheet-scroll { overflow-x: auto; }
table.results { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.results th, table.results td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.results th { font-weight: 600; color: var(--muted); background: var(--surface); }
table.results tr.new td { animation: flash 1.4s ease; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill.kill { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pill.failed { background: color-mix(in srgb, #e0782b 18%, transparent); color: #c4621b; }
:root[data-theme="dark"] .pill.failed { color: #f0a368; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.failed { color: #f0a368; } }
.sheet-empty td { color: var(--muted); font-style: italic; }
.note { font-size: 13.5px; color: var(--muted); margin-top: 12px; }

/* local-first band */
.band { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.band svg { width: 120px; height: 120px; }
@media (max-width: 640px) { .band { grid-template-columns: 1fr; } }
.band p { margin: 0; color: var(--muted); }

/* download */
.download-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
                 padding: 28px; box-shadow: var(--shadow); }
.download-card .row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.download-card .meta { color: var(--muted); font-size: 15px; }
.download-card .req { color: var(--muted); font-size: 15px; margin: 18px 0 8px; }
.download-card h3 { margin-top: 26px; }
ol.install { padding-left: 22px; margin: 10px 0 0; }
ol.install li { margin: 8px 0; }
code { background: var(--code); padding: 1px 7px; border-radius: 5px; font-size: .9em;
       font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* contact */
.contact { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.contact .button { font-size: 17px; }

/* privacy / legal pages */
.page { padding: 56px 0 72px; }
.page h1 { font-size: clamp(30px, 4vw, 42px); }
.page h2 { font-size: 24px; margin-top: 44px; }
.page h3 { margin-top: 26px; }
table.plain { border-collapse: collapse; width: 100%; font-size: 15.5px; }
table.plain th, table.plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { color: var(--muted); font-weight: 600; }

.todo { background: #fff1b8; color: #5a4500; padding: 0 5px; border-radius: 4px; }
:root[data-theme="dark"] .todo { background: #4a3c08; color: #ffe08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .todo { background: #4a3c08; color: #ffe08a; } }

/* footer */
footer.site { border-top: 1px solid var(--line); padding: 28px 0 36px; }
footer.site .wrap { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
footer.site a, footer.site span { color: var(--muted); font-size: 14px; text-decoration: none; }
footer.site a:hover { color: var(--text); }
footer.site .grow { flex: 1; }

/* reveal on scroll (only when scripting runs; content is visible without it) */
/* A small rise as sections scroll in. Never a fade: text must stay readable
   even if the script is slow, blocked, or a screenshot catches it mid-way. */
.js .reveal { transform: translateY(12px); transition: transform .6s ease; }
.js .reveal.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { transform: none; transition: none; } }
.small { font-size: 14px; color: var(--muted); }

/* Grid children may shrink below their content: the canvases carry a pixel
   width for sharpness, and without this a phone-width column grew to fit it. */
.hero .wrap > *, .steps-grid > *, .features > *, .band > * { min-width: 0; }
.scope canvas { width: 100%; }
