/* NestHealth website (home, server download, docs, support, privacy). iOS system look. */
:root {
  --bg: #F2F2F7; --bg-2: #FFFFFF; --card: #fff; --label: #000; --label-2: rgba(60,60,67,.62); --label-3: rgba(60,60,67,.35);
  --sep: rgba(60,60,67,.14); --fill: rgba(120,120,128,.12);
  --accent: #FF2D55; --accent-2: #FF6B81; --accent-soft: rgba(255,45,85,.1);
  --blue: #007AFF; --green: #34C759; --orange: #FF9500; --teal: #30B0C7; --purple: #AF52DE; --indigo: #5856D6;
  --code-bg: #1C1C1E; --code-fg: #F2F2F7;
  --glass: rgba(242,242,247,.72);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.06);
  --radius: 22px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --bg-2: #0B0B0D; --card: #1C1C1E; --label: #fff; --label-2: rgba(235,235,245,.62); --label-3: rgba(235,235,245,.3);
    --sep: rgba(84,84,88,.5); --fill: rgba(120,120,128,.24);
    --accent: #FF375F; --accent-soft: rgba(255,55,95,.16); --blue: #0A84FF;
    --code-bg: #111113; --glass: rgba(0,0,0,.66); --shadow: 0 0 0 1px rgba(255,255,255,.06);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--label); font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header (sticky glass bar) and footer ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--sep); padding-top: env(safe-area-inset-top); }
