/* Device Monitor + System Status. Web styles based on the app UI kit */

:root {
  --bg: #0b0d10;
  --bg-2: #101318;
  --card: #15181d;
  --card-2: #1b1f26;
  --border: #252a32;
  --border-strong: #323843;
  --text: #f4f5f7;
  --text-2: #c9cdd4;
  --muted: #8a919b;
  --green: #3ddc97;
  --green-ink: #06231a;
  --green-soft: rgba(61, 220, 151, 0.12);
  --gold-1: #f7cd72;
  --gold-2: #e8a23a;
  --gold-ink: #2a1a02;
  --amber: #f5a524;
  --blue: #4f8cff;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1080px;
  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-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

/* Language switching: content blocks carry data-l="en" or data-l="es" */
html[data-lang="en"] [data-l="es"],
html[data-lang="es"] [data-l="en"] { display: none !important; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--border); }
.brand span { white-space: nowrap; }
.nav { display: none; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--card-2); }
@media (min-width: 760px) { .nav { display: flex; } }

/* Segmented control, same shape as Performance / Device in the app */
.seg {
  display: inline-flex; padding: 3px; margin-left: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
@media (min-width: 760px) { .seg { margin-left: 8px; } }
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: 600 13px/1 var(--font); padding: 8px 12px; border-radius: 9px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--card-2); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }

.mobile-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 12px; border-top: 1px solid var(--border); }
.mobile-nav a { flex: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); }
.mobile-nav a[aria-current="page"] { color: var(--green-ink); background: var(--green); border-color: var(--green); }
.mobile-nav a:hover { text-decoration: none; }
@media (min-width: 760px) { .mobile-nav { display: none; } }

/* ---------- Common UI pieces ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  padding: 4px 9px; border-radius: 8px;
  color: var(--green); background: var(--green-soft); border: 1px solid rgba(61, 220, 151, 0.28);
}
.pro {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 999px; color: var(--gold-ink);
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  vertical-align: middle;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 700 15px/1 var(--font); cursor: pointer; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-green { background: var(--green); color: var(--green-ink); }
.btn-outline { color: var(--green); border-color: var(--green); background: transparent; }

/* Official Apple badge. Keep it unmodified, 40px minimum height on screen */
.store-badge { display: inline-block; line-height: 0; border-radius: 10px; }
.store-badge img { height: 52px; width: auto; }
.store-badge:hover { text-decoration: none; opacity: 0.92; }
.store-badge.sm img { height: 44px; }

/* ---------- Landing ---------- */
.hero { padding: 56px 0 32px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -120px 0 auto 0; height: 520px; z-index: -1;
  background:
    radial-gradient(520px 260px at 20% 30%, rgba(61, 220, 151, 0.14), transparent 70%),
    radial-gradient(520px 280px at 85% 20%, rgba(79, 140, 255, 0.14), transparent 70%);
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 56px; } }
.hero-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 0 0 1px var(--border), 0 18px 50px rgba(61, 140, 255, 0.25); margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.03em; margin: 12px 0 16px; }
.hero h1 em { font-style: normal; color: var(--green); }
.lead { font-size: 18px; color: var(--text-2); max-width: 34em; margin: 0 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.cta-note { font-size: 13px; color: var(--muted); }

.phones { display: flex; justify-content: center; gap: 16px; }
.phone {
  flex: 0 1 240px; aspect-ratio: 402 / 874; border-radius: 34px; overflow: hidden;
  background: #000; border: 6px solid #1d2128; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-strong);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone.back { transform: translateY(36px); display: none; }
@media (min-width: 520px) { .phone.back { display: block; } }

.section { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.02em; line-height: 1.15; margin: 8px 0 10px; }
.section-head p { color: var(--text-2); margin: 0; }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { padding: 20px; }
.tile .eyebrow { display: flex; justify-content: space-between; align-items: center; }
.tile h3 { margin: 14px 0 6px; font-size: 18px; letter-spacing: -0.01em; }
.tile p { margin: 0; color: var(--muted); font-size: 14.5px; }
.tile svg { width: 22px; height: 22px; color: var(--green); }

.gallery { display: flex; gap: 16px; overflow-x: auto; padding: 8px 2px 24px; scroll-snap-type: x mandatory; }
.gallery .phone { flex: 0 0 200px; scroll-snap-align: start; border-width: 5px; border-radius: 30px; }

.links { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.link-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.link-card:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-2px); }
.link-card strong { font-size: 17px; }
.link-card span { color: var(--muted); font-size: 14px; }
.link-card .arrow { color: var(--green); font-weight: 700; margin-top: 6px; }

/* Gold upgrade style card, reused as download CTA */
.cta-card {
  padding: 28px; border-radius: 22px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #1a1812, #14161a);
  border: 1px solid rgba(232, 162, 58, 0.35);
  display: grid; gap: 20px; align-items: center;
}
@media (min-width: 760px) { .cta-card { grid-template-columns: auto 1fr auto; padding: 32px 36px; } }
.cta-card img.icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 0 1px var(--border); }
.cta-card h2, .cta-card h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.02em; line-height: 1.2; }
.cta-card p { margin: 0; color: var(--text-2); }

