/* ============================================================
   EDITORIAL PORTFOLIO — Cream / Dark Green Theme
   Enhanced with Interactivity & Animations
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg: #f0ebe3;
    --bg-alt: #e8e2d8;
    --bg-card: #f5f1ea;
    --green: #1a5c38;
    --green-dark: #0f3d24;
    --green-light: #2d8c4e;
    --accent: #1bbc5e;
    --text: #1a3a2a;
    --text-muted: #5a7a6a;
    --white: #ffffff;
    --font-display: 'Oswald', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --nav-h: 72px;
    --section-px: clamp(1.25rem, 5vw, 6rem);
    --ease: cubic-bezier(.25, .46, .45, .94);
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ---------- Scroll Progress Bar ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--green), var(--accent));
    z-index: 9999;
    transition: width .05s linear;
}

/* ---------- Custom Cursor Glow ---------- */
.cursor-glow {
    position: fixed;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(27, 188, 94, .07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 12000;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity .4s, transform .2s ease-out;
    opacity: 0;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* ---------- Custom Cursor (Motion Style) ---------- */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 12000;
    pointer-events: none;
    display: none;
    /* Hidden by default, shown on desktop */
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--green-dark);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--green-dark);
    transition: width .2s, height .2s, background-color .2s;
}

/* Links hover state for cursor */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(26, 92, 56, 0.1);
    border-color: transparent;
}

/* Show custom cursor only on fine pointer devices */
@media (hover: hover) and (pointer: fine) {

    .cursor-dot,
    .cursor-outline {
        display: block;
    }

    /* Hide default cursor */
    html,
    body,
    a,
    button,
    input,
    textarea,
    .logo,
    .nav-links li a {
        cursor: none;
    }
}

/* Disable custom cursor when modal is open */
body.modal-open .cursor-dot,
body.modal-open .cursor-outline,
body.modal-open .cursor-glow {
    display: none !important;
}

body.modal-open,
body.modal-open * {
    cursor: auto !important;
}

/* ---------- Preloader ---------- */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 11000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s var(--ease-bounce);
}

.preloader.loaded {
    transform: translateY(-100%);
}

.preloader-content {
    text-align: center;
    color: var(--green-dark);
    overflow: hidden;
}

.preloader-text {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.8s var(--ease);
}

.preloader-counter {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
}

.preloader.start-anim .preloader-text {
    clip-path: inset(0 0 0 0);
}

/* ---------- Marquee Ticker ---------- */
.marquee-container {
    width: 110%;
    margin-left: -5%;
    background: var(--green-dark);
    color: var(--bg);
    padding: 1rem 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    transform: rotate(-3deg) translateZ(0);
    /* Hardware acceleration */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    margin: 3rem 0;
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    display: flex;
    /* Key for aligning clones */
}

.marquee-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    /* Prevent shrinking */
    animation: marquee 25s linear infinite;
}

.marquee-content span {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 1rem;
    display: inline-block;
}

.marquee-content .separator {
    color: var(--accent);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ---------- Split Text Animation ---------- */
[data-split-text] span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.8s var(--ease-bounce), opacity 0.8s;
}

.section-title.revealed span {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Grid Canvas (Shadcn Effect) ---------- */
#grid-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: 0.6;
    /* Subtle effect */
}

/* ---------- Star Canvas ---------- */
#star-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: .08;
}

/* ---------- Container ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--section-px);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-h);
    z-index: 1000;
    background: rgba(240, 235, 227, .85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(26, 58, 42, .08);
    transition: background .3s var(--ease), box-shadow .3s;
}

.navbar.scrolled {
    background: rgba(240, 235, 227, .95);
    box-shadow: 0 4px 24px rgba(26, 58, 42, .08);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    color: var(--green-dark);
    transition: color .25s, transform .25s;
}

.logo:hover {
    color: var(--accent);
    transform: scale(1.05);
}

/* Nav links — pill container */
.nav-links {
    display: flex;
    align-items: center;
    gap: .15rem;
    border: 1.5px solid var(--text);
    border-radius: 999px;
    padding: .3rem .5rem;
}

.nav-links li a {
    display: block;
    padding: .4rem 1rem;
    font-family: var(--font-mono);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    transition: color .25s;
}

.nav-links li a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--green);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease);
    z-index: -1;
}

