/* ============================================================
   LIGHT BLUE SKY THEME — DESIGN TOKENS
   ============================================================ */
:root {
    /* Icy sky-blue base, white elevated surfaces */
    --bg-base:        #c1d1d4;
    --bg-elevated:     #ffffff;
    --bg-elevated-2:   #f2f9fe;

    /* Deep navy text for strong contrast on light */
    --text-primary:    #0f2c47;
    --text-secondary:  #3d5a75;
    --text-muted:      #5c7488;

    /* Glass surfaces (white translucent — blur reveals the sky bg) */
    --card-surface:    rgba(255, 255, 255, 0.62);
    --card-surface-2:  rgba(255, 255, 255, 0.85);
    --border-clean:    rgba(15, 44, 71, 0.10);
    --border-strong:   rgba(15, 44, 71, 0.16);

    /* Sky-blue + cyan gradient accents (dark enough to read as text) */
    --accent-teal:     #0e7490;
    --accent-blue:      #0369a1;
    --accent-violet:   #7c3aed;
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0e7490 100%);
    --gold-accent:     #b45309;

    /* Soft slate-blue layered shadows (Emil: tinted to the backdrop, never
       plain black — layered soft + tight for real depth on a light canvas) */
    --shadow-soft:  0 1px 2px rgba(15,44,71,0.06),
                    0 10px 30px -12px rgba(15,44,71,0.16);
    --shadow-lift:  0 2px 4px rgba(15,44,71,0.08),
                    0 24px 60px -16px rgba(15,44,71,0.20);
    --glow-teal:    0 0 0 1px rgba(2,132,199,0.22),
                    0 18px 46px -12px rgba(2,132,199,0.28);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Emil Kowalski's exact strong easing curves (built-in CSS easings are too weak) */
    --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);      /* strong ease-out for UI enter/exit */
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);     /* on-screen movement / morphing */
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);      /* iOS-like drawer curve (Ionic) */
}

/* ============================================================
   RESET
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #eef7fd;
    background-image:
        radial-gradient(1200px 780px at 8% -12%, rgba(14,165,233,0.16), transparent 58%),
        radial-gradient(1100px 720px at 96% 4%, rgba(59,130,246,0.12), transparent 58%),
        radial-gradient(1000px 760px at 82% 108%, rgba(14,116,144,0.10), transparent 60%),
        radial-gradient(820px 620px at 16% 96%, rgba(180,83,9,0.05), transparent 62%),
        linear-gradient(175deg, #f6fbfe 0%, #eef7fd 46%, #e6f2fa 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    line-height: 1.65;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; }

/* ============================================================
   ANIMATED AMBIENT BACKGROUND
   ============================================================ */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Drifting aurora blobs */
.bg-aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    will-change: transform;
    mix-blend-mode: multiply;
}
.aurora-1 {
    width: 48vw; height: 48vw;
    max-width: 640px; max-height: 640px;
    top: -10%; left: -8%;
    background: radial-gradient(circle at 30% 30%, rgba(56,189,248,0.55), rgba(14,165,233,0.24) 45%, transparent 72%);
    animation: auroraDrift1 26s ease-in-out infinite;
}
.aurora-2 {
    width: 44vw; height: 44vw;
    max-width: 580px; max-height: 580px;
    top: 26%; right: -10%;
    background: radial-gradient(circle at 60% 40%, rgba(96,165,250,0.5), rgba(37,99,235,0.22) 45%, transparent 72%);
    animation: auroraDrift2 32s ease-in-out infinite;
}
.aurora-3 {
    width: 42vw; height: 42vw;
    max-width: 540px; max-height: 540px;
    bottom: -12%; left: 22%;
    background: radial-gradient(circle at 50% 50%, rgba(251,191,36,0.34), rgba(245,158,11,0.16) 50%, transparent 72%);
    animation: auroraDrift3 38s ease-in-out infinite;
}
.aurora-4 {
    width: 40vw; height: 40vw;
    max-width: 520px; max-height: 520px;
    top: 6%; left: 32%;
    background: radial-gradient(circle at 50% 50%, rgba(167,139,250,0.42), rgba(124,58,237,0.18) 48%, transparent 72%);
    animation: auroraDrift4 34s ease-in-out infinite;
}

