.fonts {
    font-family: 'Roobert Medium';
    font-family: "Italianno", cursive;
    font-family: "Geist Pixel", sans-serif;
    font-family: "Space Grotesk", sans-serif;
    font-family: "Fraunces", serif;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --border-primary: #2a2a2a;
    --border-secondary: #3a3a3a;

    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-tertiary: #c0c0c0;
    --text-muted: #a0a0a0;

    --accent-from: #5c5cff;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    --title-font: ;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e5e5e5;
    --border-primary: #e0e0e0;
    --border-secondary: #d0d0d0;

    --text-primary: #0a0a0a;
    --text-secondary: #1a1a1a;
    --text-tertiary: #404040;
    --text-muted: #666666;

    --accent-from: #1818ff;

}

html {
    scrollbar-gutter: stable;
    background: var(--bg-primary);
}

::selection {
    background-color: var(--accent-from);
    color: white;
}

::-moz-selection {
    background-color: var(--accent-from);
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-weight: 400;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: -2;
    transition: background-color var(--transition-slow);
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
}

::view-transition-new(root) {
    z-index: 9999;
}

::view-transition-old(root) {
    z-index: 1;
}

.blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: 9999;
    pointer-events: none;

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    mask-image: linear-gradient(to bottom,
            black 0%,
            black 10%,
            transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom,
            black 0%,
            black 10%,
            transparent 100%);

    opacity: 0;
    transition: opacity 0.5s ease;
}

.blur-overlay.visible {
    opacity: 1;
}

.container {
    max-width: 40%;
    width: 100%;
    position: relative;
    z-index: 1;
}

.container>*:not(.dock) {
    opacity: 0;
    transform: translateY(10px);
    animation: itemFade 0.5s ease-out forwards;
    animation-delay: calc(var(--i) * 0.2s);
}

