:root {
    color-scheme: dark;
    --background: #12100e;
    --surface-hover: #241d17;
    --primary: #b87432;
    --primary-light: #d99a58;
    --text: #fff7ef;
    --muted: #bcae9f;
    --border: rgba(184, 116, 50, 0.24);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 8%, rgba(184, 116, 50, 0.17), transparent 28rem),
        radial-gradient(circle at 92% 48%, rgba(184, 116, 50, 0.1), transparent 24rem),
        var(--background);
    color: var(--text);
    font-family: "Manrope", sans-serif;
    line-height: 1.6;
}

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

a {
    color: inherit;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 64px;
}

.profile {
    position: relative;
    display: grid;
    min-height: 520px;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: clamp(36px, 7vw, 84px);
    padding: 64px clamp(24px, 5vw, 64px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 36px;
    background: linear-gradient(135deg, rgba(38, 29, 22, 0.94), rgba(21, 18, 15, 0.96));
    box-shadow: var(--shadow);
}

.profile::after {
    position: absolute;
    right: -100px;
    bottom: -130px;
    width: 290px;
    height: 290px;
    border: 60px solid rgba(184, 116, 50, 0.08);
    border-radius: 50%;
    animation: halo-drift 12s ease-in-out infinite alternate;
    content: "";
    will-change: transform;
}

.avatar-wrap {
    position: relative;
    z-index: 1;
}

.avatar-wrap::before {
    position: absolute;
    inset: -10px;
    z-index: -1;
    border: 1px solid rgba(217, 154, 88, 0.42);
    border-radius: 32px;
    animation: frame-tilt 6s ease-in-out infinite;
    content: "";
    transform: rotate(5deg);
}

.avatar {
    display: block;
    width: 220px;
    aspect-ratio: 1;
    border: 3px solid rgba(217, 154, 88, 0.72);
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    object-fit: cover;
    transition: transform 250ms ease;
}

.avatar:hover {
    transform: translateY(-4px);
}

.profile-info {
    z-index: 1;
    min-width: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--primary-light);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow::before {
    width: 24px;
    height: 2px;
    background: var(--primary);
    content: "";
}

h1 {
    max-width: 700px;
    font-size: clamp(2.7rem, 7vw, 5.6rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.98;
}

.accent {
    color: var(--primary);
}

.intro {
    max-width: 590px;
    margin-top: 24px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.13rem);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.button {
    position: relative;
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button-icon {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

.button:hover,
.button:focus-visible {
    border-color: var(--primary);
    outline: none;
    background: var(--primary);
    transform: translateY(-2px);
}

.button-primary {
    border-color: var(--primary);
    background: var(--primary);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: #c17d38;
}

.music-section {
    --reveal-delay: 80ms;
    padding-top: 24px;
}

.music-card {
    position: relative;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(38, 29, 22, 0.94), rgba(21, 18, 15, 0.96));
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    color: inherit;
    text-decoration: none;
    transition: border-color 180ms ease, transform 180ms ease;
}

.music-card::after,
.project-card::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(217, 154, 88, 0.08) 50%, transparent 65%);
    content: "";
    pointer-events: none;
    transform: translateX(-110%);
    transition: transform 650ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.music-card:hover::after,
.music-card:focus-visible::after,
.project-card:hover::before {
    transform: translateX(110%);
}

.music-card:hover,
.music-card:focus-visible {
    border-color: rgba(184, 116, 50, 0.7);
    outline: none;
    transform: translateY(-3px);
}

.music-cover-wrap {
    position: relative;
    display: grid;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border-radius: 17px;
    background: rgba(184, 116, 50, 0.12);
    color: var(--primary-light);
    place-items: center;
}

.music-cover-wrap > .material-symbols-rounded {
    font-size: 2rem;
}

.music-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 450ms ease;
}

.music-cover.loaded {
    display: block;
}

.music-card:hover .music-cover {
    transform: scale(1.06);
}

.music-info {
    min-width: 0;
}

.music-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    color: var(--primary-light);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.music-status::before {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(184, 116, 50, 0.12);
    content: "";
}

.music-status.is-playing::before {
    animation: pulse 1.8s ease-out infinite;
}

.music-title {
    overflow: hidden;
    color: var(--text);
    font-size: clamp(1.08rem, 3vw, 1.35rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-artist {
    overflow: hidden;
    margin-top: 2px;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-arrow {
    display: grid;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--primary-light);
    place-items: center;
    transition: background 180ms ease, transform 180ms ease;
}

.music-card:hover .music-arrow,
.music-card:focus-visible .music-arrow {
    background: rgba(184, 116, 50, 0.12);
    transform: translate(2px, -2px);
}

.js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms ease var(--reveal-delay, 0ms), transform 600ms cubic-bezier(0.2, 0.75, 0.25, 1) var(--reveal-delay, 0ms);
}

.projects {
    padding-top: 72px;
    scroll-margin-top: 24px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.section-heading h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.section-heading p {
    max-width: 360px;
    color: var(--muted);
    text-align: right;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.project-card:nth-child(2) { --reveal-delay: 80ms; }
.project-card:nth-child(3) { --reveal-delay: 160ms; }
.project-card:nth-child(4) { --reveal-delay: 240ms; }

.project-card {
    position: relative;
    display: flex;
    min-height: 300px;
    flex-direction: column;
    padding: clamp(24px, 4vw, 34px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(33, 27, 22, 0.96), rgba(24, 20, 17, 0.96));
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
    contain-intrinsic-size: auto 320px;
    content-visibility: auto;
    transition: background 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.project-card > * {
    position: relative;
    z-index: 1;
}

.project-card:hover,
.js .project-card.is-visible:hover {
    border-color: rgba(184, 116, 50, 0.7);
    background: var(--surface-hover);
    transform: translateY(-5px);
}

.project-icon {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 30px;
    border: 1px solid rgba(184, 116, 50, 0.34);
    border-radius: 14px;
    background: rgba(184, 116, 50, 0.12);
    color: var(--primary-light);
    font-size: 1.15rem;
    place-items: center;
    transition: background 220ms ease, transform 350ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.project-card:hover .project-icon {
    background: rgba(184, 116, 50, 0.2);
    transform: rotate(-4deg) scale(1.08);
}

.material-symbols-rounded {
    font-size: 1.45rem;
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.node-logo img {
    display: block;
    width: 23px;
    height: 37px;
}

.project-card h3 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.4rem;
    letter-spacing: -0.025em;
}

.project-card p {
    color: var(--muted);
}

.project-card .actions {
    margin-top: auto;
    padding-top: 26px;
}

.project-card .button {
    min-height: 44px;
    padding: 9px 15px;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(184, 116, 50, 0.48); }
    70%, 100% { box-shadow: 0 0 0 8px rgba(184, 116, 50, 0); }
}

@keyframes frame-tilt {
    0%, 100% { transform: rotate(5deg) scale(1); }
    50% { transform: rotate(2deg) scale(1.015); }
}

@keyframes halo-drift {
    from { transform: translate3d(0, 0, 0) rotate(0); }
    to { transform: translate3d(-38px, -25px, 0) rotate(18deg); }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 28px, 600px);
        padding-top: 14px;
    }

    .profile {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 44px 24px;
        border-radius: 28px;
        text-align: center;
    }

    .avatar-wrap {
        width: 168px;
        margin: 0 auto;
    }

    .avatar {
        width: 168px;
        border-radius: 24px;
    }

    .avatar-wrap::before {
        border-radius: 27px;
    }

    .eyebrow {
        justify-content: center;
    }

    h1 {
        margin: 0 auto;
        font-size: clamp(2.55rem, 14vw, 4.2rem);
    }

    .intro {
        margin-right: auto;
        margin-left: auto;
    }

    .actions {
        justify-content: center;
    }

    .projects {
        padding-top: 54px;
    }

    .section-heading {
        display: block;
        text-align: center;
    }

    .section-heading p {
        margin: 12px auto 0;
        text-align: center;
    }

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

    .project-card {
        min-height: 280px;
    }
}

@media (max-width: 430px) {
    .profile {
        padding: 38px 18px;
    }

    .profile .actions,
    .profile .button,
    .project-card .actions,
    .project-card .button {
        width: 100%;
    }

    .project-card {
        min-height: 0;
        padding: 24px 20px;
        border-radius: 22px;
    }

    .project-icon {
        margin-bottom: 22px;
    }

    .music-card {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 15px;
        padding: 14px;
        border-radius: 20px;
    }

    .music-cover-wrap {
        width: 68px;
        height: 68px;
        border-radius: 14px;
    }

    .music-arrow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