.nav-links li a:hover {
    color: var(--white);
}

.nav-links li a:hover::before {
    transform: scaleX(1);
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: .25rem .4rem;
    border-radius: 4px;
    transition: color .2s, background .2s, transform .2s;
}

.lang-btn.active {
    color: var(--white);
    background: var(--green);
}

.lang-btn:hover {
    color: var(--green);
    transform: scale(1.1);
}

.lang-divider {
    color: var(--text-muted);
    font-weight: 300;
    user-select: none;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

.hamburger.toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.toggle span:nth-child(2) {
    opacity: 0;
}

.hamburger.toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   HERO — Overlapping Image + Big Text Layout
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-h);
    position: relative;
    overflow: hidden;
}

/* Decorative wavy background element */
.hero::before {
    content: '';
    position: absolute;
    top: 5%;
    left: -8%;
    width: 50%;
    height: 95%;
    background: linear-gradient(135deg, var(--green) 0%, var(--accent) 100%);
    border-radius: 0 45% 45% 0;
    opacity: .08;
    z-index: 0;
    pointer-events: none;
    animation: heroShapePulse 8s ease-in-out infinite alternate;
}

@keyframes heroShapePulse {
    0% {
        opacity: .08;
        transform: scale(1) rotate(0deg);
    }

    100% {
        opacity: .12;
        transform: scale(1.05) rotate(2deg);
    }
}

.hero-content {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* --- Hero Visual: image + overlay text --- */
.hero-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 520px;
}

/* Big overlay text behind image */
.hero-big-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3.5rem, 7vw, 7rem);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--green-dark);
    line-height: .9;
    z-index: 3;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    transition: transform .4s var(--ease);
}

.hero-big-top {
    align-self: flex-start;
    transform: translateX(-5%);
}

.hero-big-bottom {
    align-self: flex-end;
    transform: translateX(5%);
}

.hero-visual:hover .hero-big-top {
    transform: translateX(-8%);
}

.hero-visual:hover .hero-big-bottom {
    transform: translateX(8%);
}

/* Profile image — transparent background, overlapping text */
.hero-image {
    position: relative;
    z-index: 1;
    margin: -2.5rem 0;
}

.hero-image img {
    width: 100%;
    max-width: 380px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(26, 58, 42, .2));
    transition: transform .5s var(--ease), filter .4s;
    margin: 0 auto;
}

.hero-visual:hover .hero-image img {
    transform: scale(1.03);
    filter: drop-shadow(0 30px 60px rgba(26, 58, 42, .3));
}

/* Code icon </> */
.hero-code-icon {
    position: absolute;
    bottom: 5%;
    right: -5%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5.5rem);
    color: var(--accent);
    z-index: 3;
    pointer-events: none;
    opacity: .6;
    animation: codeIconFloat 4s ease-in-out infinite alternate;
}

@keyframes codeIconFloat {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-12px) rotate(5deg);
    }
}

/* Hero text */
.hero-text {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    /* Tighter spacing */
    margin-top: -4rem;
    /* Move content higher */
    position: relative;
    z-index: 5;
}

.hero-text h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--green-dark);
}

.hero-text h2 {
    font-family: var(--font-mono);
    font-size: clamp(.8rem, 1.1vw, 1rem);
    font-weight: 400;
    color: var(--green);
    min-height: 1.5em;
    border-right: 2px solid var(--accent);
    display: inline-block;
    padding-right: .3em;
    animation: blink .8s step-end infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.hero-text p {
    font-size: .95rem;
    /* Slightly larger per implicit request */
    color: var(--text-muted);
    max-width: 400px;
    letter-spacing: .02em;
    margin-top: -0.6rem;
    /* Pull description higher */
    line-height: 1.4;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .75rem 1.6rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all .3s var(--ease);
}

/* Button shine effect */
.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
    transform: skewX(-25deg);
    transition: left .6s;
}

.btn:hover::after {
    left: 120%;
}

.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--green-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(26, 92, 56, .3);
}

.btn-secondary {
    background: transparent;
    color: var(--green);
    border: 1.5px solid var(--green);
}

.btn-secondary:hover {
    background: var(--green);
    color: var(--white);
    transform: translateY(-3px);
}

