/* ════════════════════════════════════════════════════════════════
   PORTFOLIO ENHANCEMENTS
   Builds on the existing design tokens in index.php (:root vars).
   Load AFTER the inline <style> block.
   ════════════════════════════════════════════════════════════════ */

/* ─── 1. Dark mode ───────────────────────────────────────────────
   Re-maps the neutral tokens; --nav-bg and --accent stay as
   configured in the admin panel so branding is preserved.        */
html[data-theme="dark"] {
    --surface:        #16181D;
    --surface-2:      #1D2026;
    --surface-3:      #262A31;
    --text-primary:   #EEF0F4;
    --text-secondary: #A7ADB8;
    --text-muted:     #6E7480;
    --border:         #2C3038;
    --accent-light:   color-mix(in srgb, var(--accent) 18%, #1D2026);
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
    --shadow:         0 4px 16px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.35);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.4);
}

html[data-theme="dark"] body { background: var(--surface); color: var(--text-secondary); }
html[data-theme="dark"] .award-icon-wrap { background: linear-gradient(135deg, #3A3110, #4A3D14); }
html { transition: background 0.35s ease; }
body, .resume-section, .accomplishment-card, .timeline-card, .skill-card,
.award-card, .contact-card, .skill-badge, .project-card, .testimonial-card {
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

/* Theme toggle button (sits above the back-to-top button) */
.theme-toggle {
    position: fixed;
    bottom: 78px; right: 28px;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.theme-toggle:hover { color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }

/* ─── 2. Scroll progress bar ────────────────────────────────────── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, white));
    z-index: 1200;
    pointer-events: none;
    transition: width 0.08s linear;
}

/* ─── 3. Hero: photo, typing effect, ambient background ────────── */
.hero-photo-wrap {
    position: relative;
    width: 168px; height: 168px;
    margin-bottom: 28px;
}
.hero-photo {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.15);
    position: relative;
    z-index: 1;
}
.hero-photo-wrap::after {           /* accent offset ring */
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0.55;
    transform: translate(6px, 6px);
    z-index: 0;
}

.hero-typing {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    min-height: 1.6em;
    margin-bottom: 6px;
}
.hero-typing .typing-text { color: var(--accent); }
.hero-typing .typing-cursor {
    display: inline-block;
    width: 2px; height: 1em;
    background: var(--accent);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blinkCursor 0.9s steps(1) infinite;
}
@keyframes blinkCursor { 50% { opacity: 0; } }

/* Ambient drifting glow blobs behind the hero content */
.hero-ambient {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.hero-ambient span {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    background: var(--accent);
    animation: heroDrift 18s ease-in-out infinite alternate;
}
.hero-ambient span:nth-child(1) { width: 420px; height: 420px; top: -12%; left: -8%; }
.hero-ambient span:nth-child(2) { width: 340px; height: 340px; bottom: -14%; right: -6%; animation-duration: 24s; animation-delay: -6s; }
.hero-ambient span:nth-child(3) { width: 220px; height: 220px; top: 42%; left: 58%; opacity: 0.12; animation-duration: 30s; animation-delay: -12s; }
@keyframes heroDrift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, -40px) scale(1.15); }
}

/* ─── 4. Animated stat counters ─────────────────────────────────── */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    padding: 34px 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
@media (max-width: 991.98px) { .stats-strip { padding: 28px 24px; } }

.stat-item { text-align: center; }
.stat-value {
    font-family: 'DM Serif Display', serif;
    font-size: 2.4rem;
    color: var(--text-primary);
    line-height: 1.1;
}
.stat-value .stat-suffix { color: var(--accent); }
.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── 5. Timeline draw-in ───────────────────────────────────────── */
.timeline { --timeline-progress: 0; }
.timeline.js-draw::before {
    transform: scaleY(var(--timeline-progress));
    transform-origin: top;
    transition: transform 0.15s linear;
}
.timeline-dot { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease; }
.timeline-entry:not(.dot-active) .timeline-dot { transform: scale(0.4); opacity: 0.4; }
.timeline-entry.dot-active .timeline-dot {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 5px var(--accent-glow);
}

/* ─── 6. Certifications / licenses ──────────────────────────────── */
#certifications { background: var(--surface-2); }
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.cert-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    gap: 16px;
    transition: var(--transition);
}
.cert-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cert-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cert-icon i { color: var(--accent); font-size: 1.05rem; }
.cert-name { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin: 0 0 2px; }
.cert-org { font-size: 0.82rem; color: var(--text-secondary); margin: 0 0 6px; }
.cert-dates { font-size: 0.74rem; color: var(--text-muted); }
.cert-verify {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.76rem; font-weight: 600;
    color: var(--accent);
    margin-top: 8px;
}
.cert-verify:hover { text-decoration: underline; color: var(--accent); }

