/* #region Variables */

:root {
    --accent: #3b82f6;
    --accent-dim: color-mix(in srgb, var(--accent), transparent 85%);
    --accent-glow: color-mix(in srgb, var(--accent), transparent 60%);
    --accent-dark: color-mix(in srgb, var(--accent), black 10%);
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-sub: #475569;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-soft: 0 10px 25px -5px rgba(148, 163, 184, 0.25);
    --shadow-hard: 0 4px 6px rgba(148, 163, 184, 0.2);
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
    --bg-color: #020617;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(30, 41, 59, 0.95);
    --shadow-soft: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-hard: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* #endregion */

/* #region Global */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

html {
    color-scheme: light dark;
}

    html.club-preinit #view-feed,
    html.club-preinit #view-landing-wrapper {
        display: none !important;
    }

    html.club-preinit[data-initial-view="feed"] #view-feed {
        display: block !important;
    }

    html.club-preinit[data-initial-view="landing"] #view-landing-wrapper {
        display: block !important;
    }

    html.club-preinit * {
        animation: none !important;
        transition: none !important;
    }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.5s ease, color 0.3s ease;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* #endregion */

/* #region Background */

.aurora-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translate3d(0,0,0);
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
    opacity: 0.5;
    will-change: transform;
}

[data-theme="dark"] .aurora-blob {
    opacity: 0.3;
}

.blob-1 {
    top: -10%;
    left: -20%;
    width: 80vw;
    height: 80vw;
    animation: moveBlobs 20s infinite alternate linear;
}

.blob-2 {
    bottom: -10%;
    right: -20%;
    width: 90vw;
    height: 90vw;
    animation: moveBlobs 25s infinite alternate-reverse linear;
    opacity: 0.4;
}

.blob-3 {
    top: 40%;
    left: 30%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent), white 30%) 0%, transparent 65%);
    opacity: 0.3;
    animation: moveBlobs 30s infinite alternate linear;
}

@keyframes moveBlobs {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate3d(30px, -40px, 0) scale(1.1) rotate(10deg);
    }

    100% {
        transform: translate3d(-20px, 20px, 0) scale(0.9) rotate(-5deg);
    }
}

/* #endregion */

/* #region App Container */

.app-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: opacity 0.4s ease;
}

@media (min-width: 768px) {
    .app-wrapper {
        margin: 40px 0;
        height: 850px;
        background: var(--glass-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--glass-border);
        border-radius: 40px;
        box-shadow: var(--shadow-soft);
        overflow: hidden;
        transform: translateZ(0);
    }

    body {
        align-items: center;
    }
}

/* #endregion */

/* #region Scrollable Area */

.scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

    .scroll-container::-webkit-scrollbar {
        width: 4px;
    }

    .scroll-container::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.1);
        border-radius: 4px;
    }

/* #endregion */

/* #region Header */

.top-bar {
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
    padding-bottom: 20px;
    padding-left: calc(24px + env(safe-area-inset-left, 0px));
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.control-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 700;
    font-size: 12px;
}

    .control-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 0 15px var(--accent-dim);
        border-color: var(--accent);
        color: var(--accent);
    }

/* #endregion */

/* #region Hero */

.hero {
    padding: 0 24px;
    padding-top: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.avatar-wrapper {
    position: relative;
    margin-bottom: 20px;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    animation: popIn 0.8s var(--ease-elastic);
}

.avatar-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0.5;
    animation: pulseRing 3s infinite;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--bg-color);
    position: relative;
    z-index: 2;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
    background: #cbd5e1;
}

.hero h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    line-height: 1.1;
    opacity: 0;
    animation: slideUp 0.6s 0.2s forwards var(--ease-out);
}

.hero .nick {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-dim);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    display: inline-block;
    opacity: 0;
    animation: slideUp 0.6s 0.3s forwards var(--ease-out);
}

.hero .headline {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
    opacity: 0;
    animation: slideUp 0.6s 0.4s forwards var(--ease-out);
}

/* #endregion */

/* #region Bio */

.bio-container {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    opacity: 0;
    animation: slideUp 0.6s 0.5s forwards var(--ease-out);
}

.bio-wrapper {
    position: relative;
    max-height: 4.8em;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

    .bio-wrapper.expanded {
        max-height: 800px;
        -webkit-mask-image: none;
        mask-image: none;
    }

.bio-text {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.6;
}

.bio-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* #endregion */

/* #region CTA & Trust List */

.cta-wrapper {
    padding: 24px;
    margin-top: auto;
}

.join-btn {
    width: 100%;
    background: var(--accent);
    color: white;
    padding: 18px;
    border-radius: 20px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px -5px var(--accent-glow);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, background 0.2s;
    opacity: 0;
    animation: slideUp 0.6s 0.6s forwards var(--ease-out);
}

    .join-btn:hover {
        transform: translateY(-2px);
        background: var(--accent-dark);
    }

    .join-btn:active {
        transform: scale(0.97);
    }

    .join-btn::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transform: skewX(-20deg);
        animation: shimmer 4s infinite;
    }

