/* ============================================================
   DV Portfolio — Dark Tech Design
   ============================================================ */

/* 1 — Design Tokens */
:root {
    --bg:            #0f172a;
    --bg2:           #1e293b;
    --bg-card:       #1e293b;
    --nav-glass:     rgba(15, 23, 42, 0.88);
    --accent:        #6366f1;
    --accent-hover:  #4f46e5;
    --accent2:       #22d3ee;
    --accent-glow:   rgba(99, 102, 241, 0.32);
    --accent2-glow:  rgba(34, 211, 238, 0.25);
    --text:          #e2e8f0;
    --text-muted:    #94a3b8;
    --border:        rgba(99, 102, 241, 0.15);
    --border-hover:  rgba(99, 102, 241, 0.4);
    --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow:        0 4px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg:     0 10px 40px rgba(0, 0, 0, 0.55);
    --success-bg:    rgba(16, 185, 129, 0.12);
    --success-text:  #6ee7b7;
    --error-bg:      rgba(239, 68, 68, 0.12);
    --error-text:    #fca5a5;
    --code-bg:       #0d1117;
    --radius:        14px;
    --radius-sm:     9px;
}

/* 2 — Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: radial-gradient(rgba(99, 102, 241, 0.07) 1px, transparent 1px);
    background-size: 32px 32px;
}

h1, h2, h3 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

/* 3 — Topnav (floating pill wrapper) */
.topnav {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 14px 20px 0;
    background: transparent;
    pointer-events: none;
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    pointer-events: none;
    position: relative;
}

/* The actual floating pill */
.nav-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 56px;
    padding: 0 8px;
    background: var(--nav-glass);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 100px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    pointer-events: all;
}

/* Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    padding: 0 10px 0 4px;
    margin-right: 4px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px var(--accent-glow);
    line-height: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.01em;
}

.brand-sub {
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.845rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 100px;
    transition: background 0.18s, color 0.18s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    font-weight: 700;
}

/* Activities toggle */
.activities-btn .btn-arrow {
    transition: transform 0.22s ease;
    opacity: 0.5;
    flex-shrink: 0;
}

.activities-btn.open {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
}

.activities-btn.open .btn-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* Nav Auth */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    padding-right: 4px;
}

.auth-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 6px 13px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 100px;
    white-space: nowrap;
    font-weight: 600;
}

.auth-dot {
    width: 7px;
    height: 7px;
    background: var(--accent2);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--accent2);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.auth-link {
    color: #a5b4fc;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 7px 18px;
    border: 1.5px solid rgba(99, 102, 241, 0.38);
    border-radius: 100px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.auth-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

/* Mobile toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mobile-toggle:hover {
    border-color: var(--accent);
    color: var(--text);
    background: rgba(99, 102, 241, 0.08);
}

/* 4 — Activities Panel (inside .nav-inner, floats below pill) */
.activities-panel {
    margin-top: 8px;
    background: rgba(13, 17, 30, 0.97);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
}

.activities-panel.open {
    max-height: 460px;
    opacity: 1;
    pointer-events: all;
}

.activities-grid {
    padding: 16px 20px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.activity-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.activity-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.2);
}

.activity-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.3);
    font-weight: 700;
}

.activity-num {
    min-width: 26px;
    height: 26px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(99, 102, 241, 0.55);
    flex-shrink: 0;
    font-family: 'Space Grotesk', sans-serif;
}

.activity-link:hover .activity-num,
.activity-link.active .activity-num {
    background: rgba(99, 102, 241, 0.22);
    color: #818cf8;
}

/* Mobile dropdown panel (re-uses activities-panel style) */
.mobile-nav-panel {
    margin-top: 8px;
    background: rgba(13, 17, 30, 0.97);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
}

.mobile-nav-panel.open {
    max-height: 400px;
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-inner {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-nav-inner .nav-link {
    border-radius: var(--radius-sm);
    justify-content: flex-start;
    padding: 10px 14px;
}

.mobile-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.mobile-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 4px;
    flex-wrap: wrap;
}

.mobile-auth .auth-badge { border-radius: var(--radius-sm); }

.mobile-auth .auth-link {
    border-radius: var(--radius-sm);
    padding: 7px 16px;
}

/* 5 — Hero Banner */
.hero-banner {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: -32px;
    margin-bottom: 32px;
    padding: 88px 28px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 65% at 25% 45%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 55% at 78% 20%, rgba(34, 211, 238, 0.11) 0%, transparent 50%),
        radial-gradient(ellipse 50% 60% at 55% 95%, rgba(139, 92, 246, 0.09) 0%, transparent 50%);
    pointer-events: none;
}

.hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(99, 102, 241, 0.055) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 100px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 24px;
    font-family: 'Space Grotesk', sans-serif;
}

.hero-title {
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.1;
}