@keyframes auroraDrift1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(8vw, 6vh, 0) scale(1.12); }
    66%      { transform: translate3d(3vw, 12vh, 0) scale(0.94); }
}
@keyframes auroraDrift2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(-7vw, 8vh, 0) scale(1.08); }
    66%      { transform: translate3d(-3vw, -6vh, 0) scale(1.16); }
}
@keyframes auroraDrift3 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(6vw, -10vh, 0) scale(1.1); }
}
@keyframes auroraDrift4 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-5vw, 8vh, 0) scale(1.15); }
}

/* Subtle moving grid overlay */
.bg-grid {
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(rgba(15,44,71,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,44,71,0.05) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 30%, transparent 75%);
    animation: gridPan 40s linear infinite;
    opacity: 0.45;
}
@keyframes gridPan {
    from { transform: translate(0, 0); }
    to   { transform: translate(54px, 54px); }
}

/* Faint film grain for depth */
.bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Soft light-wash vignette — brightens the edges to frame content (airy focus) */
.bg-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 92% 88% at 50% 36%, transparent 55%, rgba(255,255,255,0.55) 100%),
        radial-gradient(circle at 50% 118%, rgba(219,238,251,0.5), transparent 55%);
    pointer-events: none;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--primary-gradient); border-radius: 10px; }

::selection { background: var(--accent-teal); color: #ffffff; }

:focus-visible {
    outline: 2.5px solid var(--accent-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 2200;
}
.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    box-shadow: 0 0 12px rgba(2,132,199,0.6);
}

/* ============================================================
   GRADIENT TEXT
   ============================================================ */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
    background: var(--card-surface);
    backdrop-filter: blur(22px) saturate(1.35);          /* richer glass */
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    border: 1px solid var(--border-clean);
    border-radius: var(--radius-lg);
    /* layered: tinted drop shadow + faint inner top-light for real glass depth */
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.6);
    position: relative;
    z-index: 5;
    transition: transform 0.25s var(--ease-out), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.glass-card.interactive-hover:hover {
    transform: translateY(-6px);
    border-color: rgba(2,132,199,0.3);
    box-shadow: var(--glow-teal);
    background: var(--card-surface-2);
}

/* ============================================================
   SECTION LAYOUT
   ============================================================ */
section {
    padding: 120px 8% 80px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.section-eyebrow {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-teal);
    letter-spacing: 0.06em;
    margin-bottom: 0.8rem;
}
.section-eyebrow.center-eyebrow { text-align: center; }

.section-title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 3.5rem;
    color: var(--text-primary);
}

.about-section .section-title,
.skills-section .section-title,
.projects-section .section-title {
    text-align: left;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
nav.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8%;
    height: 78px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-clean);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 2000;
}

.nav-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.left {
    display: flex;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 700;
    flex-shrink: 0;
}

nav .right { display: flex; align-items: center; }

nav ul { display: flex; gap: 2rem; }

nav ul a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
    padding: 0.4rem 0;
}

nav ul a:hover,
nav ul a.active-link { color: var(--text-primary); }

nav ul a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease-out);   /* GPU underline instead of animating width */
}
nav ul a:hover::after,
nav ul a.active-link::after { transform: scaleX(1); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    min-height: 100vh;
    min-height: 100svh; /* accounts for mobile browser chrome */
    flex-direction: row;
    gap: 4rem;
    padding-top: 130px;
    align-items: center;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(2,132,199,0.12), transparent 70%);
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

.leftsection { flex: 1.2; position: relative; z-index: 2; }

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(2,132,199,0.08);
    border: 1px solid rgba(2,132,199,0.25);
    color: var(--accent-teal);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.badge-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent-teal);
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(2,132,199,0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(2,132,199,0); }
}

.leftsection h1 {
    font-size: clamp(3.2rem, 5.2vw, 4.4rem);   /* larger, fluid editorial scale */
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;                   /* crisp tight display type */
    margin-bottom: 0.7rem;
    color: var(--text-primary);
}

.leftsection h2 {
    font-size: 1.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    min-height: 45px;
    color: var(--text-secondary);
}

.hero-subheading {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    max-width: 560px;
}

.hero-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2.2rem;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    margin-bottom: 2.2rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), background 200ms ease, border-color 200ms ease, color 200ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
}

.btn-gradient {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(2,132,199,0.3);
}
.btn-gradient:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(2,132,199,0.45); }