.trust-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    animation: slideUp 0.5s forwards var(--ease-out);
    padding: 6px;
    border-radius: 10px;
}

    .trust-item:nth-child(1) {
        animation-delay: 0.7s;
    }

    .trust-item:nth-child(2) {
        animation-delay: 0.8s;
    }

    .trust-item:nth-child(3) {
        animation-delay: 0.9s;
    }

    .trust-item:nth-child(4) {
        animation-delay: 1.0s;
    }

.trust-icon {
    width: 30px;
    height: 30px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .trust-icon svg {
        width: 16px;
        height: 16px;
    }

.trust-item.highlight {
    color: var(--text-main);
    font-weight: 700;
}

    .trust-item.highlight .trust-icon {
        background: rgba(212, 175, 55, 0.15);
        color: #d4af37;
    }

/* #endregion */

/* #region Feed */

.feed-view {
    display: none;
    padding: 24px;
    padding-bottom: 20px;
}

.gift-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--accent-dim) 100%);
    backdrop-filter: blur(8px);
    border: 1px solid var(--accent-dim);
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    animation: popIn 0.6s var(--ease-out);
    cursor: pointer;
}

.gift-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gift-icon {
    width: 42px;
    height: 42px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.gift-text h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.gift-text p {
    font-size: 12px;
    color: var(--text-sub);
}

.timeline {
    position: relative;
    padding-left: 28px;
    border-left: 2px solid var(--accent-dim);
    margin-bottom: 0;
}

.signal {
    position: relative;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s forwards;
}

    .signal:last-child {
        margin-bottom: 0;
    }

.signal-dot {
    position: absolute;
    left: -35px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid var(--text-sub);
    z-index: 2;
}

.signal.latest .signal-dot {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-dim);
}

.signal-content {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 16px;
    border-radius: 18px;
    box-shadow: var(--shadow-hard);
}

.signal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signal-author {
    color: var(--accent);
}

.signal-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
}

.signal-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    padding: 4px 0;
    border-bottom: 2px solid var(--accent);
}

/* #endregion */

/* #region Footer */

.footer-branding {
    margin-top: auto;
    padding: 24px;
    text-align: center;
    font-size: 11px;
    color: var(--text-sub);
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    z-index: 10;
}

@media (min-width: 768px) {
    .footer-branding {
        padding-top: 0;
    }
}

.leave-link {
    font-size: 11px;
    color: #ef4444;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}

    .leave-link:hover {
        background: rgba(239, 68, 68, 0.1);
    }

.brand-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

    .brand-link:hover {
        opacity: 1;
        color: var(--accent);
    }

/* #endregion */

/* #region Modals */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .overlay.visible {
        opacity: 1;
    }

    .overlay.drawer-mode {
        align-items: flex-end;
        justify-content: center;
    }

        .overlay.drawer-mode .modal-card {
            border-radius: 32px 32px 0 0;
            width: 100%;
            max-width: 480px;
            margin: 0;
            transform: translateY(100%);
        }

        .overlay.drawer-mode.active .modal-card {
            transform: translateY(0);
        }

    .overlay:not(.drawer-mode) {
        align-items: center;
        justify-content: center;
    }

        .overlay:not(.drawer-mode) .modal-card {
            border-radius: 32px;
            width: 90%;
            max-width: 400px;
            transform: scale(0.9) translateY(20px);
        }

        .overlay:not(.drawer-mode).active .modal-card {
            transform: scale(1) translateY(0);
        }

.modal-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .modal-card {
    background: rgba(30, 41, 59, 0.98);
    border-color: rgba(255,255,255,0.1);
}

.modal-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: 50%;
    overflow: hidden;
}

.draw-icon svg {
    width: 32px;
    height: 32px;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    display: block;
}

.draw-icon path, .draw-icon circle, .draw-icon line, .draw-icon polyline, .draw-icon rect {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 1.2s 0.3s forwards ease-in-out;
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-main);
}

.modal-body {
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-modal {
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    flex: 1;
    transition: transform 0.2s;
}

    .btn-modal:active {
        transform: scale(0.96);
    }

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
    border: 1px solid rgba(var(--text-sub), 0.2);
    color: var(--text-sub);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.hidden {
    display: none !important;
}

/* #endregion */

/* #region Animations */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.12);
        opacity: 0;
    }
}

@keyframes shimmer {
    0%, 60% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* #endregion */
