:root {
    color-scheme: dark;
    --bg: #090907;
    --surface: rgba(18, 18, 15, 0.88);
    --surface-strong: #151510;
    --surface-soft: rgba(255, 255, 255, 0.045);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.2);
    --text: #f4f7fb;
    --muted: #9da8b5;
    --subtle: #6f7a87;
    --accent: #7bd6c5;
    --accent-strong: #e8b95e;
    --good: #9be28e;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --radius: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(9, 9, 7, 0.9) 0%, #090907 44%),
        radial-gradient(circle at top left, rgba(123, 214, 197, 0.14), transparent 34%),
        var(--bg);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    line-height: 1.5;
    letter-spacing: 0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;
    opacity: 0.36;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #090907;
}

::-webkit-scrollbar-thumb {
    background: #29313a;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4652;
}

.background-slideshow,
.background-overlay {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.revealed .background-slideshow,
body.revealed .background-overlay {
    opacity: 1;
}

.background-slideshow {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    filter: saturate(0.9) contrast(1.06) brightness(0.46) blur(2px);
    transform: scale(1.04);
}

.slide.active {
    opacity: 0.52;
}

.background-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(9, 9, 7, 0.92) 0%, rgba(9, 9, 7, 0.72) 52%, rgba(9, 9, 7, 0.9) 100%),
        linear-gradient(180deg, rgba(9, 9, 7, 0.08), #090907 78%);
}

.container,
.music-player {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

body.revealed .container,
body.revealed .music-player {
    visibility: visible;
    opacity: 1;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 42px;
}

#home,
#skills,
#projects,
#connect {
    scroll-margin-top: 110px;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 760;
    font-size: 1rem;
}

.logo-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.76rem;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.04);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 620;
    padding: 8px 10px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.hero {
    min-height: min(540px, calc(100vh - 120px));
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    align-items: center;
    gap: 58px;
    padding: 16px 0 34px;
}

.hero-content {
    max-width: 690px;
}

.eyebrow,
.section-kicker {
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.eyebrow {
    margin-bottom: 20px;
}

.hero h1 {
    max-width: 760px;
    font-size: clamp(3rem, 6.5vw, 5.8rem);
    line-height: 0.94;
    font-weight: 820;
    letter-spacing: 0;
    text-wrap: balance;
}

.hero-copy {
    max-width: 600px;
    margin-top: 26px;
    color: #c9d1da;
    font-size: clamp(1.03rem, 1.6vw, 1.22rem);
}

.hero-actions,
.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.hero-actions {
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 7px;
    color: var(--text);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.055);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 700;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.085);
}