.btn-glass {
    background: var(--card-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(10px);
}
.btn-glass:hover { background: var(--card-surface-2); transform: translateY(-2px); border-color: var(--accent-teal); }

.icon-action-btn {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--card-surface);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: transform 200ms var(--ease-out), border-color 200ms ease, color 200ms ease;
}
.icon-action-btn:hover { border-color: var(--accent-teal); color: var(--accent-teal); transform: translateY(-2px); }

/* ============================================================
   FLOATING TECH BADGES
   ============================================================ */
.hero-tech-row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}
.floating-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border-radius: 100px;
    background: var(--card-surface);
    border: 1px solid var(--border-clean);
    color: var(--text-secondary);
    animation: floatBadge 4s ease-in-out infinite;
}
.fb-1 { animation-delay: 0s; }
.fb-2 { animation-delay: 0.6s; }
.fb-3 { animation-delay: 1.2s; }
.fb-4 { animation-delay: 1.8s; }
@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============================================================
   HERO AVATAR
   ============================================================ */
.rightsection { flex: 0.8; display: flex; justify-content: center; position: relative; z-index: 2; }

.hero-avatar-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    flex-shrink: 0;
}

.avatar-pulse-ring {
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 50%;
    background: var(--primary-gradient);
    z-index: 1;
    padding: 3px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateRing 8s linear infinite;
}
@keyframes rotateRing { to { transform: rotate(360deg); } }

.hero-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    background: var(--bg-elevated);
    border: 4px solid var(--bg-base);
}

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats-section { padding: 60px 8% 40px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    width: 100%;
}
.stat-box {
    padding: 1.8rem;
    text-align: center;
}
.stat-box h3 {
    font-size: 2.3rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-box p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-card {
    padding: 2.5rem;
    max-width: 850px;
}
.about-card p {
    font-size: 1.08rem;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 1.2rem;
}
.about-card p:last-child { margin-bottom: 0; }
.about-card strong { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);   /* bento base */
    gap: 1.6rem;
    width: 100%;
}

/* Asymmetric 7/5 → 5/7 bento — deliberate, not a generic equal row */
.skill-card { grid-column: span 6; padding: 2rem; }
.skill-card:nth-child(1) { grid-column: span 7; }
.skill-card:nth-child(2) { grid-column: span 5; }
.skill-card:nth-child(3) { grid-column: span 5; }
.skill-card:nth-child(4) { grid-column: span 7; }

.skill-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.8rem;
}

.skill-icon-box {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-frontend { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.icon-backend  { background: rgba(2,132,199,0.12); color: var(--accent-teal); }
.icon-data     { background: rgba(139,92,246,0.12); color: var(--accent-violet); }
.icon-ai       { background: rgba(212,175,106,0.14); color: var(--gold-accent); }

.skill-card h3 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); }

.pill-cloud {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tech-pill {
    background: rgba(15,44,71,0.04);
    border: 1px solid rgba(15,44,71,0.08);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.pill-name { font-size: 0.9rem; font-weight: 500; position: relative; z-index: 2; color: var(--text-primary); }
.pill-level { font-size: 0.85rem; font-weight: 600; color: var(--accent-teal); position: relative; z-index: 2; }
.pill-progress {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: var(--target-width, 80%);
    background: linear-gradient(90deg, rgba(2,132,199,0.10) 0%, rgba(59,130,246,0.10) 100%);
    border-right: 2px solid rgba(59,130,246,0.3);
    z-index: 1;
    clip-path: inset(0 100% 0 0);           /* GPU reveal (Emil-endorsed) instead of animating width */
    transition: clip-path 1s var(--ease-out);
}
.tech-pill.in-view .pill-progress { clip-path: inset(0 0 0 0); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);   /* bento base */
    gap: 1.8rem;
    width: 100%;
}

/* Bento: first project is a full-width featured card (banner beside body);
   the remaining two sit half-width below it. */
.project-card-v2 { grid-column: span 3; }

.project-card-v2.project-featured {
    grid-column: span 6;
    flex-direction: row;
}
.project-featured .project-banner {
    width: 46%;
    height: auto;
    min-height: 320px;
    border-bottom: none;
    border-right: 1px solid var(--border-clean);
}
.project-featured .project-body { width: 54%; justify-content: center; }
.project-featured h3 { font-size: 1.55rem; }
.project-featured .project-summary { font-size: 1rem; }

.project-card-v2 {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.project-banner {
    height: 190px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-bottom: 1px solid var(--border-clean);
    background: var(--bg-elevated);  /* fills any letterbox gaps */
}

.project-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;   /* wide screenshots show their header/hero, not the middle */
}

/* ---- DESKTOP: three equal project cards in a clean sequence ----
   (tablet <=968px and mobile <=768px keep their own rules below, untouched) */
@media (min-width: 969px) {
    .projects-grid { grid-template-columns: repeat(3, 1fr); }

    .project-card-v2,
    .project-card-v2.project-featured {
        grid-column: auto;
        flex-direction: column;
    }

    .project-featured .project-banner {
        width: 100%;
        height: 190px;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-clean);
    }
    .project-featured .project-body { width: 100%; justify-content: flex-start; }
    .project-featured h3 { font-size: 1.25rem; }
    .project-featured .project-summary { font-size: 0.9rem; }

    /* Skills: drop the asymmetric bento — equal cards in a clean sequence */
    .skills-container { grid-template-columns: repeat(2, 1fr); }
    .skill-card,
    .skill-card:nth-child(1), .skill-card:nth-child(2),
    .skill-card:nth-child(3), .skill-card:nth-child(4) { grid-column: auto; }
}

