/* ═══════════════════════════════════════════════════════════════
   CV — ARCHITECTURAL DOCUMENT (POLISHED)
   Brutalist Typography | Liquid Glass | Kinetic Depth
   Premium Easing | Micro-Interactions | Intricate Details
   ═══════════════════════════════════════════════════════════════ */

/* --- FONTS --- */
@font-face {
    font-family: 'Chettavissto';
    src: url('../assets/fonts/ChettaVissto.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('../assets/fonts/Manrope-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Rolide';
    src: url('../assets/fonts/Rolide-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Campeno';
    src: url('../assets/fonts/Campeno-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

/* --- VARIABLES --- */
:root {
    /* Surfaces */
    --surface: #faf9f7;
    --card: #ffffff;

    /* Ink & Structure */
    --ink: #1a1a1a;
    --ink-soft: #555555;
    --ink-faint: #999999;

    /* Accent */
    --accent: #c9a227;
    --accent-light: #e8c56a;
    --accent-glow: rgba(201, 162, 39, 0.15);

    /* Borders */
    --line: rgba(26, 26, 26, 0.12);
    --line-active: #1a1a1a;

    /* Typography */
    --font-display: 'Chettavissto', Georgia, serif;
    --font-body: 'Manrope', system-ui, sans-serif;
    --font-mono: 'Rolide', 'Courier New', monospace;
    --font-accent: 'Campeno', sans-serif;

    /* Spacing (8px baseline grid) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 64px;

    /* Premium Motion (fast in, slow out) */
    --ease-in-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in-fast: cubic-bezier(0.5, 0, 0.2, 1);
    --ease-out-slow: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* --- RESET --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--ink);
    min-height: 100vh;
    padding: var(--space-md);
    position: relative;
    overflow-x: hidden;
}

/* Texture Grain */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.07;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
}

/* Lenis Smooth Scroll */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

/* --- FLUID CANVAS --- */
#fluid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

/* --- NAVIGATION --- */
.nav-back {
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    padding: 8px 20px;

    /* Liquid Glass */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 100px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.05);

    color: var(--ink);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.5s var(--ease-out-slow),
        transform 0.3s var(--ease-spring);
    z-index: 100;
}

.nav-back:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.5));
    border-color: var(--accent);
    transform: translateX(-6px);
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.5),
        0 10px 25px rgba(0, 0, 0, 0.1),
        0 0 30px var(--accent-glow);
}

.arrow {
    display: inline-block;
    transition: transform 0.4s var(--ease-spring);
}

.nav-back:hover .arrow {
    transform: translateX(-4px) scale(1.1);
}

/* --- DOWNLOAD BUTTON (Icon Reveal) --- */
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: var(--space-md);
    padding: 12px 24px;
    background: var(--ink);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.5s var(--ease-out-slow);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.download-btn .icon {
    font-size: 1.1em;
    transition: transform 0.5s var(--ease-out-slow);
    flex-shrink: 0;
}

.download-btn .btn-text {
    transition: letter-spacing 0.5s var(--ease-out-slow);
}

.download-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow:
        0 12px 30px rgba(201, 162, 39, 0.3),
        0 0 40px var(--accent-glow);
}

.download-btn:hover .icon {
    transform: translateY(2px);
}

.download-btn:hover .btn-text {
    letter-spacing: 0.05em;
}

/* --- CV CONTAINER --- */
.cv-container {
    max-width: 1000px;
    margin: 80px auto 40px;
    padding: var(--space-xl);

    /* Liquid Glass */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.15) 100%);
    backdrop-filter: blur(30px) saturate(120%);
    -webkit-backdrop-filter: blur(30px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 0 30px rgba(255, 255, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.05);
    border-radius: 16px;

    /* Kinetic Depth */
    transform-style: preserve-3d;
    will-change: transform;
    transition:
        transform 0.4s var(--ease-out-slow),
        box-shadow 0.6s var(--ease-out-slow);

    animation: fadeUp 1.2s var(--ease-out-slow) forwards;
    opacity: 0;
    transform: translateY(40px);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- HEADER --- */
.cv-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--line);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cv-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 1.5s var(--ease-out-slow) 0.3s;
}

