/* Homelab Pulse site: privacy policy, terms and project page. Colors follow design/tokens.json. */
:root {
  color-scheme: light dark;
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F0F2F5;
  --border: #E3E6EA;
  --text: #15181D;
  --text-2: #3A404A;
  --muted: #5F6672;
  --brand: #087A51;
  --brand-soft: #E3F5EC;
  --radius: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "IBM Plex Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1114;
    --surface: #171A1F;
    --surface-2: #1E2228;
    --border: #2A2F36;
    --text: #E8EAED;
    --text-2: #B4BAC3;
    --muted: #8A919C;
    --brand: #4FD3A0;
    --brand-soft: #12352A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.7 var(--font); }
html[lang="ar"] body { line-height: 1.9; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 760px; margin-inline: auto; padding-inline: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; display: block; }
.lang {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 14px; text-decoration: none;
}
.lang:hover { color: var(--text); border-color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 5vw, 40px); }
h1 { font-size: clamp(26px, 6vw, 34px); line-height: 1.25; margin: 0 0 4px; letter-spacing: -0.01em; }
html[lang="ar"] h1 { letter-spacing: 0; }
h2 { font-size: 19px; line-height: 1.4; margin: 34px 0 8px; scroll-margin-top: 16px; }
p, ul { margin: 0 0 12px; }
ul { padding-inline-start: 22px; }
li + li { margin-top: 6px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.summary { background: var(--brand-soft); border-radius: 16px; padding: 16px 20px; margin: 0 0 18px; }
.summary h2 { margin: 0 0 6px; font-size: 16px; }
.summary ul { margin: 0; }

.toc { border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; margin: 0 0 8px; background: var(--surface-2); }
.toc ol { margin: 0; padding-inline-start: 22px; columns: 2 220px; column-gap: 24px; }
.toc li { break-inside: avoid; margin: 2px 0; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--brand); text-decoration: underline; }

code, .ltr { font-family: var(--mono); font-size: .92em; direction: ltr; unicode-bidi: isolate; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-block: 24px 40px; color: var(--muted); font-size: 14px; }
.foot a { color: var(--muted); }

/* Project page */
.hero { text-align: center; padding-block: 28px 4px; }
.hero img { width: 88px; height: 88px; border-radius: 24px; box-shadow: 0 10px 30px rgba(8, 122, 81, .25); }
.hero h1 { margin-top: 18px; }
.tagline { color: var(--text-2); font-size: 18px; margin: 6px auto 0; max-width: 34em; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 28px 0; padding: 0; list-style: none; }
.features li { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.features strong { display: block; margin-bottom: 4px; }
.features span { color: var(--muted); font-size: 15px; }
.note { text-align: center; color: var(--muted); font-size: 15px; margin: 0; }

/* Setup guides (P8-09) */
.lead { color: var(--text-2); font-size: 17px; margin: 0 0 18px; }
.needs { border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; margin: 0 0 8px; background: var(--surface-2); }
.needs h2 { margin: 0 0 6px; font-size: 16px; }
.needs ul { margin: 0; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding-inline-start: 46px; margin: 34px 0 0; }
.steps > li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 15px;
}
.steps h2 { margin: 2px 0 8px; font-size: 18px; }
.shot { margin: 16px 0 0; }
.shot img {
  display: block; width: min(100%, 300px); height: auto; border-radius: 26px;
  border: 1px solid var(--border); background: var(--surface-2); box-shadow: 0 10px 28px rgba(15, 17, 20, .10);
}
.shot figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 300px; }
@media (min-width: 720px) {
  .steps > li.with-shot { display: grid; grid-template-columns: minmax(0, 1fr) 260px; column-gap: 28px; align-items: start; }
  .steps > li.with-shot > .shot { grid-column: 2; grid-row: 1 / span 20; margin: 0; }
  .steps > li.with-shot > :not(.shot) { grid-column: 1; }
  .shot img { width: 260px; }
}
pre {
  direction: ltr; text-align: left; overflow-x: auto; white-space: pre; margin: 10px 0 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font: 14px/1.6 var(--mono); color: var(--text);
}
.tip { border-inline-start: 3px solid var(--brand); background: var(--surface-2); border-start-end-radius: 12px; border-end-end-radius: 12px; padding: 10px 14px; margin: 12px 0; }
.tip p:last-child { margin-bottom: 0; }
.trouble dt { font-weight: 700; margin-top: 14px; }
.trouble dd { margin: 4px 0 0; color: var(--text-2); }
.guide-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.guide-list li { margin: 0; }
.guide-list a {
  display: block; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; color: var(--text); text-decoration: none;
}
.guide-list a:hover { border-color: var(--brand); }
.guide-list strong { display: block; font-size: 17px; }
.guide-list span { color: var(--muted); font-size: 15px; }
.crumbs { font-size: 14px; margin: 0 0 10px; }
.crumbs a { color: var(--muted); }
.next { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); }
.nw { white-space: nowrap; }