/* ---- WIDE LAPTOP / DESKTOP: all four skill cards in a single clean row ---- */
@media (min-width: 1200px) {
    .skills-container { grid-template-columns: repeat(4, 1fr); }
    .skill-card { padding: 1.6rem; }
}



.bg-gradient-1 { background: linear-gradient(135deg, rgba(59,130,246,0.25) 0%, rgba(139,92,246,0.25) 100%); }
.bg-gradient-2 { background: linear-gradient(135deg, rgba(2,132,199,0.25) 0%, rgba(59,130,246,0.25) 100%); }
.bg-gradient-3 { background: linear-gradient(135deg, rgba(212,175,106,0.22) 0%, rgba(2,132,199,0.22) 100%); }

.badge-tag {
    position: relative;
    margin: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    z-index: 2;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--border-clean);
}

.project-body {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.project-body h3 { font-size: 1.25rem; margin-bottom: 0.6rem; font-weight: 600; color: var(--text-primary); }
.project-summary { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }

.bullet-feature-list { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.bullet-feature-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding-left: 22px;
    position: relative;
}
.bullet-feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-teal);
    font-weight: 700;
}

.tag-chips-wrapper {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
    margin-top: auto;
}
.tag-chips-wrapper span {
    background: rgba(15,44,71,0.04);
    border: 1px solid var(--border-clean);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.action-footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-clean);
    padding-top: 1rem;
    gap: 0.75rem;
}

.action-status-lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.project-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--card-surface);
    border: 1px solid var(--border-clean);
    color: var(--text-secondary);
    transition: transform 200ms var(--ease-out), background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.project-cta:hover {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px) scale(1.05);
}

.project-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lift);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.dual-timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    width: 100%;
}

.section-title.align-left {
    text-align: left;
    margin-bottom: 1.6rem;
    font-size: 1.5rem;
}

.interactive-timeline-box {
    padding: 2.2rem;
    height: 100%;
    border-left: 3px solid transparent;
    background-image: linear-gradient(var(--card-surface), var(--card-surface)), var(--primary-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.timeline-node {
    width: 10px; height: 10px;
    background: var(--primary-gradient);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(2,132,199,0.6);
    margin-bottom: 0.8rem;
}

.duration-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-blue);
    display: block;
    margin-bottom: 0.4rem;
}

.interactive-timeline-box h3 { color: var(--text-primary); margin-bottom: 0.5rem; font-size: 1.1rem; }
.institution-name { color: var(--text-secondary); margin-bottom: 1rem; }

