/* src/styles/home.css */
:root {
    --home-main-padding-y: 60px;
    --home-logo-margin-bottom: 2rem;
    --home-logo-width: 240px;
    --home-tagline-font-size: 1rem;
    --home-tagline-line-height: 1.6;
    --home-tagline-margin-bottom: 32px;
    --home-headline-font-size: clamp(1.75rem, 4vw, 2.5rem);
    --home-headline-line-height: 1.35;
    --home-headline-margin-bottom: 48px;
    --home-headline-max-width: 800px;
    --home-process-gap: 16px;
    --home-process-margin-bottom: 40px;
    --home-process-step-padding: 14px 28px;
    --home-process-step-font-size: 0.95rem;
    --home-process-arrow-font-size: 1.3rem;
    --home-trust-font-size: 0.8rem;
    --home-trust-margin-bottom: 40px;
    --home-flow-panel-open-max-height: 400px;
    --home-flow-panel-open-margin-bottom: 40px;
    --home-flow-content-margin-top: 24px;
    --home-flow-content-padding: 28px 32px;
    --home-flow-tagline-line-height: 1.5;
    --home-flow-tagline-margin-bottom: 20px;
    --home-flow-points-gap: 10px;
    --home-flow-point-padding: 10px 16px;
    --home-auth-min-height: 200px;
    --home-auth-loading-padding: 40px;
    --home-auth-login-max-width: 380px;
    --home-auth-login-padding: 32px;
    --home-auth-login-button-padding: 14px 24px;
    --home-auth-login-button-margin-bottom: 12px;
    --home-auth-divider-margin: 20px 0;
    --home-auth-input-padding: 14px 16px;
    --home-auth-input-margin-bottom: 12px;
    --home-auth-terms-margin-top: 20px;
    --home-desktop-hero-left-width: 40%;
    --home-desktop-hero-right-width: 60%;
    --home-desktop-hero-icon-width: 280px;
    --home-desktop-hero-right-padding: 0 48px 0 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Animated gradient background */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 25%, #fff5f5 50%, #f0fff4 75%, #f8f9ff 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent-green) 100%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #A855F7 0%, #6366F1 100%);
    top: 50%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -40px) scale(1.1); }
    50% { transform: translate(-30px, 50px) scale(0.9); }
    75% { transform: translate(-50px, -30px) scale(1.05); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--home-main-padding-y) 0;
    position: relative;
}

.content {
    text-align: center;
}

/* Logo with glow animation */
.logo {
    margin-bottom: var(--home-logo-margin-bottom);
    text-align: center;
    animation: fadeSlideIn 1s ease-out;
}

.logo svg {
    width: var(--home-logo-width);
    height: auto;
    filter: drop-shadow(0 0 0 transparent);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 189, 255, 0)); }
    50% { filter: drop-shadow(0 0 30px var(--brand-alpha-30)); }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline {
    font-size: var(--home-tagline-font-size);
    color: var(--text-tertiary);
    margin-bottom: var(--home-tagline-margin-bottom);
    line-height: var(--home-tagline-line-height);
    animation: fadeSlideIn 1s ease-out 0.2s both;
}