/* Magnetic button wrapper (JS enhances this) */
.magnetic-btn {
    transition: transform .2s var(--ease-bounce);
}

/* ============================================================
   SECTIONS — Shared
   ============================================================ */
.section {
    padding: 6rem 0;
    position: relative;
}

.section:nth-child(even) {
    background: var(--bg-alt);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--green-dark);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width .8s var(--ease);
}

/* Animate title underline when section is revealed */
.section.revealed .section-title::after {
    width: 80px;
}

/* ============================================================
   SCROLL REVEAL SYSTEM
   ============================================================ */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal-scale {
    opacity: 0;
    transform: scale(.92);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.revealed {
    opacity: 1 !important;
    transform: none !important;
}

/* Stagger children animations */
.stagger-children .reveal-up:nth-child(1) {
    transition-delay: 0s;
}

.stagger-children .reveal-up:nth-child(2) {
    transition-delay: .1s;
}

.stagger-children .reveal-up:nth-child(3) {
    transition-delay: .2s;
}

.stagger-children .reveal-up:nth-child(4) {
    transition-delay: .25s;
}

.stagger-children .reveal-up:nth-child(5) {
    transition-delay: .3s;
}

.stagger-children .reveal-up:nth-child(6) {
    transition-delay: .35s;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-content {
    max-width: 720px;
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.about-content strong {
    color: var(--green);
    font-weight: 600;
    position: relative;
}

.about-content strong::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--ease);
}

.about-content:hover strong::after {
    transform: scaleX(1);
}

.about-content em {
    font-style: italic;
    color: var(--green-light);
}

/* ============================================================
   EDUCATION
   ============================================================ */
.education-card {
    background: var(--bg-card);
    border: 1px solid rgba(26, 58, 42, .1);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: transform .4s var(--ease), box-shadow .4s;
}

.education-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .6s var(--ease);
}

.education-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(26, 58, 42, .12);
}

.education-card:hover::before {
    transform: scaleX(1);
}

.edu-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.edu-logo-wrapper {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid rgba(26, 58, 42, .1);
    padding: .5rem;
    transition: box-shadow .3s, transform .3s;
}

.edu-logo-wrapper:hover {
    box-shadow: 0 4px 16px rgba(26, 92, 56, .15);
    transform: rotate(-3deg) scale(1.05);
}

.edu-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.edu-info h3 {
    margin-bottom: .25rem;
}

.edu-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--green);
    transition: color .2s;
}

.edu-link:hover {
    color: var(--accent);
}

.edu-course {
    font-size: .88rem;
    color: var(--text-muted);
}

.edu-year {
    font-family: var(--font-mono);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: .25rem;
}

.edu-skills h4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--green-dark);
    margin-bottom: .75rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.skill-tags li {
    padding: .35rem .85rem;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--green);
    color: var(--white);
    position: relative;
    overflow: hidden;
    transition: transform .25s var(--ease-bounce);
}

.skill-tags li::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: translateX(-100%);
    transition: transform .35s var(--ease);
    z-index: -1;
}

.skill-tags li:hover {
    transform: translateY(-3px) scale(1.05);
}

.skill-tags li:hover::before {
    transform: translateX(0);
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid rgba(26, 58, 42, .08);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform .4s var(--ease), box-shadow .4s;
}

/* Animated left border */
.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(to bottom, var(--green), var(--accent));
    transition: height .5s var(--ease);
}

/* Subtle glow on hover */
.skill-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(27, 188, 94, .06) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width .6s var(--ease), height .6s var(--ease);
    z-index: 0;
}

.skill-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(26, 58, 42, .12);
}

.skill-card:hover::before {
    height: 100%;
}

.skill-card:hover::after {
    width: 300px;
    height: 300px;
}

.skill-card h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--green-dark);
    margin-bottom: .5rem;
    position: relative;
    z-index: 1;
}

.skill-card p {
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* ============================================================
   PROJECTS — Card Grid
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid rgba(26, 58, 42, .08);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform .4s var(--ease), box-shadow .4s, border-color .4s;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .5s var(--ease);
    z-index: 2;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(26, 58, 42, .15);
    border-color: var(--green);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Card Image */
.project-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--green-dark);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease), filter .4s;
}

.project-card:hover .project-card-image img {
    transform: scale(1.08);
    filter: brightness(.85);
}

