/* Phantom — shared design system.
   Visual language matches the app: deep navy surface with a radial glow,
   cyan→purple gradient accents, glassmorphic cards, system typography.
   Dark-only by design (mirrors the app). */

:root {
    --bg: #0b0f1a;
    --card: rgba(255, 255, 255, 0.06);
    --card-2: rgba(255, 255, 255, 0.04);
    --card-3: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.12);
    --border-soft: rgba(255, 255, 255, 0.08);
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.72);
    --muted2: rgba(255, 255, 255, 0.58);

    --accent: #7dd3fc;   /* sky / cyan — app PIN dots, presence, active */
    --accent2: #a78bfa;  /* purple — group avatars, secondary accent */
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #fb7185;

    --grad: linear-gradient(135deg, #7dd3fc, #a78bfa);
    --grad-soft: linear-gradient(135deg, rgba(125,211,252,.9), rgba(167,139,250,.9));

    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .35);
    --radius: 16px;
    --radius-sm: 12px;
    --maxw: 1080px;
    --maxw-prose: 880px;

    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }

body {
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(900px 600px at 10% 8%, rgba(125, 211, 252, .18), transparent 60%),
        radial-gradient(760px 520px at 92% 14%, rgba(167, 139, 250, .18), transparent 55%),
        radial-gradient(1000px 760px at 60% 100%, rgba(52, 211, 153, .08), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

/* ---------- Brand logo (app icon) ---------- */
.logo-mark {
    display: inline-block;
    width: 32px; height: 32px;
    border-radius: 10px;
    background: #0d1424 url("phantom-icon-128.png") center / cover no-repeat;
    box-shadow: var(--shadow-sm);
    flex: 0 0 auto;
}
.logo-mark.lg { width: 64px; height: 64px; border-radius: 16px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    background: rgba(11, 15, 26, .68);
    border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; min-height: 62px;
}
.brand {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 18px; letter-spacing: .2px;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
    color: var(--muted); font-size: 14px; font-weight: 500;
}
.nav a:hover { color: var(--text); text-decoration: none; }

.lang-switch {
    display: inline-flex; gap: 4px;
    padding: 4px; border: 1px solid var(--border);
    border-radius: 999px; background: rgba(255, 255, 255, .04);
}
.lang-switch button {
    appearance: none; border: 0; background: transparent;
    color: var(--muted); padding: 6px 11px; border-radius: 999px;
    cursor: pointer; font-weight: 600; font-size: 13px; letter-spacing: .2px;
    font-family: inherit;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
    color: rgba(0, 0, 0, .86);
    background: var(--grad);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 12px 20px; border-radius: 12px;
    font-weight: 600; font-size: 15px; cursor: pointer;
    border: 1px solid transparent; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-primary {
    color: rgba(0, 0, 0, .88);
    background: var(--grad);
    box-shadow: 0 8px 28px rgba(125, 211, 252, .25);
}
.btn-primary:hover { box-shadow: 0 12px 34px rgba(167, 139, 250, .35); }
.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, .06);
    border-color: var(--border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, .1); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero-grid {
    display: grid; grid-template-columns: 1.05fr .95fr;
    gap: 48px; align-items: center;
}
.hero-ghost { margin-bottom: 22px; }   /* now holds .logo-mark.lg */
.eyebrow {
    font-family: var(--mono); font-size: 12.5px; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}
.hero h1 {
    font-size: clamp(32px, 5vw, 50px); line-height: 1.08;
    letter-spacing: -.5px; margin: 0 0 18px; font-weight: 800;
}
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 30em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-note { margin: 14px 0 0; font-size: 13px; color: var(--muted2); }

/* Thesis card: what you send vs what the server sees */
.thesis {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px;
}
.thesis-row { margin-bottom: 18px; }
.thesis-label {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
    text-transform: uppercase; color: var(--muted2); margin-bottom: 10px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot-you { background: var(--accent); box-shadow: 0 0 0 4px rgba(125, 211, 252, .16); }
.dot-server { background: var(--danger); box-shadow: 0 0 0 4px rgba(251, 113, 133, .16); }
.bubble {
    display: inline-block; padding: 11px 15px;
    background: var(--grad); color: rgba(0, 0, 0, .86);
    border-radius: 14px 14px 14px 4px; font-size: 15px; font-weight: 500;
    max-width: 92%;
}
.cipher {
    font-family: var(--mono); font-size: 13px; line-height: 1.7;
    color: var(--muted); word-break: break-all;
    background: rgba(0, 0, 0, .28); border: 1px solid var(--border-soft);
    border-radius: 10px; padding: 12px 14px; min-height: 78px;
}
.thesis-caption { margin: 4px 0 0; font-size: 13px; color: var(--muted2); }

/* ---------- Sections ---------- */
.section { padding: 52px 0; }
.section-head { margin-bottom: 28px; max-width: 40em; }
.section-head h2 {
    font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.3px;
    margin: 0 0 10px; font-weight: 800;
}
.section-head p { color: var(--muted); font-size: 16px; margin: 0; }
.divider { height: 1px; background: var(--border-soft); border: 0; margin: 0; }

/* ---------- Card grids ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px; transition: border-color .2s ease, transform .15s ease;
}
.card:hover { border-color: rgba(125, 211, 252, .35); transform: translateY(-2px); }
.card .icon {
    width: 40px; height: 40px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(125, 211, 252, .12); color: var(--accent);
    margin-bottom: 14px;
}
.card .icon svg { width: 20px; height: 20px; }
.card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 12px; }
.step {
    position: relative; counter-increment: step;
    background: var(--card-2); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 18px 18px 18px 64px;
}
.step::before {
    content: counter(step, decimal-leading-zero);
    position: absolute; left: 18px; top: 18px;
    font-family: var(--mono); font-size: 14px; font-weight: 700;
    color: var(--accent);
    width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(125, 211, 252, .1); border: 1px solid rgba(125, 211, 252, .25);
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Platforms ---------- */
.platform {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 22px; display: flex; flex-direction: column; gap: 6px;
}
.platform .status {
    font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
    text-transform: uppercase; color: var(--muted2);
}
.platform .pname {
    display: flex; align-items: center; gap: 9px;
    font-size: 18px; font-weight: 700; margin: 2px 0 4px;
}
.platform .pname svg { width: 20px; height: 20px; opacity: .9; }
.platform p { margin: 0 0 14px; color: var(--muted); font-size: 14px; flex: 1; }
.platform-cta { margin-top: auto; }
.platform-cta .btn { width: 100%; }

/* ---------- Download card ---------- */
.download-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 26px; margin-top: 16px;
}
.download-card h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.download-card > p { margin: 0 0 16px; color: var(--muted); }
.meta-row {
    display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 18px;
    font-family: var(--mono); font-size: 13px; color: var(--muted);
}
.meta-row .k { color: var(--muted2); }
.meta-row code {
    font-family: var(--mono); color: var(--text);
    background: rgba(0, 0, 0, .3); padding: 2px 7px; border-radius: 6px;
    border: 1px solid var(--border-soft); word-break: break-all;
}
.download-note {
    border-left: 3px solid var(--accent);
    padding: 10px 14px; background: rgba(125, 211, 252, .08);
    border-radius: 10px; margin: 16px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .86);
}

/* ---------- Prose pages (privacy / support) ---------- */
.page-head { padding: 56px 0 20px; text-align: center; }
.page-head .logo-mark { margin: 0 auto 18px; display: block; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; font-weight: 800; letter-spacing: -.3px; }
.page-head .subtitle { color: var(--muted2); margin: 0; font-size: 14px; }

.prose-wrap { max-width: var(--maxw-prose); margin: 0 auto; padding: 0 20px 64px; }
.prose { font-size: 15.5px; color: var(--text); }
.prose h2 {
    color: var(--accent); font-size: 19px; font-weight: 700;
    margin: 34px 0 10px; letter-spacing: .1px;
}
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--muted); margin: 10px 0; }
.prose ul { color: var(--muted); padding-left: 20px; margin: 10px 0; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text); font-weight: 700; }
.prose a { color: var(--accent); }
.highlight {
    border-left: 3px solid var(--accent2);
    background: rgba(167, 139, 250, .1);
    padding: 14px 16px; border-radius: 12px; margin: 6px 0 26px;
    color: rgba(255, 255, 255, .9);
}

