/* ============================================
   RESET & FUNDAMENTALS
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f0ece4;
    --bg-dark: #e6e0d4;
    --text: #1a1a1a;
    --text-light: #6b6b6b;
    --accent: #e63312;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Space Grotesk', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

html {
    scroll-behavior: auto; /* we handle smooth scroll in JS */
    overflow-x: hidden;
    cursor: none;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

a, button { cursor: none; }

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

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
    mix-blend-mode: difference;
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--text);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s;
    opacity: 0.5;
}

.cursor-hover .cursor-dot {
    width: 50px;
    height: 50px;
    background: var(--accent);
    mix-blend-mode: normal;
    opacity: 0.2;
}

.cursor-hover .cursor-ring {
    width: 60px;
    height: 60px;
    border-color: var(--accent);
    opacity: 1;
}

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: transform 1s var(--ease);
}

.preloader.done {
    transform: translateY(-100%);
}

.preloader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.preloader-line {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--bg);
    line-height: 1;
    opacity: 0;
    transform: translateY(60px);
    animation: preloaderReveal 0.8s var(--ease) forwards;
}

.preloader-line:nth-child(1) { animation-delay: 0.1s; }
.preloader-line:nth-child(2) { animation-delay: 0.25s; }
.preloader-line:nth-child(3) { animation-delay: 0.4s; }

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

.preloader-counter {
    position: absolute;
    bottom: 40px;
    right: 40px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--bg);
    opacity: 0.5;
}

/* ============================================
   NAVIGATION
   ============================================ */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    mix-blend-mode: difference;
}

.nav-name {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-dot {
    color: var(--accent);
    font-size: 0.6rem;
    vertical-align: super;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-role {
    font-size: 0.8rem;
    font-weight: 400;
    color: white;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-location {
    font-size: 0.8rem;
    color: white;
    opacity: 0.6;
}

.nav-menu-btn {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 20px;
    border-radius: 100px;
    transition: all 0.3s var(--ease);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu-btn:hover {
    background: white;
    color: var(--text);
}

.nav-menu-btn.active {
    background: white;
    color: var(--text);
}

/* ============================================
   MENU OVERLAY
   ============================================ */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: circle(0% at calc(100% - 80px) 30px);
    transition: clip-path 0.8s var(--ease);
    pointer-events: none;
}

.menu-overlay.open {
    clip-path: circle(150% at calc(100% - 80px) 30px);
    pointer-events: all;
}

.menu-content {
    text-align: center;
    width: 100%;
}

.menu-link {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--bg);
    text-decoration: none;
    line-height: 1.2;
    position: relative;
    transition: color 0.3s;
    padding: 8px 0;
}

.menu-link::before {
    content: attr(data-index);
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.menu-link:hover {
    color: var(--accent);
}

.menu-link:hover::before {
    opacity: 1;
}

.menu-footer {
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(240, 236, 228, 0.4);
}

/* ============================================
   HERO — MASSIVE TYPOGRAPHY
   ============================================ */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 40px 40px;
    position: relative;
    overflow: hidden;
}

.hero-oversized-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    will-change: transform;
    padding: 0 20px;
}

.hero-line {
    overflow: visible;
    line-height: 0.9;
}

.hero-word {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 12vw, 14rem);
    font-weight: 400;
    display: inline-block;
    letter-spacing: -0.04em;
    will-change: transform, opacity;
    transform: translateY(100%);
    animation: heroWordReveal 1.2s var(--ease) forwards;
    animation-delay: 1.8s;
}

.hero-line-2 .hero-word {
    font-style: italic;
    animation-delay: 2s;
}

.hero-line-3 .hero-word {
    animation-delay: 2.2s;
}

@keyframes heroWordReveal {
    to {
        transform: translateY(0);
    }
}

.hero-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(26, 26, 26, 0.15);
    opacity: 0;
    animation: fadeIn 1s var(--ease) 2.5s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.hero-meta .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.hero-meta .value {
    font-size: 0.95rem;
    font-weight: 500;
}

.scroll-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scroll-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
}

