/* BabyMonitor — styles */
:root {
    --brand: #4f7cff;
    --brand-2: #7aa2ff;
    --ink: #0b1220;
    --ink-soft: #1a2233;
    --text: #e8ecf6;
    --text-dim: #9aa6bf;
    --bg: #0b1220;
    --bg-soft: #121a2c;
    --card: #161f33;
    --line: #243049;
    --danger: #ff5d6c;
    --ok: #38d39f;
    --warn: #ffb24d;
    --radius: 16px;
    --shadow: 0 10px 40px rgba(0, 0, 0, .35);
    --maxw: 1080px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    background: radial-gradient(1200px 800px at 50% -200px, #16213f 0%, var(--bg) 55%, #060912 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
    min-height: 100vh;
}

body.no-translate { visibility: hidden; opacity: 0; }

img { max-width: 100%; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }

a { color: var(--brand-2); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 999px;
    padding: 12px 22px; font-size: 1rem; font-weight: 700; cursor: pointer;
    text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 24px rgba(79, 124, 255, .4); }
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--danger { background: linear-gradient(135deg, #ff5d6c, #ff8a72); color: #fff; }
.btn--small { padding: 8px 16px; font-size: .9rem; }
.btn--lg { padding: 15px 30px; font-size: 1.08rem; }
.btn--block { width: 100%; }

.link-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: .9rem; text-decoration: underline; padding: 8px; }
.link-btn:hover { color: var(--text); }

/* ── Top bar ─────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); background: rgba(11, 18, 32, .7); border-bottom: 1px solid var(--line); }
.topbar__inner { max-width: var(--maxw); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon img { border-radius: 8px; display: block; }
.logo-text { font-weight: 800; letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav-link { color: var(--text-dim); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-link:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.nav-drawer { display: none; flex-direction: column; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }

/* ── Hero ────────────────────────────────────────────── */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 64px 0 48px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.02em; }
.lead { font-size: 1.12rem; color: var(--text-dim); max-width: 40ch; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0; }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; color: var(--text-dim); font-size: .95rem; }

.hero__art { display: flex; justify-content: center; }
.device-mock { width: 220px; height: 320px; border-radius: 32px; background: linear-gradient(160deg, #1c2942, #0d1426); border: 2px solid var(--line); box-shadow: var(--shadow); padding: 14px; }
.device-mock__screen { position: relative; width: 100%; height: 100%; border-radius: 22px; background: radial-gradient(circle at 50% 40%, #233354, #0a1120); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.device-mock__dot { width: 70px; height: 70px; border-radius: 50%; background: rgba(122, 162, 255, .25); box-shadow: 0 0 0 12px rgba(122, 162, 255, .12), 0 0 0 28px rgba(122, 162, 255, .06); animation: pulse 2.2s infinite; }
.device-mock__live { position: absolute; top: 12px; left: 12px; font-size: .7rem; color: var(--danger); font-weight: 800; letter-spacing: .05em; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: .5; } }

/* ── Sections ────────────────────────────────────────── */
.how, .features, .faq { padding: 48px 0; border-top: 1px solid var(--line); }
.how h2, .features h2, .faq h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); text-align: center; margin-bottom: 32px; }
.steps, .features__grid { display: grid; gap: 20px; }
.steps { grid-template-columns: repeat(3, 1fr); }
.features__grid { grid-template-columns: repeat(4, 1fr); }
.step, .feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step__num { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feat__icon { font-size: 2rem; margin-bottom: 10px; }
.step h3, .feat h3 { font-size: 1.1rem; }
.step p, .feat p { color: var(--text-dim); font-size: .95rem; margin: 0; }
.mini-note { text-align: center; color: var(--text-dim); font-size: .85rem; margin-top: 24px; font-style: italic; }

.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--text-dim); margin: 10px 0 0; }

/* ── Footer ──────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 32px 20px; text-align: center; color: var(--text-dim); font-size: .9rem; }
.footer-links nav { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 12px; }
.footer-nav-link { color: var(--text-dim); }

/* ── App ─────────────────────────────────────────────── */
.app { min-height: 100vh; min-height: 100dvh; }
.screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.screen[hidden] { display: none; }
.screen__card { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px; text-align: center; }
.screen__title { font-size: 1.5rem; }
.screen__subtitle { color: var(--text-dim); margin-bottom: 24px; }

/* Role select */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.role-card { text-align: left; background: var(--bg-soft); border: 1.5px solid var(--line); border-radius: 16px; padding: 22px; cursor: pointer; color: var(--text); transition: border-color .15s, transform .12s; }
.role-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.role-card__icon { font-size: 2.2rem; }
.role-card h3 { margin: 10px 0 6px; }
.role-card p { color: var(--text-dim); font-size: .9rem; margin: 0 0 14px; }
.role-card__cta { display: inline-block; font-weight: 700; color: var(--brand-2); }

