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

:root {
    --bg: #f6f6f3;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --surface-elevated: rgba(255, 255, 255, 0.56);
    --text: #131313;
    --muted: rgba(19, 19, 19, 0.68);
    --soft: rgba(19, 19, 19, 0.46);
    --border: rgba(19, 19, 19, 0.08);
    --border-strong: rgba(19, 19, 19, 0.14);
    --line: rgba(19, 19, 19, 0.06);
    --hover-surface: rgba(19, 19, 19, 0.035);
    --gradient: radial-gradient(circle at top left, rgba(255,255,255,0.9), rgba(255,255,255,0.35));
    --grid: rgba(19, 19, 19, 0.04);
    --scrollbar: rgba(19, 19, 19, 0.2);
    --nav-active: #131313;
    --nav-active-text: #ffffff;
    --shadow-soft: 0 12px 34px rgba(18, 18, 18, 0.06);
    --shadow: 0 24px 80px rgba(18, 18, 18, 0.08);
}

body.dark-mode {
    --bg: #0e0f12;
    --surface: rgba(20, 21, 26, 0.72);
    --surface-strong: rgba(21, 22, 28, 0.92);
    --surface-elevated: rgba(30, 32, 38, 0.58);
    --text: #f3f4f6;
    --muted: rgba(243, 244, 246, 0.72);
    --soft: rgba(243, 244, 246, 0.48);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --line: rgba(255, 255, 255, 0.06);
    --hover-surface: rgba(255, 255, 255, 0.045);
    --gradient: radial-gradient(circle at top left, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    --grid: rgba(255, 255, 255, 0.04);
    --scrollbar: rgba(255, 255, 255, 0.22);
    --nav-active: #f3f4f6;
    --nav-active-text: #121317;
    --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.22);
    --shadow: 0 28px 84px rgba(0, 0, 0, 0.36);
}

h1 {
    padding-bottom: 2%;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.35s ease, color 0.35s ease;
}

.page-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.custom-cursor {
    position: fixed;
    inset: 0 auto auto 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    display: none;
    transition: background 0.35s ease, transform 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
    .custom-cursor {
        display: block;
    }

    body,
    a,
    button {
        cursor: none;
    }
}

.bg-orb {
    position: fixed;
    width: 36rem;
    height: 36rem;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.7;
    z-index: 0;
}

.orb-1 {
    top: -10rem;
    left: -6rem;
    background: rgba(180, 180, 180, 0.12);
}

.orb-2 {
    right: -8rem;
    bottom: -10rem;
    background: rgba(120, 120, 120, 0.12);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(circle at center, black 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at center, black 20%, transparent 78%);
    pointer-events: none;
    z-index: 0;
}

.top-controls {
    position: fixed;
    top: 1.6rem;
    right: 1.6rem;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.language-switcher,
.theme-button,
.floating-nav,
.hero-panel,
.premium-card {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.lang-button,
.theme-button {
    border: none;
    background: transparent;
    color: var(--muted);
    transition: all 0.25s ease;
}

.lang-button {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    padding: 0.65rem 0.92rem;
    border-radius: 999px;
}

.lang-button:hover,
.theme-button:hover {
    color: var(--text);
    background: var(--hover-surface);
}

.lang-button.active,
.theme-button.active {
    background: var(--nav-active);
    color: var(--nav-active-text);
}

.theme-button {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-icon-sun {
    display: none;
}

body.dark-mode .theme-icon-moon {
    display: none;
}

body.dark-mode .theme-icon-sun {
    display: block;
}

.main-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.content-section {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.content-section.active {
    opacity: 1;
    visibility: visible;
}

.reveal {
    animation: revealUp 0.6s ease both;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

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

.hero-panel,
.section-shell {
    width: min(100%, 1180px);
}

.hero-panel {
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: 2rem;
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-elevated));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    margin-bottom: 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--hover-surface);
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(3.8rem, 10vw, 7rem);
    line-height: 0.95;
    font-weight: 500;
    letter-spacing: -0.06em;
    margin-bottom: 1rem;
}

.hero-tagline {
    font-size: clamp(1.1rem, 2.4vw, 1.45rem);
    color: var(--text);
    margin-bottom: 1.35rem;
    font-weight: 400;
}

.hero-description,
.about-text,
.contact-text,
.project-description,
.section-subtitle,
.availability,
.email,
.contact-email {
    color: var(--muted);
}

.hero-description {
    font-size: clamp(1rem, 1.7vw, 1.14rem);
    line-height: 1.8;
    max-width: 760px;
    margin: 0 auto;
}

.hero-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.highlight-card,
.premium-chip {
    background: var(--hover-surface);
    border: 1px solid var(--border);
    border-radius: 1.35rem;
}

.highlight-card {
    padding: 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.highlight-value {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.highlight-label {
    font-size: 0.92rem;
    color: var(--muted);
}

.section-shell {
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
    overflow-y: auto;
    padding: 0 0.5rem 0.5rem;
}

.section-shell::-webkit-scrollbar {
    width: 6px;
}

.section-shell::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 999px;
}

.narrow-shell {
    width: min(100%, 860px);
}

.section-heading {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: clamp(2.6rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.05em;
    margin-bottom: 0.8rem;
}

.section-subtitle {
    font-size: 1rem;
}

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

.premium-card {
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-elevated));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.project-card {
    text-decoration: none;
    color: inherit;
    border-radius: 1.8rem;
    padding: 1.6rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.4rem;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.project-card:hover,
.social-card:hover,
.skill-item:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.project-meta,
.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.project-pill {
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: var(--hover-surface);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--soft);
}

.project-title {
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: -0.04em;
    margin-bottom: 0.55rem;
}

.project-description {
    line-height: 1.65;
}

.project-year,
.project-link-text {
    font-size: 0.88rem;
    color: var(--soft);
}

.project-icon {
    opacity: 0.7;
}

.about-panel,
.contact-panel {
    border-radius: 2rem;
    padding: clamp(1.7rem, 4vw, 3rem);
}

.skills-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 2rem;
}

.social-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem auto;
    width: fit-content;
    flex-wrap: wrap;
}

.skill-item,
.social-card {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    padding: 1rem;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.skill-item span,
.social-card span {
    color: var(--muted);
}

.social-card svg {
    width: 22px;
    height: 22px;
}

.about-text,
.contact-text {
    font-size: 1rem;
    line-height: 1.8;
}

.premium-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.availability,
.email,
.contact-cta,
.contact-email {
    text-align: center;
}

.contact-cta {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 0.55rem;
}

.contact-email {
    text-decoration: none;
    display: inline-block;
}

.centered-contact {
    text-align: center;
}

.centered-contact .contact-email {
    display: inline-block;
    text-align: center;
}

.floating-nav {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 1001;
    padding: 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow);
}

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}

