/* ElfClean site. Colours are the app's own "Aurora" palette (App/ElfClean/Sources/Styles.swift):
   ice by day, obsidian by night, one pine/mint accent. The level colours are the app's risk
   colours and mean the same thing here: what rebuilds itself, what to review, personal data. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/HankenGrotesk.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f1f6f5;
  --bg-deep: #e6efec;
  --card: #ffffff;
  --raised: #f7fbfa;
  --ink: #0b1b18;
  --muted: #4d655f;
  --rule: #d3e0dc;
  --accent: #0a7157;
  --accent-ink: #ffffff;
  --tube: #e4ecea;
  --tube-edge: #cfdcd8;
  --used: #c9d6d2;
  --caches: #4bc79b;
  --recommended: #0e8f70;
  --personal: #d39a2e;
  --risk-text: #a63a2a;
  --risk-fill: #f6dcd6;
  --glow: #3fe2b0;
  --code-bg: #e8f0ed;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06110e;
    --bg-deep: #050e0c;
    --card: #0c1a17;
    --raised: #102420;
    --ink: #e3f1ec;
    --muted: #a9c2b8;
    --rule: #1d3530;
    --accent: #4cecbb;
    --accent-ink: #06110e;
    --tube: #0b1714;
    --tube-edge: #1d3530;
    --used: #23403a;
    --caches: #5ed9ae;
    --recommended: #2fb88e;
    --personal: #e7b553;
    --risk-text: #f38a78;
    --risk-fill: #3a1c17;
    --glow: #4cecbb;
    --code-bg: #0f201c;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 16px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); margin-inline: auto; }

.num { font-variant-numeric: tabular-nums; }

/* Header */
.site-head { padding: 22px 0; }
.site-head .wrap { display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; }
.site-head nav { margin-left: auto; display: flex; gap: 22px; align-items: center; font-size: 16px; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ink); }
.site-head nav a.button { color: var(--accent-ink); }
@media (max-width: 640px) {
  .site-head nav .optional { display: none; }
}

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 650; font-size: 17px; text-decoration: none;
  padding: 14px 24px; border-radius: 999px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 6px 18px -8px var(--accent);
}
.button:hover { filter: brightness(1.06); }
.button svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.button.small { padding: 9px 16px; font-size: 15px; }

/* Hero */
.hero { padding: 40px 0 80px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(42px, 6.4vw, 76px); line-height: 1.0; letter-spacing: -0.035em;
  font-weight: 800; margin: 0 0 24px; text-wrap: balance;
}
.hero .lede { font-size: 21px; line-height: 1.5; color: var(--muted); margin: 0 0 32px; max-width: 34em; }
.hero .fine { font-size: 15px; color: var(--muted); margin: 14px 0 0; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
}

/* The vessel: the disk as a tube, as the app draws it. Used space fills from the bottom; the
   bands under the surface are what each level would take away. Choosing a level moves the
   dashed "after" line. Pure CSS (:has), so it works without script. */
.gauge {
  background: var(--card); border: 1px solid var(--rule); border-radius: 28px;
  padding: 26px 26px 22px; display: grid; grid-template-columns: 112px 1fr; gap: 8px 24px;
}
.gauge-caption { grid-column: 1 / -1; margin: 10px 0 0; font-size: 14px; color: var(--muted); }

.tube {
  position: relative; height: 420px; width: 72px; margin-left: 34px;
  border-radius: 36px; background: var(--tube); border: 1px solid var(--tube-edge);
}
.tube .used, .tube .band { position: absolute; left: 0; right: 0; }
.tube .used { bottom: 0; height: 91.8%; background: var(--used); border-radius: 0 0 35px 35px; }
.tube .band { transition: opacity 0.35s ease; opacity: 0.22; }
.band.caches { bottom: 86.33%; height: 5.47%; background: var(--caches); }
.band.recommended { bottom: 77.34%; height: 8.99%; background: var(--recommended); }
.band.personal { bottom: 66.02%; height: 11.32%; background: var(--personal); }