.hero-accent {
    background: linear-gradient(90deg, #818cf8 0%, #22d3ee 50%, #818cf8 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 5s linear infinite;
}

@keyframes shimmer {
    from { background-position: 200% center; }
    to   { background-position: -200% center; }
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.75;
}

/* Tech stack tags below hero desc */
.hero-tech-stack {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.tech-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.09);
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: var(--text-muted);
    letter-spacing: 0.04em;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.2s;
}

.tech-tag:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
}

.hero-btn {
    font-size: 0.95rem;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 50%, var(--accent2) 100%);
    background-size: 200% auto;
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 24px var(--accent-glow), 0 2px 8px var(--accent2-glow);
    border-radius: 100px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

.hero-btn:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.55), 0 4px 16px var(--accent2-glow);
    color: #ffffff;
}

/* 6 — Page Hero (activity pages) */
.page-hero {
    background: var(--bg);
    padding: 48px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 90% at 20% 50%, rgba(99, 102, 241, 0.13) 0%, transparent 55%),
        radial-gradient(ellipse 55% 65% at 80% 30%, rgba(34, 211, 238, 0.07) 0%, transparent 50%);
    pointer-events: none;
}

.page-hero h1 {
    position: relative;
    font-size: clamp(1.7rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
}

.accent-text {
    background: linear-gradient(90deg, #818cf8, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-hero p {
    position: relative;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* 7 — Layout */
.container {
    width: 92%;
    max-width: 1100px;
    margin: 32px auto;
    flex: 1;
}

/* 8 — Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 28px 32px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.01em;
}

.card h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    border-radius: 2px;
    flex-shrink: 0;
}

.card p  { color: var(--text-muted); margin-bottom: 10px; }
.card ul,
.card ol { padding-left: 22px; color: var(--text-muted); }
.card li { margin-bottom: 5px; }

/* 9 — Demo Area (light island so rendered HTML is readable) */
.demo-area {
    background: #f8fafc;
    border: 1px dashed rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin: 16px 0;
    color: #1e293b;
}

.demo-area * { color: inherit; }

/* 10 — Buttons */
.source-btn,
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', inherit;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px var(--accent-glow);
    margin: 4px 4px 4px 0;
}

.source-btn:hover,
.btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.5);
    transform: translateY(-1px);
    color: #ffffff;
}

.source-btn {
    background: var(--code-bg);
    box-shadow: none;
    color: #7c83fd;
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.source-btn:hover {
    background: #161b22;
    box-shadow: none;
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

/* 11 — Source Code Block */
.source-code {
    background: var(--code-bg);
    color: #7c83fd;
    padding: 20px 22px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-top: 10px;
    font-size: 0.82rem;
    line-height: 1.65;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    border: 1px solid rgba(99, 102, 241, 0.14);
}

/* 12 — Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead tr {
    background: rgba(99, 102, 241, 0.18);
    border-bottom: 1px solid rgba(99, 102, 241, 0.28);
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-family: 'Space Grotesk', sans-serif;
    color: #a5b4fc;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

tbody tr:hover td { background: rgba(99, 102, 241, 0.06); }

tbody tr:nth-child(even) td {
    background: rgba(99, 102, 241, 0.025);
}

tbody td {
    padding: 11px 16px;
    color: var(--text-muted);
    border: none;
}

/* 13 — Forms */
input,
select,
textarea {
    width: 100%;
    padding: 11px 15px;
    margin-top: 5px;
    margin-bottom: 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Inter', inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(99, 102, 241, 0.06);
}

option {
    background: var(--bg2);
    color: var(--text);
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* 14 — Alerts */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 4px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-left-color: #10b981;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-left-color: #ef4444;
}

/* 15 — Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.gallery-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}

.gallery-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

/* 16 — Footer */
.footer {
    background: var(--bg2);
    color: var(--text-muted);
    text-align: center;
    padding: 28px;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.footer p        { margin: 0; line-height: 1.8; }
.footer a        { color: #a5b4fc; text-decoration: none; }
.footer a:hover  { color: var(--accent2); }
.footer-heart    { color: var(--accent); }
.footer-highlight { color: var(--text); font-weight: 600; }

/* 17 — Responsive */
@media (max-width: 900px) {
    .activities-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .topnav { padding: 10px 14px 0; }
    .nav-pill { height: 52px; padding: 0 6px; }
    .brand-sub { display: none; }
    .nav-links  { display: none; }
    .nav-auth   { display: none; }
    .mobile-toggle { display: flex; }

    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px 16px 16px;
    }

    .hero-banner { padding: 64px 20px 56px; }
    .page-hero   { padding: 36px 20px; }
    .container   { width: 95%; margin: 22px auto; }
    .card        { padding: 20px 18px; }
    .form-row    { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .activities-grid { grid-template-columns: 1fr; }
    .brand-text { display: none; }
    .brand-logo { width: 32px; height: 32px; font-size: 0.95rem; border-radius: 9px; }
    .hero-title { font-size: 2rem; }
    .nav-pill   { height: 48px; }
    .hero-tech-stack { gap: 6px; }
}