/* Hover Overlay */
.project-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 61, 36, .7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .35s var(--ease);
    z-index: 1;
}

.project-card:hover .project-card-overlay {
    opacity: 1;
}

.project-card-overlay span {
    font-family: var(--font-mono);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--white);
    padding: .6rem 1.4rem;
    border: 1.5px solid var(--white);
    transition: background .25s, transform .25s var(--ease-bounce);
}

.project-card-overlay span:hover {
    background: rgba(255, 255, 255, .15);
    transform: scale(1.05);
}

/* Card Body */
.project-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
}

.project-card-body h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--green-dark);
}

.project-card-body p {
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
}

/* Project Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .25rem;
}

.project-tags span {
    padding: .2rem .6rem;
    font-family: var(--font-mono);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(26, 92, 56, .1);
    color: var(--green);
    border: 1px solid rgba(26, 92, 56, .15);
    transition: background .25s, color .25s;
}

.project-card:hover .project-tags span {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

/* ============================================================
   PROJECT MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 24, 18, .6);
    backdrop-filter: blur(10px);
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility .35s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-container {
    width: 1000px;
    max-width: 90vw;
    height: 700px;
    max-height: 85vh;
    pointer-events: auto;
    background: var(--bg);
    border: 1px solid rgba(26, 58, 42, .15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
    opacity: 0;
    transition: opacity .4s var(--ease-bounce);
    border-radius: 16px;
}

.modal-overlay.active .modal-container {
    opacity: 1;
}

/* Modal Header — Browser Bar */
.modal-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.25rem;
    background: var(--green-dark);
    border-bottom: 1px solid rgba(27, 188, 94, .2);
    flex-shrink: 0;
}

.modal-browser-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ff5f57;
    font-size: 2rem;
    line-height: 1;
    padding: 0 .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, color .2s;
    outline: none;
}

.modal-close-btn:hover {
    transform: scale(1.1);
    color: #ff3b30;
}

.modal-address-bar {
    flex: 1;
    background: rgba(255, 255, 255, .08);
    border-radius: 6px;
    padding: .35rem .85rem;
    font-family: var(--font-mono);
    font-size: .7rem;
    color: rgba(255, 255, 255, .6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.modal-title {
    display: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .9rem;
    color: rgba(255, 255, 255, .9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, .6);
    font-size: 1.6rem;
    line-height: 1;
    padding: .25rem;
    border-radius: 4px;
    transition: color .2s, background .2s;
    flex-shrink: 0;
}

.modal-close:hover {
    color: var(--white);
    background: rgba(255, 255, 255, .1);
}

/* Modal Body */
.modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading State */
.modal-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--bg);
    z-index: 2;
    transition: opacity .4s;
}

.modal-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(26, 92, 56, .15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: modalSpin .8s linear infinite;
}

@keyframes modalSpin {
    to { transform: rotate(360deg); }
}

.modal-loading p {
    font-family: var(--font-mono);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Error State */
.modal-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    background: var(--bg);
    text-align: center;
    padding: 2rem;
    z-index: 3;
}

.modal-error[hidden],
.modal-error.hidden {
    display: none !important;
}

.modal-error-icon {
    font-size: 3rem;
    animation: modalErrorFloat 3s ease-in-out infinite alternate;
}

@keyframes modalErrorFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.modal-error h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: uppercase;
    color: var(--green-dark);
}

.modal-error p {
    font-size: .92rem;
    color: var(--text-muted);
    max-width: 400px;
}

/* ============================================================
   NOTEBOOK LAYOUT (inside modal)
   ============================================================ */
.notebook-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notebook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.25rem;
    background: var(--bg-alt);
    border-bottom: 1px solid rgba(26, 58, 42, .1);
    flex-shrink: 0;
}

.notebook-step-info {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.notebook-step-counter {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--green);
}

.notebook-step-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--green-dark);
}

.notebook-step-desc {
    font-size: .82rem;
    color: var(--text-muted);
    padding: 1.25rem;
    background: var(--bg-alt);
    border-right: 1px solid rgba(26, 58, 42, .08);
    white-space: pre-wrap;
    line-height: 1.6;
    overflow-y: auto;
    height: 100%;
}

/* Progress Bar */
.notebook-progress {
    height: 3px;
    background: rgba(26, 92, 56, .1);
    flex-shrink: 0;
}