.nav-button {
    position: relative;
    z-index: 2;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 0.85rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.nav-button:hover {
    color: var(--text);
}

.nav-button.active {
    color: var(--nav-active-text);
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--nav-active);
    transition: all 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(17, 17, 17, 0.05), transparent 38%), var(--bg);
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

body.dark-mode .loading-screen {
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 38%), var(--bg);
}

body.is-loaded .loading-screen {
    opacity: 0;
    visibility: hidden;
}

.loading-core {
    width: min(420px, calc(100vw - 3rem));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
}

.loading-mark {
    width: 88px;
    height: 88px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-indent: 0.34em;
    color: var(--text);
    background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.32));
    border: 1px solid var(--border);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.5);
    animation: loadingPulse 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

body.dark-mode .loading-mark {
    background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08);
}

.loading-line {
    position: relative;
    width: 100%;
    height: 1px;
    overflow: hidden;
    background: var(--border);
}

.loading-line-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--text);
    animation: loadingBar 1.4s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.loading-label {
    font-size: 0.74rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--soft);
}

.page-wrapper,
.top-controls {
    transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

body.is-loading .page-wrapper,
body.is-loading .top-controls {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
}

body.is-loaded .page-wrapper,
body.is-loaded .top-controls {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

@keyframes loadingBar {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

@keyframes loadingPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

@media (max-width: 980px) {
    .premium-grid,
    .hero-highlights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .page-wrapper {
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
    }

    .main-container {
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
        align-items: flex-start;
        padding: 1rem;
    }

    .top-controls {
        top: 0.85rem;
        right: 0.85rem;
        left: 0.85rem;
        justify-content: flex-end;
        gap: 0.45rem;
        z-index: 1002;
    }

    .language-switcher {
        padding: 0.25rem;
    }

    .lang-button {
        padding: 0.55rem 0.75rem;
        font-size: 0.72rem;
    }

    .theme-button {
        width: 2.45rem;
        height: 2.45rem;
    }

    .content-section {
        position: absolute;
        inset: 0;
        padding-top: 7.5rem;
        padding-bottom: 7.5rem;
        align-items: flex-start;
    }

    .content-section.active {
        overflow-y: auto;
    }

    .hero-panel,
    .about-panel,
    .contact-panel {
        border-radius: 1.5rem;
    }

    .hero-panel {
        padding: 6.5rem 1.25rem 1.5rem;
    }

    .eyebrow {
        margin-bottom: 0.9rem;
        font-size: 0.68rem;
        letter-spacing: 0.12em;
    }

    .hero-title {
        font-size: 3.1rem;
        line-height: 0.95;
        margin-bottom: 0.75rem;
    }

    .hero-tagline {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .hero-highlights {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .highlight-card {
        padding: 0.95rem 0.9rem;
        border-radius: 1.2rem;
    }

    .highlight-value {
        font-size: 1rem;
    }

    .highlight-label {
        font-size: 0.88rem;
    }

    .section-shell {
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .floating-nav {
        bottom: calc(0.75rem + env(safe-area-inset-bottom));
        padding: 0.55rem;
        width: calc(100% - 1.5rem);
        max-width: 420px;
    }

    .nav-list {
        justify-content: space-between;
        width: 100%;
    }

    .nav-button {
        flex: 1;
        justify-content: center;
        padding: 0.8rem 0.6rem;
    }

    .nav-button span {
        display: none;
    }
}

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

    .social-grid {
        gap: 0.75rem;
    }

    .hero-title {
        font-size: 3.4rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.7rem;
    }

    .hero-description {
        font-size: 0.94rem;
        line-height: 1.65;
    }
}