/* ---------- Document pages ---------- */
.doc-hero { padding: 48px 0 8px; }
.doc-hero h1 { font-size: clamp(32px, 5vw, 46px); letter-spacing: -0.03em; line-height: 1.1; margin: 12px 0 12px; }
.doc-hero p { color: var(--text-2); margin: 0; max-width: 42em; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.doc-layout { display: grid; gap: 28px; padding: 32px 0 64px; }
@media (min-width: 960px) { .doc-layout { grid-template-columns: 250px 1fr; gap: 40px; align-items: start; } }

.toc { padding: 18px; }
@media (min-width: 960px) { .toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; } }
.toc ol { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text-2); font-size: 14px; line-height: 1.35; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 1px; }
.toc a:hover { background: var(--card-2); color: var(--text); text-decoration: none; }

.doc { min-width: 0; }
.doc section { padding: 26px 24px; margin-bottom: 14px; scroll-margin-top: 90px; }
@media (min-width: 720px) { .doc section { padding: 30px 34px; } }
.doc h2 { font-size: 21px; letter-spacing: -0.01em; margin: 0 0 12px; line-height: 1.3; }
.doc h3 { font-size: 16px; margin: 22px 0 6px; color: var(--text); }
.doc p, .doc li { color: var(--text-2); }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--green); }
.doc strong { color: var(--text); }
.doc section > :last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 6px 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
th { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td strong { color: var(--text); }

.callout { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--green-soft); border: 1px solid rgba(61, 220, 151, 0.25); color: var(--text); margin: 4px 0 14px; }
.callout svg { flex: none; width: 20px; height: 20px; color: var(--green); margin-top: 2px; }
.callout p { margin: 0; color: var(--text); }

/* ---------- FAQ ---------- */
.faq-group { margin-bottom: 34px; scroll-margin-top: 90px; }
.faq-group > .eyebrow { display: block; margin: 0 0 12px 4px; }
.faq-list { overflow: hidden; }
.faq-list details { border-bottom: 1px solid var(--border); }
.faq-list details:last-child { border-bottom: 0; }
.faq-list summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px; font-weight: 600; font-size: 16px; color: var(--text);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.2s;
}
.faq-list details[open] summary::after { transform: rotate(45deg); border-color: var(--green); }
.faq-list summary:hover { background: var(--card-2); }
.faq-list .answer { padding: 0 22px 20px; color: var(--text-2); }
.faq-list .answer p { margin: 0 0 10px; }
.faq-list .answer p:last-child { margin: 0; }
.faq-list .answer ol, .faq-list .answer ul { margin: 0 0 10px; padding-left: 20px; }

.faq-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; margin: 24px 0 30px; max-width: 560px; }
.faq-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.faq-search input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: 500 16px var(--font); outline: none; }
.faq-search input::placeholder { color: var(--muted); }
.faq-empty { color: var(--muted); display: none; padding: 8px 4px 24px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0 44px; color: var(--muted); font-size: 14px; }
.foot-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { margin: 0 0 10px; color: var(--text); font-size: 13px; font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--text-2); }
.site-footer .legal { margin-top: 28px; font-size: 12px; line-height: 1.5; }

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