.notebook-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--accent));
    transition: width .4s var(--ease);
}

/* Two-column Content */
.notebook-content {
    display: grid;
    grid-template-columns: 28% 42% 30%;
    flex: 1;
    overflow: hidden;
}

/* Code Panel */
.notebook-code-panel {
    background: #1e1e2e;
    padding: 1.25rem;
    overflow-y: auto;
    position: relative;
}

.notebook-code-panel pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: .78rem;
    line-height: 1.7;
    color: #cdd6f4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Syntax Highlighting — Custom lightweight */
.nb-keyword { color: #cba6f7; font-weight: 700; }
.nb-builtin { color: #f9e2af; }
.nb-string { color: #a6e3a1; }
.nb-comment { color: #6c7086; font-style: italic; }
.nb-number { color: #fab387; }
.nb-function { color: #89b4fa; }
.nb-operator { color: #89dceb; }
.nb-decorator { color: #f38ba8; }

/* Output Panel */
.notebook-output-panel {
    background: var(--bg);
    padding: 1.25rem;
    overflow-y: auto;
    overflow-x: auto;
    border-left: 1px solid rgba(26, 58, 42, .1);
    position: relative;
}

.notebook-output-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
    opacity: .5;
}

.notebook-output-placeholder .placeholder-icon {
    font-size: 3rem;
    margin-bottom: .5rem;
}

.notebook-output-placeholder p {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* Output content */
.notebook-output-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s var(--ease), transform .5s var(--ease);
}

.notebook-output-content.visible {
    opacity: 1;
    transform: none;
}

.notebook-output-content.text-output {
    font-family: var(--font-mono);
    font-size: .82rem;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    padding: .5rem;
}

/* Image lightbox effect */
.notebook-output-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.notebook-output-content img.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
    border-radius: 8px;
}

/* Table output */
.notebook-output-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: .72rem;
}

.notebook-output-content table th {
    background: var(--green);
    color: var(--white);
    padding: .5rem .75rem;
    text-align: left;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.notebook-output-content table td {
    padding: .45rem .75rem;
    border-bottom: 1px solid rgba(26, 58, 42, .1);
    color: var(--text);
}

.notebook-output-content table tr:nth-child(even) td {
    background: var(--bg-alt);
}

.nb-shape {
    margin-top: .75rem;
    font-family: var(--font-mono);
    font-size: .7rem;
    color: var(--text-muted);
}

/* Chart output */
.notebook-chart-container {
    width: 100%;
    max-height: 100%;
    position: relative;
}

.notebook-chart-container canvas {
    width: 100% !important;
    max-height: 350px;
}

/* Controls */
.notebook-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.25rem;
    background: var(--bg-alt);
    border-top: 1px solid rgba(26, 58, 42, .1);
    flex-shrink: 0;
}

.notebook-nav-btns {
    display: flex;
    gap: .5rem;
}

.nb-btn {
    padding: .5rem 1.2rem;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all .25s var(--ease);
}

.nb-btn-secondary {
    background: transparent;
    color: var(--green);
    border: 1.5px solid var(--green);
}

.nb-btn-secondary:hover:not(:disabled) {
    background: var(--green);
    color: var(--white);
}

.nb-btn-primary {
    background: var(--green);
    color: var(--white);
}

.nb-btn-primary:hover:not(:disabled) {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 188, 94, .3);
}

.nb-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* Dot indicators */
.notebook-dots {
    display: flex;
    gap: .35rem;
}

.notebook-dots .step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(26, 92, 56, .15);
    transition: background .3s, transform .3s var(--ease-bounce);
}

.notebook-dots .step-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

.notebook-dots .step-dot.completed {
    background: var(--green);
}

/* ============================================================
   CERTIFICATIONS
   ============================================================ */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.cert-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(26, 58, 42, .08);
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: transform .4s var(--ease), box-shadow .4s, border-color .4s;
}

.cert-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, rgba(27, 188, 94, .06), transparent);
    transition: height .5s var(--ease);
}

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 56px rgba(26, 58, 42, .14);
    border-color: var(--green);
}

.cert-card:hover::before {
    height: 100%;
}

.cert-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: transform .4s var(--ease-bounce);
}

