/* LiveWall Gallery — the app's "golden hour" brand on the web: one amber
   accent for what's primary or selected, neutral everywhere else, so the
   wallpapers provide the colour. */
:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --text: #16161a;
  --muted: #6b6b73;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #f59e38;
  --accent-ink: #1a1206;
  --radius-hero: 26px;
  --radius-card: 16px;
  --radius-tile: 14px;
  --spring: cubic-bezier(0.2, 0.9, 0.1, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0d;
    --surface: #17171b;
    --text: #f2f2f4;
    --muted: #9a9aa3;
    --line: rgba(255, 255, 255, 0.08);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --surface: #17171b;
  --text: #f2f2f4;
  --muted: #9a9aa3;
  --line: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(20px);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand img { border-radius: 7px; }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.search {
  flex: 1; max-width: 420px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.search svg { width: 16px; height: 16px; fill: var(--muted); flex: none; }
.search input { all: unset; flex: 1; min-width: 0; font-size: 14px; }
.github {
  text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap;
}
.github:hover { border-color: var(--accent); }

main { max-width: 1320px; margin: 0 auto; padding: 28px; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  height: min(56vw, 460px); min-height: 280px;
  border-radius: var(--radius-hero);
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); }
.hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.82)); }
.hero-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px; color: #fff; }
.eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #ffd27a; }
.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; letter-spacing: -0.02em; }
.hero-desc { margin: 8px 0 18px; max-width: 560px; color: rgba(255,255,255,0.78); }
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.credit { font-size: 12px; color: rgba(255,255,255,0.6); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform 0.25s var(--spring), filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.wide { width: 100%; padding: 12px 18px; }

/* Library */
.library { margin-top: 40px; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.library h2 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
#count { color: var(--muted); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.tag[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: var(--accent); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 22px; }
.tile { all: unset; cursor: pointer; display: block; }
.tile:focus-visible .art { outline: 3px solid var(--accent); outline-offset: 3px; }
.art {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-tile); background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.45s var(--spring), box-shadow 0.45s var(--spring);
}
/* Scaled slightly to crop the thin dark edge some source footage has. */
.art img, .art video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); }
.art video { opacity: 0; transition: opacity 0.3s; }
.tile.playing .art video { opacity: 1; }
.tile:hover .art { transform: translateY(-3px) scale(1.02); box-shadow: 0 18px 40px rgba(0,0,0,0.28); }
.tile-foot { display: flex; align-items: center; gap: 10px; margin: 10px 2px 0; }
.tile-foot .tile-title { flex: 1; min-width: 0; margin: 0; }
.downloads { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vote {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-variant-numeric: tabular-nums; transition: transform 0.25s var(--spring), color 0.2s, border-color 0.2s;
}
.vote:hover { border-color: var(--accent); color: var(--text); }
.vote:active { transform: scale(0.92); }
.vote.voted { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.sheet-stats { display: flex; align-items: center; gap: 12px; }
.sheet-stats .vote { font-size: 14px; padding: 6px 14px; }
.sorts { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.sort { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.sort[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tags { margin-bottom: 18px; }
.intro { margin: 8px 0 28px; }
.intro h1 { margin: 0 0 6px; font-size: clamp(28px, 4.5vw, 40px); letter-spacing: -0.02em; }
.intro p { margin: 0; max-width: 640px; color: var(--muted); font-size: 16px; }
.intro a { color: var(--accent); }
.hero h2 { margin: 0; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; letter-spacing: -0.02em; }
.tile-title { margin: 10px 2px 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }

/* Licence-unverified flag */
.flag {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(0,0,0,0.6); color: #ffd27a; border: 1px solid rgba(255,210,122,0.5);
  backdrop-filter: blur(6px);
}
.unverified-note {
  font-size: 12px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.unverified-note[hidden], .licence[hidden] { display: none; }

/* Selection */
.pick {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85); background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px); cursor: pointer;
  opacity: 0; transition: opacity 0.2s, background 0.2s, transform 0.25s var(--spring);
}
.tile:hover .pick, .tile:focus-within .pick, .tile.selected .pick { opacity: 1; }
.tile.selected .pick { background: var(--accent); border-color: var(--accent); }
.tile.selected .pick::after {
  content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px;
  border: solid var(--accent-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.pick:active { transform: scale(0.9); }
.tile.selected .art { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (hover: none) { .pick { opacity: 1; } }

.tray {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 20px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: rise 0.4s var(--spring);
}
.tray[hidden] { display: none; }
#tray-count { font-weight: 600; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 21; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 13px; text-align: center;
}
.toast[hidden] { display: none; }
.toast a { color: var(--accent); font-weight: 600; }

/* App download */
.download {
  margin-top: 72px; padding: 28px; border-radius: var(--radius-card);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface));
  border: 1px solid var(--line);
}
.download img { border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.download-copy { flex: 1; min-width: 220px; }
.download h2 { margin: 0 0 4px; font-size: 24px; }
.download p { margin: 0; color: var(--muted); }
.download .fine { margin-top: 8px; }
.download-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn.secondary:hover { border-color: var(--accent); }

/* How-to */
.how { margin: 24px 0 24px; padding: 28px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line); }
.how h2 { margin: 0 0 12px; font-size: 20px; }
.how ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.how code { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--line); }
.fine { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.fine a, footer a { color: var(--accent); }

footer { max-width: 1320px; margin: 0 auto; padding: 8px 28px 48px; color: var(--muted); font-size: 12px; }

/* Detail sheet */
dialog {
  width: min(920px, calc(100vw - 32px)); padding: 0; border: 0;
  border-radius: var(--radius-hero); background: var(--surface); color: var(--text);
  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
  overflow: hidden;
}
dialog[open] { display: grid; grid-template-columns: 1.4fr 1fr; animation: rise 0.45s var(--spring); }
dialog::backdrop { background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.sheet-media { background: #000; min-height: 260px; }
.sheet-media video { width: 100%; height: 100%; object-fit: cover; }
.sheet-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.sheet-body h3 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.sheet-body p { margin: 0; color: var(--muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.chips li { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0; }
.meta dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.meta dd { margin: 0; font-weight: 600; }
.licence { font-size: 12px; }
.licence a { color: var(--accent); }
.close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,0.5); color: #fff; font-size: 20px; line-height: 1;
}

@media (max-width: 720px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .brand em, .github { display: none; }
  main { padding: 16px; }
  .hero-copy { padding: 20px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  dialog[open] { grid-template-columns: 1fr; }
  .sheet-media { aspect-ratio: 16 / 9; min-height: 0; }
}

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

/* Setup guide */
.guide { max-width: 760px; }
.guide h1 { font-size: clamp(30px, 5vw, 42px); margin: 8px 0 8px; letter-spacing: -0.02em; }
.guide .lede { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.guide section { margin: 40px 0; }
.guide h2 { font-size: 24px; margin: 0 0 12px; letter-spacing: -0.01em; scroll-margin-top: 80px; }
.guide h3 { font-size: 16px; margin: 20px 0 6px; }
.guide p { margin: 0 0 12px; }
.guide code { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--line); }
.guide pre { margin: 12px 0; padding: 16px; border-radius: 12px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line); }
.guide pre code { padding: 0; background: none; font-size: 12.5px; line-height: 1.6; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.toc a { text-decoration: none; font-size: 13px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); }
.toc a:hover { border-color: var(--accent); }
.callout { padding: 16px 18px; border-radius: 12px; margin: 0 0 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.steps { padding-left: 22px; display: grid; gap: 10px; margin: 0 0 12px; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.facts { padding-left: 20px; display: grid; gap: 10px; margin: 0 0 12px; }
.note { font-size: 14px; color: var(--muted); padding-left: 12px; border-left: 3px solid var(--accent); }
.guide details { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.guide summary { cursor: pointer; font-weight: 600; }
.faq dt { font-weight: 600; margin-top: 16px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }
.guide a:not(.btn) { color: var(--accent); }

/* Download page */
.dl { max-width: 1120px; }
.dl-hero { text-align: center; padding: 40px 0 8px; position: relative; }
.dl-hero[hidden] { display: none; }
.dl-hero::before {
  content: ""; position: absolute; left: 50%; top: 10px; width: 420px; height: 260px; transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 35%, transparent), transparent);
  filter: blur(20px); z-index: -1; pointer-events: none;
}
.dl-icon { margin: 0 auto 18px; border-radius: 22px; box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.dl-hero h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.02em; }
.dl-status, .dl-sub { font-size: 17px; margin: 0 0 6px; display: inline-flex; align-items: center; gap: 10px; }
.dl-sub { display: block; color: var(--muted); }
.dl-meta { color: var(--muted); font-size: 13px; margin: 8px 0 4px; }
.dl-retry { font-size: 13px; color: var(--muted); margin: 0; }
.dl-retry a, .dl-next a:not(.btn), footer a { color: var(--accent); }
.dl-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.dl-check { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.dl-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.dl-steps { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.dl-step {
  position: relative; padding: 18px 18px 22px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--line);
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s var(--spring), transform 0.6s var(--spring), border-color 0.2s;
}
.steps-ready .dl-step { opacity: 1; transform: none; }
.steps-ready .dl-step:nth-child(2) { transition-delay: 0.12s; }
.steps-ready .dl-step:nth-child(3) { transition-delay: 0.24s; }
.dl-step:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.dl-visual {
  height: 180px; border-radius: 12px; margin-bottom: 16px; overflow: hidden;
  display: grid; place-items: center; padding: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg));
}
.dl-visual img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.dl-num {
  position: absolute; top: 28px; left: 28px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.dl-step h2 { font-size: 17px; margin: 0 0 6px; }
.dl-step p { margin: 0; font-size: 14px; color: var(--muted); }
.dl-step p strong { color: var(--text); }

/* Step 1 mock: a browser download row */
.mock-download {
  width: 100%; max-width: 280px; display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.mock-dmg { width: 40px; height: 48px; border-radius: 6px; display: grid; place-items: end center; padding-bottom: 6px;
  background: linear-gradient(#e9e9ee, #c9c9d2); color: #555; font-size: 9px; font-weight: 800; flex: none; }
.mock-file { display: grid; flex: 1; min-width: 0; font-size: 13px; }
.mock-file span { font-size: 11px; color: var(--muted); }
.mock-open { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }

/* Step 3 mock: the Privacy & Security row */
.mock-settings { width: 100%; max-width: 300px; border-radius: 12px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,0.3); font-size: 12px; }
.mock-settings-head { padding: 9px 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.mock-settings-row { padding: 12px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.mock-settings-row span:first-child { color: var(--muted); }
.mock-anyway { flex: none; padding: 5px 10px; border-radius: 7px; font-weight: 600; background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); animation: nudge 2.4s ease-out infinite; }
@keyframes nudge { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }

.dl-terminal { all: unset; cursor: pointer; margin-top: 12px; display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
  padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.dl-terminal code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); }
.dl-terminal span { font-size: 11px; font-weight: 600; color: var(--accent); }
.dl-terminal:hover { border-color: var(--accent); }

.dl-next { margin: 32px 0 24px; padding: 24px 28px; border-radius: var(--radius-card); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface)); border: 1px solid var(--line); }
.dl-next h2 { margin: 0 0 4px; font-size: 20px; }
.dl-next p { margin: 0; color: var(--muted); }
.dl-next .dl-actions { margin: 0; }

@media (max-width: 860px) { .dl-steps { grid-template-columns: 1fr; } }
/* Long commands and paths wrap instead of widening the page on phones. */
.guide code, .how code { overflow-wrap: anywhere; }
.guide pre { max-width: 100%; }
.guide pre code { overflow-wrap: normal; }
