/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
    /* Color */
    --bg: #0b0d10;
    --surface: #14171c;
    --surface-2: #1b1f26;
    --border: #262b33;
    --border-soft: #1e222a;
    --text-primary: #e9ebee;
    --text-secondary: #8b92a0;
    --text-tertiary: #5c6270;
    --accent: #5b8def;
    --accent-soft: rgba(91, 141, 239, 0.14);
    --accent-glow: rgba(91, 141, 239, 0.35);
    --violet: #7c5cfc;

    /* Type */
    --font-display: 'Instrument Serif', serif;
    --font-body: 'Inter', sans-serif;

    /* Layout */
    --max-width: 1240px;
    --section-pad-y: clamp(5rem, 10vw, 9rem);
    --section-pad-x: clamp(1.5rem, 5vw, 5rem);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ==========================================================================
   Signature aurora backdrop
   ========================================================================== */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 40% at 20% 0%, rgba(91, 141, 239, 0.16), transparent 60%),
        radial-gradient(ellipse 50% 35% at 85% 15%, rgba(124, 92, 252, 0.12), transparent 60%),
        radial-gradient(ellipse 45% 30% at 50% 100%, rgba(91, 141, 239, 0.08), transparent 60%);
    animation: auroraDrift 22s ease-in-out infinite;
}

