/* ============================================================
   AppTela info-page system - shared across privacy / changelog
   / support / terms. White body, modern typography, restrained
   accent (brand purple). Mobile-first.
   ============================================================ */

:root {
    --bg:              #ffffff;
    --bg-soft:         #fafafc;
    --bg-callout:      #f1f3ff;
    --ink:             #0f1014;
    --body:            #44444c;
    --soft:            #6e6e76;
    --subtle:          #a1a1aa;
    --line:            #ebebef;
    --line-soft:       #f4f4f7;
    --line-strong:     #d4d4dc;
    --accent:          #667eea;
    --accent-deep:     #4f5cc9;
    --accent-soft:     #e1e5ff;
    --pos:             #1f9d55;     /* "no data leaves" positive accent */
    --warn-soft:       #fff4ec;

    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
    --font-text:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
    --font-mono:    ui-monospace, "SF Mono", "Menlo", "Monaco", "Cascadia Code", "Roboto Mono", monospace;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;

    --shadow-1:  0 1px 2px rgba(15, 16, 20, 0.04);
    --shadow-2:  0 1px 2px rgba(15, 16, 20, 0.04), 0 8px 24px rgba(15, 16, 20, 0.06);
    --shadow-3:  0 1px 3px rgba(15, 16, 20, 0.06), 0 12px 36px rgba(15, 16, 20, 0.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: var(--font-text);
    background: var(--bg);
    color: var(--body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: var(--ink); }

a {
    color: var(--accent);
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
a:hover { color: var(--accent-deep); text-decoration: underline; }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

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

/* ============================================================
   Hero strip - thin animated ember band at the very top.
   Echoes the cinematic landing page hero, but only ~60px tall
   so it does not compete with reading. Scrolls off; the sticky
   site bar below it then takes the top spot.
   ============================================================ */

.hero-strip {
    position: relative;
    height: 64px;
    width: 100%;
    overflow: hidden;
    background: #0a0a0c; /* fallback if video fails to load */
    z-index: 1;
}
.hero-strip video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 55%;
    filter: saturate(1.1) brightness(0.95);
}
.hero-strip::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 70%, var(--bg) 100%);
}
@media (max-width: 640px) {
    .hero-strip { height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-strip video { display: none; }
    .hero-strip {
        background: linear-gradient(135deg, #1a0e05 0%, #ff6b1a 60%, #ff8a3a 100%);
    }
}

/* ============================================================
   Variant B - "banner-head"  (video AS the header background,
   nav links sitting on top of it). Toggle via class on body:
   body.banner-head .site-bar { ...this layout takes over... }
   and the standalone hero-strip is hidden.
   ============================================================ */

body.banner-head .hero-strip { display: none; }

body.banner-head .site-bar {
    position: relative;       /* not sticky in the banner variant */
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    overflow: hidden;
    isolation: isolate;
}
body.banner-head .site-bar .bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 55%;
    z-index: -2;
    filter: saturate(1.05) brightness(0.92);
}
/* Colour-rich video in the top 70%, soft fade to page-white in
   the bottom 30%. A light dark veil up top keeps the white nav
   text legible if a bright ember moment passes underneath. */
body.banner-head .site-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg,
            rgba(15, 8, 4, 0.25) 0%,
            rgba(15, 8, 4, 0.18) 50%,
            rgba(255, 255, 255, 0) 70%,
            rgba(255, 255, 255, 0.70) 90%,
            var(--bg) 100%);
}
body.banner-head .site-bar-inner {
    padding: 22px 24px;
}
body.banner-head .brand {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
body.banner-head .brand:hover { color: #ffd9be; }
body.banner-head .site-nav a {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
body.banner-head .site-nav a:hover,
body.banner-head .site-nav a[aria-current="page"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
@media (max-width: 640px) {
    body.banner-head .site-bar-inner { padding: 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    body.banner-head .site-bar .bg-video { display: none; }
    body.banner-head .site-bar {
        background: linear-gradient(180deg, #fff5ed 0%, #ffffff 100%);
    }
}

/* ============================================================
   Top site bar - replaces the heavy gradient banner
   ============================================================ */

.site-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-bar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.012em;
}
.brand:hover { color: var(--accent-deep); text-decoration: none; }
.brand img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
    color: var(--soft);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.site-nav a:hover {
    color: var(--ink);
    background: var(--bg-soft);
    text-decoration: none;
}
.site-nav a[aria-current="page"] {
    color: var(--ink);
    background: var(--bg-soft);
}

/* ============================================================
   Page shell + masthead
   ============================================================ */

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.page-head {
    padding: 72px 0 48px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 56px;
}
.page-head .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 14px;
}
.page-head h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5.2vw, 3.6rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: var(--ink);
    margin: 0 0 18px;
    max-width: 22ch;
}
.page-head .meta {
    font-family: var(--font-text);
    font-size: 0.95rem;
    color: var(--soft);
    margin: 0;
}
.page-head .meta time { font-variant-numeric: tabular-nums; }
.page-head .meta strong { color: var(--ink); font-weight: 500; }

/* Optional lead under page-head */
.page-head .lead {
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--ink);
    margin-top: 24px;
    max-width: 58ch;
    font-weight: 400;
}

/* ============================================================
   Layout - article column + optional sticky TOC
   ============================================================ */

.article {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
}
.article-body {
    max-width: 720px;
}

@media (min-width: 1100px) {
    .article {
        grid-template-columns: 220px 1fr;
        gap: 80px;
    }
    .toc {
        position: sticky;
        top: 88px;
        align-self: start;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* ============================================================
   TOC (sticky on desktop)
   ============================================================ */

.toc { display: none; }
@media (min-width: 1100px) {
    .toc { display: block; }
}
.toc-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--subtle);
    margin: 0 0 14px;
}
.toc ul {
    list-style: none;
    border-left: 1px solid var(--line);
}
.toc li { margin: 0; }
.toc a {
    display: block;
    padding: 6px 14px;
    color: var(--soft);
    font-size: 0.92rem;
    line-height: 1.5;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.toc a:hover {
    color: var(--ink);
    text-decoration: none;
    border-left-color: var(--line-strong);
}
.toc a[aria-current="true"] {
    color: var(--accent);
    border-left-color: var(--accent);
}

/* ============================================================
   Content blocks
   ============================================================ */

.article-body section {
    margin-bottom: 56px;
    scroll-margin-top: 80px;
}
.article-body section:last-child { margin-bottom: 0; }

.article-body h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.6vw, 1.85rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}
.article-body section:first-of-type h2 {
    padding-top: 0;
    border-top: none;
}

.article-body h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.012em;
    color: var(--ink);
    margin: 32px 0 10px;
}
.article-body h4 {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin: 24px 0 6px;
}

.article-body p {
    font-family: var(--font-text);
    color: var(--body);
    margin: 0 0 16px;
}
.article-body p strong { color: var(--ink); font-weight: 600; }

.article-body ul, .article-body ol {
    margin: 0 0 16px 0;
    padding-left: 20px;
    color: var(--body);
}
.article-body ul { list-style: none; padding-left: 0; }
.article-body ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}
.article-body ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.65em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.7;
}
.article-body ol li { margin-bottom: 8px; }
.article-body li strong { color: var(--ink); font-weight: 600; }