body.loaded .cv-header::after {
    width: 120px;
}

.cv-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 0.95;
    margin-bottom: var(--space-sm);
    color: var(--ink);
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(20px);
    animation: titleReveal 1s var(--ease-out-slow) 0.2s forwards;
}

@keyframes titleReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cv-role {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: var(--space-md);
    display: block;
    opacity: 0;
    animation: fadeIn 0.8s var(--ease-out-slow) 0.4s forwards;
    transition: letter-spacing 0.5s var(--ease-out-slow);
}

.cv-role:hover {
    letter-spacing: 0.3em;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.cv-contact {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.5s var(--ease-out-slow),
        transform 0.3s var(--ease-spring);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.contact-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s var(--ease-out-slow);
}

.contact-badge:hover::before {
    opacity: 1;
}

.contact-badge:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(0, 0, 0, 0.1);
}

.contact-badge .icon {
    font-size: 1em;
    transition: transform 0.4s var(--ease-spring);
}

.contact-badge:hover .icon {
    transform: scale(1.2) rotate(5deg);
}

.divider {
    color: var(--line);
}

.location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--ink-soft);
    transition: all 0.4s var(--ease-out-slow);
}

.location:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

/* --- SECTIONS --- */
.cv-section {
    margin-bottom: var(--space-xl);
    opacity: 0;
    animation: sectionFadeIn 0.8s var(--ease-out-slow) forwards;
}

.cv-section:nth-child(1) {
    animation-delay: 0.6s;
}

.cv-section:nth-child(2) {
    animation-delay: 0.7s;
}

.cv-section:nth-child(3) {
    animation-delay: 0.8s;
}

.cv-section:nth-child(4) {
    animation-delay: 0.9s;
}

.cv-section:nth-child(5) {
    animation-delay: 1s;
}

@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: var(--space-md);
    color: var(--ink);
    position: relative;
    padding-bottom: var(--space-xs);
    transition: color 0.4s var(--ease-out-slow);
}

/* Brutalist underline with animation */
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.8s var(--ease-out-slow);
}

.section-title.visible::after {
    width: 60px;
}

.section-title:hover {
    color: var(--accent);
}

/* --- DIVIDER --- */
.cv-divider {
    border: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--line) 0%, transparent 100%);
    margin: var(--space-lg) 0;
    transform-origin: left;
    transform: scaleX(0);
    animation: dividerGrow 1s var(--ease-out-slow) 0.5s forwards;
}

@keyframes dividerGrow {
    to {
        transform: scaleX(1);
    }
}

/* --- SUMMARY --- */
.summary-section {
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.2);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    transition: all 0.5s var(--ease-out-slow);
    position: relative;
}

.summary-section:hover {
    background: rgba(255, 255, 255, 0.35);
    border-left-width: 4px;
    transform: translateX(2px);
    box-shadow: -4px 0 20px rgba(201, 162, 39, 0.08);
}

.summary-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ink);
}

.summary-text strong {
    color: var(--accent);
    font-weight: 600;
    transition: color 0.3s var(--ease-out-slow);
}

.summary-text strong:hover {
    color: var(--accent-light);
}

/* --- JOB ITEMS --- */
.job-item {
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    transition: all 0.5s var(--ease-out-slow),
        transform 0.3s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.job-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.4s var(--ease-spring);
}

.job-item:hover::before {
    width: 4px;
}

.job-item:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(6px) scale(1.01);
    box-shadow:
        -6px 0 0 0 rgba(201, 162, 39, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.05);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
    gap: var(--space-md);
}

.job-title-group {
    flex: 1;
}

.job-role {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
    transition: color 0.3s var(--ease-out-slow),
        letter-spacing 0.4s var(--ease-out-slow);
}

.job-item:hover .job-role {
    color: var(--accent);
    letter-spacing: 0.01em;
}

.job-company {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    transition: letter-spacing 0.4s var(--ease-out-slow);
}

.job-item:hover .job-company {
    letter-spacing: 0.15em;
}

.job-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--ink-soft);
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s var(--ease-out-slow);
}

.job-item:hover .job-date {
    color: var(--ink);
    transform: translateX(2px);
}