.metric-badge {
    display: inline-block;
    background: rgba(212,175,106,0.1);
    border: 1px solid rgba(212,175,106,0.25);
    color: var(--gold-accent);
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.professional-accolades-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.professional-accolades-list li {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}
.accolade-icon { flex-shrink: 0; margin-top: 1px; }
.professional-accolades-list li span:last-child { color: var(--text-primary); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-flex-layout {
    display: flex;
    gap: 2.2rem;
    flex-wrap: wrap;
    width: 100%;
}

.form-wrapper-v2 {
    flex: 1.3;
    min-width: 300px;
    padding: 2.5rem;
}

.interactive-input-group {
    position: relative;
    margin-bottom: 1.8rem;
}

.interactive-input-group input,
.interactive-input-group textarea {
    width: 100%;
    padding: 0.9rem;
    background: rgba(15,44,71,0.04);
    border: 1px solid var(--border-clean);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.interactive-input-group textarea { height: 140px; resize: vertical; }

.interactive-input-group label {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: top 200ms var(--ease-out), left 200ms var(--ease-out), font-size 200ms var(--ease-out), color 200ms ease, background 200ms ease;
}
.interactive-input-group textarea ~ label { top: 1.2rem; transform: none; }

.interactive-input-group input:focus ~ label,
.interactive-input-group input:not(:placeholder-shown) ~ label,
.interactive-input-group textarea:focus ~ label,
.interactive-input-group textarea:not(:placeholder-shown) ~ label {
    top: -0.55rem;
    left: 0.7rem;
    font-size: 0.75rem;
    padding: 0 0.4rem;
    background: var(--bg-elevated);
    color: var(--accent-teal);
    transform: none;
}

.interactive-input-group input:focus,
.interactive-input-group textarea:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(2,132,199,0.12);
}

.submit-glow-btn {
    width: 100%;
    padding: 0.95rem;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(2,132,199,0.25);
    transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), background 200ms ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.submit-glow-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(2,132,199,0.4); }
.submit-glow-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-arrow { transition: transform 0.3s var(--ease-out); }
.submit-glow-btn:hover .btn-arrow { transform: translateX(4px); }

.metadata-profile-card {
    flex: 1;
    min-width: 290px;
    padding: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-avatar-v2 {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--bg-base);
    box-shadow: 0 0 0 2px var(--border-strong);
}

.metadata-profile-card h3 { color: var(--text-primary); font-size: 1.2rem; }
.profile-role { color: var(--accent-teal); font-size: 0.85rem; font-weight: 600; margin-top: 0.3rem; margin-bottom: 1.4rem; }

.structural-directory {
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.6rem;
}
.directory-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    background: rgba(15,44,71,0.04);
    transition: transform 200ms var(--ease-out), background 200ms ease, color 200ms ease;
}
.directory-row svg { flex-shrink: 0; color: var(--accent-teal); }
.directory-row:hover { background: rgba(2,132,199,0.08); color: var(--text-primary); }

