/* KeyHalo website — same minimal language as the app: neutral greys, Inter, colour only from lighting. */
@font-face {
  font-family: "Inter";
  src: url("inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --border: #232327;
  --border-strong: #2e2e33;
  --text: #ededef;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --primary: #ededef;
  --primary-text: #09090b;
  --focus: #818cf8;
  --radius: 10px;
  --radius-lg: 16px;
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --spectrum: linear-gradient(90deg, #ff4d6d, #ffb703, #3ddc97, #22d3ee, #4c6fff, #b04dff);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --border: #e6e6e9;
    --border-strong: #d4d4d8;
    --text: #18181b;
    --text-2: #52525b;
    --text-3: #71717a;
    --primary: #18181b;
    --primary-text: #fafafa;
    --focus: #6366f1;
    color-scheme: light;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.35em; }

.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-text); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; font-size: 17px; }
.brand svg { width: 26px; height: 26px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a { text-decoration: none; color: var(--text-2); font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav .lang { border: 1px solid var(--border); }
@media (max-width: 820px) { .site-nav a:not(.keep) { display: none; } }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 10px;
  font: 600 15px/1 var(--font); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: background 140ms, transform 140ms;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.primary:hover { opacity: 0.9; }
.btn svg { width: 18px; height: 18px; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* Hero -------------------------------------------------------------------- */
.hero { padding: 72px 0 24px; text-align: center; position: relative; overflow: hidden; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; background: var(--surface); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--spectrum); }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; margin: 20px auto 18px; max-width: 15ch; }
.hero .lead { font-size: clamp(16px, 2vw, 19px); color: var(--text-2); max-width: 62ch; margin: 0 auto 30px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 8px 22px; justify-content: center; flex-wrap: wrap; list-style: none; padding: 0; margin: 22px 0 0; color: var(--text-3); font-size: 13.5px; }
.hero-meta li::before { content: "✓"; margin-right: 6px; color: var(--text-2); }
.hero-art { margin: 40px auto 0; max-width: 980px; }
.hero-art .kb-svg { width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art .kb-keys, .hero-art .kb-halo { animation: hue 18s linear infinite; }
}
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* Sections ---------------------------------------------------------------- */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 12px; font-weight: 680; }
.section-head p { color: var(--text-2); margin: 0; font-size: 17px; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.feature h3 { font-size: 16.5px; margin: 14px 0 6px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); }
.icon svg { width: 20px; height: 20px; stroke: var(--text); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Screenshots ------------------------------------------------------------- */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.shots figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.shots figure:first-child { grid-column: 1 / -1; }
.shots img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; background: var(--surface-2); }
.shots figcaption { padding: 12px 16px; font-size: 14px; color: var(--text-2); border-top: 1px solid var(--border); }
@media (max-width: 720px) { .shots { grid-template-columns: 1fr; } }

/* Devices table ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td code { background: transparent; border: 0; padding: 0; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pill.verified::before { background: #22c55e; }
.pill.experimental::before { background: #f59e0b; }
.pill.community::before { background: #60a5fa; }
.note { color: var(--text-3); font-size: 14px; margin-top: 14px; }
.row-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* FAQ --------------------------------------------------------------------- */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--text-2); }

/* Community --------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
.step { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-lg); padding: 22px; }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); font-weight: 650; font-size: 13px; }
.step h3 { margin: 14px 0 6px; font-size: 16.5px; }
.step p { margin: 0; color: var(--text-2); font-size: 14.5px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 56px; color: var(--text-3); font-size: 14px; }
.site-footer .wrap { display: grid; gap: 18px; }
.site-footer .top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.spectrum-rule { height: 2px; border: 0; background: var(--spectrum); opacity: 0.7; margin: 0; }

/* Gallery ----------------------------------------------------------------- */
.page-head { padding: 56px 0 8px; }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.03em; margin: 0 0 10px; }
.page-head p { color: var(--text-2); margin: 0; font-size: 17px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 28px 0 20px; }
.search { flex: 1 1 280px; height: 42px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 0 14px; font: inherit; font-size: 15px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 550 13.5px var(--font); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.chip .n { opacity: 0.6; margin-left: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding-bottom: 72px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.card .thumb { aspect-ratio: 16 / 7; background: var(--surface-2); border-bottom: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .glyph { width: 100%; height: 100%; opacity: 0.85; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h2 { font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--text-3); }
.tag { border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--text-2); }
.card .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.warn { font-size: 12.5px; color: #f59e0b; }
.empty { color: var(--text-3); padding: 40px 0; text-align: center; }

/* Hide the screenshots section until at least one screenshot loads (images hide themselves on error). */
#screenshots:not(:has(figure:not([hidden]))) { display: none; }