.article-body code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--line);
    color: var(--ink);
    word-break: break-word;
}

/* ============================================================
   Callout (replaces .highlight box)
   ============================================================ */

.callout {
    margin: 24px 0 32px;
    padding: 22px 26px;
    background: var(--bg-callout);
    border: 1px solid var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}
.callout-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin: 0 0 8px;
    display: block;
}
.callout p { margin: 0; color: var(--ink); font-size: 1.02rem; }
.callout p + p { margin-top: 8px; }

/* TL;DR variant near the top */
.callout--tldr {
    margin: 0 0 56px;
    padding: 28px 32px;
}
.callout--tldr p { font-size: 1.08rem; line-height: 1.55; }

/* Quiet variant - tip / aside */
.callout--quiet {
    background: var(--bg-soft);
    border-color: var(--line);
    border-left-color: var(--soft);
}
.callout--quiet .callout-label { color: var(--soft); }

/* ============================================================
   Figure - product screenshots
   ============================================================ */

figure {
    margin: 28px 0 36px;
}
figure picture, figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    background: var(--bg-soft);
    overflow: hidden;
    display: block;
}
figure.narrow img { max-width: 380px; margin: 0 auto; }
figcaption {
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--soft);
    line-height: 1.55;
    text-align: center;
}
figcaption strong { color: var(--ink); font-weight: 600; }

/* Side-by-side figures on desktop */
.figure-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 28px 0 36px;
}
@media (min-width: 700px) {
    .figure-row { grid-template-columns: 1fr 1fr; gap: 28px; }
    .figure-row figure { margin: 0; }
}

/* ============================================================
   Two-col list ("what's local" / "what's network")
   ============================================================ */