.scroll-arrow {
    font-size: 1.2rem;
    animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============================================
   MARQUEE
   ============================================ */
.marquee-section {
    padding: 24px 0;
    border-top: 1px solid rgba(26, 26, 26, 0.1);
    border-bottom: 1px solid rgba(26, 26, 26, 0.1);
    overflow: hidden;
    background: var(--text);
    color: var(--bg);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 30s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 16px;
    flex-shrink: 0;
}

.marquee-content span {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.marquee-sep {
    color: var(--accent);
    font-size: 0.6rem !important;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   ABOUT — EDITORIAL SPLIT
   ============================================ */
#about {
    padding: 160px 40px;
}

.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.section-index {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 24px;
}

.about-heading {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 5vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.about-heading em {
    font-style: italic;
    color: var(--accent);
}

/* Text reveal animation */
.reveal-text .line {
    display: block;
    overflow: hidden;
}

.reveal-text .line-inner {
    display: block;
    transform: translateY(110%);
    transition: transform 1s var(--ease);
}

.reveal-text.revealed .line-inner {
    transform: translateY(0);
}

.reveal-text .line:nth-child(2) .line-inner { transition-delay: 0.1s; }
.reveal-text .line:nth-child(3) .line-inner { transition-delay: 0.2s; }
.reveal-text .line:nth-child(4) .line-inner { transition-delay: 0.3s; }

/* Slide reveal */
.reveal-slide {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal-slide.revealed {
    opacity: 1;
    transform: translateY(0);
}

.about-bio {
    margin-bottom: 48px;
}

.bio-large {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 500;
}

.bio-large em {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--accent);
}

.about-bio p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 16px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid rgba(26,26,26,0.15);
}

.stat-block {
    padding: 24px 0;
    border-right: 1px solid rgba(26,26,26,0.1);
    text-align: center;
}

.stat-block:last-child {
    border-right: none;
}

.stat-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-txt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
}

/* ============================================
   SKILLS — EXPANDABLE ROWS
   ============================================ */
#skills {
    padding: 120px 40px 160px;
    background: var(--text);
    color: var(--bg);
}

.skills-header {
    margin-bottom: 80px;
}

.skills-header .section-index {
    color: rgba(240,236,228,0.4);
}

.section-title-huge {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 7vw, 7rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.section-title-huge em {
    font-style: italic;
    color: var(--accent);
}

.skills-container {
    max-width: 1100px;
}

.skill-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid rgba(240,236,228,0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.5s var(--ease);
}

.skill-row:first-child {
    border-top: 1px solid rgba(240,236,228,0.1);
}

.skill-row:hover {
    padding-left: 20px;
}

.skill-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.5s var(--ease);
}

.skill-row:hover::before {
    transform: scaleY(1);
}

.skill-name {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.skill-index {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.6;
}

.skill-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    letter-spacing: -0.02em;
}

.skill-sub {
    font-size: 0.75rem;
    color: rgba(240,236,228,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skill-bar-container {
    width: 100%;
    height: 3px;
    background: rgba(240,236,228,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6b4a);
    border-radius: 3px;
    width: 0;
    transition: width 1.5s var(--ease);
}

.skill-detail {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: rgba(240,236,228,0.4);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease), padding 0.5s var(--ease);
    padding: 0;
}

.skill-row:hover .skill-detail {
    max-height: 60px;
    padding-top: 12px;
}

/* ============================================
   SERVICES — STACKED CARDS
   ============================================ */
#services {
    padding: 160px 40px;
}

.services-header {
    margin-bottom: 80px;
}

.services-list {
    max-width: 1100px;
}

.service-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 40px;
    padding: 48px 0;
    border-bottom: 1px solid rgba(26,26,26,0.12);
    align-items: start;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.service-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.service-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    padding-top: 8px;
}

.service-body h3 {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    transition: color 0.3s;
}

.service-item:hover .service-body h3 {
    color: var(--accent);
}

.service-body p {
    color: var(--text-light);
    font-size: 0.95rem;
    max-width: 500px;
}

.service-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
}

.service-tags-wrap span {
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid rgba(26,26,26,0.15);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s var(--ease);
}

.service-item:hover .service-tags-wrap span {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================
   EDUCATION
   ============================================ */
#education {
    padding: 160px 40px;
    background: var(--bg-dark);
}

.edu-header {
    margin-bottom: 80px;
}