.headline {
    font-size: var(--home-headline-font-size);
    font-weight: 700;
    line-height: var(--home-headline-line-height);
    margin-bottom: var(--home-headline-margin-bottom);
    max-width: var(--home-headline-max-width);
    margin-left: auto;
    margin-right: auto;
    animation: fadeSlideIn 1s ease-out 0.4s both;
    background: linear-gradient(135deg, var(--text-primary) 0%, #444 50%, var(--text-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeSlideIn 1s ease-out 0.4s both, shimmer 3s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.process-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--home-process-gap);
    margin-bottom: var(--home-process-margin-bottom);
    flex-wrap: wrap;
    animation: fadeSlideIn 1s ease-out 0.6s both;
}

.trust-strip {
    font-size: var(--home-trust-font-size);
    color: var(--text-muted);
    margin-bottom: var(--home-trust-margin-bottom);
    letter-spacing: 0.01em;
    animation: fadeSlideIn 1s ease-out 0.7s both;
}

.process-step {
    background: var(--surface-glass-80);
    backdrop-filter: blur(10px);
    padding: var(--home-process-step-padding);
    border-radius: 12px;
    font-weight: 600;
    font-size: var(--home-process-step-font-size);
    border: 1px solid var(--brand-alpha-20);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    /* --mag-x/--mag-y are set by js/magnetic.js (0px at rest) so the
       pills lean toward the cursor; composes with the hover lift. */
    transform: translate(var(--mag-x, 0px), var(--mag-y, 0px));
}

.process-step:hover {
    transform: translate(var(--mag-x, 0px), calc(var(--mag-y, 0px) - 4px));
    box-shadow: 0 10px 30px var(--brand-alpha-20);
    border-color: var(--brand-alpha-50);
    background: var(--surface-glass-95);
}

.process-step.active {
    transform: translate(var(--mag-x, 0px), calc(var(--mag-y, 0px) - 4px));
    box-shadow: 0 10px 40px var(--brand-alpha-35);
    border-color: var(--brand-primary);
    background: rgba(255, 255, 255, 1);
}

/* Flow Detail Panel */
.flow-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-bottom: 0;
}

.flow-detail-panel.open {
    max-height: var(--home-flow-panel-open-max-height);
    opacity: 1;
    margin-bottom: var(--home-flow-panel-open-margin-bottom);
}

.flow-detail-content[hidden] {
    display: none;
}

.flow-detail-content {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
    background: var(--surface-glass-85);
    backdrop-filter: blur(15px);
    border: 1px solid var(--brand-alpha-20);
    border-radius: 16px;
    padding: var(--home-flow-content-padding);
    margin-top: var(--home-flow-content-margin-top);
    box-shadow: 0 8px 32px var(--overlay-black-08);
}

.flow-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.flow-detail-icon {
    font-size: 1.5rem;
}

.flow-detail-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.flow-detail-tagline {
    font-size: 0.95rem;
    color: var(--text-secondary-soft);
    margin-bottom: var(--home-flow-tagline-margin-bottom);
    line-height: var(--home-flow-tagline-line-height);
    /* Don't let the tagline's long single line widen the card: it
       contributes only its min-content width to the card's
       shrink-to-fit sizing, then stretches to the width the points
       list resolved and wraps there. */
    width: min-content;
    min-width: 100%;
}

/* Points stack as a column so the inline-flex card shrinks to its
   longest line; a wrapping row would keep its full pre-wrap width,
   leaving dead space on the right. */
.flow-detail-points {
    display: flex;
    flex-direction: column;
    gap: var(--home-flow-points-gap);
}

.flow-detail-point {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-glass-70);
    padding: var(--home-flow-point-padding);
    border-radius: 10px;
    border: 1px solid var(--brand-alpha-10);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.flow-detail-point-icon {
    font-size: 1rem;
}

.flow-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.flow-detail-close:hover {
    background: var(--overlay-black-05);
    color: var(--text-secondary);
}

.flow-detail-content {
    position: relative;
}

.process-arrow {
    color: var(--brand-primary);
    font-size: var(--home-process-arrow-font-size);
    font-weight: bold;
    animation: arrowPulse 1.5s ease-in-out infinite;
}

.process-arrow:nth-child(2) { animation-delay: 0s; }
.process-arrow:nth-child(4) { animation-delay: 0.2s; }
.process-arrow:nth-child(6) { animation-delay: 0.4s; }

@keyframes arrowPulse {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(5px); opacity: 1; }
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: white;
    padding: 18px 40px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    animation: fadeSlideIn 1s ease-out 0.8s both;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--brand-alpha-40);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 35px var(--brand-alpha-50);
}

.cta-button svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.cta-button:hover svg {
    transform: translateX(4px);
}