.cert-card:hover .cert-icon {
    transform: scale(1.3) rotate(-8deg);
}

.cert-card h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--green-dark);
    margin-bottom: .5rem;
}

.cert-card p {
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    transition: letter-spacing .3s;
}

.cert-card:hover p {
    letter-spacing: .15em;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid rgba(26, 58, 42, .08);
    text-decoration: none;
    color: var(--text);
    position: relative;
    z-index: 5;
    /* Fix mailto click issue */
    overflow: hidden;
    transition: transform .4s var(--ease), box-shadow .4s, border-color .4s;
}

.contact-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(27, 188, 94, .06), transparent);
    transition: width .5s var(--ease);
}

.contact-card:hover {
    transform: translateX(6px);
    box-shadow: 0 12px 36px rgba(26, 58, 42, .12);
    border-color: var(--green);
}

.contact-card:hover::before {
    width: 100%;
}

.contact-card .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--green);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: background .3s, transform .3s var(--ease-bounce);
}

.contact-card:hover .icon {
    background: var(--accent);
    transform: scale(1.1) rotate(-3deg);
}

.contact-card .icon svg {
    fill: currentColor;
    width: 22px;
    height: 22px;
}

.contact-card span:last-child {
    font-size: .92rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--green);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(.8);
    transition: all .4s var(--ease-bounce);
    z-index: 999;
}

#back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

#back-to-top:hover {
    background: var(--accent);
    transform: translateY(-4px) scale(1.1);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--green-dark);
    padding: 2.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

footer p {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
}

/* ============================================================
   FADE-IN ANIMATIONS (initial load)
   ============================================================ */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp .8s var(--ease) forwards;
}

.delay-1 {
    animation-delay: .15s;
}

.delay-2 {
    animation-delay: .3s;
}

.delay-3 {
    animation-delay: .45s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   TILT EFFECT (JS adds inline styles)
   ============================================================ */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 800px;
}

/* ============================================================
   RESPONSIVE — Tablet (≤ 960px)
   ============================================================ */
@media (max-width: 960px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        order: -1;
        min-height: 400px;
    }

    .hero-big-text {
        font-size: clamp(2.5rem, 6vw, 4.5rem);
    }

    .hero-image img {
        max-width: 300px;
    }

    .hero-text {
        align-items: center;
    }

    .hero-code-icon {
        right: 5%;
    }

    .skills-grid,
    .cert-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: var(--bg);
        border: none;
        border-left: 1px solid rgba(26, 58, 42, .1);
        border-radius: 0;
        padding: 2rem;
        gap: 1.5rem;
        transition: right .35s var(--ease);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li a {
        font-size: .85rem;
        padding: .8rem 1.25rem;
        border-radius: 0;
        text-align: center;
    }

    .hamburger {
        display: flex;
    }

    .lang-switcher {
        margin-right: 3rem;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-h) + 2rem);
        padding-bottom: 3rem;
    }

    .hero-visual {
        min-height: 350px;
    }

    .hero-big-text {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero-text h1 {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }

    .hero-image img {
        max-width: 240px;
    }

    .hero-code-icon {
        font-size: 2.5rem;
        right: 0;
    }

    .section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
        margin-bottom: 2rem;
    }

    .skills-grid,
    .cert-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .modal-container {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        transform: translateY(100%);
        transition: opacity .4s var(--ease-bounce), transform .4s var(--ease-bounce);
    }

    .modal-overlay.active .modal-container {
        transform: translateY(0);
    }

    .notebook-content {
        grid-template-columns: 1fr;
        grid-template-rows: min-content 1fr 1fr;
    }

    .notebook-step-desc {
        border-right: none;
        border-bottom: 1px solid rgba(26, 58, 42, .08);
    }

    .notebook-code-panel {
        padding: 1rem;
    }

    .notebook-output-panel {
        border-left: none;
        border-top: 1px solid rgba(26, 58, 42, .1);
    }

    .edu-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cta-buttons {
        justify-content: center;
    }

    .cursor-glow {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE — Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.6rem;
    }

    .hero-big-text {
        font-size: 2rem;
    }

    .btn {
        padding: .65rem 1.2rem;
        font-size: .68rem;
    }

    .education-card {
        padding: 1.5rem;
    }

    .project-info {
        padding: 1.5rem;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal-up,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}