/* Server Sidekick website. One stylesheet, no external requests. */

:root {
  --brand-sky: #38b6ff;
  --brand-blue: #004aad;
  --brand-navy: #0b1f44;

  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --text: #0b1f44;
  --text-muted: #4a5a78;
  --border: #d9e2ef;
  --link: #0057c8;
  --accent: #004aad;
  --accent-text: #ffffff;
  --ok: #1b7f3b;
  --code-bg: #eef3fa;
  --shadow: 0 1px 2px rgb(11 31 68 / 6%), 0 8px 24px rgb(11 31 68 / 8%);

  --radius: 14px;
  --max: 1120px;
  --prose: 72ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08142c;
    --surface: #0f1f3d;
    --surface-2: #142849;
    --text: #e8eefb;
    --text-muted: #a9b8d4;
    --border: #22385f;
    --link: #7cc8ff;
    --accent: #38b6ff;
    --accent-text: #04122b;
    --ok: #5fd08a;
    --code-bg: #142849;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #08142c;
  --surface: #0f1f3d;
  --surface-2: #142849;
  --text: #e8eefb;
  --text-muted: #a9b8d4;
  --border: #22385f;
  --link: #7cc8ff;
  --accent: #38b6ff;
  --accent-text: #04122b;
  --ok: #5fd08a;
  --code-bg: #142849;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

pre {
  background: var(--code-bg);
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 28px;
  }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav {
  margin-left: auto;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

.nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.nav-toggle {
  display: none;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }

  .nav.open {
    display: block;
  }

  .nav ul {
    flex-direction: column;
  }

  .nav a {
    padding: 12px;
    font-size: 1rem;
  }
}

/* ---------- Buttons & badges ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.2;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 14px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgb(255 255 255 / 25%);
  min-width: 190px;
}

.store-badge svg {
  width: 28px;
  height: 28px;
  flex: none;
}

.store-badge small {
  display: block;
  font-size: 0.7rem;
  opacity: 0.85;
  line-height: 1.1;
}

.store-badge strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1.2;
}

.store-badge:hover {
  background: #1a1a1a;
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgb(56 182 255 / 45%), transparent 60%),
    linear-gradient(135deg, #0b1f44 0%, #003a8c 55%, #0a63c9 100%);
  color: #fff;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  gap: 40px;
  padding-top: 64px;
  padding-bottom: 0;
  align-items: end;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.1fr 0.9fr;
    padding-top: 88px;
  }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.hero p.lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: rgb(255 255 255 / 85%);
  margin: 0 0 28px;
  max-width: 38ch;
}

.hero-copy {
  padding-bottom: 64px;
}

.hero .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.hero .pill {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  border: 1px solid rgb(255 255 255 / 20%);
  color: #fff;
}

.hero-shots {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 18px;
  min-height: 340px;
}

.phone {
  width: 240px;
  border-radius: 34px 34px 0 0;
  border: 8px solid #0a1630;
  border-bottom: 0;
  background: #0a1630;
  box-shadow: 0 30px 60px rgb(0 0 0 / 40%);
  overflow: hidden;
  align-self: flex-end;
}

.phone img {
  border-radius: 26px 26px 0 0;
}

.phone.back {
  width: 210px;
  margin-bottom: -10px;
  opacity: 0.95;
}

@media (max-width: 520px) {
  .phone {
    width: 62%;
  }

  .phone.back {
    display: none;
  }
}

/* ---------- Sections ---------- */

section {
  padding: 72px 0;
}

section.tight {
  padding: 48px 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: 36px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 8px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  margin: 0 0 12px;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}

.muted {
  color: var(--text-muted);
}

.alt {
  background: var(--surface-2);
}

.grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 640px) {
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

.card ul {
  margin: 8px 0 0;
  padding-left: 1.1em;
  color: var(--text-muted);
}

.card li {
  margin: 4px 0;
}

.icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-sky), var(--brand-blue));
  color: #fff;
  margin-bottom: 14px;
}

.icon svg {
  width: 22px;
  height: 22px;
}

/* Feature split rows */

.split {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }

  .split.reverse > :first-child {
    order: 2;
  }
}