/* Auth Section */
.auth-section {
    min-height: var(--home-auth-min-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeSlideIn 1s ease-out 0.8s both;
}

.auth-loading {
    padding: var(--home-auth-loading-padding);
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--brand-alpha-20);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth Welcome State */
.auth-welcome {
    text-align: center;
    animation: fadeSlideIn 0.5s ease-out;
}

.auth-welcome-text {
    font-size: 1.2rem;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.auth-welcome-text strong {
    color: var(--text-primary);
}

.auth-not-you {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-not-you a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-not-you a:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* Auth Login State */
.auth-login {
    max-width: var(--home-auth-login-max-width);
    width: 100%;
    animation: fadeSlideIn 0.5s ease-out;
    background: var(--surface-glass-60);
    backdrop-filter: blur(10px);
    border: 1px solid var(--brand-alpha-20);
    border-radius: 16px;
    padding: var(--home-auth-login-padding);
    box-shadow: 0 4px 24px var(--overlay-black-06);
}

.auth-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: var(--home-auth-login-button-padding);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--surface-glass-30);
    background: var(--surface-glass-80);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    margin-bottom: var(--home-auth-login-button-margin-bottom);
    font-family: inherit;
}

.auth-login-btn:hover {
    background: var(--surface-glass-95);
    border-color: var(--brand-alpha-30);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--overlay-black-10);
}

.auth-login-divider {
    display: flex;
    align-items: center;
    margin: var(--home-auth-divider-margin);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-login-divider::before,
.auth-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--overlay-black-10);
}

.auth-login-divider span {
    padding: 0 16px;
}

.auth-email-input {
    width: 100%;
    padding: var(--home-auth-input-padding);
    border: 1px solid var(--surface-glass-30);
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: var(--home-auth-input-margin-bottom);
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--surface-glass-80);
    backdrop-filter: blur(10px);
}

.auth-email-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: var(--surface-glass-95);
    box-shadow: 0 0 0 3px var(--brand-alpha-10);
}

.auth-email-input::placeholder {
    color: var(--text-muted-soft);
}

.auth-login-email {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 20px var(--brand-alpha-40);
}

.auth-login-email:hover {
    background: linear-gradient(135deg, var(--brand-primary-hover) 0%, var(--brand-primary-active) 100%);
    box-shadow: 0 6px 25px var(--brand-alpha-50);
}

.auth-login-terms {
    margin-top: var(--home-auth-terms-margin-top);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.auth-login-terms a {
    color: var(--brand-primary);
    text-decoration: none;
}

.auth-login-terms a:hover {
    text-decoration: underline;
}

/* Animated particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--brand-alpha-50);
    border-radius: 50%;
    animation: rise 6s linear infinite;
    box-shadow: 0 0 10px var(--brand-alpha-50);
}

@keyframes rise {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

footer {
    padding: 24px 0;
    text-align: center;
    animation: fadeSlideIn 1s ease-out 1s both;
    position: relative;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--brand-primary);
}

.copyright {
    color: var(--text-muted-soft);
    font-size: 0.85rem;
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-cookie-banner);
    backdrop-filter: blur(10px);
    padding: 20px 24px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 280px;
    color: var(--bg-gray-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-text a {
    color: var(--brand-primary);
    text-decoration: none;
}

.cookie-text a:hover {
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.cookie-btn-accept {
    background: var(--brand-primary);
    color: white;
}

.cookie-btn-accept:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-2px);
}

.cookie-btn-decline {
    background: transparent;
    color: var(--text-muted-soft);
    border: 1px solid #555;
}

.cookie-btn-decline:hover {
    border-color: var(--text-muted);
    color: var(--text-disabled);
}

/* Two-column hero layout for wide screens */
.hero-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.hero-left {
    display: none;
}

.hero-right {
    width: 100%;
}

@media (min-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0;
    }

    .hero-wrapper {
        flex-direction: row;
        align-items: center;
    }

    .hero-left {
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--home-desktop-hero-left-width);
    }

    .hero-left svg {
        width: var(--home-desktop-hero-icon-width);
        height: auto;
        fill: var(--text-primary);
        filter: drop-shadow(0 0 0 transparent);
        animation: logoIconGlow 4s ease-in-out infinite;
        opacity: 0.66;
    }

    @keyframes logoIconGlow {
        0%, 100% { filter: drop-shadow(0 0 30px rgba(0, 189, 255, 0)); }
        50% { filter: drop-shadow(0 0 50px var(--brand-alpha-40)); }
    }

    .hero-right {
        width: var(--home-desktop-hero-right-width);
        padding: var(--home-desktop-hero-right-padding);
    }

    .hero-right .content {
        text-align: left;
    }

    .hero-right .logo {
        text-align: left;
    }

    .hero-right .process-flow {
        justify-content: flex-start;
    }

    .hero-right .headline {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-right .auth-section {
        align-items: flex-start;
    }
}

