/* Arianna HAO Engine — Components (panel, modes grid, join)
   Derived from Pyragogy.org (MIT · FTG-003 / Fabrizio Terzi).
   Adapted for Arianna HAO Engine — Human–Agentic Orchestration.
   ============================================================ */

/* --- Live dot --- */
.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgb(var(--ai));
    box-shadow: 0 0 10px rgba(var(--ai), 0.9);
    animation: livePulse 2.4s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.8); }
}

/* ================================================================
   PANNELLO UNICO CENTRALE
   ================================================================ */

.panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.25rem, 3vw, 2.5rem);
    border-radius: 14px;
    border: 1px solid rgba(var(--ghost), 0.07);
    background: rgba(255, 255, 255, 0.015);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.015),
                0 24px 80px -24px rgba(0, 0, 0, 0.7);
    width: 100%;
    max-width: 38rem;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.panel:hover {
    border-color: rgba(var(--ghost), 0.10);
}

/* --- Icona marchio --- */
.panel-icon {
    margin-bottom: 1rem;
    opacity: 0.75;
}

/* --- Titolo --- */
.panel-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0 0 1rem;
}

.panel-arianna {
    font-family: var(--font-serif);
    font-weight: 380;
    font-size: clamp(28px, 5vw, 48px);
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: rgba(var(--ghost), 0.96);
    text-wrap: balance;
}

.panel-sub {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: clamp(10px, 1.2vw, 13px);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(var(--ghost), 0.50);
}

.panel-sub::before,
.panel-sub::after {
    content: '';
    display: inline-block;
    width: 0.5rem;
    height: 1px;
    background: rgba(var(--ghost), 0.20);
    vertical-align: middle;
    margin: 0 0.5rem;
}

/* --- Citazione --- */
.panel-quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 380;
    font-size: clamp(16px, 2.4vw, 24px);
    line-height: 1.2;
    color: rgba(var(--ghost), 0.70);
    margin: 0 0 1.5rem;
    text-wrap: balance;
    letter-spacing: -0.01em;
}

/* ================================================================
   GRIGLIA MODALITÀ 2×2
   ================================================================ */

.modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 34rem;
    margin-bottom: 1.5rem;
}

/* --- Card singola --- */
.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(var(--ghost), 0.06);
    background: rgba(255, 255, 255, 0.01);
    transition: border-color 0.4s ease, background 0.4s ease, transform 0.3s ease;
    position: relative;
}

.mode-card:hover {
    border-color: rgba(var(--ghost), 0.12);
    background: rgba(255, 255, 255, 0.025);
    transform: translateY(-1px);
}

/* Accento colore per tipo */
.mode-card-ai .mode-icon { color: rgba(var(--ai), 0.8); }
.mode-card-cli .mode-icon { color: rgba(var(--ghost), 0.55); }
.mode-card-web .mode-icon { color: rgba(var(--human), 0.8); }
.mode-card-voice .mode-icon { color: rgba(var(--human), 0.6); }

/* Accento bordo per tipo */
.mode-card-ai:hover { border-color: rgba(var(--ai), 0.25); }
.mode-card-cli:hover { border-color: rgba(var(--ghost), 0.15); }
.mode-card-web:hover { border-color: rgba(var(--human), 0.25); }
.mode-card-voice:hover { border-color: rgba(var(--human), 0.20); }

.mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.mode-name {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(var(--ghost), 0.80);
}

.mode-desc {
    font-family: var(--font-ui);
    font-size: 11px;
    line-height: 1.4;
    color: rgba(var(--ghost), 0.45);
    margin: 0;
    max-width: 22ch;
}

/* --- Pulsante azione nella card --- */
.mode-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.3rem;
    padding: 7px 16px;
    border-radius: 2px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid rgba(var(--ai), 0.25);
    background: rgba(var(--ai), 0.05);
    color: rgba(var(--ghost), 0.80);
    transition: all 0.3s ease;
    cursor: pointer;
}

.mode-action:hover,
.mode-action:focus-visible {
    border-color: rgba(var(--ai), 0.50);
    background: rgba(var(--ai), 0.10);
    color: rgba(var(--ghost), 0.95);
    transform: translateY(-1px);
    outline: none;
}