.social-icon-row { display: flex; gap: 0.8rem; }
.social-icon-row a {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    background: rgba(15,44,71,0.04);
    border: 1px solid var(--border-clean);
    transition: transform 200ms var(--ease-out), background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.social-icon-row a:hover {
    color: #ffffff;
    background: var(--primary-gradient);
    border-color: transparent;
    transform: translateY(-3px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-v2 {
    padding: 2.5rem 8%;
    text-align: center;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-clean);
    position: relative;
    z-index: 10;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}
.footer-brand { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.dot-accent { color: var(--accent-teal); }
.footer-v2 p { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(2,132,199,0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: transform 250ms var(--ease-out), opacity 250ms var(--ease-out), visibility 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
    z-index: 1500;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(2,132,199,0.5); }

/* ============================================================
   MICRO-INTERACTIONS & POLISH
   ============================================================ */

/* Glass cards get a soft top-edge highlight + smoother lift */
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(160deg, rgba(255,255,255,0.9), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.45s var(--ease-out);
    pointer-events: none;
}
.glass-card:hover::before { opacity: 1; }

/* Shine sweep across gradient buttons */
.btn-gradient, .submit-glow-btn { position: relative; overflow: hidden; }
.btn-gradient::after, .submit-glow-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: translateX(0) skewX(-20deg);
    transition: transform 0.6s var(--ease-out);   /* GPU sweep instead of animating left */
    pointer-events: none;
}
.btn-gradient:hover::after, .submit-glow-btn:hover::after { transform: translateX(420%) skewX(-20deg); }

/* Press feedback — every pressable element confirms the press (Emil: scale 0.95–0.98) */
.btn:active,
.icon-action-btn:active,
.project-cta:active,
.submit-glow-btn:active:not(:disabled),
.social-icon-row a:active,
.back-to-top:active,
.menu-toggle:active {
    transform: scale(0.97);
}

/* Emil: gate hover-motion so a touch tap doesn't trigger/stick a hover transform */
@media (hover: none), (pointer: coarse) {
    .glass-card.interactive-hover:hover,
    .project-card-v2:hover,
    .skill-card:hover .skill-icon-box,
    .project-card-v2:hover .project-banner-img,
    .btn-gradient:hover, .btn-glass:hover, .icon-action-btn:hover,
    .project-cta:hover, .submit-glow-btn:hover,
    .directory-row:hover, .social-icon-row a:hover,
    .nav-logo, .back-to-top:hover {
        transform: none;
    }
}

/* Gentle float on the hero avatar */
.hero-avatar-wrapper { animation: avatarFloat 6s ease-in-out infinite; }
@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* Hero content entrance (staggered 60ms — Emil's 30–80ms range) */
.leftsection > * { animation: heroRise 0.55s var(--ease-out) both; }
.leftsection > *:nth-child(1) { animation-delay: 0.00s; }
.leftsection > *:nth-child(2) { animation-delay: 0.06s; }
.leftsection > *:nth-child(3) { animation-delay: 0.12s; }
.leftsection > *:nth-child(4) { animation-delay: 0.18s; }
.leftsection > *:nth-child(5) { animation-delay: 0.24s; }
.leftsection > *:nth-child(6) { animation-delay: 0.30s; }
.leftsection > *:nth-child(7) { animation-delay: 0.36s; }
@keyframes heroRise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rightsection { animation: heroFade 1s var(--ease-out) 0.3s both; }
@keyframes heroFade {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* Nav links lift slightly on hover for tactile feel */
nav ul a:hover { transform: translateY(-1px); }

/* Skill icon pops on card hover */
.skill-card .skill-icon-box { transition: transform 0.25s var(--ease-out); }
.skill-card:hover .skill-icon-box { transform: scale(1.12) rotate(-6deg); }

/* Project banner image subtle zoom on hover */
.project-banner-img { transition: transform 0.4s var(--ease-out); }
.project-card-v2:hover .project-banner-img { transform: scale(1.06); }

/* Directory rows slide on hover */
.directory-row { transition: transform 0.25s var(--ease-out), background 0.2s ease, color 0.2s ease; }
.directory-row:hover { transform: translateX(4px); }

/* While pointer-tilting, use a crisp transition (no laggy 0.4s catch-up) */
.is-tilting {
    transition: transform 0.12s ease-out, border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease !important;
    z-index: 20 !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-backdrop { display: none; }

@media (max-width: 968px) {
    section { padding: 100px 6% 60px; }

    .hero-section {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 120px;
        gap: 2.5rem;
        min-height: auto;
    }
    .leftsection { display: flex; flex-direction: column; align-items: center; }
    .hero-subheading { margin-left: auto; margin-right: auto; }
    .hero-buttons, .hero-tech-row { justify-content: center; }
    .leftsection h1 { font-size: 2.7rem; }
    .hero-avatar-wrapper { width: 250px; height: 250px; }

    .about-section .section-title,
    .skills-section .section-title,
    .projects-section .section-title { text-align: center; }
    .about-card { margin: 0 auto; }

    /* Bento collapses to 2 columns; reset the desktop span rules */
    .skills-container { grid-template-columns: repeat(2, 1fr); }
    .skill-card,
    .skill-card:nth-child(1), .skill-card:nth-child(2),
    .skill-card:nth-child(3), .skill-card:nth-child(4) { grid-column: auto; }

    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .project-card-v2 { grid-column: auto; }
    .project-card-v2.project-featured { grid-column: span 2; flex-direction: column; }
    .project-featured .project-banner {
        width: 100%; height: 190px; min-height: 0;
        border-right: none; border-bottom: 1px solid var(--border-clean);
    }
    .project-featured .project-body { width: 100%; justify-content: flex-start; }

    .dual-timeline-grid { grid-template-columns: 1fr; gap: 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- TABLET: slightly larger hero on portrait tablets ---- */
@media (min-width: 700px) and (max-width: 968px) {
    .hero-avatar-wrapper { width: 280px; height: 280px; }
    .leftsection h1 { font-size: 3rem; }
}

/* ---- Lighten the animated background on smaller / touch screens (perf) ---- */
@media (max-width: 900px) {
    .bg-aurora { filter: blur(60px); opacity: 0.42; }
    .aurora-3, .aurora-4 { display: none; }
    .bg-grid   { animation: none; opacity: 0.3; background-size: 44px 44px; }
    .bg-noise  { display: none; }
    .bg-vignette { background: radial-gradient(ellipse 100% 92% at 50% 34%, transparent 58%, rgba(255,255,255,0.5) 100%); }
}

@media (max-width: 768px) {
    nav.glass-nav { padding: 0 6%; }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px; height: 44px;
        z-index: 2500;
    }
    .menu-toggle span {
        width: 24px;
        height: 2.5px;
        background: var(--text-primary);
        border-radius: 2px;
        margin: 0 auto;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .menu-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

    nav .right {
        position: fixed;
        top: 78px;
        right: 0;
        width: min(80%, 330px);
        height: calc(100vh - 78px);
        height: calc(100dvh - 78px);
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: -10px 0 30px rgba(15,44,71,0.14);
        transform: translateX(100%);                    /* GPU drawer instead of animating 'right' */
        transition: transform 0.4s var(--ease-drawer);  /* Emil's iOS drawer curve */
        overflow-y: auto;
        will-change: transform;
    }
    nav .right.active { transform: translateX(0); }

    /* Dim + tap-away backdrop when menu is open */
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 78px 0 0 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        z-index: 1900;
    }
    .nav-backdrop.active { opacity: 1; visibility: visible; }

    /* Lock page scroll while the menu is open */
    body.menu-open { overflow: hidden; }

    nav ul { flex-direction: column; padding: 2.5rem 2rem; gap: 0.4rem; }
    nav ul a {
        font-size: 1.05rem;
        display: block;
        padding: 0.85rem 0.5rem;   /* bigger tap target */
        border-radius: 8px;
    }
    nav ul a:hover, nav ul a.active-link { background: rgba(2,132,199,0.08); }
    nav ul a::after { display: none; }   /* underline replaced by row highlight on mobile */

    .hero-section { padding-top: 110px; }
    .leftsection h1 { font-size: 2.3rem; }
    .leftsection h2 { font-size: 1.4rem; }
    .hero-subheading { font-size: 1rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .btn, .icon-action-btn { width: 100%; justify-content: center; }
    .hero-avatar-wrapper { width: 220px; height: 220px; }

    .section-title { font-size: 1.9rem; margin-bottom: 2.2rem; }

    /* Single column: skills + projects fully stack */
    .skills-container { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card-v2.project-featured { grid-column: auto; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    .contact-flex-layout { flex-direction: column; }
    .form-wrapper-v2, .metadata-profile-card { width: 100%; padding: 1.8rem; }

    .back-to-top { width: 44px; height: 44px; bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
    html { font-size: 14.5px; }
    .leftsection h1 { font-size: 2rem; }
    .leftsection h2 { font-size: 1.2rem; }
    .hero-avatar-wrapper { width: 190px; height: 190px; }
    .section-title { font-size: 1.7rem; }
    .glass-card { border-radius: 14px; }
    section { padding: 88px 5.5% 50px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-box { padding: 1.3rem; }
    .stat-box h3 { font-size: 1.8rem; }
}

/* ---- Landscape phones: don't lock hero to full height ---- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section { min-height: auto; padding-top: 100px; }
    section { padding-top: 90px; }
}

/* ---- Very small phones: tighten spacing further ---- */
@media (max-width: 360px) {
    .hero-tech-row { gap: 0.45rem; }
    .floating-badge { font-size: 0.72rem; padding: 0.4rem 0.7rem; }
    .stats-grid { gap: 0.8rem; }
    .welcome-badge { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
    /* Emil: reduced motion = fewer & gentler, NOT zero.
       Remove continuous & position-based movement; keep opacity/colour transitions. */

    /* Stop all ambient/looping movement */
    .bg-aurora, .bg-grid, .avatar-pulse-ring, .badge-dot,
    .floating-badge, .hero-avatar-wrapper {
        animation: none !important;
    }
    .animated-bg { opacity: 0.5; }

    /* Entrances resolve to their final state — no travel */
    .leftsection > *, .rightsection {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    /* Reveal skill bars fully, no clip sweep */
    .pill-progress { clip-path: inset(0 0 0 0) !important; transition: none !important; }

    /* Neutralise transform-based hovers/tilts — colour, shadow & opacity still animate */
    .glass-card.interactive-hover:hover,
    .project-card-v2:hover, .project-card-v2:hover .project-banner-img,
    .skill-card:hover .skill-icon-box,
    .btn:hover, .btn:active, .icon-action-btn:hover,
    .project-cta:hover, .submit-glow-btn:hover,
    .directory-row:hover, .social-icon-row a:hover,
    .back-to-top, .back-to-top:hover, .is-tilting {
        transform: none !important;
    }

    html { scroll-behavior: auto; }
}