:root {
  --bg: #f5f5f7;
  --bg-2: #ebecf0;
  --text: #1d1d1f;
  --muted: #5f6068;
  --line: rgba(0, 0, 0, 0.1);
  --card: rgba(255, 255, 255, 0.72);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --menubar: rgba(255, 255, 255, 0.55);
  --accent: #0a66d8;
  --accent-text: #ffffff;
  --select: rgba(10, 102, 216, 0.14);
  --kbd-bg: rgba(0, 0, 0, 0.06);
  --shadow: 0 20px 50px -20px rgba(20, 30, 60, 0.35), 0 2px 6px rgba(20, 30, 60, 0.08);
  --wall-1: #c9d8f2;
  --wall-2: #eed9e4;
  --wall-3: #d8ecdf;
  --mark-filter: none;
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101114;
    --bg-2: #17181c;
    --text: #f5f5f7;
    --muted: #a1a3ab;
    --line: rgba(255, 255, 255, 0.12);
    --card: rgba(34, 36, 42, 0.7);
    --glass: rgba(40, 42, 50, 0.6);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --menubar: rgba(20, 22, 28, 0.5);
    --accent: #3d8bff;
    --select: rgba(61, 139, 255, 0.22);
    --kbd-bg: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
    --wall-1: #1d2a4a;
    --wall-2: #3a2338;
    --wall-3: #173229;
    --mark-filter: invert(1);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101114;
  --bg-2: #17181c;
  --text: #f5f5f7;
  --muted: #a1a3ab;
  --line: rgba(255, 255, 255, 0.12);
  --card: rgba(34, 36, 42, 0.7);
  --glass: rgba(40, 42, 50, 0.6);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --menubar: rgba(20, 22, 28, 0.5);
  --accent: #3d8bff;
  --select: rgba(61, 139, 255, 0.22);
  --kbd-bg: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  --wall-1: #1d2a4a;
  --wall-2: #3a2338;
  --wall-3: #173229;
  --mark-filter: invert(1);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); font-weight: 650; }
h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

