/* ==========================================================================
   Cuer — website redesign (#627). Layout + components.
   Design tokens (colors, radii, asymmetric corners, fonts) come from
   tokens.css, generated from the app's CuerDesignTokens.kt — link it FIRST.
   ========================================================================== */

:root { --maxw: 1160px; }

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    letter-spacing: -.01em;
    font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
p { margin: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.icon { width: 1em; height: 1em; display: block; }

/* --- Mono labels / eyebrow ------------------------------------------------ */
.mono {
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    font-family: var(--font-mono);
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 22px;
}
.eyebrow--center { justify-content: center; width: 100%; }
.eyebrow__dot { width: 7px; height: 7px; border-radius: 999px; background: var(--accent); flex: none; }

.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.dot--live { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .55em;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .98rem;
    padding: 13px 20px;
    border-radius: var(--asym-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn .glyph { width: 1.15em; height: 1.15em; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn--sm { padding: 9px 15px; font-size: .9rem; }
.btn--block { width: 100%; justify-content: center; }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { opacity: .9; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }

/* --- Sections ------------------------------------------------------------- */
.section { padding: 104px 0; background: var(--bg); }
.section--alt { background: var(--surface-2); }

.section__title { font-size: clamp(2.1rem, 5vw, 3.3rem); }
.section__title--center { text-align: center; }
.section__sub {
    margin: 18px 0 0;
    max-width: 540px;
    color: var(--muted);
    font-size: 1.06rem;
}
.section__sub--center { margin-left: auto; margin-right: auto; text-align: center; }

/* --- Cards ---------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--asym);
    box-shadow: 0 1px 2px rgba(20, 16, 12, .04), 0 18px 40px -30px rgba(20, 16, 12, .3);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    background: rgba(20, 17, 14, .72);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid rgba(255, 247, 235, .08);
    color: #F6F1E8;
}
.nav__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 13px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.nav__logo { width: 26px; height: 26px; }
.nav__menu { display: flex; align-items: center; gap: 28px; }
.nav__link { color: #B5AC9C; font-size: .95rem; font-weight: 500; transition: color .15s ease; }
.nav__link:hover { color: #F6F1E8; }
.nav__menu .btn--primary { background: #8C8CE8; }
.nav__lang {
    font-family: var(--font-mono);
    font-size: .82rem;
    color: #B5AC9C;
    background: transparent;
    border: 1px solid rgba(245, 241, 232, .18);
    border-radius: 999px;
    padding: 7px 30px 7px 12px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B5AC9C' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 13px;
    transition: color .15s ease, border-color .15s ease;
}
.nav__lang:hover { color: #F6F1E8; border-color: rgba(245, 241, 232, .4); }
.nav__lang option { color: #1a1a1a; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 22px; height: 2px; background: #F6F1E8; border-radius: 2px; transition: .2s ease; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative;
    /* Fill the browser window; svh tracks mobile dynamic toolbars. */
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Top padding clears the fixed nav; content stays centred between the two. */
    padding: 146px 0 104px;
    background:
        radial-gradient(1100px 520px at 80% 18%, rgba(140, 140, 232, .20), transparent 60%),
        var(--bg);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
/* Decorative particle canvas — sits behind hero content, never intercepts input. */
.hero__fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
/* Dark backdrop lifts the headline/tagline off the moving particle field. */
.hero__copy {
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 34px 38px;
    border-radius: var(--asym-lg);
}
.hero__title { font-size: clamp(2.7rem, 6vw, 4.4rem); font-weight: 800; color: var(--ink); margin-bottom: 22px; }
.hero__lead { color: var(--ink-2); font-size: 1.12rem; max-width: 470px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 24px; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }

.chip {
    font-family: var(--font-mono);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--muted);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 7px 14px;
}

/* --- Mesh diagram --------------------------------------------------------- */
.mesh-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--asym-lg);
    padding: 22px;
    box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .9);
}
.mesh-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mesh-card__label { color: var(--muted); font-size: .88rem; font-weight: 700; }
.mesh-card__peers { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: .88rem; font-weight: 700; }

.mesh { position: relative; aspect-ratio: 1 / .92; width: 100%; }
.mesh__links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.mesh__links line { stroke: var(--line-strong); stroke-width: .5; stroke-dasharray: 2 2; }

.mesh__node {
    position: absolute; z-index: 1;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transform: translate(-50%, -50%);
    width: 110px; text-align: center;
}
.mesh__icon {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border: 1px solid var(--line-strong); border-radius: var(--asym-sm);
    background: var(--surface-3); color: var(--ink); font-size: 22px;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .7);
}
.mesh__name { color: var(--muted); font-size: .62rem; letter-spacing: .04em; white-space: nowrap; }
.mesh__ms { color: var(--accent); }