/* Product site (landing) */
.wide { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a.link { color: var(--text-2); text-decoration: none; font-size: 15px; }
.nav a.link:hover { color: var(--brand); }
@media (max-width: 720px) { .nav a.link { display: none; } }
.hero2 { display: grid; gap: 36px; align-items: center; padding-block: 28px 12px; }
@media (min-width: 900px) { .hero2 { grid-template-columns: 1.05fr 1fr; padding-block: 56px 24px; } }
.hero2 h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.12; margin: 0 0 14px; }
html[lang="ar"] .hero2 h1 { line-height: 1.3; }
.hero2 .tagline { margin: 0 0 24px; font-size: 19px; text-align: start; max-width: 32em; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 700; text-decoration: none; }
.btn.primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #062a1d; } }
.btn.ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn:hover { filter: brightness(1.06); }
.phones { position: relative; height: clamp(420px, 70vw, 600px); }
.phones figure { position: absolute; margin: 0; width: clamp(200px, 36vw, 280px); border-radius: 34px; padding: 9px; background: #0b0d10; box-shadow: 0 30px 70px rgba(15, 17, 20, .28), 0 0 0 1px rgba(255, 255, 255, .12); }
.phones img { display: block; width: 100%; height: auto; border-radius: 26px; }
.phones .front { inset-inline-start: 6%; top: 0; z-index: 2; }
.phones .back { inset-inline-end: 4%; top: 64px; transform: rotate(4deg); opacity: .96; }
html[dir="rtl"] .phones .back { transform: rotate(-4deg); }
.section { padding-block: 56px 8px; }
.section > h2 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 8px; text-align: center; }
.section > .sub { color: var(--text-2); text-align: center; margin: 0 auto 28px; max-width: 40em; }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); list-style: none; padding: 0; margin: 0; }
.grid3 li { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.grid3 svg { width: 30px; height: 30px; stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 10px; }
.grid3 strong { display: block; font-size: 17px; margin-bottom: 4px; }
.grid3 span { color: var(--muted); font-size: 15px; }
.how { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); counter-reset: how; list-style: none; padding: 0; margin: 0; }
.how li { margin: 0; counter-increment: how; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.how li::before { content: counter(how); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 10px; }
.how strong { display: block; font-size: 17px; margin-bottom: 4px; }
.how p { color: var(--muted); font-size: 15px; margin: 0; }
.how pre { font-size: 12.5px; margin: 10px 0 0; }
.arch { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 10px; margin: 22px 0 0; }
.arch div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; text-align: center; min-width: 150px; }
.arch b { display: block; }
.arch small { color: var(--muted); }
.arch i { align-self: center; color: var(--muted); font-style: normal; font-size: 22px; }
.gallery { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.gallery img { flex: 0 0 auto; width: 220px; height: auto; border-radius: 18px; scroll-snap-align: start; border: 1px solid var(--border); }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin: 0 0 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--text-2); }
.final { text-align: center; background: linear-gradient(135deg, #0E9A68, #07734B); color: #fff; border-radius: 26px; padding: 40px 20px; margin-top: 56px; }
.final h2 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); }
.final p { margin: 0 0 20px; opacity: .92; }
.final .btn.primary { background: #fff; color: #07734B; }