.split ul.checks {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.checks li {
  position: relative;
  padding-left: 30px;
  margin: 10px 0;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.shot {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--surface);
}

.shot-phone {
  max-width: 300px;
  margin: 0 auto;
  border-radius: 28px;
  border: 6px solid var(--brand-navy);
}

/* Gallery */

.gallery {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 18px;
  margin: 0 -4px;
}

.gallery figure {
  flex: 0 0 auto;
  width: min(230px, 62vw);
  margin: 0;
  scroll-snap-align: start;
}

.gallery img {
  border-radius: 22px;
  border: 5px solid var(--brand-navy);
  box-shadow: var(--shadow);
}

.gallery figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* Platforms strip */

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.platforms span {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 500;
}

/* CTA band */

.cta {
  background: linear-gradient(135deg, #0b1f44, #004aad);
  color: #fff;
  border-radius: 22px;
  padding: 40px 28px;
  display: grid;
  gap: 22px;
  align-items: center;
}

.cta p {
  color: rgb(255 255 255 / 85%);
  margin: 0;
}

.cta h2 {
  margin: 0 0 6px;
}

@media (min-width: 860px) {
  .cta {
    grid-template-columns: 1fr auto;
    padding: 48px;
  }
}

/* ---------- Page header for inner pages ---------- */

.page-head {
  background: linear-gradient(135deg, #0b1f44 0%, #003a8c 60%, #0a63c9 100%);
  color: #fff;
  padding: 56px 0 48px;
}

.page-head h1 {
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  margin: 0 0 10px;
}

.page-head p {
  margin: 0;
  color: rgb(255 255 255 / 85%);
  font-size: 1.12rem;
  max-width: 60ch;
}

/* ---------- Prose (policy pages) ---------- */

.prose {
  max-width: var(--prose);
}

.prose h2 {
  font-size: 1.5rem;
  margin: 2.2em 0 0.5em;
  padding-top: 0.2em;
}

.prose h3 {
  margin: 1.6em 0 0.4em;
}

.prose p,
.prose li {
  color: var(--text);
}

.prose ul {
  padding-left: 1.3em;
}

.prose li {
  margin: 0.4em 0;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.96rem;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.prose th {
  background: var(--surface-2);
}

.summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 1.5em 0;
}

.summary-box ul {
  margin: 0.4em 0 0;
}

.layout-toc {
  display: grid;
  gap: 40px;
}

@media (min-width: 1000px) {
  .layout-toc {
    grid-template-columns: 240px 1fr;
  }

  .toc {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }
}

.toc {
  font-size: 0.93rem;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
}

.toc ol,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid var(--border);
}

.toc a:hover {
  color: var(--text);
  border-left-color: var(--accent);
}

@media (max-width: 999px) {
  .toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
  }
}

/* ---------- FAQ ---------- */

.faq-group {
  margin-bottom: 40px;
}

.faq-group > h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
}

details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}

details.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 48px 16px 20px;
  font-weight: 600;
  position: relative;
}

details.faq summary::-webkit-details-marker {
  display: none;
}

details.faq summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.15s;
}

details.faq[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

details.faq .answer {
  padding: 0 20px 18px;
}

details.faq .answer > :first-child {
  margin-top: 0;
}

details.faq .answer > :last-child {
  margin-bottom: 0;
}

details.faq:target,
details.faq:has(:target) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 32px;
  margin-top: 40px;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.site-footer h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 0 0 10px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin: 6px 0;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.legal {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.theme-toggle {
  margin-top: 12px;
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.theme-toggle button {
  background: var(--surface);
  color: var(--text-muted);
  border: 0;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

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

@media print {
  .site-header,
  .site-footer,
  .toc,
  .nav-toggle {
    display: none !important;
  }

  .page-head {
    background: none;
    color: #000;
    padding: 0;
  }

  .page-head p {
    color: #000;
  }
}

/* Grid and flex children default to min-width:auto, so a long code line
   would widen the whole column past a phone's screen. */
.layout-toc > *,
.split > *,
.grid > *,
.footer-grid > * {
  min-width: 0;
}