.split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 24px 0 32px;
}
@media (min-width: 800px) {
    .split-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
.split-card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 26px;
}
.split-card-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.split-card-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--accent);
}
.split-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.01em;
}
.split-card ul { padding-left: 0; }
.split-card ul li {
    padding-left: 18px;
    font-size: 0.96rem;
    line-height: 1.55;
    margin-bottom: 8px;
}
.split-card ul li::before { left: 2px; top: 0.6em; }

/* ============================================================
   Definition list pattern (used for the "5 paths" etc)
   ============================================================ */

dl.spec {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 24px 0 32px;
    border-top: 1px solid var(--line);
}
dl.spec > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 20px 0 22px;
    border-bottom: 1px solid var(--line);
}
@media (min-width: 700px) {
    dl.spec > div {
        grid-template-columns: 200px 1fr;
        gap: 32px;
        padding: 22px 0;
    }
}
dl.spec dt {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}
dl.spec dt .ix {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--accent);
}
dl.spec dt .tag {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-soft);
    color: var(--soft);
    border: 1px solid var(--line);
}
dl.spec dt .tag.opt {
    color: var(--accent-deep);
    background: var(--bg-callout);
    border-color: var(--accent-soft);
}
dl.spec dd { font-size: 0.98rem; color: var(--body); margin: 0; line-height: 1.55; }
@media (min-width: 700px) {
    dl.spec dt .tag { margin-left: 0; }
    dl.spec dt {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ============================================================
   Version cards (changelog)
   ============================================================ */

.version-card {
    margin-bottom: 56px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--line-soft);
}
.version-card:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.version-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.version-head h2 {
    border-top: none;
    padding-top: 0;
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 1.85rem);
}
.version-meta {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--soft);
    font-weight: 500;
}
.version-meta .current {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--accent);
    color: #fff;
    border-radius: 3px;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
}
.version-headline {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 20px;
    letter-spacing: -0.012em;
}
.version-pillars {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
}
@media (min-width: 700px) { .version-pillars { grid-template-columns: 1fr 1fr; } }
.pillar-row {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.pillar-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--accent);
    padding-top: 0.18em;
}
.pillar-row h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 2px;
    letter-spacing: -0.01em;
}
.pillar-row p {
    font-size: 0.92rem;
    color: var(--body);
    margin: 0;
    line-height: 1.5;
}

/* ============================================================
   FAQ disclosure (support page)
   ============================================================ */

.faq-list {
    border-top: 1px solid var(--line);
    margin: 16px 0 24px;
}
.faq-item {
    border-bottom: 1px solid var(--line);
}
.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
    display: grid;
    grid-template-columns: 1fr 20px;
    gap: 12px;
    align-items: center;
    transition: color 0.15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--soft);
    text-align: center;
    line-height: 1;
    transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { color: var(--accent); }
.faq-item summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 2px;
}
.faq-item-body {
    padding: 0 0 22px;
    color: var(--body);
}
.faq-item-body p { margin-bottom: 12px; }
.faq-item-body p:last-child { margin-bottom: 0; }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--line);
    padding: 48px 24px 56px;
    text-align: center;
    color: var(--soft);
    font-size: 0.92rem;
    background: var(--bg-soft);
}
.site-footer p { margin: 0 0 10px; }
.site-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px 18px;
    flex-wrap: wrap;
}
.site-footer-links a { color: var(--soft); }
.site-footer-links a:hover { color: var(--accent); }
.site-footer-email {
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--subtle);
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   Mobile polish
   ============================================================ */
@media (max-width: 640px) {
    body { font-size: 16px; }
    main { padding: 0 18px 64px; }
    .page-head { padding: 48px 0 36px; margin-bottom: 40px; }
    .site-nav { gap: 2px; }
    .site-nav a { padding: 5px 9px; font-size: 0.88rem; }
    .site-bar-inner { padding: 12px 18px; gap: 12px; }
    .brand { font-size: 1rem; }
    .brand img { width: 26px; height: 26px; }
    .callout, .callout--tldr { padding: 20px 22px; }
    .split-card { padding: 20px 22px; }
}

/* Narrow phones - the "AppTela" word costs ~80px we cannot
   spare. Icon stays as the brand mark; nav links pack tighter. */
@media (max-width: 520px) {
    .brand span { display: none; }
    .brand img { width: 28px; height: 28px; }
    .site-bar-inner { padding: 10px 14px; gap: 10px; }
    .site-nav { gap: 0; }
    .site-nav a { padding: 5px 8px; font-size: 0.85rem; }
}
@media (max-width: 380px) {
    .site-nav a { padding: 4px 6px; font-size: 0.82rem; letter-spacing: -0.005em; }
    .site-bar-inner { padding: 10px 12px; gap: 8px; }
}