/* Seven platforms arranged as a heptagon around the router hub. */
.mesh__node--androidtv { left: 50%; top: 13%; }
.mesh__node--macos     { left: 77%; top: 27%; }
.mesh__node--tvos      { left: 84%; top: 58%; }
.mesh__node--android   { left: 65%; top: 83%; }
.mesh__node--ios       { left: 35%; top: 83%; }
.mesh__node--linux     { left: 16%; top: 58%; }
.mesh__node--windows   { left: 23%; top: 27%; }

.mesh__hub {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
    width: 84px; height: 84px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    /* Same surface/border/ink as the platform nodes — no accent fill. */
    background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--asym-sm);
    color: var(--ink); font-size: 26px;
    box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .8);
}
.mesh__hubname { font-size: .6rem; font-weight: 700; letter-spacing: .05em; color: var(--ink); }

/* ==========================================================================
   How it works — steps
   ========================================================================== */
.steps, .features, .platforms { margin-top: 52px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 28px; }
.step__icon { font-size: 24px; color: var(--ink); display: block; margin-bottom: 20px; }
.step__num { color: var(--accent); margin: 0 0 10px; }
.step__title { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.step__text { color: var(--muted); font-size: .98rem; }

/* ==========================================================================
   Local-first (boosted, dark emphasis section)
   ========================================================================== */
.local { padding: 104px 0; }
.local__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.local__title { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; margin: 0 0 22px; }
.local__title em { font-style: normal; color: var(--accent); }
.local__text { color: var(--ink-2); font-size: 1.12rem; max-width: 480px; }
.local__chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 28px 0 0; padding: 0; }

.local__diagram {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--asym-lg);
    padding: 40px 28px 26px;
    display: flex; flex-direction: column; align-items: center; gap: 26px;
}
.local__cloud { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 30px; }
.local__cloud .mono { font-size: .62rem; }
.local__lan { display: flex; align-items: center; gap: 18px; }
.local__link { width: 40px; height: 2px; background: repeating-linear-gradient(90deg, var(--muted-2) 0 4px, transparent 4px 8px); }
.local__device { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink); font-size: 24px; }
.local__ms { color: var(--accent); font-size: .58rem; }
.local__hub {
    width: 64px; height: 64px; display: grid; place-items: center;
    background: var(--accent); color: #fff; border-radius: var(--asym-sm); font-size: 26px;
    box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 70%, transparent);
}
.local__net { color: var(--muted); font-size: .58rem; }

/* ==========================================================================
   Features
   ========================================================================== */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 28px; }
.feature__icon {
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: var(--asym-sm); background: var(--accent-soft); color: var(--accent);
    font-size: 22px; margin-bottom: 20px;
}
.feature__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.feature__text { color: var(--muted); font-size: .98rem; }