kbd {
  font: 500 0.82em/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  background: var(--kbd-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.22em 0.45em;
  white-space: nowrap;
}

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: 16px; top: -48px;
  background: var(--accent); color: var(--accent-text);
  padding: 8px 14px; border-radius: 10px; z-index: 10;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-mark, .mb-mark { filter: var(--mark-filter); }
.nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; background: var(--kbd-bg); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { background: var(--kbd-bg); color: var(--text); }
.theme-toggle[hidden] { display: none; }

/* Hero */
.hero { text-align: center; padding-top: clamp(48px, 9vw, 96px); }
.lede { font-size: clamp(1.08rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 36em; margin: 0 auto 1.6em; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.actions-left { justify-content: flex-start; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 1rem;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 18px -6px var(--accent); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.fineprint { color: var(--muted); font-size: 0.88rem; margin-top: 1em; }

/* Demo */
.demo { margin: clamp(40px, 7vw, 72px) 0 0; }
.demo figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 14px; }
.callouts {
  display: block; margin: 0 0 0 auto; max-width: 100%; overflow: visible;
  color: var(--muted);
  font: 500 11.5px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  animation: fade-in 0.6s 0.3s ease-out both;
}
.callouts text { fill: currentColor; stroke: none; }
.callouts path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; }
.callouts-sm { display: none; }
@keyframes fade-in { from { opacity: 0; } }
.desktop {
  position: relative; overflow: hidden;
  border-radius: 20px; border: 1px solid var(--line);
  min-height: 360px;
  background:
    radial-gradient(60% 80% at 15% 20%, var(--wall-1), transparent 70%),
    radial-gradient(50% 70% at 85% 30%, var(--wall-2), transparent 70%),
    radial-gradient(60% 70% at 50% 100%, var(--wall-3), transparent 70%),
    var(--bg-2);
  box-shadow: var(--shadow);
  text-align: left;
}
.menubar {
  display: flex; justify-content: space-between; align-items: center;
  height: 30px; padding: 0 12px; gap: 12px;
  background: var(--menubar);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 13px; white-space: nowrap;
}
.mb-left, .mb-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mb-left span:not(.apple) { color: var(--text); }
.apple { width: 13px; height: 15px; flex: none; color: var(--text); margin-top: -2px; }
.mb-right { gap: 12px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 15px; height: 15px; flex: none; color: var(--text); opacity: 0.85; }
.ico-battery { width: 23px; }
.ico-overflow { width: 13px; opacity: 0.6; }
.mark-group { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 6px; margin: 0 -2px; border-radius: 7px; }
.mark-group.is-active { background: color-mix(in srgb, var(--text) 14%, transparent); }
.count { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.clock { font-variant-numeric: tabular-nums; }

/* Dropdown panel, hung under the mark (right edge lines up with the pill) */
.panel {
  --anchor-right: 168px;
  width: min(360px, calc(100% - 24px));
  margin: 6px var(--anchor-right) 36px auto;
  padding: 10px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-edge);
  font-size: 13px; line-height: 1.3;
  transform-origin: top right;
  animation: drop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 11px;
  background: var(--kbd-bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted);
}
.search-ico { width: 14px; height: 14px; flex: none; }
.placeholder { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { display: inline-block; width: 1.5px; height: 1.15em; vertical-align: -0.22em; margin-right: 2px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.section-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 8px 6px; font-size: 11px; color: var(--muted); }
.section-title { font-weight: 600; font-variant-caps: all-small-caps; font-size: 12.5px; letter-spacing: 0.04em; line-height: 1; }

.results { list-style: none; margin: 0; padding: 0; }
.results li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.results li.selected { background: color-mix(in srgb, var(--text) 8%, transparent); }
.name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.shortcut { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pin { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; color: var(--muted); }
.pin.is-fav { color: var(--accent); }
.pin svg { width: 15px; height: 15px; }

.app {
  display: grid; place-items: center; flex: none;
  width: 24px; height: 24px; border-radius: 6px;
  color: #fff; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.app svg { width: 15px; height: 15px; }
.app-docker { background: linear-gradient(180deg, #3b82ff, #1d63ed); }
.app-tailscale { background: linear-gradient(180deg, #2c2c30, #0e0e10); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2); }
.app-tailscale svg { width: 14px; height: 14px; }
.app-telegram { background: linear-gradient(180deg, #37bbfe, #1e96d4); }
.app-telegram svg { width: 17px; height: 17px; }
.app-1password { background: linear-gradient(180deg, #ffffff, #dfeaff); color: #1a6cf5; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15); }
.app-cleanshot { background: linear-gradient(180deg, #4fa3ff, #1f6fe0); }
.app-rectangle { background: linear-gradient(180deg, #7d93b0, #4b6180); }

.panel-foot { margin: 6px 0 0; padding: 8px 8px 2px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

/* Sections */
.section { padding-top: clamp(64px, 10vw, 112px); }
.section > h2 { text-align: center; margin-bottom: 1.2em; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card p { color: var(--muted); margin: 0; }

.table-wrap { max-width: 680px; margin: 0 auto; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
td:first-child { white-space: nowrap; width: 1%; }

.split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.list { margin: 0; padding: 0; list-style: none; }
.list li { position: relative; padding-left: 28px; margin-top: 12px; color: var(--muted); }
.list li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.list-yes li::before { content: "✓"; color: #2e9d57; }
.list-no li::before { content: "–"; color: var(--muted); }

.ukraine { display: flex; gap: 20px; align-items: flex-start; max-width: 760px; margin: 0 auto; }
.ukraine h2 { font-size: 1.4rem; }
.ukraine p { margin-bottom: 1.2em; }
.note { max-width: 760px; margin: 0 auto; }
.note h2 { font-size: 1.4rem; }
.note p { color: var(--muted); margin: 0 0 0.9em; }
.note p:last-child { margin-bottom: 0; }
.flag { flex: none; width: 36px; height: 24px; border-radius: 5px; background: linear-gradient(#0057b7 50%, #ffd700 50%); margin-top: 4px; }

.site-footer { margin-top: clamp(64px, 10vw, 112px); border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-inner p { margin: 0; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav a[href^="#"] { display: none; }
  .hide-sm { display: none; }
  .mb-left { gap: 10px; }
  .mb-left span:nth-child(n+4) { display: none; }
  .clock { display: none; }
  .desktop { min-height: 320px; }
  .panel { width: auto; margin: 6px 12px 24px; }
  .callouts-wide { display: none; }
  .callouts-sm { display: block; }
  .ukraine { flex-direction: column; gap: 12px; }
  .btn { width: 100%; justify-content: center; }
}

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