/* ─── 7. Projects / portfolio ───────────────────────────────────── */
#projects { background: var(--surface); }

.project-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.project-filter {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.project-filter:hover { color: var(--accent); border-color: var(--accent); }
.project-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}
.project-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition), opacity 0.3s ease, transform 0.3s ease;
}
.project-card.filtered-out { display: none; }
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.project-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--surface-3);
    display: flex; align-items: center; justify-content: center;
}
.project-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.06); }
.project-thumb .thumb-placeholder { color: var(--text-muted); font-size: 1.8rem; }
.project-thumb::after {
    content: '\f00e';                 /* magnifier icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--accent) 55%, transparent);
    color: #fff;
    font-size: 1.4rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.project-thumb:hover::after { opacity: 1; }

.project-body { padding: 18px 20px 20px; }
.project-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.project-desc { font-size: 0.86rem; color: var(--text-secondary); margin: 0 0 12px; line-height: 1.6; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.project-tag {
    font-size: 0.7rem; font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
}
.project-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--accent);
}
.project-link:hover { color: var(--accent); text-decoration: underline; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(10, 11, 14, 0.92);
    display: flex; align-items: center; justify-content: center;
    z-index: 1300;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 40px;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
    max-width: 100%; max-height: 100%;
    border-radius: var(--radius);
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    transform: scale(0.94);
    transition: transform 0.25s ease;
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
    position: absolute;
    top: 22px; right: 26px;
    background: none; border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.6rem;
    cursor: pointer;
    transition: color 0.2s ease;
}
.lightbox-close:hover { color: #fff; }
.lightbox-caption {
    position: absolute;
    bottom: 22px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
}

/* ─── 8. Testimonials carousel ──────────────────────────────────── */
#testimonials { background: var(--surface-2); }

.testimonial-carousel { position: relative; max-width: 760px; }
.testimonial-track { position: relative; min-height: 220px; }
.testimonial-card {
    position: absolute;
    inset: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 38px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}
.testimonial-card.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.testimonial-quote-mark { color: var(--accent); font-size: 1.6rem; margin-bottom: 12px; opacity: 0.7; }
.testimonial-quote { font-size: 1rem; color: var(--text-secondary); line-height: 1.75; font-style: italic; margin: 0 0 20px; }
.testimonial-author { display: flex; align-items: center; gap: 14px; }
.testimonial-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--accent-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}
.testimonial-name { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.testimonial-role { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

.testimonial-dots { display: flex; gap: 8px; margin-top: 22px; }
.testimonial-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}
.testimonial-dot.active { background: var(--accent); transform: scale(1.25); }

/* ─── 9. Contact form ───────────────────────────────────────────── */
.contact-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 767.98px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
}
.contact-form .form-label {
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted);
}
.contact-form .form-control {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    padding: 10px 14px;
}
.contact-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--surface);
    color: var(--text-primary);
}
.contact-submit {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 26px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: var(--transition);
}
.contact-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--accent-glow); color: #fff; }
.contact-submit:disabled { opacity: 0.6; transform: none; box-shadow: none; }
.contact-feedback { font-size: 0.85rem; margin-top: 14px; display: none; }
.contact-feedback.ok { display: block; color: #2E9E5B; }
.contact-feedback.err { display: block; color: #D64545; }

/* Honeypot — visually hidden, still in the DOM for bots */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0;
    height: 0; width: 0;
    overflow: hidden;
}

/* ─── 10. Resume download button ────────────────────────────────── */
.resume-download {
    display: inline-flex; align-items: center; gap: 9px;
    margin-top: 22px;
    padding: 11px 24px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition);
}
.resume-download:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* ─── 11. Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hero-ambient span,
    .hero-scroll,
    .hero-typing .typing-cursor { animation: none !important; }
    .timeline.js-draw::before { transform: scaleY(1) !important; }
    .scroll-progress { transition: none; }
    * { scroll-behavior: auto !important; }
}