.job-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--ink-soft);
    transition: color 0.3s var(--ease-out-slow);
}

.job-item:hover .job-desc {
    color: var(--ink);
}

.job-achievements {
    list-style: none;
    padding: 0;
    margin: 0;
}

.job-achievements li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink-soft);
    margin-bottom: var(--space-xs);
    padding-left: 20px;
    position: relative;
    transition: all 0.3s var(--ease-out-slow);
    opacity: 0;
    transform: translateX(-10px);
}

.job-item:hover .job-achievements li {
    color: var(--ink);
    opacity: 1;
    transform: translateX(0);
}

.job-achievements li:nth-child(1) {
    transition-delay: 0.05s;
}

.job-achievements li:nth-child(2) {
    transition-delay: 0.1s;
}

.job-achievements li:nth-child(3) {
    transition-delay: 0.15s;
}

.job-achievements li:nth-child(4) {
    transition-delay: 0.2s;
}

.job-achievements li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
    transition: transform 0.3s var(--ease-spring);
}

.job-item:hover .job-achievements li::before {
    transform: translateX(3px);
}

.job-achievements li strong {
    color: var(--ink);
    position: relative;
}

/* --- SKILLS SECTION --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.skill-category {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: var(--space-md);
    transition: all 0.5s var(--ease-out-slow),
        transform 0.3s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.skill-category::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--accent-glow), transparent 60%);
    opacity: 0;
    transition: opacity 0.6s var(--ease-out-slow);
    pointer-events: none;
}

.skill-category:hover::after {
    opacity: 1;
}

.skill-category:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.06),
        0 0 40px rgba(201, 162, 39, 0.05);
}

.skill-label {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: var(--space-md);
    display: block;
    font-weight: 600;
    transition: all 0.4s var(--ease-out-slow);
}

.skill-category:hover .skill-label {
    letter-spacing: 0.25em;
    color: var(--accent-light);
}

/* --- SKILL METERS (Polished) --- */
.skill-meters {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.skill-meter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.3s var(--ease-out-slow);
}

.skill-category:hover .skill-meter-item {
    transform: translateX(2px);
}

.skill-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.skill-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
    transition: color 0.3s var(--ease-out-slow);
}

.skill-category:hover .skill-name {
    color: var(--accent);
}

.skill-level {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-soft);
    letter-spacing: 0.05em;
    transition: color 0.3s var(--ease-out-slow);
}

.skill-category:hover .skill-level {
    color: var(--accent-light);
}

.skill-meter-bar {
    position: relative;
    height: 4px;
    background: rgba(26, 26, 26, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.skill-meter-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 2px;
    width: 0%;
    transition: width 1.2s var(--ease-out-slow);
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.3);
}

/* Animate on visibility */
.skill-category.visible .skill-meter-fill {
    width: var(--skill-width, 0%) !important;
}

.skill-category:hover .skill-meter-fill {
    box-shadow: 0 0 20px rgba(201, 162, 39, 0.5);
}

/* --- FOOTER --- */
.cv-footer {
    border-top: 2px solid var(--line);
    padding-top: var(--space-md);
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    align-items: center;
    font-size: 0.85rem;
    color: var(--ink-soft);
    opacity: 0;
    animation: fadeIn 0.8s var(--ease-out-slow) 1.2s forwards;
}

.footer-note {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-style: italic;
    transition: color 0.3s var(--ease-out-slow);
}

.footer-note:hover {
    color: var(--accent);
}

.footer-copyright {
    font-size: 0.75rem;
    font-weight: 500;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .cv-container {
        margin: 60px auto 20px;
        padding: var(--space-lg);
    }

    .cv-title {
        font-size: 2.5rem;
    }

    .job-header {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body {
        padding: var(--space-sm);
    }

    .cv-container {
        margin: 50px 0 10px;
        padding: var(--space-md);
        border-radius: 12px;
    }

    .cv-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .cv-contact {
        flex-direction: column;
    }

    .nav-back,
    .download-pill {
        font-size: 0.8rem;
        padding: 6px 16px;
    }
}

/* --- ACCESSIBILITY --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}