@keyframes itemFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    margin-top: 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-family: var(--title-font);
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.header-text p {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.theme-toggle {
    margin-left: auto;
    display: flex;
}

.theme-sound {
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
}

.theme-theme {
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
}

.theme-btn {
    width: 35px;
    height: 35px;
    background-color: var(--bg-secondary);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.theme-btn svg {
    width: 15px;
    height: 15px;
}

.theme-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.music-note {
    width: 7px;
    color: var(--accent-from);
}

.music-note.last-listened {
    color: var(--text-muted) !important;
}

.music-content {
    margin-top: 1px;
    color: var(--text-muted);
    font-size: 0.87rem;
}

.music-content-bold {
    color: var(--text-primary);
}

.music-container {
    display: flex;
    gap: 7px;
    margin-bottom: 0.5rem;
}

.content {
    line-height: 1.8;
    font-size: 0.90rem;
    color: var(--text-tertiary);
    letter-spacing: 0.01em;
}

@media (max-width: 996px) {
    .music-note {
        width: 6px;
    }

    .music-content {
        font-size: 0.65rem !important;
    }

    .content p {
        font-size: 0.85rem;
    }
}

.social-links {
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-links svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.social-btn:hover {
    color: var(--text-primary);
}

.social-btn {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.social-btn {
    min-height: 2.5rem;
    max-height: 2.5rem;
    padding: 0.50rem 0.85rem;
    background-color: var(--bg-secondary);
    border-radius: 25px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.80rem;
    display: flex;
    align-items: center;
    gap: 0.30rem;
    transition: all var(--transition-base);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.social-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

.icon {
    width: 15px;
    height: 15px;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-fast);
}

/* Accessibility */
.theme-btn:focus-visible,
.social-btn:focus-visible,
.project-card:focus-visible,
.link-to:focus-visible,
.tx-banner:focus-visible,
.cy-banner:focus-visible {
    z-index: 2;
    outline: 2px solid var(--accent-from);
    outline-offset: 2px;
}

.settings-btn {
    display: none !important;
}

/* Responsive */
@media (max-width: 1321px) {
    body {
        padding: 1.5rem;
    }

    .container {
        max-width: 80%;
    }
}

@media (max-width: 996px) {
    body {
        padding: 1.5rem;
    }

    .container {
        max-width: 90%;
    }
}

@media (max-width: 640px) {
    .header-text h1 {
        font-size: 2rem;
    }

    .content {
        font-size: 1rem;
    }

    .social-links {
        gap: 0.5rem;
    }

    .social-btn {
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .header {
        margin-bottom: 2rem;
    }

    .header-text h1 {
        font-size: 1.75rem;
    }

    .profile-pic {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .social-links {
        display: inline-grid;
        grid-template-columns: repeat(3, auto);
    }
}

@media (max-width: 360px) {
    .social-links {
        display: inline-grid;
        grid-template-columns: repeat(2, auto);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {

    .social-btn,
    .theme-btn {
        border-width: 2px;
    }
}

.projects-section {
    margin-top: 2rem;
}

.section-title {
    font-family: var(--title-font);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 2rem;
    letter-spacing: 0.01em;
}

@media (max-width: 640px) {
    .section-title {
        font-size: 2rem;
    }

    .thoughts-section-title {
        font-size: 2rem;
    }

    .projects-section {
        margin-top: 3rem;
    }
}

.link-to {
    border-radius: 5px;
    float: right;
    margin-top: 1.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.link-to:hover {
    color: var(--text-tertiary);
}

.starfield-container {
    margin-top: 2rem;
    min-height: 100px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.starfield-container {
    margin-top: 4rem;
}

.footer-wrapper {
    overflow-x: hidden;
    position: relative;
}

.site-footer {
    position: relative;
    margin-top: 20px;
    border-top: 1px solid var(--border-primary);
    padding: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 120px;
    /* length of the glowing bar */
    height: 1px;
    background: var(--text-primary);
    animation: footer-loading-bar 3.5s linear infinite;
}

@keyframes footer-loading-bar {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(calc(100vw + 120px));
    }
}

.footer-left img {
    height: 28px;
    width: auto;
    transition: opacity var(--transition-fast);
}

.footer-right {
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .site-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
}

.tx-banner {
    margin-top: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100px;
    padding-left: 20px;
    border-radius: 16px;
    background-color: #000000;
    background-image:
        radial-gradient(circle farthest-side at right center,
            #106ae9 0%,
            #0f66e6 1.1%,
            #0c60e1 4.3%,
            #0b57d5 7.5%,
            #084cc3 10.7%,
            #0943b4 13.9%,
            #083ba3 17.1%,
            #053192 20.3%,
            #042b81 23.4%,
            #042474 26.6%,
            #042067 29.8%,
            #031b59 33.0%,
            #02164a 36.2%,
            #021342 39.4%,
            #020f38 42.6%,
            #020d30 45.8%,
            #020b27 49.0%,
            #000720 52.2%,
            #01061a 55.3%,
            #010415 58.5%,
            #000310 61.7%,
            #00030c 64.9%,
            #010208 68.1%,
            #000005 71.3%,
            #010104 74.5%,
            #000002 77.7%,
            #010001 80.9%,
            #000000 84.1%);
    border: 0.5px solid var(--border-primary);
    text-decoration: none;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

[data-theme="light"] .tx-banner {
    background-image:
        radial-gradient(circle farthest-side at right center,
            #106ae9 0%,
            #2879ea 4.3%,
            #4189ec 10.7%,
            #5998ee 17.1%,
            #71a7ef 23.4%,
            #89b6f1 29.8%,
            #a1c5f3 36.2%,
            #b9d4f5 42.6%,
            #c8ddf6 49.0%,
            #d6e4f8 55.3%,
            #e4ecfa 61.7%,
            #eef3fc 68.1%,
            #f5f8fd 74.5%,
            #fbfcfe 80.9%,
            #ffffff 100%);
}

.tx-image {
    opacity: .5;
    filter: blur(2px);
    transition: all .4s ease-in-out;
}

.tx-banner:hover {
    border-color: var(--border-secondary);
}

.tx-banner::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22px;
    bottom: 22px;
    width: 2px;
    background: var(--accent-from);
}

.tx-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-eyebrow {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tx-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
}

.tx-cta svg {
    transition: transform 0.2s ease;
}

.tx-banner:hover .tx-cta svg {
    transform: translate(2px, -2px);
}

.tx-image {
    height: 200px;
    display: flex;
    align-items: center;
    /* vertical centering */
    justify-content: center;
    /* optional: horizontal centering too */
}

.tx-image img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.on-desktop-x {
    height: 85px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

/* Desktop hint */
.search-hint {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.search-hint kbd {
    font-family: inherit;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
}

.search-hint-text {
    margin-left: 0.25rem;
}

/* Mobile / touch button (hidden by default) */
.search-trigger {
    display: none;
    align-items: center;
    gap: 0.4rem;
    height: 2.2rem;
    padding: 0 0.85rem;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 25px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.search-trigger svg {
    width: 15px;
    height: 15px;
}

.search-trigger:hover,
.search-trigger:active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-trigger:focus-visible {
    outline: 2px solid var(--accent-from);
    outline-offset: 2px;
}

/* Touch devices / small screens: swap hint for button */
@media (hover: none),
(pointer: coarse),
(max-width: 640px) {
    .search-hint {
        display: none;
    }

    .search-trigger {
        display: flex;
    }
}