/* Floating cards */
.float-card {
    position: absolute;
    background: rgba(17,17,17,0.85);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 22px;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: floatIn 0.9s ease both;
}

.card-portfolio {
    top: 0; left: 0;
    width: 260px;
    animation-delay: 0.2s;
}
.card-asset {
    top: 60px; right: 0;
    width: 230px;
    animation-delay: 0.4s;
}
.card-goal {
    bottom: 60px; left: 30px;
    width: 200px;
    animation-delay: 0.5s;
    text-align: center;
}
.card-typewriter {
    bottom: 20px; right: 10px;
    width: 240px;
    animation-delay: 0.65s;
}

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

/* Subtle floating idle animation */
.card-portfolio { animation: floatIn 0.9s ease 0.2s both, idleFloat 6s ease-in-out 1.2s infinite; }
.card-asset     { animation: floatIn 0.9s ease 0.4s both, idleFloat 7s ease-in-out 1.5s infinite; }
.card-goal      { animation: floatIn 0.9s ease 0.5s both, idleFloat 5.5s ease-in-out 1s infinite; }
.card-typewriter{ animation: floatIn 0.9s ease 0.65s both, idleFloat 6.5s ease-in-out 1.3s infinite; }

@keyframes idleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card-label-right { font-size: 0.72rem; color: var(--text-muted); }
.card-badge {
    font-size: 0.73rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}
.card-badge.up { background: rgba(29,185,84,0.15); color: var(--green); }
.card-value {
    font-family: var(--font-head);
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

/* Mini chart */
.mini-chart { width: 100%; height: 40px; }
.mini-chart svg { width: 100%; height: 100%; }

/* Asset bars */
.asset-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.asset-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.asset-name { font-size: 0.75rem; color: var(--text-muted); width: 46px; flex-shrink: 0; }
.asset-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.asset-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}
.asset-pct { font-size: 0.72rem; color: #fff; width: 28px; text-align: right; }

/* Goal ring */
.goal-ring-wrap {
    position: relative;
    width: 80px; height: 80px;
    margin: 12px auto 8px;
}
.goal-ring { width: 100%; height: 100%; }
.goal-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.goal-pct {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}
.goal-info {
    display: flex;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
}
.goal-curr { color: var(--green); font-weight: 700; }
.goal-sep { color: var(--text-muted); }
.goal-total { color: var(--text-muted); }

/* Typewriter card */
.typing-line {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.5;
    min-height: 40px;
}
#typewriter { color: var(--green); font-weight: 600; }
#typewriter::after {
    content: "|";
    margin-left: 2px;
    color: var(--green);
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== TOPICS SECTION ===== */
.topics {
    padding: 100px 64px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
}

.section-title {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    text-align: center;
}
.section-sub {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 56px;
    font-size: 1rem;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px 28px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s, background 0.25s, transform 0.25s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.topic-card:hover {
    border-color: var(--green);
    background: rgba(29,185,84,0.05);
    transform: translateY(-4px);
}
.topic-icon { font-size: 2rem; }
.topic-card h3 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}
.topic-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; flex: 1; }
.topic-link { color: var(--green); font-size: 0.85rem; font-weight: 600; }

@media (max-width: 900px) {
    .card-portfolio { width: 200px; }
    .card-asset { width: 185px; top: 40px; }
    .card-goal { width: 170px; bottom: 0; left: 10px; }
    .card-typewriter { width: 190px; bottom: 0; right: 0; }
}

@media (max-width: 900px) {
    .card-portfolio { width: 200px; }
    .card-asset { width: 185px; top: 40px; }
    .card-goal { width: 170px; bottom: 0; left: 10px; }
    .card-typewriter { width: 190px; bottom: 0; right: 0; }
}

@media (max-width: 640px) {
    .card-portfolio { font-size: 0.9rem; width: 180px; }
    .card-asset { width: 170px; }
}