.surface, .after { position: absolute; left: -34px; right: 0; height: 0; }
.surface { bottom: 91.8%; border-top: 2px solid var(--accent); }
.surface::after {
  content: ""; position: absolute; right: 30px; top: -5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--glow); box-shadow: 0 0 10px 3px var(--glow);
}
.after { border-top: 2px dashed var(--ink); transition: bottom 0.5s cubic-bezier(0.3, 0.7, 0.2, 1); bottom: 77.34%; }
.after::before { content: ""; position: absolute; left: -2px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

.readout { display: flex; flex-direction: column; min-width: 0; }
.ticked { margin: 0; line-height: 1; }
.ticked .big { font-size: 64px; font-weight: 750; letter-spacing: -0.04em; }
.ticked .unit { font-size: 26px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.ticked-note { font-size: 15px; color: var(--muted); margin: 8px 0 16px; line-height: 1.45; }
.ticked-note strong { color: var(--ink); font-weight: 650; }

.levels { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; min-width: 0; }
.levels legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.levels label {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 12px; align-items: baseline;
  padding: 10px 12px; border-radius: 14px; cursor: pointer; border: 1px solid transparent; position: relative;
}
.levels label:hover { background: var(--raised); }
.levels input { position: absolute; opacity: 0; pointer-events: none; }
.levels .dot { width: 12px; height: 12px; border-radius: 50%; align-self: center; }
.levels .name { font-weight: 650; font-size: 17px; }
.levels .size { font-size: 16px; color: var(--muted); }
.levels .desc { grid-column: 2 / -1; font-size: 14px; color: var(--muted); line-height: 1.45; }
.levels label:has(input:checked) { background: var(--raised); border-color: var(--rule); }
.levels label:has(input:focus-visible) { outline: 3px solid var(--glow); outline-offset: 1px; }
.dot.caches { background: var(--caches); }
.dot.recommended { background: var(--recommended); }
.dot.personal { background: var(--personal); }

.gauge .shows { display: none; }
.gauge:has(#lv-caches:checked) .shows.caches,
.gauge:has(#lv-recommended:checked) .shows.recommended,
.gauge:has(#lv-personal:checked) .shows.personal { display: inline; }
.gauge:has(#lv-caches:checked) .after { bottom: 86.33%; }
.gauge:has(#lv-recommended:checked) .after { bottom: 77.34%; }
.gauge:has(#lv-personal:checked) .after { bottom: 66.02%; }
.gauge:has(#lv-caches:checked) .band.caches,
.gauge:has(#lv-recommended:checked) :is(.band.caches, .band.recommended),
.gauge:has(#lv-personal:checked) .band { opacity: 1; }

@media (max-width: 520px) {
  .gauge { grid-template-columns: 64px 1fr; padding: 20px 14px 18px; gap: 8px 12px; }
  .tube { width: 44px; margin-left: 18px; height: 400px; }
  .surface, .after { left: -18px; }
  .surface::after { right: 18px; }
  .ticked .big { font-size: 50px; }
  .levels label { padding: 8px 8px; gap: 2px 10px; }
}

/* Sections */
section.block { padding: 88px 0; }
section.block.tinted { background: var(--bg-deep); }
h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 780; margin: 0 0 18px; text-wrap: balance; }
h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; margin: 0 0 8px; }
.intro { font-size: 20px; color: var(--muted); max-width: 36em; margin: 0 0 40px; }
p { margin: 0 0 1em; }

/* The ledger: what ElfClean looks for, where it lives, and how careful to be. */
.ledger { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: 20px; overflow: hidden; border: 1px solid var(--rule); font-size: 16px; }
.ledger th, .ledger td { text-align: left; padding: 15px 20px; vertical-align: top; border-top: 1px solid var(--rule); }
.ledger thead th { border-top: 0; font-size: 14px; font-weight: 600; color: var(--muted); background: var(--raised); }
.ledger tbody th { font-weight: 650; }
.ledger tbody th span { display: block; font-weight: 400; color: var(--muted); font-size: 15px; }
.ledger code { font-size: 13px; white-space: nowrap; }
.ledger td.where { max-width: 360px; }
.ledger .group td { background: var(--raised); font-weight: 650; font-size: 15px; color: var(--muted); padding-top: 11px; padding-bottom: 11px; }
.tag { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 14px; font-weight: 550; }
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.tag.rebuilds::before { background: var(--caches); }
.tag.review::before { background: var(--recommended); }
.tag.personal::before { background: var(--personal); }
@media (max-width: 760px) {
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr, .ledger th, .ledger td { display: block; }
  .ledger tr { border-top: 1px solid var(--rule); padding: 12px 16px; }
  .ledger tr:first-child { border-top: 0; }
  .ledger tr.group { padding: 0; }
  .ledger th, .ledger td { border: 0; padding: 2px 0; }
  .ledger .group td { padding: 10px 16px; }
  .ledger td.where { max-width: none; }
  .ledger code { white-space: normal; }
}

/* Screens: real renders of the app's windows, light and dark */
.screen { margin: 0; }
.screen img { border-radius: 14px; border: 1px solid var(--rule); box-shadow: 0 30px 60px -30px rgb(11 27 24 / 0.35); background: var(--card); }
.screen figcaption { font-size: 15px; color: var(--muted); margin-top: 14px; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.flip > :first-child { order: 2; }
@media (max-width: 900px) {
  .split, .split.flip { grid-template-columns: 1fr; gap: 32px; }
  .split.flip > :first-child { order: 0; }
}

.badge { display: inline-block; font-size: 0.85em; font-weight: 600; padding: 1px 8px; border-radius: 7px; background: var(--risk-fill); color: var(--risk-text); }

ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
ul.plain li { padding-left: 22px; position: relative; }
ul.plain li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Audiences */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.trio p { color: var(--muted); font-size: 17px; }
@media (max-width: 860px) { .trio { grid-template-columns: 1fr; gap: 28px; } }

/* Terms: price and privacy */
.terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.terms > div { background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 28px 30px; }
.terms p { color: var(--muted); font-size: 17px; margin: 0; }
@media (max-width: 760px) { .terms { grid-template-columns: 1fr; } }

/* FAQ */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 20px 0; font-weight: 650; font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 24px; line-height: 1; transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 20px; color: var(--muted); max-width: 40em; }

/* Guides list */
.guides { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.guides li { border-top: 1px solid var(--rule); padding: 18px 0; }
.guides a { font-weight: 650; font-size: 19px; text-decoration: none; color: var(--ink); }
.guides a:hover { color: var(--accent); }
.guides span { display: block; color: var(--muted); font-size: 16px; margin-top: 2px; }
@media (max-width: 760px) { .guides { grid-template-columns: 1fr; } }

/* Closing call */
.closer .wrap { display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.closer h2 { margin: 0; }
.closer p { margin: 8px 0 0; color: var(--muted); }

/* Articles (guides, support, privacy) */
.article { padding: 32px 0 80px; }
.article .crumbs { font-size: 15px; color: var(--muted); margin: 0 0 18px; }
.article .crumbs a { color: var(--muted); }
.article h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 20px; text-wrap: balance; }
.article .standfirst { font-size: 21px; color: var(--muted); line-height: 1.5; margin: 0 0 36px; }
.article h2 { font-size: 30px; margin: 52px 0 14px; }
.article h3 { margin-top: 28px; }
.article li { margin-bottom: 8px; }
.article .meta { font-size: 15px; color: var(--muted); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); border-radius: 14px; padding: 16px 18px; overflow-x: auto; font-size: 15px; line-height: 1.55; margin: 0 0 1.2em; }
pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.note { border-left: 3px solid var(--personal); padding: 4px 0 4px 18px; margin: 24px 0; }
.note.safe { border-color: var(--caches); }
.cta-box { margin: 48px 0 8px; background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 28px 30px; }
.cta-box h2 { margin-top: 0; font-size: 26px; }
.cta-box p { color: var(--muted); }
.article table { border-collapse: collapse; width: 100%; font-size: 16px; margin: 0 0 1.4em; }
.article table th, .article table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.article table th { font-size: 14px; color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 40px 0 56px; font-size: 15px; color: var(--muted); }
.site-foot .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-foot h2 { font-size: 15px; letter-spacing: 0; font-weight: 650; color: var(--ink); margin: 0 0 10px; }
.site-foot p { margin: 0 0 8px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--ink); }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.article td:first-child code { white-space: nowrap; }
@media (max-width: 520px) {
  .hero .lede, .article .standfirst { font-size: 19px; }
  body { font-size: 17px; }
}