.edu-grid {
    display: grid;
    gap: 0;
    max-width: 900px;
}

.edu-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 40px;
    padding: 40px 0;
    border-bottom: 1px solid rgba(26,26,26,0.12);
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.edu-card.revealed {
    opacity: 1;
    transform: translateX(0);
}

.edu-card:first-child {
    border-top: 1px solid rgba(26,26,26,0.12);
}

.edu-year {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    line-height: 1.2;
    color: var(--accent);
}

.edu-info h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.edu-info p {
    color: var(--text-light);
    font-size: 0.92rem;
}

/* ============================================
   CONTACT — FULL STATEMENT
   ============================================ */
#contact {
    padding: 160px 40px;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.contact-layout {
    width: 100%;
}

.contact-big-text {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 8rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 80px;
}

.contact-big-text em {
    font-style: italic;
    color: var(--accent);
}

.contact-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(26,26,26,0.15);
}

.contact-detail {
    margin-bottom: 20px;
}

.contact-detail .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.contact-detail .value {
    font-size: 1rem;
    font-weight: 500;
}

.contact-desc {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 32px;
    max-width: 450px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-serif);
    font-size: 1.6rem;
    padding: 20px 40px;
    border: 1px solid var(--text);
    border-radius: 100px;
    transition: all 0.4s var(--ease);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: translateX(-101%);
    transition: transform 0.5s var(--ease);
    z-index: 0;
}

.cta-button:hover::before {
    transform: translateX(0);
}

.cta-button:hover {
    color: white;
    border-color: var(--accent);
}

.cta-text, .cta-arrow {
    position: relative;
    z-index: 1;
}

.cta-arrow {
    transition: transform 0.3s var(--ease);
}

.cta-button:hover .cta-arrow {
    transform: translateX(6px);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    padding: 24px 40px;
    border-top: 1px solid rgba(26,26,26,0.1);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
}

.footer-name {
    font-weight: 500;
    color: var(--text);
}

/* ============================================
   PARALLAX SCROLL TRANSFORMS — applied via JS
   ============================================ */
.hero-word {
    transition: transform 0.1s linear, opacity 0.1s linear, letter-spacing 0.1s linear, font-size 0.1s linear;
}

/* ============================================
   TOGGLE BUTTONS (Lang)
   ============================================ */
.nav-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 100px;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s var(--ease);
}

.nav-toggle-btn:hover {
    border-color: rgba(255,255,255,0.5);
}

.toggle-label, .toggle-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.toggle-label.active, .toggle-icon.active {
    opacity: 1;
}

.toggle-track {
    width: 28px;
    height: 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 14px;
    position: relative;
    transition: background 0.3s var(--ease);
}

.toggle-thumb {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.4s var(--ease);
}

.toggle-track.on .toggle-thumb {
    transform: translateX(14px);
}

.toggle-track.on {
    background: var(--accent);
}

/* ============================================
   I18N TEXT ANIMATION
   ============================================ */
[data-i18n] {
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.i18n-out {
    opacity: 0 !important;
    transform: translateY(8px);
}

.i18n-in {
    animation: i18nSlideIn 0.4s var(--ease) forwards;
}

@keyframes i18nSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    #navbar { padding: 16px 20px; }
    .nav-center { display: none; }
    .nav-location { display: none; }

    .nav-toggle-btn {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .toggle-track {
        width: 22px;
        height: 12px;
    }

    .toggle-thumb {
        width: 8px;
        height: 8px;
    }

    .toggle-track.on .toggle-thumb {
        transform: translateX(10px);
    }

    #hero { padding: 100px 20px 40px; }

    .hero-meta {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .skill-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-item {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .service-num { display: none; }

    .contact-bottom {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .edu-card {
        grid-template-columns: 80px 1fr;
        gap: 20px;
    }

    .menu-link {
        font-size: 2.5rem;
    }

    #skills, #about, #services, #education, #contact {
        padding: 80px 20px;
    }
}

@media (max-width: 480px) {
    .hero-word {
        font-size: clamp(3rem, 14vw, 5rem) !important;
    }

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

    .footer-row {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .cursor-dot, .cursor-ring {
        display: none;
    }

    html, body, a, button {
        cursor: auto;
    }
}