@keyframes auroraDrift {

    0%,
    100% {
        opacity: 0.7;
        transform: translateY(0) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateY(20px) scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    .aurora {
        animation: none;
    }
}

/* ==========================================================================
   Shared layout
   ========================================================================== */
section {
    position: relative;
    z-index: 1;
    padding: var(--section-pad-y) var(--section-pad-x);
    max-width: var(--max-width);
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 3.5rem;
    max-width: 18ch;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #08090b;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.6rem 1.3rem;
    font-size: 0.85rem;
}

.btn-ghost {
    background: var(--surface-2);
    color: var(--text-secondary);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem clamp(1.5rem, 5vw, 5rem);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
}

nav.scrolled {
    background: rgba(11, 13, 16, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
    padding-block: 0.85rem;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 2.4rem;
}

.nav-link {
    position: relative;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.25s;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1.5px;
    width: 0;
    background: var(--accent);
    transition: width 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after,
.nav-link:hover::after {
    width: 100%;
}

.nav-resume {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.3s, transform 0.3s;
}

.nav-resume:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 22px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 1.7px;
    background: var(--text-primary);
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 clamp(1.5rem, 5vw, 5rem);
    max-width: var(--max-width);
    margin: 0 auto;
    z-index: 1;
}

.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.5;
    animation: floatShape 14s ease-in-out infinite;
}

.shape-1 {
    width: 10px;
    height: 10px;
    background: var(--accent);
    top: 22%;
    left: 8%;
    animation-delay: 0s;
}

.shape-2 {
    width: 6px;
    height: 6px;
    background: var(--violet);
    top: 65%;
    left: 18%;
    animation-delay: -4s;
}

.shape-3 {
    width: 8px;
    height: 8px;
    background: var(--accent);
    top: 40%;
    left: 85%;
    animation-delay: -8s;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-26px) translateX(10px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .shape {
        animation: none;
    }
}

.hero-content {
    max-width: 720px;
    padding-top: 6rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6.4vw, 5rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin-bottom: 1.6rem;
}

.hero-title-italic {
    font-style: italic;
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.1rem;
}

.hero-description {
    font-size: 1.08rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: 2.4rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.6rem;
}

.hero-socials {
    display: flex;
    gap: 0.9rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: color 0.3s, border-color 0.3s, transform 0.3s;
}

.social-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.scroll-cue {
    position: absolute;
    bottom: 2.5rem;
    left: clamp(1.5rem, 5vw, 5rem);
    width: 1px;
    height: 50px;
    background: var(--border);
    overflow: hidden;
}

.scroll-cue-line {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    animation: scrollCue 2.2s ease-in-out infinite;
}

@keyframes scrollCue {
    0% {
        top: -100%;
    }

    50% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-cue-line {
        animation: none;
        top: 0;
    }
}

/* ==========================================================================
   Reveal animations
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    animation: revealUp 0.7s var(--ease) forwards;
}

.hero-content .eyebrow.reveal {
    animation-delay: 0.05s;
}

.hero-content .hero-title.reveal {
    animation-delay: 0.15s;
}

.hero-content .hero-subtitle.reveal {
    animation-delay: 0.25s;
}

.hero-content .hero-description.reveal {
    animation-delay: 0.35s;
}

.hero-content .hero-actions.reveal {
    animation-delay: 0.45s;
}

.hero-content .hero-socials.reveal {
    animation-delay: 0.55s;
}

.scroll-cue.reveal {
    animation-delay: 0.7s;
}

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

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

    .reveal,
    .reveal-on-scroll {
        animation: none;
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}

.about-visual {
    position: relative;
}

.about-frame {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--surface);
    border: 1px solid var(--border);
}

.about-frame-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle at 30% 20%, var(--accent-glow), transparent 60%);
    opacity: 0.5;
}

.about-frame-inner {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-frame-initials {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(4rem, 10vw, 7rem);
    color: var(--text-primary);
    opacity: 0.16;
}

.about-stat-card {
    position: absolute;
    bottom: -1.6rem;
    right: -1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.about-stat-number {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--accent);
    line-height: 1;
}

.about-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    line-height: 1.4;
}

.about-text {
    color: var(--text-secondary);
    font-size: 1.04rem;
    max-width: 56ch;
    margin-bottom: 1.4rem;
}

.about-facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.4rem;
    margin-top: 2.2rem;
    padding-top: 2.2rem;
    border-top: 1px solid var(--border-soft);
}

.about-fact {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.about-fact-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.about-fact-value {
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-wrap {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
    height: 100%;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.project-featured {
    flex-direction: row;
}

.project-featured .project-image {
    flex: 1 1 50%;
    aspect-ratio: auto;
    height: auto;
}

.project-featured .project-content {
    flex: 1 1 50%;
    padding: 2.6rem;
    justify-content: center;
}

.project-image {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--surface-2);
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.9rem;
    background: var(--accent);
    color: #08090b;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.project-content {
    display: flex;
    flex-direction: column;
    padding: 1.8rem;
    flex: 1;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    letter-spacing: -0.01em;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.96rem;
    margin-bottom: 1.1rem;
}

.project-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.4rem;
}

.project-features li {
    position: relative;
    padding-left: 1.3rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    margin-bottom: 1.4rem;
}

.tag {
    padding: 0.35rem 0.85rem;
    background: var(--surface-2);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.78rem;
    border: 1px solid var(--border);
}

.project-links {
    display: flex;
    gap: 0.7rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.2rem;
}

@media (max-width: 900px) {
    .project-featured {
        flex-direction: column;
    }

    .project-featured .project-image {
        aspect-ratio: 16 / 10;
    }

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

/* ==========================================================================
   Skills
   ========================================================================== */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6rem;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.9rem;
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.skill-card-learning {
    border-style: dashed;
}

.skill-icon {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.skill-name {
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.skill-list span {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.84rem;
    transition: color 0.25s, border-color 0.25s;
}

.skill-list span:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-container {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.contact-container .eyebrow {
    justify-content: center;
}

.contact-container .section-title {
    margin: 0 auto 1.2rem;
}

.contact-intro {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.3rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    text-align: left;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
    width: 100%;
}

.contact-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--accent);
}

.contact-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.contact-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 2.4rem clamp(1.5rem, 5vw, 5rem) 3rem;
    border-top: 1px solid var(--border-soft);
    color: var(--text-tertiary);
    font-size: 0.88rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: border-color 0.3s, color 0.3s, transform 0.3s;
}

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 64px;
        right: 1.2rem;
        left: 1.2rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 0.6rem;
        transform: translateY(-12px) scale(0.98);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        transform: translateY(0) scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.85rem 1rem;
        border-radius: var(--radius-sm);
    }

    .nav-link::after {
        display: none;
    }

    .nav-link.active,
    .nav-link:hover {
        background: var(--surface-2);
    }

    .nav-resume {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

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

    .about-stat-card {
        right: 1rem;
    }

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

    .hero-content {
        padding-top: 5rem;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
    }
}