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

body {
    background-color: #f5f5f7;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden; 
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    scroll-behavior: smooth;
}

body.allow-scroll {
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

body::-webkit-scrollbar { width: 12px; }
body::-webkit-scrollbar-track { background: #f5f5f7; }
body::-webkit-scrollbar-thumb {
    background: #2d2d2f;
    border-radius: 6px;
    border: 3px solid #f5f5f7;
}
body::-webkit-scrollbar-thumb:hover { background: #1d1d1f; }

/* Header Menu */
.glass-menu {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: flex-end; 
    width: 100%;
    padding: 40px 50px; 
    background: transparent; 
    z-index: 1000;
}

.back-btn {
    margin-right: auto;
    text-decoration: none;
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 40px;
    background: rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.back-btn:hover { background: rgba(0, 0, 0, 0.1); }

.lang-switch {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.06); 
    padding: 4px;
    border-radius: 50px;
}
.lang-switch button {
    background: transparent;
    border: none;
    color: #86868b; 
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.lang-switch button.active {
    background: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

/* Hero */
.hero-section {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center; 
}

#chaos-text-container {
    width: 50%; 
    max-width: 800px;
    text-align: center;
    position: relative;
    font-size: 3.5vw;
    font-weight: 300; 
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: #1d1d1f;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.char {
    display: inline-block;
    will-change: transform, opacity;
}

@keyframes fallAndFlow {
    0% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
    15% { transform: translate3d(0, 40px, 0) scale(1); opacity: 1; }
    80% { transform: translate3d(var(--tx), var(--ty), 0) scale(0.2); opacity: 0.5; }
    100% { transform: translate3d(var(--tx), var(--ty), 0) scale(0); opacity: 0; }
}

/* TOC Architecture */
.toc-fullscreen {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100vw; 
    height: 100vh;
    height: 100dvh;
    pointer-events: none;
    display: flex;
    align-items: center;
    padding-left: 10vw;
    z-index: 10;
}

.toc-anchor {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.master-dot {
    position: absolute;
    left: 0;
    width: 60px; 
    height: 60px;
    background: #1d1d1f;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

.toc-list {
    list-style: none;
    padding: 0; 
    margin: 0;
    position: absolute;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.toc-item {
    position: absolute;
    width: 60px; 
    height: 60px;
    background: #1d1d1f;
    border-radius: 30px; 
    overflow: hidden;
    opacity: 0;
    transform: translateY(0) scale(1);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                width 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.1s,
                background-color 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
}

.toc-item.visible { opacity: 1; }
.toc-item.spread:nth-child(1) { transform: translateY(-80px) scale(1); }
.toc-item.spread:nth-child(2) { transform: translateY(0) scale(1); }
.toc-item.spread:nth-child(3) { transform: translateY(80px) scale(1); }
.toc-item.expand { width: 480px; }

.toc-item.expand:nth-child(1):hover { transform: translateY(-80px) scale(1.04); background-color: #3d3d40; }
.toc-item.expand:nth-child(2):hover { transform: translateY(0) scale(1.04); background-color: #3d3d40; }
.toc-item.expand:nth-child(3):hover { transform: translateY(80px) scale(1.04); background-color: #3d3d40; }

.toc-link {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 25px;
    text-decoration: none;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.4s ease 0.4s;
}

.toc-item.expand .toc-link { opacity: 1; }

.toc-number {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 30px;
    font-variant-numeric: tabular-nums;
}

.toc-text {
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* ========================================= */
/* BOLD, MASSIVE, APPLE-STYLE CV ARCHITECTURE */
/* ========================================= */

.cv-page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 160px 40px 120px 40px;
    animation: fadeIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

.cv-header-massive {
    margin-bottom: 80px;
}

.cv-header-massive h1 {
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #1d1d1f;
    margin-bottom: 20px;
}

.cv-contact-info {
    font-size: 18px;
    font-weight: 500;
    color: #86868b;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.dot-separator {
    color: #d2d2d7;
}

.cv-section-modern {
    margin-bottom: 80px;
}

.cv-huge-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #1d1d1f;
    margin-bottom: 50px;
}

.cv-huge-title.small-huge {
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 40px;
}

/* Timeline Design */
.cv-timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid #e5e5ea;
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -37px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #1d1d1f;
    box-shadow: 0 0 0 6px #f5f5f7;
}

.timeline-date {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.timeline-role {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1d1d1f;
    margin-bottom: 6px;
}

.timeline-org {
    font-size: 18px;
    font-weight: 400;
    color: #515154;
    margin-bottom: 16px;
}

.timeline-desc {
    font-size: 17px;
    line-height: 1.6;
    color: #515154;
    max-width: 700px;
    text-align: justify;
    hyphens: auto; 
}

/* Skills & Languages Grid */
.cv-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

@media (max-width: 768px) {
    .cv-bottom-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

.cv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cv-tag {
    background-color: #ffffff;
    border: 1px solid #d2d2d7;
    color: #1d1d1f;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cv-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ========================================= */
/* HORIZONTAL PORTFOLIO SCROLLING (BIG STYLE)*/
/* ========================================= */

#projects-view {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.projects-page-wrapper {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 140px 60px 60px 60px;
    gap: 80px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#projects-view::-webkit-scrollbar { height: 8px; }
#projects-view::-webkit-scrollbar-track { background: #f5f5f7; }
#projects-view::-webkit-scrollbar-thumb {
    background: #2d2d2f;
    border-radius: 4px;
}

.project-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid #d2d2d7;
    padding-right: 40px;
}

.project-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.project-location {
    font-size: 14px;
    font-weight: 500;
    color: #86868b;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.project-meta-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-meta-label {
    font-size: 11px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-meta-value {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    text-transform: uppercase;
    margin-top: -12px;
    margin-bottom: 12px;
}

.project-content-stream {
    display: flex;
    flex-direction: row;
    gap: 60px;
    align-items: flex-start;
    height: 100%;
}

.stream-image-wrapper {
    height: 70vh;
    flex-shrink: 0;
}

.stream-image-wrapper img {
    height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.stream-text-wrapper {
    width: 320px;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #1d1d1f;
    padding-top: 10px;
    white-space: normal; 
    text-align: justify;
    hyphens: auto; 
}

/* ========================================= */
/* INTRO MENU & CONTACT VIEW */
/* ========================================= */

#intro-menu {
    display: flex;
    justify-content: space-between;
    width: 60vw;
    max-width: 900px;
    z-index: 50;
}

.lang-word {
    font-size: 2vw;
    font-weight: 300;
    color: #1d1d1f;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
}

.lang-word:hover {
    opacity: 0.4;
}

#contact-view {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-page-wrapper {
    display: flex;
    flex-direction: column;
    gap: 60px;
    text-align: center;
    animation: fadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.contact-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-label {
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-value {
    font-size: 32px;
    font-weight: 300;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

/* ========================================= */
/* RESPONSIVE DESIGN (MOBILE, TABLET, FOLD)  */
/* ========================================= */

/* Tablets and below (max-width: 1024px) */
@media (max-width: 1024px) {
    #chaos-text-container { width: 75%; font-size: 28px; }
    .toc-item.expand { width: 380px; }
    .glass-menu { padding: 30px 40px; }
    #intro-menu { width: 80vw; }
    .lang-word { font-size: 18px; }
}

/* Mobile phones (max-width: 768px) */
@media (max-width: 768px) {
    .glass-menu { padding: 20px; }
    #intro-menu { width: 90vw; flex-direction: row; justify-content: space-evenly; gap: 10px; }
    .lang-word { font-size: 14px; letter-spacing: 0.1em; }
    
    #chaos-text-container { width: 85%; font-size: 20px; line-height: 1.4; }
    
    .toc-fullscreen { padding-left: 5vw; }
    .toc-item.expand { width: calc(100vw - 40px) !important; max-width: 350px; }
    .toc-text { font-size: 16px; }
    .toc-number { margin-right: 15px; }

    .cv-page-wrapper, .projects-page-wrapper, .contact-page-wrapper {
        padding-top: 100px;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .contact-value { font-size: 24px; }
}

/* Foldable phones (folded state, max-width: 320px) */
@media (max-width: 320px) {
    .lang-word { font-size: 11px; }
    #chaos-text-container { font-size: 16px; }
    .toc-text { font-size: 14px; }
    .toc-item.expand { max-width: 270px; }
    .contact-value { font-size: 20px; }
}