/* ============================================================================
   home.css — Phase R8 — Home pane (blue color identity).

   Blue is the cool deep — calm, dependable, the home you return to. Home
   recomposes around the avatar at hero scale with a time-of-day greeting,
   a row of glass quick-action tiles, a small stats strip, and the identity
   chip. The avatar narrates the greeting once per session.

   All selectors live under .page-home.home-stage[data-color="blue"] with
   .h-* prefixes so they never collide with the legacy .hero / .row / .row-btn
   classes still in app.css.
   ========================================================================= */

.page-home.home-stage {
    --h-color-0: #6cb6ff;       /* primary blue */
    --h-color-1: #2f87f5;       /* deeper sky */
    --h-color-2: #c9e3ff;       /* highlight */
    --h-color-3: rgba(47, 135, 245, 0.16);
    --h-color-4: rgba(47, 135, 245, 0.32);
    --h-glass:   rgba(10, 18, 32, 0.58);
    --h-glass-2: rgba(14, 26, 44, 0.72);
    --h-border:  rgba(108, 182, 255, 0.22);
    --h-border-strong: rgba(108, 182, 255, 0.42);
    --h-fg:      #f0f6ff;
    --h-fg-2:    #b8c8de;
    --h-fg-3:    #6f8099;
    --h-shadow:  0 18px 42px rgba(47, 135, 245, 0.18);

    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px clamp(14px, 4vw, 28px);
    container-type: inline-size;
    color: var(--h-fg);
    min-height: 100%;
    background:
        radial-gradient(ellipse at 50% -20%, var(--h-color-3), transparent 60%),
        radial-gradient(ellipse at -10% 110%, rgba(108, 182, 255, 0.08), transparent 60%);
}

/* ── Hero ──────────────────────────────────────────────────────── */

.home-stage .h-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    place-items: center;
    text-align: center;
    padding: 24px 18px 20px;
    border: 1px solid var(--h-border);
    border-radius: 22px;
    background: var(--h-glass);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: var(--h-shadow);
}
.home-stage .h-avatar-wrap {
    position: relative;
    width: clamp(140px, 28vmin, 220px);
    aspect-ratio: 1 / 1;
}
.home-stage .h-avatar-host { width: 100%; height: 100%; }
.home-stage .h-greeting {
    margin: 0;
    font-size: clamp(22px, 3.5vmin, 32px);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.home-stage .h-greeting-name { color: var(--h-color-0); }
.home-stage .h-status {
    margin: 0;
    font-size: 13px;
    color: var(--h-fg-2);
    line-height: 1.45;
    max-width: 460px;
}
.home-stage .h-status[data-state="offline"]         { color: #ff8a7a; }
.home-stage .h-status[data-state="reconnecting"]    { color: #f5b94c; }
.home-stage .h-status[data-state="manual-offline"]  { color: var(--h-fg-2); }

/* ── Quick action tiles ────────────────────────────────────────── */

.home-stage .h-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@container (min-width: 720px) {
    .home-stage .h-actions { grid-template-columns: repeat(4, 1fr); }
}

.home-stage .h-tile {
    appearance: none;
    cursor: pointer;
    text-align: left;
    color: var(--h-fg);
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--h-border);
    background: var(--h-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: grid;
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    align-items: center;
    transition: transform .12s ease, border-color .15s ease, background .15s ease;
    font: inherit;
}
.home-stage .h-tile:hover  { transform: translateY(-2px); border-color: var(--h-border-strong); background: var(--h-glass-2); }
.home-stage .h-tile:active { transform: translateY(0); }

.home-stage .h-tile-icon {
    grid-row: 1 / 3;
    width: 36px; height: 36px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 18px;
    background: var(--h-color-3);
    color: var(--h-color-0);
}
.home-stage .h-tile-title { font-weight: 600; font-size: 14px; line-height: 1.2; }
.home-stage .h-tile-sub   { font-size: 11.5px; color: var(--h-fg-2); line-height: 1.35; }

/* Each tile inherits the destination pane's accent. */
.home-stage .h-tile[data-go="twin"]     .h-tile-icon { background: rgba(255, 107, 107, 0.18); color: #ff8a8a; }
.home-stage .h-tile[data-go="contacts"] .h-tile-icon { background: rgba(255, 157, 61,  0.18); color: #ffb56c; }
.home-stage .h-tile[data-go="chat"]     .h-tile-icon { background: rgba(245, 197, 24,  0.18); color: #ffe06b; }
.home-stage .h-tile[data-go="call"]     .h-tile-icon { background: rgba(74,  214, 130, 0.18); color: #7af7a8; }
.home-stage .h-tile[data-go="settings"] .h-tile-icon { background: rgba(150, 130, 220, 0.18); color: #b896ff; }
.home-stage .h-tile[data-go="sphere1"]  .h-tile-icon { background: rgba(184, 150, 255, 0.18); color: #c9b6ff; }

/* ── Stats strip ───────────────────────────────────────────────── */

.home-stage .h-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.home-stage .h-stat {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--h-border);
    background: var(--h-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-align: center;
    cursor: pointer;
    transition: transform .12s ease, border-color .15s ease;
    appearance: none;
    color: inherit;
    font: inherit;
}
.home-stage .h-stat:hover { transform: translateY(-1px); border-color: var(--h-border-strong); }
.home-stage .h-stat-num {
    font-size: 22px; font-weight: 700;
    color: var(--h-color-0);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.home-stage .h-stat-label {
    font-size: 11.5px;
    color: var(--h-fg-2);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Identity chip ─────────────────────────────────────────────── */

.home-stage .h-identity {
    display: flex; gap: 12px; align-items: center;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--h-border);
    background: var(--h-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.home-stage .h-identity-label {
    font-size: 11px; color: var(--h-fg-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.home-stage .h-identity-addr {
    font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 12px;
    color: var(--h-fg);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.home-stage .h-copy-btn {
    appearance: none;
    border: 1px solid var(--h-border-strong);
    background: rgba(0,0,0,.3);
    color: var(--h-color-0);
    border-radius: 999px;
    padding: 6px 12px;
    font: inherit; font-size: 12px;
    cursor: pointer;
    transition: background .15s ease;
}
.home-stage .h-copy-btn:hover { background: var(--h-color-3); }

/* ── Install banner (legacy class kept) ────────────────────────── */
.home-stage .install-banner {
    border-radius: 14px;
    border: 1px solid var(--h-border-strong);
    background: linear-gradient(180deg, var(--h-color-3), var(--h-glass));
}

@media (prefers-reduced-motion: reduce) {
    .home-stage .h-tile,
    .home-stage .h-stat { transition: none; }
}