/* FAQ accordion (support) */
.faq { display: grid; gap: 10px; margin: 8px 0 0; }
.faq details {
    border: 1px solid var(--border); border-radius: 14px;
    background: var(--card-3); padding: 14px 16px;
}
.faq summary {
    cursor: pointer; font-weight: 700; color: rgba(255, 255, 255, .9);
    list-style: none; font-size: 15.5px; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 18px; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { color: var(--muted); font-size: 14.5px; margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border-soft); margin-top: 24px;
    padding: 30px 0 40px;
}
.site-footer .wrap {
    display: flex; flex-wrap: wrap; gap: 16px;
    justify-content: space-between; align-items: center;
}
.footer-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.footer-tagline { color: var(--muted2); font-size: 13px; margin-top: 4px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted2); font-size: 12px; width: 100%; margin-top: 4px; }

/* ---------- Reveal on scroll (progressive enhancement) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .nav { gap: 14px; }
    .nav a:not(.lang-switch) { display: none; }
}
@media (max-width: 620px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .hero { padding: 40px 0 24px; }
    .cta-row .btn { flex: 1 1 auto; }
    .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

/* Small spacing utilities (replaces inline style= so CSP style-src can stay strict) */
.mb-28 { margin-bottom: 28px; }
.mt-40 { margin-top: 40px; }
