/*
 * landing/css/install.css
 *
 * Install section — 5 installation methods as a tab group.
 * Desktop: tabs laid out as a horizontal pill bar.
 * Mobile: collapses into an accordion (each tab becomes expandable
 * panel).
 *
 * Each panel contains a terminal-style command block with its own
 * copy-to-clipboard button. Commands use per-line prompt coloring
 * for the "$ " marker.
 */

.manifesto {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem 1.5rem;
    z-index: 1;
    text-align: center;
}

.manifesto-text {
    font-size: clamp(2.25rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #ffffff;
    max-width: 18ch;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.manifesto.in-view .manifesto-text {
    opacity: 1;
    transform: translateY(0);
}

.manifesto-text .accent {
    background: linear-gradient(135deg,
        rgba(var(--purple-4), 1),
        rgba(var(--purple-1), 1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Install section shell ───────────────────────────────────── */
.install {
    position: relative;
    padding: 2rem 1.5rem 6rem;
    z-index: 1;
}

.install-inner {
    max-width: 900px;
    margin: 0 auto;
}

.install-header {
    text-align: center;
    margin-bottom: 3rem;
}

.install-eyebrow {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.75rem;
    color: rgba(var(--purple-3), 1);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.install-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.install-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 520px;
    margin: 0 auto;
}

/* ─── Desktop tab bar ─────────────────────────────────────────── */
.install-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.375rem;
    background: rgba(16, 16, 24, 0.6);
    border: 1px solid rgba(var(--purple-1), 0.18);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: max-content;
    margin: 0 auto 2.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.install-tabs::-webkit-scrollbar { display: none; }

.install-tab {
    padding: 0.625rem 1.125rem;
    border: none;
    background: transparent;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    white-space: nowrap;
    transition: background 150ms ease, color 150ms ease;
}

.install-tab:hover {
    color: #ffffff;
}

.install-tab.active {
    background: linear-gradient(135deg,
        rgba(var(--purple-1), 0.9),
        rgba(var(--purple-2), 0.9));
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(var(--purple-1), 0.3);
}

/* ─── Panels ─────────────────────────────────────────────────── */
.install-panels {
    position: relative;
}

.install-panel {
    display: none;
    animation: panelFadeIn 0.4s ease-out;
}

.install-panel.active {
    display: block;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.install-panel-desc {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.install-panel-desc a {
    color: rgba(var(--purple-3), 1);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--purple-3), 0.3);
    transition: border-color 150ms;
}

.install-panel-desc a:hover {
    border-bottom-color: rgba(var(--purple-3), 1);
}

/* ─── Terminal block (reused inside every panel) ─────────────── */
.terminal {
    position: relative;
    background: rgba(8, 8, 14, 0.8);
    border: 1px solid rgba(var(--purple-1), 0.25);
    border-radius: 14px;
    padding: 1.25rem 3.5rem 1.25rem 1.25rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #ffffff;
    overflow-x: auto;
    margin-bottom: 1rem;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.terminal + .terminal {
    margin-top: -0.25rem;
}

.terminal-line {
    white-space: nowrap;
}

.terminal-line .prompt {
    color: rgba(var(--purple-3), 1);
    user-select: none;
    margin-right: 0.65rem;
}

.terminal-copy {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--purple-1), 0.15);
    border: 1px solid rgba(var(--purple-1), 0.3);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
}

.terminal-copy:hover { background: rgba(var(--purple-1), 0.3); }
.terminal-copy:active { transform: scale(0.95); }

.terminal-copy svg { width: 14px; height: 14px; }

.terminal-copy.copied {
    background: rgba(16, 185, 129, 0.35);
    border-color: rgba(16, 185, 129, 0.6);
}

/* Home Assistant "Add to HA" button — big purple pill with HA icon */
.ha-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg,
        rgba(var(--purple-1), 1),
        rgba(var(--purple-2), 1));
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(var(--purple-1), 0.4);
    transition: transform 150ms ease, box-shadow 150ms ease;
    margin-top: 0.5rem;
}

.ha-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(var(--purple-1), 0.55);
}

.ha-install-btn svg { width: 18px; height: 18px; }

/* Umbrel badge — uses the official SVG from apps.umbrel.com so it
   stays visually consistent with other Umbrel marketing material.
   Just center it and add a subtle lift on hover. */
.umbrel-install-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: transform 150ms ease, filter 150ms ease;
}

.umbrel-install-btn img {
    display: block;
    height: 64px;
    width: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.umbrel-install-btn:hover {
    transform: translateY(-2px);
}

.umbrel-install-btn:hover img {
    filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.45));
}

.install-panel ol {
    list-style: none;
    counter-reset: step;
    margin: 1rem 0 1.5rem;
    padding: 0;
}

.install-panel ol li {
    counter-increment: step;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.install-panel ol li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 1.75rem; height: 1.75rem;
    background: rgba(var(--purple-1), 0.18);
    border: 1px solid rgba(var(--purple-1), 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.75rem;
    color: rgba(var(--purple-3), 1);
    font-weight: 600;
}

.install-panel code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.8125rem;
    background: rgba(var(--purple-1), 0.1);
    border: 1px solid rgba(var(--purple-1), 0.2);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: rgba(var(--purple-3), 1);
}

.compose-variant {
    margin-bottom: 2rem;
}

.compose-variant h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(var(--purple-3), 1);
    margin-bottom: 0.75rem;
}

/* ─── Mobile: accordion layout ────────────────────────────────── */
@media (max-width: 767px) {
    .install { padding: 4rem 1.25rem; }
    .install-header { margin-bottom: 2rem; }

    .install-tabs {
        display: none;
    }

    /* Every panel becomes an accordion row — headers re-added by
       JS (install-tabs.js) wrapping each panel with a button. */
    .install-panel {
        display: block;
        border: 1px solid rgba(var(--purple-1), 0.18);
        border-radius: 16px;
        margin-bottom: 0.75rem;
        background: rgba(16, 16, 24, 0.55);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        overflow: hidden;
        animation: none;
    }

    .accordion-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1rem 1.25rem;
        background: transparent;
        border: none;
        color: #ffffff;
        font-family: inherit;
        font-size: 0.9375rem;
        font-weight: 600;
        cursor: pointer;
        text-align: left;
    }

    .accordion-head svg {
        width: 16px; height: 16px;
        transition: transform 200ms ease;
        color: rgba(var(--purple-3), 1);
    }

    .install-panel.active .accordion-head svg {
        transform: rotate(180deg);
    }

    .accordion-body {
        padding: 0 1.25rem 1.25rem;
        display: none;
    }

    .install-panel.active .accordion-body {
        display: block;
    }

    .terminal { font-size: 0.75rem; padding: 1rem 3rem 1rem 1rem; }
    .terminal-copy { width: 30px; height: 30px; top: 0.5rem; right: 0.5rem; }

    .ha-install-btn { width: 100%; justify-content: center; }
    .umbrel-install-btn { width: 100%; }
    .umbrel-install-btn img { height: 56px; margin: 0 auto; }
}