.mode-action:active {
    transform: translateY(0) scale(0.97);
}

/* --- Pulsante ghost (per card "in preparazione" / "in progettazione") --- */
.mode-action-ghost {
    border-color: rgba(var(--ghost), 0.10);
    background: transparent;
    color: rgba(var(--ghost), 0.40);
    cursor: default;
    pointer-events: none;
}

.mode-action-ghost:hover {
    border-color: rgba(var(--ghost), 0.10);
    background: transparent;
    color: rgba(var(--ghost), 0.40);
    transform: none;
}

/* --- Feedback copia --- */
.copy-feedback {
    font-family: var(--font-sans);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: rgb(var(--ai));
    min-height: 1.1em;
    opacity: 0;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.copy-feedback.visible {
    opacity: 1;
}

/* ================================================================
   JOIN THE LAB
   ================================================================ */

.join-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(var(--ghost), 0.06);
}

.join-label {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: rgba(var(--ghost), 0.40);
}

.join-desc {
    font-family: var(--font-ui);
    font-size: 12px;
    line-height: 1.5;
    color: rgba(var(--ghost), 0.45);
    max-width: 32ch;
    margin: 0;
}

.join-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.2rem;
    padding: 12px 28px;
    border-radius: 2px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    border: 1px solid rgba(var(--ghost), 0.12);
    background: rgba(var(--ghost), 0.03);
    color: rgba(var(--ghost), 0.75);
    transition: all 0.4s var(--reveal-ease);
}

.join-btn:hover,
.join-btn:focus-visible {
    border-color: rgba(var(--human), 0.50);
    background: rgba(var(--human), 0.06);
    color: rgba(var(--ghost), 0.95);
    box-shadow: 0 0 0 1px rgba(var(--human), 0.15),
                0 18px 60px -24px rgba(var(--human), 0.5);
    transform: translateY(-1px);
    outline: none;
}

.join-btn:active {
    transform: translateY(0) scale(0.985);
}

.join-btn-icon {
    display: flex;
    transition: transform 0.3s ease;
}

.join-btn:hover .join-btn-icon {
    transform: translateX(2px);
}

/* ================================================================
   REVEAL ANIMATION
   ================================================================ */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: reveal 1s var(--reveal-ease) forwards;
}

@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; opacity: 1; transform: none; }
    .live-dot { animation: none; }
    .mode-card:hover { transform: none; }
    .mode-action:hover { transform: none; }
    .mode-action:active { transform: none; }
    .join-btn:hover { transform: none; }
    .join-btn:hover .join-btn-icon { transform: none; }
}

/* ================================================================
   MOBILE OVERRIDES
   ================================================================ */

@media (max-width: 640px) {
    .panel {
        padding: 1.25rem;
        border-radius: 12px;
        max-width: 100%;
    }

    .panel-arianna {
        font-size: clamp(24px, 7vw, 36px);
    }

    .panel-sub {
        font-size: 10px;
    }

    .panel-sub::before,
    .panel-sub::after {
        width: 0.35rem;
        margin: 0 0.35rem;
    }

    .panel-quote {
        font-size: clamp(15px, 4vw, 20px);
        margin-bottom: 1.25rem;
    }

    .modes-grid {
        gap: 0.5rem;
    }

    .mode-card {
        padding: 0.75rem 0.5rem;
    }

    .mode-desc {
        font-size: 10px;
    }

    .mode-action {
        font-size: 10px;
        padding: 6px 12px;
    }

    .join-section {
        padding-top: 1rem;
    }

    .join-desc {
        font-size: 11px;
    }

    .join-btn {
        width: 100%;
        justify-content: center;
        font-size: 13px;
        padding: 11px 24px;
    }
}

@media (max-width: 420px) {
    .panel {
        padding: 1rem 0.75rem;
    }

    .panel-arianna {
        font-size: clamp(20px, 6vw, 28px);
    }

    .modes-grid {
        gap: 0.4rem;
    }

    .mode-card {
        padding: 0.6rem 0.4rem;
    }

    .mode-name {
        font-size: 10px;
    }

    .mode-desc {
        font-size: 9px;
    }

    .mode-action {
        font-size: 9px;
        padding: 5px 10px;
    }

    .join-desc {
        font-size: 10px;
    }
}