/* Pairing */
.pair { display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 8px 0 16px; }
.pair__label { display: block; color: var(--text-dim); font-size: .85rem; margin-bottom: 6px; }
.pair__label--pin { margin-top: 14px; }
.pair__code { font-size: 2.4rem; font-weight: 800; letter-spacing: .35em; padding-left: .35em; color: #fff; font-variant-numeric: tabular-nums; }
.pair__pin { font-size: 1.8rem; font-weight: 800; letter-spacing: .3em; padding-left: .3em; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.pair__qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pair__qr #qrcode { background: #fff; padding: 10px; border-radius: 12px; line-height: 0; }
.pair__qr-hint, .pair__scan-hint { color: var(--text-dim); font-size: .8rem; }
.self-preview { width: 160px; height: 110px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); margin: 12px auto; display: block; background: #000; transform: scaleX(-1); }
.status { color: var(--warn); font-weight: 600; margin: 12px 0; min-height: 1.4em; }

.code-input-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.code-input { flex: 1 1 100%; min-width: 0; background: var(--bg-soft); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; color: #fff; font-size: 1.4rem; text-align: center; letter-spacing: .25em; text-transform: uppercase; outline: none; }
.code-input::placeholder { letter-spacing: normal; text-transform: none; font-size: 1rem; }
.code-input:focus { border-color: var(--brand); }
.code-input--pin { flex: 1 1 120px; text-transform: none; }
.code-input-row .btn { flex: 1 1 120px; }

/* ── Live ────────────────────────────────────────────── */
.screen--live { padding: 0; position: relative; background: #000; }
.live-video { width: 100%; height: 100vh; height: 100dvh; object-fit: contain; background: #000; display: block; }
.live-video.blurred { filter: blur(22px) brightness(.5); }
.self-preview, .screen--live-monitor .live-video { transform: scaleX(-1); }

.live-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; pointer-events: none; }
.live-overlay > * { pointer-events: auto; }
.live-overlay__top { display: flex; justify-content: space-between; align-items: flex-start; }
.live-overlay__center { flex: 1; display: flex; align-items: center; justify-content: center; }
.live-overlay__bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.live-hint { color: rgba(255, 255, 255, .8); font-size: .85rem; max-width: 30ch; margin: 0; }

.live-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .55); color: #fff; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(255, 93, 108, .6); animation: live 1.6s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 93, 108, .6); } 70% { box-shadow: 0 0 0 8px rgba(255, 93, 108, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 93, 108, 0); } }
.det-chip { background: rgba(56, 211, 159, .18); color: var(--ok); border: 1px solid rgba(56, 211, 159, .4); padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; }

.toast { background: rgba(0, 0, 0, .7); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; }

.dim-overlay { position: absolute; inset: 0; background: #000; opacity: .94; }

/* Viewer controls */
.viewer-controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: stretch; justify-content: space-around; gap: 6px; padding: 14px 10px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent); }
.ctrl { flex: 1 1 0; max-width: 110px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 10px 6px; color: #fff; cursor: pointer; font-size: .72rem; transition: background .12s; }
.ctrl:hover { background: rgba(255, 255, 255, .16); }
.ctrl.is-active { background: var(--brand); border-color: var(--brand); }
.ctrl--talk.is-active { background: var(--ok); border-color: var(--ok); }
.ctrl--danger { background: rgba(255, 93, 108, .2); border-color: rgba(255, 93, 108, .4); }
.ctrl__icon { font-size: 1.3rem; }
.ctrl__label { line-height: 1.15; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.trial-pill { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: rgba(255, 178, 77, .95); color: #1a1200; padding: 6px 16px; border-radius: 999px; font-weight: 800; font-size: .85rem; white-space: nowrap; max-width: calc(100% - 24px); z-index: 6; }

.alert-banner { position: absolute; top: 64px; left: 50%; transform: translateX(-50%) translateY(-20px); width: max-content; max-width: calc(100% - 28px); background: var(--danger); color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; opacity: 0; transition: opacity .25s, transform .25s; box-shadow: var(--shadow); z-index: 7; }
.alert-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.viewer-tap-unmute { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .7); color: #fff; padding: 14px 24px; border-radius: 999px; font-weight: 700; cursor: pointer; }

.settings-drawer { position: absolute; left: 0; right: 0; bottom: 92px; padding: 0 14px; }
.settings-drawer__inner { background: rgba(18, 26, 44, .96); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 14px; max-width: 420px; margin: 0 auto; }
.switch-row { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.sens-row { display: grid; gap: 8px; }
.seg { display: flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg__btn { flex: 1; background: none; border: none; color: var(--text-dim); padding: 8px; cursor: pointer; font-weight: 700; }
.seg__btn.is-active { background: var(--brand); color: #fff; }

/* ── Modal / paywall ─────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.modal-content { position: relative; max-width: 420px; margin: 10vh auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px; text-align: center; }
.modal .close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-dim); font-size: 1.6rem; cursor: pointer; }
.modal-desc { color: var(--text-dim); }
.paywall-price { margin: 18px 0; }
.paywall-price__main { display: block; font-size: 1.8rem; font-weight: 800; color: #fff; }
.paywall-price__sub { color: var(--text-dim); font-size: .85rem; }
.payment-link-button { display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; padding: 15px; border-radius: 999px; font-weight: 800; text-decoration: none; box-shadow: 0 8px 24px rgba(79, 124, 255, .4); }
.lock-icon { width: 18px; height: 18px; }
.payment-secure-note { color: var(--text-dim); font-size: .78rem; margin: 12px 0 6px; }

/* Night mode (viewer body) */
body.night { filter: brightness(.6) saturate(.85); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 860px) {
    .nav { display: none; }
    .nav-toggle { display: block; }
    .hero { grid-template-columns: 1fr; padding: 40px 0 24px; }
    .hero__art { display: none; }
    .steps { grid-template-columns: 1fr; }
    .features__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .features__grid { grid-template-columns: 1fr; }
    .role-grid { grid-template-columns: 1fr; }
    .pair__code { font-size: 2rem; }
    .screen { padding: 16px; }
    .screen__card { padding: 24px 18px; }
    /* Compact control bar so labels (incl. long translations) stay on 2 lines max */
    .viewer-controls { gap: 4px; padding: 10px 6px calc(10px + env(safe-area-inset-bottom)); }
    .ctrl { max-width: none; padding: 8px 3px; font-size: .6rem; border-radius: 12px; }
    .ctrl__icon { font-size: 1.1rem; }
    .alert-banner { font-size: .9rem; padding: 9px 14px; }
}