.top .wrap { display: flex; align-items: center; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.3px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 15px; }
.top nav a { color: var(--label-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.top nav a:hover { color: var(--label); background: var(--fill); }
.top nav a[aria-current] { color: var(--label); font-weight: 600; }
.top nav a.nav-cta { background: var(--accent); color: #fff; font-weight: 600; margin-left: 6px; }
.top nav a.nav-cta:hover { background: var(--accent); filter: brightness(1.06); }

.foot { border-top: 1px solid var(--sep); margin-top: 72px; padding: 40px 0 calc(env(safe-area-inset-bottom) + 40px); color: var(--label-2); font-size: 14px; }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot h4 { margin: 0 0 10px; color: var(--label); font-size: 14px; }
.foot a { color: var(--label-2); text-decoration: none; display: block; margin-bottom: 6px; }
.foot a:hover { color: var(--label); }
.foot .brand { font-size: 16px; margin-bottom: 10px; color: var(--label); }
.foot .brand img { width: 24px; height: 24px; border-radius: 6px; }
.foot p { margin: 0 0 8px; max-width: 30em; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; background: var(--accent); color: #fff; border: 0; cursor: pointer; transition: transform .15s, filter .15s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn.plain { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
.btn.ghost { background: var(--fill); color: var(--label); }
.btn[aria-disabled="true"] { cursor: default; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.small { font-size: 14px; color: var(--label-2); }

/* ---------- Home: hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto 40%; height: 900px; background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(42px, 6vw, 68px); line-height: 1.02; letter-spacing: -1.6px; margin: 0 0 20px; }
.grad { background: linear-gradient(180deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 21px; line-height: 1.5; color: var(--label-2); margin: 0 0 32px; max-width: 29em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .small { margin-top: 16px; }
.phones { position: relative; height: 620px; }
.phone { position: absolute; width: 270px; border-radius: 40px; box-shadow: 0 40px 80px rgba(0,0,0,.18), 0 0 0 1px var(--sep); display: block; background: var(--card); }
.phones .p1 { right: 34%; top: 0; z-index: 2; }
.phones .p2 { right: 2%; top: 64px; transform: rotate(4deg); opacity: .96; }

/* ---------- Home: sections ---------- */
.band { padding: 72px 0; }
.band.alt { background: var(--bg-2); border-top: 1px solid var(--sep); border-bottom: 1px solid var(--sep); }
.band-head { text-align: center; max-width: 36em; margin: 0 auto 40px; }
.band-head h2 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.8px; line-height: 1.1; margin: 0 0 12px; }
.band-head p { color: var(--label-2); font-size: 19px; margin: 0; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.band.alt .feature { background: var(--bg); box-shadow: none; }
.feature h3 { font-size: 19px; margin: 16px 0 6px; letter-spacing: -0.2px; }
.feature p { margin: 0; color: var(--label-2); font-size: 16px; }
.tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.tile svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.shots { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 24px 24px; justify-content: safe center; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shots figure { margin: 0; flex: 0 0 210px; scroll-snap-align: center; text-align: center; }
.shots img { border-radius: 30px; box-shadow: 0 16px 40px rgba(0,0,0,.14), 0 0 0 1px var(--sep); display: block; }
.shots figcaption { font-size: 14px; color: var(--label-2); margin-top: 12px; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: -0.2px; }
.card p { margin: 0 0 12px; color: var(--label-2); }
.card p:last-child { margin-bottom: 0; }
.card .tile { margin-bottom: 16px; }
.arrow { font-weight: 600; text-decoration: none; }
.arrow::after { content: " →"; }

/* Server promo on the home page */
.promo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: center; background: linear-gradient(135deg, #1C1C1E, #2C2C2E); color: #fff; border-radius: 32px; padding: 48px; }
.promo h2 { font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -0.6px; line-height: 1.1; margin: 0 0 12px; }
.promo p { color: rgba(235,235,245,.7); margin: 0 0 24px; }
.promo .terminal { margin: 0; }
.note { font-size: 14px; color: var(--label-2); text-align: center; max-width: 42em; margin: 48px auto 0; }

/* ---------- Code ---------- */
code { font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--fill); padding: 2px 6px; border-radius: 6px; }
pre { background: var(--code-bg); color: var(--code-fg); border-radius: 16px; padding: 18px 20px; overflow-x: auto; font: 14.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 0 16px; }
pre code { background: none; padding: 0; font: inherit; color: inherit; }
pre .c { color: rgba(235,235,245,.45); }
pre .p { color: #FF6B81; user-select: none; }
.terminal { background: #0B0B0D; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08); overflow: hidden; }
.terminal .bar { display: flex; gap: 7px; padding: 12px 14px; background: rgba(255,255,255,.04); }
.terminal .bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.terminal .bar i:nth-child(2) { background: #FEBC2E; }
.terminal .bar i:nth-child(3) { background: #28C840; }
.terminal pre { background: none; margin: 0; border-radius: 0; padding: 16px 20px 20px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Server download page ---------- */
.page-hero { position: relative; overflow: hidden; text-align: center; padding: 72px 0 32px; }
.page-hero::before { content: ""; position: absolute; left: 50%; top: -300px; width: 1100px; height: 700px; transform: translateX(-50%); background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); pointer-events: none; }
.page-hero .wrap { position: relative; }
.page-hero .icon { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 14px 34px rgba(255,45,85,.3); margin-bottom: 22px; }
.page-hero h1 { font-size: clamp(38px, 5.4vw, 60px); letter-spacing: -1.4px; line-height: 1.05; margin: 0 0 16px; }
.page-hero .lede { margin: 0 auto 32px; }
.page-hero .cta { justify-content: center; }
.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 18px; font-size: 14px; color: var(--label-2); }
.meta span::before { content: "·"; margin-right: 20px; color: var(--label-3); }
.meta span:first-child::before { content: none; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.step { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.step::before { counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; margin-bottom: 16px; }
.step h3 { margin: 0 0 6px; font-size: 19px; }
.step p { margin: 0 0 14px; color: var(--label-2); font-size: 16px; }
.step pre { margin-top: auto; margin-bottom: 0; font-size: 13.5px; padding: 14px 16px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 16px; }
.compare th, .compare td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--sep); vertical-align: top; }
.compare tr:last-child td { border-bottom: 0; }
.compare thead th { font-size: 14px; color: var(--label-2); font-weight: 600; background: var(--fill); }
.compare td:first-child { font-weight: 600; }
.yes { color: var(--green); font-weight: 600; }
.no { color: var(--label-2); }

/* ---------- Docs (sidebar + article) ---------- */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-top: 48px; align-items: start; }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 15px; }
.toc h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--label-2); margin: 0 0 10px 12px; }
.toc a { display: block; padding: 6px 12px; border-radius: 10px; color: var(--label-2); text-decoration: none; }
.toc a:hover { color: var(--label); background: var(--fill); }
.toc a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.toc .dl { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.toc .dl p { margin: 0 0 10px; color: var(--label-2); font-size: 14px; }
.toc .dl .btn, .toc .dl .btn:hover { width: 100%; padding: 10px 16px; font-size: 15px; color: #fff; background: var(--accent); }
.article { max-width: 760px; }
.article h1 { font-size: 44px; letter-spacing: -1px; margin: 0 0 10px; line-height: 1.1; }
.article > .lede { font-size: 19px; margin-bottom: 36px; }
.article h2 { font-size: 28px; letter-spacing: -0.5px; margin: 56px 0 14px; padding-top: 8px; }
.article h3 { font-size: 20px; margin: 28px 0 8px; }
.article p, .article li { color: var(--label); }
.article p { margin: 0 0 14px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 16px; }
.article li { margin-bottom: 6px; }
.article table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 18px; background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.article th, .article td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--sep); vertical-align: top; }
.article tr:last-child td { border-bottom: 0; }
.article th { background: var(--fill); font-size: 13px; color: var(--label-2); }
.article td code { white-space: nowrap; }
.callout { display: flex; gap: 12px; background: var(--card); border-radius: 16px; padding: 16px 18px; margin: 0 0 18px; box-shadow: var(--shadow); border-left: 4px solid var(--blue); }
.callout.warn { border-left-color: var(--orange); }
.callout p { margin: 0; }
.table-scroll { overflow-x: auto; margin: 0 0 18px; border-radius: 16px; }
.table-scroll table { margin: 0; min-width: 560px; }

/* ---------- Privacy and support ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 24px 0; }
.doc h1 { font-size: 44px; margin: 0 0 6px; letter-spacing: -1px; }
.updated { color: var(--label-2); margin: 0 0 28px; font-size: 15px; }
.doc section { background: var(--card); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.doc h2 { font-size: 21px; margin: 0 0 10px; }
.doc p, .doc li { margin: 0 0 10px; }
.doc section > :last-child, .doc li:last-child { margin-bottom: 0; }
.doc ul { padding-left: 20px; margin: 0; }
.help-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.help-links a { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.help-links a:hover { box-shadow: var(--shadow), 0 0 0 2px var(--accent-soft); }
.help-links strong { display: block; margin: 12px 0 2px; }
.help-links span { color: var(--label-2); font-size: 14px; }
.help-links .tile { width: 36px; height: 36px; border-radius: 10px; }
.help-links .tile svg { width: 20px; height: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); text-align: center; padding-top: 48px; }
  .lede { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
  .phones { height: auto; display: flex; justify-content: center; }
  .phone, .phones .p1 { position: static; width: min(270px, 72vw); }
  .phones .p2 { display: none; }
  .features, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promo { grid-template-columns: minmax(0, 1fr); padding: 32px; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 32px; }
  .toc { position: static; max-height: none; margin-bottom: 8px; }
  .toc nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .toc nav a { background: var(--card); box-shadow: var(--shadow); }
  .toc .dl { display: none; }
  .foot .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .features, .steps, .split, .help-links { grid-template-columns: minmax(0, 1fr); }
  .band { padding: 52px 0; }
  .promo { padding: 24px; border-radius: 24px; }
  .article h1, .doc h1 { font-size: 36px; }
  .doc { padding: 32px 16px 0; }
  .top nav a { padding: 6px 8px; }
  .top nav .hide-sm { display: none; }
  .compare th, .compare td { padding: 12px 14px; }
  .meta { flex-direction: column; gap: 4px; }
  .meta span::before { content: none; }
  .docs { padding-top: 20px; }
  .toc { margin: 0 -16px 8px; }
  .toc h4 { display: none; }
  .toc nav { flex-wrap: nowrap; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
  .toc nav::-webkit-scrollbar { display: none; }
  .toc nav a { flex: none; }
  .help-links { gap: 10px; }
  .help-links a { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 14px 16px; }
  .help-links .tile { grid-row: span 2; }
  .help-links strong { margin: 0; }
}
@media (max-width: 340px) { .top nav .hide-xs { display: none; } }
