/* Clean Macbook Mouse Cursor Styling */
html, body, *, video, div, section, main {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 3.5v15.8l4.6-4.6 3.4 7.8 2.8-1.2-3.3-7.7 6.1-.5L4.5 3.5z' fill='%23000000' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, auto !important;
}

a, button, .cursor-pointer, .magnetic-btn, input[type="button"], #overlay-text {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 2a2 2 0 0 1 2 2v7.5a.5.5 0 0 0 1 0V4a2 2 0 1 1 4 0v7.5a.5.5 0 0 0 1 0V6a2 2 0 1 1 4 0v8a8 8 0 0 1-8 8h-1a8 8 0 0 1-8-8v-6.5a2 2 0 0 1 4 0v4a.5.5 0 0 0 1 0V4a2 2 0 0 1 2-2z' fill='%23000000' stroke='%23ffffff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 6 2, pointer !important;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
    background-color: #000;
}

html.home-page, body.home-page {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

#background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -100; 
    object-fit: cover; 
    pointer-events: none;
    filter: brightness(0.35) contrast(1.1);
    transition: filter 0.5s ease;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 100;
    opacity: 1;
}

.fading-out {
    animation: fadeOut 1.5s ease-out forwards;
}

#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

body.home-page #main-content-container {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pinch-zoom;
    scroll-behavior: smooth;
}

body.home-page #main-section, body.home-page #second-section {
    min-height: 100%;
}

.Typewriter__cursor {
    color: #a0aec0; 
}

#second-section {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

#second-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

#music-player {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem; 
    translate: 0 200%;
    opacity: 0;
    transition: opacity 0.5s ease-out, translate 0.5s ease-out;
    pointer-events: none;
}

#music-player.is-visible {
    translate: 0 0;
    opacity: 1;
    pointer-events: auto;
}

/* Interactive Magnetic & Tilt GUI Effects */
.magnetic-btn {
    transform: var(--motion-transform, none);
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    transition-property: box-shadow, border-color, background-color, color, opacity, translate !important;
    will-change: transform;
    transform-style: preserve-3d;
}

.tilt-card {
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
}

.tilt-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    background: radial-gradient(500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.08), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.tilt-card:hover::before {
    opacity: 1;
}

.social-icon-btn {
    flex-shrink: 0;
}

.social-icon-btn:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

.profile-card-footer {
    display: flex;
    justify-content: center;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-privacy-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.profile-privacy-button:hover {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.profile-privacy-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

#second-section {
    min-height: 100svh;
    padding: 64px 16px 96px;
}

.projects-panel {
    width: 100%;
    max-width: 512px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: rgba(12, 12, 14, 0.68);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.projects-nav, .projects-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.projects-back, .projects-privacy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    transition: color 0.2s ease;
}

.projects-back:hover, .projects-privacy:hover {
    color: #fff;
}

.projects-heading {
    margin: 26px 0 22px;
}

.projects-heading h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.2;
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.16);
}

.projects-heading p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

.projects-list {
    display: grid;
    gap: 10px;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.project-link:hover {
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.project-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
}

.project-details {
    flex: 1;
    min-width: 0;
}

.project-details h3 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.project-details p {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
}

.project-arrow {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
    transition: color 0.2s ease;
}

.project-link:hover .project-arrow {
    color: #fff;
}

.projects-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.projects-back:focus-visible, .projects-privacy:focus-visible, .project-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 4px;
    border-radius: 8px;
}

@media (max-width: 480px) {
    .projects-panel { padding: 22px 18px; }
    .project-link { gap: 12px; padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    #second-section, .project-link, .project-arrow, .projects-back, .projects-privacy {
        transition: none;
    }
    #second-section .magnetic-btn { transform: none !important; }
}

/* Pure White Glitter Particles & White Profile Glow */
.glitter-profile-card {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.12), 0 0 70px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.glitter-profile-card:hover {
    box-shadow: 0 0 45px rgba(255, 255, 255, 0.25), 0 0 90px rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.45);
}

.glitter-particle {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.9), 0 0 12px 4px rgba(255, 255, 255, 0.6);
    animation: glitterSparkle var(--duration, 2.5s) ease-in-out infinite var(--delay, 0s);
    z-index: 1;
}

@keyframes glitterSparkle {
    0%, 100% {
        opacity: 0.15;
        transform: scale(0.4) translateY(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.4) translateY(-5px);
        box-shadow: 0 0 10px 3px rgba(255, 255, 255, 1), 0 0 22px 7px rgba(255, 255, 255, 0.8);
    }
}

/* Tools use the same portfolio components, with scrollable content. */
body.tools-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100svh;
    padding: 48px 24px;
    overflow-y: auto;
    color: #f5f5f5;
}

.tool-shell { width: 100%; max-width: 640px; }
.tool-shell-wide { width: 100%; max-width: 960px; }
.tools-page .tool-shell .tool-panel, .tools-page .tool-shell-wide .tool-panel { max-width: none; }
.tools-page .tool-panel > :not(.tool-glitter) { position: relative; z-index: 2; }
.tool-glitter { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }

.tools-heading { margin: 26px 0 24px; }
.tools-page h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.25;
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.16);
}
.tools-description { margin-top: 8px; color: rgba(255, 255, 255, 0.55); font-size: 12px; line-height: 1.6; }
.tool-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.2); margin-bottom: 16px; }
.tools-page .tool-input {
    min-width: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
}
.tools-page .tool-input:focus { border-color: rgba(255, 255, 255, 0.35); outline: 2px solid rgba(255, 255, 255, 0.15); outline-offset: 2px; }
.tools-page .tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
}
.tools-page .tool-button:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.3); }
.tools-page .tool-button:disabled { opacity: 0.5; }
.tools-page a:focus-visible, .tools-page button:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 4px; }
.tool-result { padding: 18px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); }
.tools-page .code-block { background: rgba(0, 0, 0, 0.2); color: #d1d5db; white-space: pre; overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid rgba(255, 255, 255, 0.06); font-family: ui-monospace, monospace; }
.code-block .key { color: #c4b5fd; }
.code-block .string { color: #86efac; }
.code-block .number { color: #fdba74; }
.code-block .boolean { color: #93c5fd; }
.code-block .null { color: #fca5a5; }
.code-block p { white-space: normal; font-family: 'Space Grotesk', sans-serif; }
.tools-page .info-item { padding: 14px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; background: rgba(255, 255, 255, 0.035); }
.tools-page .info-item p:first-child { font-size: 11px; color: rgba(255, 255, 255, 0.5); }
.tools-page .info-item p:last-child { margin-top: 5px; font-size: 14px; }
.loading-placeholder { display: inline-block; width: 100px; height: 1.25rem; background: rgba(255, 255, 255, 0.08); border-radius: 6px; animation: loadingPulse 2s ease-in-out infinite; }
@keyframes loadingPulse { 50% { opacity: 0.45; } }
.speedtest-frame { width: 100%; height: 460px; border: 0; border-radius: 14px; background: #111; }

@media (max-width: 480px) {
    body.tools-page { padding: 32px 20px; }
    .tools-page h1 { font-size: 25px; }
    .tool-result { padding: 12px; }
    .speedtest-frame { height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
    .tools-page .magnetic-btn { transform: none !important; }
    .tools-page .glitter-particle, .loading-placeholder { animation: none; }
}