.btn-primary {
    color: #061017;
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: #a5e1ff;
    border-color: #a5e1ff;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 620px;
    margin-top: 34px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stat-item {
    padding: 18px 18px 18px 0;
}

.stat-item + .stat-item {
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.stat-number {
    display: block;
    color: var(--text);
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    font-weight: 820;
    line-height: 1;
}

.stat-label {
    margin-top: 8px;
    color: var(--subtle);
    font-size: 0.82rem;
}

.hero-visual {
    position: relative;
    min-width: 0;
}

.terminal-card {
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(9, 12, 15, 0.92);
    box-shadow: var(--shadow);
}

.terminal-topbar {
    display: flex;
    gap: 7px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.terminal-topbar span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4a5561;
}

.terminal-body {
    display: grid;
    gap: 12px;
    padding: clamp(20px, 4vw, 34px);
    color: #d7dee8;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: clamp(0.8rem, 1.5vw, 0.98rem);
}

.terminal-body div {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-body div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.muted {
    color: var(--subtle);
    margin-right: 10px;
}

.success {
    color: var(--good);
    margin-right: 10px;
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.signal-grid span {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.86fr);
    gap: 16px;
    margin-bottom: 84px;
}

.panel,
.project-card,
.contact-area {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.panel {
    padding: clamp(22px, 3vw, 34px);
}

.section-heading {
    margin-bottom: 24px;
}

.section-heading.centered {
    text-align: center;
}

.section-heading h2 {
    max-width: 660px;
    margin-top: 8px;
    font-size: clamp(1.55rem, 3vw, 2.5rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: 0;
}

.centered h2 {
    margin-inline: auto;
}

.about-text {
    display: grid;
    gap: 14px;
    color: #c4ccd6;
    font-size: 1rem;
}

.highlight-quote {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--accent-strong);
    font-size: 1.05rem;
    font-weight: 700;
}

.review-content {
    min-height: 190px;
}

.review-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.review-avatar {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line-strong);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.review-avatar:hover {
    transform: translateY(-1px);
    border-color: rgba(114, 208, 255, 0.62);
}

.review-person {
    color: var(--text);
    font-weight: 800;
}

.review-role {
    margin-top: 2px;
    color: var(--subtle);
    font-size: 0.82rem;
}

.review-text {
    margin-top: 14px;
    color: #cbd3dc;
    font-size: 0.95rem;
}

.review-empty {
    display: grid;
    min-height: 130px;
    place-items: center;
    color: var(--subtle);
}

.skills-section,
.projects-section {
    margin-bottom: 84px;
}

.skills-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 820px;
    margin: 0 auto;
}

.skill-tag {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 12px;
    color: #cfd7df;
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.9rem;
    font-weight: 680;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.project-card {
    min-height: 230px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(114, 208, 255, 0.38);
    background: rgba(18, 23, 29, 0.94);
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.project-meta span {
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.project-meta a {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.project-meta a:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.project-card h3 {
    font-size: 1.35rem;
    line-height: 1.12;
    margin-bottom: 12px;
}

.project-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

.contact-section {
    margin-bottom: 64px;
}

.contact-area {
    padding: clamp(26px, 5vw, 46px);
    text-align: center;
}

.contact-area .section-kicker {
    display: block;
    margin-bottom: 12px;
}

.contact-area h2 {
    max-width: 760px;
    margin: 0 auto;
    font-size: clamp(1.7rem, 4vw, 3.1rem);
    line-height: 1.04;
    font-weight: 820;
}

.contact-area p {
    max-width: 560px;
    margin: 16px auto 0;
    color: var(--muted);
}

.contact-buttons {
    justify-content: center;
    margin-top: 26px;
}

.command-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    margin-top: 28px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: #bfc8d2;
    background: rgba(0, 0, 0, 0.24);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

footer {
    padding-top: 26px;
    border-top: 1px solid var(--line);
    color: var(--subtle);
    text-align: center;
    font-size: 0.82rem;
}

.music-player {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    display: inline-block;
    width: auto;
    border-radius: 8px;
    background: rgba(9, 12, 15, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
}

.music-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
}

.music-details {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.25s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.music-player:hover .music-details,
.music-player:focus-within .music-details {
    max-width: 340px;
    opacity: 1;
    pointer-events: auto;
}

.music-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #061017;
    background: var(--accent);
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.music-btn:hover {
    background: #a5e1ff;
    transform: translateY(-1px);
}

.music-btn.muted {
    color: var(--muted);
    background: #23241f;
}

.music-name {
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.055);
}

.volume-icon {
    color: var(--muted);
    font-size: 0.72rem;
}

.volume-slider {
    width: 88px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #303842;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #303842;
    border-radius: 4px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -4px;
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    background: #303842;
    border-radius: 4px;
}

.volume-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.click-to-enter,
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(12, 12, 9, 0.94), #090907),
        var(--bg);
}

.click-to-enter {
    cursor: pointer;
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.click-content {
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

.click-logo,
.intro-logo {
    color: var(--text);
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 850;
    letter-spacing: 0;
}

.click-logo {
    margin-bottom: 24px;
}

.click-line {
    width: 76px;
    height: 1px;
    margin: 0 auto 18px;
    background: var(--line-strong);
    animation: expandLine 1.4s ease infinite;
}

.click-text {
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem;
    font-weight: 800;
}

.click-arrow {
    margin-top: 14px;
    color: var(--muted);
    animation: bounce 1.2s ease infinite;
}

.intro-overlay {
    z-index: 9999;
    flex-direction: column;
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-logo {
    margin-bottom: 22px;
    animation: pulseLogo 1.2s ease infinite alternate;
}

.intro-terminal {
    max-width: calc(100% - 36px);
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 14px;
    color: #d7dee8;
    background: rgba(255, 255, 255, 0.045);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.92rem;
}

.intro-progress {
    width: min(260px, calc(100% - 48px));
    height: 3px;
    margin-top: 24px;
    overflow: hidden;
    border-radius: 4px;
    background: #202832;
}

.intro-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.1s linear;
}

.glitch-text {
    animation: pulseLogo 1.2s ease infinite alternate;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes expandLine {
    0%, 100% {
        width: 50px;
        opacity: 0.5;
    }
    50% {
        width: 120px;
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.55;
    }
    50% {
        transform: translateY(7px);
        opacity: 1;
    }
}

@keyframes pulseLogo {
    from {
        opacity: 0.55;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .container {
        width: min(100% - 28px, 1180px);
    }

    .navbar {
        align-items: flex-start;
        margin-bottom: 34px;
    }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 34px;
        padding-bottom: 64px;
    }

    .hero-visual {
        max-width: 620px;
    }

    .about-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 1180px);
        padding-top: 12px;
    }

    .navbar {
        position: static;
        flex-direction: column;
        gap: 14px;
    }

    .nav-links {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
    }

    .nav-links a {
        text-align: center;
        padding-inline: 4px;
        font-size: 0.82rem;
    }

    .hero h1 {
        font-size: clamp(2.45rem, 13vw, 3.45rem);
        line-height: 0.98;
    }

    .hero-copy {
        margin-top: 20px;
    }

    .stats-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stat-item,
    .stat-item + .stat-item {
        padding: 13px 8px 13px 0;
        border-left: 0;
    }

    .stat-item + .stat-item {
        padding-left: 8px;
        border-top: 0;
        border-left: 1px solid var(--line);
    }

    .stat-number {
        font-size: 1.55rem;
    }

    .stat-label {
        font-size: 0.74rem;
    }

    .hero-actions,
    .contact-buttons {
        align-items: stretch;
    }

    .btn {
        flex: 1 1 100%;
    }

    .panel,
    .project-card,
    .contact-area {
        padding: 20px;
    }

    .review-card {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 12px;
    }

    .review-avatar {
        width: 44px;
        height: 44px;
    }

    .signal-grid {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        display: none;
    }

    .music-player {
        right: 12px;
        top: 12px;
        bottom: auto;
        max-width: calc(100% - 24px);
    }

    .music-player:hover .music-details,
    .music-player:focus-within .music-details {
        max-width: calc(100vw - 88px);
    }

    .volume-control {
        display: none;
    }
}