/* ==========================================================================
   Platforms
   ========================================================================== */
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.platform { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.platform__icon {
    width: 44px; height: 44px; flex: none; display: grid; place-items: center;
    border-radius: var(--asym-sm); background: var(--surface-3); color: var(--ink); font-size: 22px;
}
.platform__icon .glyph { width: 22px; height: 22px; }
.platform__info { flex: 1; min-width: 0; }
.platform__name { font-size: 1.08rem; font-weight: 700; }
.platform__meta { color: var(--muted); margin-top: 3px; font-size: .62rem; }
.platform__cta { color: var(--accent); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.platform__cta--soon { color: var(--muted); font-weight: 500; }
a.platform__cta--soon:hover { color: var(--ink); }
.platform__ctas { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.platform__cta--alt { color: var(--muted); font-weight: 500; font-size: .8rem; }
.platform__cta--alt:hover { color: var(--accent); }

/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing { margin-top: 48px; display: flex; justify-content: center; }
.price { width: 100%; max-width: 420px; padding: 32px; border-color: var(--accent); }
.price__name { font-size: 1.3rem; font-weight: 700; }
.price__amount { font-family: var(--font-display); font-weight: 800; font-size: 3rem; margin: 8px 0 22px; letter-spacing: -.03em; }
.price__per { font-family: var(--font-body); font-weight: 400; font-size: 1rem; color: var(--muted); }
.price__list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 13px; }
.price__list li { position: relative; padding-left: 28px; color: var(--ink); font-size: .98rem; }
.price__list li::before {
    content: "";
    position: absolute; left: 0; top: .3em; width: 16px; height: 16px;
    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='M5 12l5 5 9-10' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%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='M5 12l5 5 9-10' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ==========================================================================
   Download CTA
   ========================================================================== */
.cta { text-align: center; }
.cta__inner { display: flex; flex-direction: column; align-items: center; }
.cta__logo { width: 52px; height: 52px; margin-bottom: 24px; }
.cta__title { font-size: clamp(2.3rem, 5.2vw, 3.4rem); font-weight: 800; color: var(--ink); }
.cta__sub { color: var(--ink-2); max-width: 480px; margin: 16px auto 0; font-size: 1.06rem; }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 32px 0 8px; }

.cta__group-label { color: var(--muted); margin: 38px 0 14px; }
.cta__desktop { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.cta__mini {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 12px 20px; border: 1px solid var(--line-strong); border-radius: var(--asym-sm);
    color: var(--ink); transition: border-color .15s ease;
}
.cta__mini:hover { border-color: var(--ink); }
.cta__mini .glyph { width: 22px; height: 22px; flex: none; }
.cta__mini strong { font-weight: 600; display: block; }
.cta__mini .mono { color: var(--muted); font-size: .58rem; }
.cta__mini-txt { text-align: left; }

.cta__trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; list-style: none; margin: 38px 0 0; padding: 0; color: var(--muted); font-size: .92rem; }
.cta__trust li { display: inline-flex; align-items: center; gap: 8px; }
.cta__trust li::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 60px 0 34px; color: var(--ink); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer__tag { color: var(--muted); margin-top: 16px; max-width: 280px; font-size: .96rem; }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__head { color: var(--muted); margin-bottom: 4px; font-size: .88rem; font-weight: 700; }
.footer__col a { color: var(--ink); font-size: .96rem; transition: color .15s ease; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line);
    color: var(--muted); font-size: .88rem;
}
.footer__bottom .mono { font-size: .64rem; }

/* ==========================================================================
   iOS download page (ios.html)
   ========================================================================== */
.dl { padding: 150px 0 110px; min-height: 100vh; }
.dl__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.dl__back { color: var(--muted); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 26px; }
.dl__back:hover { color: var(--ink); }
.dl__glyph { width: 56px; height: 56px; color: var(--ink); margin-bottom: 22px; }
.dl__title { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; margin-bottom: 18px; }
.dl__lead { color: var(--ink-2); font-size: 1.12rem; max-width: 460px; margin-bottom: 14px; }
.dl__badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 22px; }
.dl__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 22px; }
.dl__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.dl__steps li { display: flex; gap: 14px; align-items: flex-start; color: var(--ink-2); }
.dl__steps .n { font-family: var(--font-mono); font-weight: 600; color: var(--accent); flex: none; }
.dl__card { padding: 40px; display: grid; place-items: center; gap: 18px; text-align: center; }
.dl__card .glyph { width: 64px; height: 64px; color: var(--accent); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .section, .local { padding: 78px 0; }
    .hero { padding: 128px 0 78px; }
    .hero__grid, .local__grid, .dl__grid { grid-template-columns: 1fr; gap: 44px; }
    .hero__lead, .local__text { max-width: none; }
    .steps, .features, .platforms { grid-template-columns: 1fr 1fr; }
    .footer__grid { grid-template-columns: 1fr 1fr; }

    .nav__toggle { display: flex; }
    .nav__menu {
        position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: flex-start;
        gap: 18px; padding: 22px 24px 26px; background: rgba(20, 17, 14, .97);
        border-bottom: 1px solid rgba(255, 247, 235, .08);
        transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .2s ease;
    }
    .nav__menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
    .nav__menu .btn { width: 100%; justify-content: center; }
}

@media (max-width: 560px) {
    .steps, .features, .platforms { grid-template-columns: 1fr; }
    .footer__brand { grid-column: 1 / -1; }
    .btn { width: 100%; justify-content: center; }
    .hero__actions, .cta__actions, .dl__actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn:hover, .cta__mini:hover { transform: none; }
}

/* Cookie-consent banner (analytics) — injected by scripts.js when GA is enabled. */
.consent {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
    padding: 16px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--asym-lg);
    box-shadow: 0 14px 44px rgba(0, 0, 0, .45);
}
.consent__msg { flex: 1 1 280px; margin: 0; color: var(--ink-2); font-size: .92rem; line-height: 1.45; }
.consent__actions { display: flex; gap: 8px; flex-shrink: 0; }
