/* Theme switch and dark palette. */
.theme-toggle{width:44px;height:44px;flex:0 0 auto;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;background:#fff;color:#252b31;cursor:pointer;box-shadow:0 7px 18px #1e252a12;transition:transform var(--motion-fast),background var(--motion-fast),color var(--motion-fast),border-color var(--motion-fast),box-shadow var(--motion-fast)}
.theme-toggle:hover{transform:translateY(-2px);box-shadow:0 11px 23px #1e252a24}.theme-toggle:active{transform:scale(.96)}.theme-icon{position:absolute;width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;transition:opacity var(--motion-fast),transform var(--motion-fast)}.theme-icon-moon{fill:currentColor;stroke:none}.theme-icon-sun{opacity:0;transform:rotate(-50deg) scale(.7)}
html.theme-transition *,html.theme-transition *::before,html.theme-transition *::after{transition-duration:300ms!important}
html[data-theme="dark"]{color-scheme:dark;--navy:#f8f5ff;--teal:#b994ff;--sky:#8b5cf6;--ink:#f5f2fb;--muted:#b9b1c8;--paper:#0d0b14;--line:#342d43;--soft:#211a2d;--surface:#171320;--surface-muted:#12101a;--text-soft:#c7bfd5;--shadow-sm:0 8px 22px rgba(0,0,0,.24);--shadow-md:0 18px 44px rgba(0,0,0,.32);--shadow-hover:0 24px 56px rgba(0,0,0,.42)}
html[data-theme="dark"] body{color:var(--ink);background:radial-gradient(circle at 14% 7%,rgba(139,92,246,.14),transparent 31rem),linear-gradient(180deg,#0d0b14 0,#12101a 44%,#0d0b14 100%)}
html[data-theme="dark"]{background:#0d0b14;scrollbar-color:#5b21b6 transparent}html[data-theme="dark"]::-webkit-scrollbar-track{background:transparent}html[data-theme="dark"]::-webkit-scrollbar-thumb{background:#5b21b6}html[data-theme="dark"]::-webkit-scrollbar-thumb:hover{background:#7440c7}html[data-theme="dark"] .footer-links a:hover{background:#5b21b6;border-color:#5b21b6;color:#fff;box-shadow:0 8px 18px rgba(91,33,182,.32)}
html[data-theme="dark"] .navbar{background:rgba(13,11,20,.82);border-bottom-color:transparent}html[data-theme="dark"] .navbar[data-scroll-state="scrolled"]{background:rgba(13,11,20,.95);border-bottom-color:#342d43;box-shadow:0 8px 28px rgba(0,0,0,.3)}html[data-theme="dark"] .navbar nav{background:rgba(28,23,38,.78);border-color:#3d3450;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}html[data-theme="dark"] .navbar nav a{color:#d6cfe0}html[data-theme="dark"] .navbar nav a:hover,html[data-theme="dark"] .navbar nav a.is-active{background:#8b5cf6;color:#fff}html[data-theme="dark"] .brand{color:#fff}html[data-theme="dark"] .header-socials a,html[data-theme="dark"] .theme-toggle{border-color:#3d3450;background:#1a1623;color:#f8f5ff}html[data-theme="dark"] .header-socials a:hover,html[data-theme="dark"] .theme-toggle:hover{background:#8b5cf6;border-color:#8b5cf6;color:#fff}html[data-theme="dark"] .theme-icon-moon{opacity:0;transform:rotate(45deg) scale(.7)}html[data-theme="dark"] .theme-icon-sun{opacity:1;transform:none}
html[data-theme="dark"] .hero h1,html[data-theme="dark"] .hero h2,html[data-theme="dark"] .content h2,html[data-theme="dark"] .intro strong,html[data-theme="dark"] .about-card strong,html[data-theme="dark"] .project-copy h3,html[data-theme="dark"] .project-stats strong,html[data-theme="dark"] .certificate-copy h3{color:#fff}html[data-theme="dark"] .hero h2 i,html[data-theme="dark"] section h2 i,html[data-theme="dark"] .eyebrow,html[data-theme="dark"] .talk,html[data-theme="dark"] .talk span,html[data-theme="dark"] .overview-icon,html[data-theme="dark"] .tool-icon{color:#b994ff}html[data-theme="dark"] .intro,html[data-theme="dark"] .about-card,html[data-theme="dark"] .projects-intro,html[data-theme="dark"] .project-copy>p,html[data-theme="dark"] .certificate-copy p{color:#b9b1c8!important}
html[data-theme="dark"] .portrait{background:#1b1724;border-color:#2c2539;box-shadow:0 18px 42px rgba(0,0,0,.4)}html[data-theme="dark"] .ring{border-color:#b994ff}html[data-theme="dark"] .ring-two{border-color:#7c4dff}html[data-theme="dark"] .photo-area:before,html[data-theme="dark"] .photo-area:after,html[data-theme="dark"] .brand-mark{background:linear-gradient(145deg,#211a2d,#4c3672);color:#fff}
html[data-theme="dark"] .overview,html[data-theme="dark"] .about-card,html[data-theme="dark"] .tech-stack,html[data-theme="dark"] .project-card,html[data-theme="dark"] .certificate-card,html[data-theme="dark"] .message-form,html[data-theme="dark"] .project-dialog{background:#171320;border-color:#342d43;color:#f5f2fb}html[data-theme="dark"] .overview article{border-color:#342d43}html[data-theme="dark"] .overview article:hover{background:#211a2d}html[data-theme="dark"] .overview strong,html[data-theme="dark"] .overview small{color:#bbb3c7}html[data-theme="dark"] .tech-badges span{background:#171320;border-color:#3d3450;color:#f7f3ff}html[data-theme="dark"] .tech-badges span:hover{border-color:#9f73ff;box-shadow:0 9px 22px rgba(139,92,246,.18)}html[data-theme="dark"] .stack-title,html[data-theme="dark"] .primary,html[data-theme="dark"] .message-form button,html[data-theme="dark"] .back-to-top,html[data-theme="dark"] .dialog-link{background:#8b5cf6;color:#fff}html[data-theme="dark"] .secondary{background:transparent;border-color:#b994ff;color:#fff}
html[data-theme="dark"] #certifications{background:#100d18}html[data-theme="dark"] .certificate-preview{background:#211a2d;border-color:#342d43}html[data-theme="dark"] .certificate-copy span,html[data-theme="dark"] .project-tags span{background:#241b34;border-color:#493761;color:#d8c6ff}html[data-theme="dark"] .certificate-nav{background:#1a1623;border-color:#493d5e;color:#fff}html[data-theme="dark"] .certificate-nav:hover{background:#8b5cf6}html[data-theme="dark"] .project-stats{border-color:#342d43}html[data-theme="dark"] .project-stats div+div{border-color:#342d43}html[data-theme="dark"] .project-actions button{background:#8b5cf6}html[data-theme="dark"] .project-actions a{border-color:#b994ff;color:#f8f5ff}html[data-theme="dark"] .project-actions a:hover{background:#241b34}html[data-theme="dark"] .project-github-icon{background:#1a1623;color:#fff}
html[data-theme="dark"] #contact{background:#0a0810}html[data-theme="dark"] .contact-direct{background:#171320;border-color:#423653}html[data-theme="dark"] .contact-direct:hover{background:#211a2d;border-color:#7e5db2}html[data-theme="dark"] .contact-direct>span{background:#8b5cf6;color:#fff}html[data-theme="dark"] .message-form h3,html[data-theme="dark"] .message-form label{color:#fff}html[data-theme="dark"] .message-form input,html[data-theme="dark"] .message-form textarea{background:#100d18;border-color:#493d5e;color:#fff}html[data-theme="dark"] .message-form input:focus,html[data-theme="dark"] .message-form textarea:focus{background:#151020;border-color:#a979ff;box-shadow:0 0 0 4px rgba(139,92,246,.18)}html[data-theme="dark"] .dialog-close{background:#241f2e;color:#fff}html[data-theme="dark"] .dialog-highlights div{background:#211a2d;border-color:#3d3450;color:#ded7e8}html[data-theme="dark"] .site-footer{background:#07060b!important}
html[data-theme="dark"] :focus-visible{outline-color:#b994ff}
@media(max-width:900px){html[data-theme="dark"] .navbar nav{background:rgba(13,11,20,.98)}html[data-theme="dark"] .menu-toggle{background:#1a1623;border-color:#3d3450}html[data-theme="dark"] .menu-toggle span{background:#fff}}
@media(max-width:680px){.theme-toggle{width:40px;height:40px;margin-left:auto}.navbar{gap:8px}.menu-toggle{margin-left:0}}
@media(prefers-reduced-motion:reduce){.theme-icon,.theme-toggle{transition:none}html.theme-transition *,html.theme-transition *::before,html.theme-transition *::after{transition-duration:.01ms!important}}

html[data-theme="dark"] .dialog-header{background:linear-gradient(135deg,#1d1827,#171320);border-color:#342d43}html[data-theme="dark"] .dialog-section-grid section,html[data-theme="dark"] .dialog-highlights div{background:#211a2d;border-color:#3d3450}html[data-theme="dark"] .dialog-section-grid h3,html[data-theme="dark"] .dialog-highlights strong{color:#fff}html[data-theme="dark"] .dialog-section-grid p,html[data-theme="dark"] .dialog-section-grid li,html[data-theme="dark"] .dialog-highlights span{color:#c5bdd1}html[data-theme="dark"] .dialog-tools span{background:#241b34;border-color:#493761;color:#d8c6ff}

/* Darker purple refinement. */
html[data-theme="dark"]{--teal:#8b5cf6;--sky:#6d28d9}
html[data-theme="dark"] body{background:radial-gradient(circle at 14% 7%,rgba(91,33,182,.16),transparent 31rem),linear-gradient(180deg,#0d0b14 0,#12101a 44%,#0d0b14 100%)}
html[data-theme="dark"] .navbar nav a:hover,html[data-theme="dark"] .navbar nav a.is-active,html[data-theme="dark"] .header-socials a:hover,html[data-theme="dark"] .theme-toggle:hover,html[data-theme="dark"] .stack-title,html[data-theme="dark"] .primary,html[data-theme="dark"] .message-form button,html[data-theme="dark"] .back-to-top,html[data-theme="dark"] .dialog-link,html[data-theme="dark"] .certificate-nav:hover,html[data-theme="dark"] .project-actions button,html[data-theme="dark"] .contact-direct>span{background:#5b21b6;border-color:#5b21b6}
html[data-theme="dark"] .hero h2 i,html[data-theme="dark"] section h2 i,html[data-theme="dark"] .eyebrow,html[data-theme="dark"] .talk,html[data-theme="dark"] .talk span,html[data-theme="dark"] .overview-icon,html[data-theme="dark"] .tool-icon,html[data-theme="dark"] .contact-accent{color:#8b5cf6}
html[data-theme="dark"] .ring{border-color:#7c3aed}html[data-theme="dark"] .ring-two{border-color:#5b21b6}
html[data-theme="dark"] .photo-area:before,html[data-theme="dark"] .photo-area:after,html[data-theme="dark"] .brand-mark{background:linear-gradient(145deg,#1d1528,#3b1d63)}
html[data-theme="dark"] .secondary,html[data-theme="dark"] .project-actions a{border-color:#7c3aed}
html[data-theme="dark"] .tech-badges span:hover{border-color:#7c3aed;box-shadow:0 9px 22px rgba(91,33,182,.24)}
html[data-theme="dark"] .badge{background:#5b21b6;color:#fff;border:1px solid #7c3aed;box-shadow:0 8px 20px rgba(0,0,0,.28)}
html[data-theme="dark"] .message-form input:focus,html[data-theme="dark"] .message-form textarea:focus{border-color:#7c3aed;box-shadow:0 0 0 4px rgba(91,33,182,.22)}
html[data-theme="dark"] :focus-visible{outline-color:#7c3aed}
html[data-theme="dark"] .certificate-nav{background:#090b0d;border-color:#090b0d;color:#fff}
html[data-theme="dark"] .certificate-nav:hover{background:#5b21b6;border-color:#5b21b6}

/* Full project reader in dark mode */
html[data-theme="dark"] .dialog-header{background:#171320}
html[data-theme="dark"] .dialog-header .dialog-label{background:#292232;color:#d8d0e2}
html[data-theme="dark"] .dialog-close{background:#292431;color:#fff}
html[data-theme="dark"] .dialog-close:hover{background:#373040}
html[data-theme="dark"] .dialog-body{scrollbar-color:#665b74 transparent}
html[data-theme="dark"] .dialog-loading{color:#b9b1c8}
html[data-theme="dark"] .dialog-readme{color:#c5bdd1}
html[data-theme="dark"] .dialog-readme>h1,html[data-theme="dark"] .dialog-readme h2,html[data-theme="dark"] .dialog-readme h3,html[data-theme="dark"] .dialog-readme h4,html[data-theme="dark"] .dialog-readme strong{color:#fff}
html[data-theme="dark"] .dialog-readme>h1,html[data-theme="dark"] .dialog-readme h2{border-color:#3d3450}
html[data-theme="dark"] .dialog-readme a{color:#bda0ff}html[data-theme="dark"] .dialog-readme a:hover{color:#ded0ff}
html[data-theme="dark"] .dialog-readme img{border-color:#493d5e;box-shadow:0 12px 28px rgba(0,0,0,.32)}
html[data-theme="dark"] .dialog-readme th,html[data-theme="dark"] .dialog-readme td{border-color:#493d5e}html[data-theme="dark"] .dialog-readme th{background:#241f2e;color:#fff}
html[data-theme="dark"] .dialog-readme code,html[data-theme="dark"] .dialog-readme pre{background:#100d18;color:#e9e3f0;border-color:#493d5e}
html[data-theme="dark"] .dialog-readme blockquote{border-color:#7c3aed;background:#211a2d;color:#c9c1d5}
html[data-theme="dark"] .dialog-toc{background:#211a2d;border-color:#493d5e}
html[data-theme="dark"] .dialog-gallery{border-color:#3d3450}html[data-theme="dark"] .dialog-gallery h3{color:#fff}html[data-theme="dark"] .dialog-gallery figure{background:#211a2d;border-color:#493d5e}html[data-theme="dark"] .dialog-gallery a{background:#100d18}html[data-theme="dark"] .dialog-gallery figcaption{color:#eee8f5}
html[data-theme="dark"] .resume-dialog{background:#171320;border-color:#342d43;color:#f5f2fb}html[data-theme="dark"] .resume-dialog header,html[data-theme="dark"] .resume-dialog footer{background:#171320;border-color:#342d43}html[data-theme="dark"] .resume-dialog header p{background:#292232;color:#d8d0e2}html[data-theme="dark"] .resume-dialog header h2{color:#fff}html[data-theme="dark"] .resume-dialog-close{background:#292431;color:#fff}html[data-theme="dark"] .resume-dialog-close:hover{background:#373040}html[data-theme="dark"] .resume-frame{background:#100d18}
html[data-theme="dark"] .certificate-dialog{background:#171320;border-color:#3b324b;color:#f5f2fb}html[data-theme="dark"] .certificate-dialog-preview{background:#100d18}html[data-theme="dark"] .certificate-dialog-close{background:#292431;color:#fff}html[data-theme="dark"] .certificate-dialog-title{color:#fff}html[data-theme="dark"] .certificate-dialog-copy>p,html[data-theme="dark"] .certificate-dialog-skills-block>b{color:#c7bfd1}html[data-theme="dark"] .certificate-dialog-skills-block{border-color:#3b324b}html[data-theme="dark"] .certificate-dialog-skills span{background:#241d30;border-color:#463b58;color:#f4f0fa}html[data-theme="dark"] .certificate-dialog-issuer{background:#5b21b6}