/* Compact desktop rhythm: laptop-width and short-height viewports need
   tighter vertical spacing, but wide short viewports keep desktop composition. */
@media (min-width: 1024px) and (max-width: 1536px),
       (min-width: 1537px) and (max-height: 900px) {
    :root {
        --home-main-padding-y: 30px;
        --home-logo-margin-bottom: 1rem;
        --home-logo-width: 195px;
        --home-tagline-font-size: 0.95rem;
        --home-tagline-line-height: 1.45;
        --home-tagline-margin-bottom: 18px;
        --home-headline-font-size: clamp(1.8rem, 2.65vw, 2.15rem);
        --home-headline-line-height: 1.23;
        --home-headline-margin-bottom: 26px;
        --home-headline-max-width: 700px;
        --home-process-gap: 10px;
        --home-process-margin-bottom: 24px;
        --home-process-step-padding: 10px 18px;
        --home-process-step-font-size: 0.9rem;
        --home-process-arrow-font-size: 1.1rem;
        --home-trust-font-size: 0.76rem;
        --home-trust-margin-bottom: 24px;
        --home-flow-panel-open-max-height: 360px;
        --home-flow-panel-open-margin-bottom: 28px;
        --home-flow-content-margin-top: 18px;
        --home-flow-content-padding: 22px 26px;
        --home-flow-tagline-line-height: 1.45;
        --home-flow-tagline-margin-bottom: 16px;
        --home-flow-points-gap: 8px;
        --home-flow-point-padding: 8px 14px;
        --home-auth-min-height: 156px;
        --home-auth-loading-padding: 28px;
        --home-auth-login-max-width: 360px;
        --home-auth-login-padding: 20px;
        --home-auth-login-button-padding: 11px 18px;
        --home-auth-login-button-margin-bottom: 10px;
        --home-auth-divider-margin: 16px 0;
        --home-auth-input-padding: 12px 14px;
        --home-auth-input-margin-bottom: 10px;
        --home-auth-terms-margin-top: 16px;
    }
}

@media (min-width: 1024px) and (max-width: 1536px) {
    :root {
        --home-desktop-hero-left-width: 34%;
        --home-desktop-hero-right-width: 66%;
        --home-desktop-hero-icon-width: clamp(190px, 18vw, 240px);
        --home-desktop-hero-right-padding: 0 36px 0 16px;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .logo {
        margin-bottom: 50px;
    }

    .logo svg {
        width: 160px;
    }

    .orb {
        opacity: 0.3;
    }

    .process-flow {
        flex-direction: column;
        gap: 12px;
    }

    .process-arrow {
        transform: rotate(90deg);
        animation: arrowPulseVertical 1.5s ease-in-out infinite;
    }

    @keyframes arrowPulseVertical {
        0%, 100% { transform: rotate(90deg) translateX(0); opacity: 0.5; }
        50% { transform: rotate(90deg) translateX(5px); opacity: 1; }
    }

    .cta-button {
        width: 100%;
        justify-content: center;
    }

    .auth-section {
        padding: 0 16px;
    }

    .auth-login {
        max-width: 100%;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }

    .footer-links {
        gap: 16px;
    }

    /* Points stack vertically on mobile, so the panel is taller than the
       desktop 400px cap — raise it so the tallest panel (Execute) doesn't clip. */
    .flow-detail-panel.open {
        max-height: 800px;
    }

    .flow-detail-content {
        padding: 20px;
    }
}
