:root {
    --accent1: #34d399;
    --accent2: #60a5fa;
    --muted: #6b7280;
    --card-bg: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    --card-border: rgba(255,255,255,0.06);
    --shadow: 0 12px 30px rgba(2,6,23,0.14);
    --shadow-lg: 0 26px 60px rgba(2,6,23,0.20);
    --glass-accent: rgba(96,165,250,0.08);
    --glass-accent-2: rgba(94,234,212,0.06);
    --txt: #4b5563;
}

* {
    box-sizing: border-box;
}

body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.cool-effect {
    position: relative;
    display: inline-block;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: none;
    line-height: 1.2;
    color: transparent;
    background: linear-gradient(90deg, #34d399, #60a5fa);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    transition: transform .28s cubic-bezier(.2,.9,.28,1), filter .28s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: normal;
    word-wrap: break-word;
}

.cool-effect .char {
    display: inline-block;
    transform-origin: 50% 100%;
    will-change: transform, opacity, filter;
    animation: wave 1200ms cubic-bezier(.2,.9,.28,1) infinite;
    animation-delay: calc(var(--i) * 70ms);
    opacity: 0.98;
}

.cool-effect .char.space {
    width: .5em;
    display: inline-block;
    animation: none;
    opacity: 1;
}

.cool-effect::before {
    content: "";
    position: absolute;
    inset: 0;
    left: -40%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 45%, rgba(255,255,255,0.05) 60%, rgba(255,255,255,0) 100%);
    transform: skewX(-18deg);
    filter: blur(10px);
    opacity: 0.0;
    transition: opacity .4s ease;
    pointer-events: none;
    animation: shimmer 3.2s linear infinite;
}

.cool-effect::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: -10px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #60a5fa);
    box-shadow: 0 14px 30px rgba(124,58,237,0.08), 0 8px 18px rgba(96,165,250,0.06);
    transform: scaleX(.6);
    transform-origin: center;
    transition: transform .45s cubic-bezier(.2,.9,.28,1), opacity .3s ease;
    opacity: .95;
}

.cool-effect:hover {
    transform: translateY(-6px) scale(1.02);
    filter: drop-shadow(0 10px 30px rgba(124,58,237,0.14));
}

.cool-effect:hover::before {
    opacity: .85;
}

.cool-effect:hover::after {
    transform: scaleX(1);
    box-shadow: 0 24px 48px rgba(124,58,237,0.16);
}

.cool-effect:hover .char {
    animation-play-state: paused;
    transform: translateY(-8px) rotate(-2deg) scale(1.03);
    transition: transform .28s cubic-bezier(.2,.9,.28,1);
    text-shadow: 0 12px 28px rgba(124,58,237,0.12), 0 2px 8px rgba(0,0,0,0.25);
}

.cool-effect.is-pop .char {
    animation: pop 520ms cubic-bezier(.2,.9,.28,1);
}

@keyframes wave {
    0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: .95; }
    25%  { transform: translateY(-6px) rotate(-1.2deg) scale(1.01); opacity: 1; }
    50%  { transform: translateY(0) rotate(0.6deg) scale(1); opacity: .98; }
    75%  { transform: translateY(-4px) rotate(-0.6deg) scale(1.005); opacity: 1; }
    100% { transform: translateY(0) rotate(0deg) scale(1); opacity: .95; }
}

@keyframes shimmer {
    0%   { left: -40%; opacity: 0; }
    30%  { left: -5%; opacity: 0.45; }
    60%  { left: 55%; opacity: 0.25; }
    100% { left: 120%; opacity: 0; }
}

@keyframes pop {
    0%   { transform: translateY(0) scale(1); }
    30%  { transform: translateY(-12px) scale(1.06); }
    100% { transform: translateY(0) scale(1); }
}

.h5-effect {
    font-size: clamp(1rem, 3vw, 1.6rem);
    color: #555;
    line-height: 1.6;
    max-width: 600px;
    margin: 20px auto 0;
    position: relative;
    display: inline-block;
    transition: all 0.6s ease;
}

.h5-effect:hover {
    color: transparent;
    background: linear-gradient(90deg, #34d399, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    transform: translateY(-5px);
    text-shadow: 0 0 20px rgba(255, 0, 153, 0.3);
}

.h5-effect::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #34d399, #60a5fa);
    transition: width 0.4s ease;
    border-radius: 4px;
    opacity: 0.6;
}

.h5-effect:hover::after {
    width: 80%;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.navbar:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.navbar .btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.navbar .btn:hover {
    background-color: #212121;
    color: #fff !important;
    transform: translateY(-2px);
}

.tech-card {
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    padding: clamp(16px, 3vw, 28px);
    margin: 28px auto 40px;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
    transition: transform .42s cubic-bezier(.2,.9,.28,1), box-shadow .42s ease, border-color .42s ease, filter .42s ease;
    position: relative;
    overflow: visible;
    isolation: isolate;
}

@media (min-width: 768px) {
    .tech-card {
        grid-template-columns: 1fr 360px;
    }
}

.tech-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.0;
    transition: opacity .38s ease, transform .5s ease;
    pointer-events: none;
}

.tech-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255,255,255,0.12);
    filter: saturate(1.02);
}

.tech-card:hover::before {
    opacity: 1;
    transform: translateY(-3px);
}

.tech-card::after {
    content: "";
    position: absolute;
    inset: -20%;
    pointer-events: none;
    background: radial-gradient(600px 240px at -20% 120%, rgba(96,165,250,0.04), transparent 60%),
    radial-gradient(800px 300px at 120% -20%, rgba(94,234,212,0.03), transparent 60%);
    opacity: 0;
    transition: opacity .42s ease;
    z-index: 0;
    mix-blend-mode: screen;
}

.tech-card:hover::after {
    opacity: 1;
}

.tech-content {
    position: relative;
    z-index: 2;
    min-width: 0;
}

.category {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    letter-spacing: .4px;
    color: var(--muted);
    text-transform: uppercase;
    background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: 0 6px 18px rgba(2,6,23,0.03) inset;
    font-size: clamp(0.7rem, 2vw, 0.82rem);
}

.tech-title {
    margin: .25rem 0 0.75rem;
    font-weight: 800;
    color: #111827;
    z-index: 2;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
}

.tech-description {
    color: var(--txt);
    opacity: .95;
    line-height: 1.7;
    z-index: 2;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.tech-media {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.tech-image {
    width: 100%;
    max-width: min(280px, 90vw);
    height: auto;
    border-radius: 10px;
    transform: translateZ(0);
    transition: transform .45s cubic-bezier(.2,.9,.28,1), box-shadow .45s ease, filter .45s ease;
    will-change: transform, filter;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    background: #fff;
    padding: 8px;
}

.tech-card:hover .tech-image {
    transform: translateY(-10px) rotate(-1deg) scale(1.03);
    filter: saturate(1.06) drop-shadow(0 22px 48px rgba(2,6,23,0.14));
}

.tech-media::before {
    content: "";
    position: absolute;
    inset: auto;
    width: 72%;
    height: 72%;
    border-radius: 999px;
    left: 14%;
    top: 8%;
    background: radial-gradient(circle at 50% 50%, rgba(96,165,250,0.2), rgba(94,234,212,0.12) 60%, transparent 70%);
    filter: blur(28px);
    z-index: 0;
    opacity: .9;
}

.text-info { color: #60a5fa; }
.text-success { color: #34d399; }
.text-primary { color: #93c5fd; }
.text-warning { color: #fbbf24; }
.text-danger { color: #f87171; }
.text-secondary { color: #a8b3bc; }

.section-subtitle {
    position: relative;
    display: inline-block;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0.15em 0;
    --g1: var(--accent, #ff6a88);
    --g2: var(--brand, #60a5fa);
    background: linear-gradient(90deg, var(--g1), var(--g2), var(--g1));
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 6px 18px rgba(0,0,0,0.35);
    filter: drop-shadow(0 2px 8px rgba(94,234,212,0.12));
    animation: subtitleSlideIn 900ms cubic-bezier(.2,.9,.28,1) both,
    gradientShift 6s linear infinite,
    glowPulse 3.6s ease-in-out infinite 900ms;
}

.section-subtitle::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -10px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,0,153,0.95), rgba(96,165,250,0.9));
    transform-origin: left;
    transform: scaleX(0);
    opacity: 0.95;
    box-shadow: 0 8px 20px rgba(96,165,250,0.12);
    transition: transform .45s cubic-bezier(.2,.9,.28,1), opacity .3s ease;
}

.section-subtitle:hover {
    transform: translateY(-4px);
    text-shadow: 0 10px 30px rgba(94,234,212,0.45), 0 2px 8px rgba(0,0,0,0.35);
}

.section-subtitle:hover::after {
    transform: scaleX(1);
}

@keyframes subtitleSlideIn {
    0%   { opacity: 0; transform: translateY(18px) scale(.98); filter: blur(3px); }
    60%  { opacity: 1; transform: translateY(-6px) scale(1.03); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes glowPulse {
    0%   { text-shadow: 0 6px 18px rgba(0,0,0,0.35); filter: drop-shadow(0 2px 6px rgba(94,234,212,0.08)); }
    50%  { text-shadow: 0 10px 30px rgba(94,234,212,0.30); filter: drop-shadow(0 4px 14px rgba(94,234,212,0.18)); }
    100% { text-shadow: 0 6px 18px rgba(0,0,0,0.35); filter: drop-shadow(0 2px 6px rgba(94,234,212,0.08)); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.tech-content,
.tech-media {
    opacity: 0;
    transition: transform .72s cubic-bezier(.2,.9,.28,1), opacity .56s ease;
    will-change: transform, opacity;
}

.tech-content {
    transform: translate3d(-40px, 0, 0);
}

.tech-media {
    transform: translate3d(40px, 0, 0);
}

.tech-card.in-view .tech-content,
.tech-card.in-view .tech-media {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.tech-card .tech-content {
    transition-delay: 0s;
}

.tech-card .tech-media {
    transition-delay: 0.12s;
}

.tech-card:nth-of-type(even) .tech-content {
    transform: translate3d(40px, 0, 0);
}

.tech-card:nth-of-type(even) .tech-media {
    transform: translate3d(-40px, 0, 0);
}

.tech-card:nth-of-type(even).in-view .tech-content,
.tech-card:nth-of-type(even).in-view .tech-media {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.hero-section {
    position: relative;
    width: 100%;
    height: clamp(50vh, 70vh, 80vh);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.hero-section h2,
.hero-section h5 {
    color: #fff;
    z-index: 2;
}

.hero-section h2 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    margin-bottom: 15px;
}

.hero-section h5 {
    font-size: clamp(1rem, 3vw, 1.2rem);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.school-text,
.project-text {
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    font-weight: 500;
    margin-bottom: 10px;
}

.school-logo {
    width: 70%;
    max-width: 220px;
    margin: 10px auto 15px;
    display: block;
    transition: transform 0.3s ease;
}

.school-logo:hover {
    transform: scale(1.05);
}

.project-logo {
    width: 65%;
    max-width: 180px;
    margin: 10px auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.project-logo:hover {
    transform: scale(1.05);
}

.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, #a445b2, #00c6ff);
    margin: 20px 0;
}

.card-profile {
    transition: transform .32s cubic-bezier(.2,.9,.28,1), box-shadow .32s ease;
}

.card-profile .card-avatar {
    position: relative;
    display: inline-block;
    padding: 6px;
    border-radius: 999px;
    transition: transform .32s cubic-bezier(.2,.9,.28,1), box-shadow .32s ease;
    will-change: transform;
}

.card-profile .card-avatar img {
    display: block;
    width: clamp(96px, 15vw, 120px);
    height: clamp(96px, 15vw, 120px);
    object-fit: cover;
    border-radius: 50%;
    transition: transform .32s cubic-bezier(.2,.9,.28,1), box-shadow .32s ease, filter .32s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card-profile .card-avatar::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124,58,237,0.12), rgba(96,165,250,0.10));
    filter: blur(10px);
    opacity: 0;
    transform: scale(.85);
    transition: transform .32s cubic-bezier(.2,.9,.28,1), opacity .32s ease;
    pointer-events: none;
}

.card-profile:hover,
.card-profile:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(124,58,237,0.06), 0 8px 26px rgba(0,0,0,0.08);
}

.card-profile:hover .card-avatar,
.card-profile:focus-within .card-avatar {
    transform: translateY(-6px);
}

.card-profile:hover .card-avatar img,
.card-profile:focus-within .card-avatar img {
    transform: translateY(-6px) scale(1.03);
    filter: saturate(1.06);
    box-shadow: 0 22px 48px rgba(124,58,237,0.10);
}

.card-profile:hover .card-avatar::after,
.card-profile:focus-within .card-avatar::after {
    opacity: 1;
    transform: scale(1);
}

.card-profile .card-avatar a:focus,
.card-profile .card-avatar a:focus-visible {
    outline: none;
}

.lang {
    display: none;
}

.lang.active {
    display: block;
}

.lang-toggle-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 18px 0;
    user-select: none;
    flex-wrap: wrap;
}

.lang-toggle-wrap .lang-label {
    font-weight: 700;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 8px;
    transition: all .18s ease;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.lang-toggle-wrap .lang-label.active {
    color: #fff;
    background: linear-gradient(90deg, var(--accent1), var(--accent2));
    box-shadow: 0 8px 22px rgba(2,6,23,0.10);
}

.lang-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.lang-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    left: 0;
    top: 0;
}

.lang-switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    transition: background .22s ease, box-shadow .22s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.lang-switch .slider::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: transform .22s cubic-bezier(.2,.9,.28,1), box-shadow .18s ease;
    box-shadow: 0 6px 16px rgba(2,6,23,0.12);
}

.lang-switch input:checked + .slider {
    background: linear-gradient(90deg, var(--accent1), var(--accent2));
    box-shadow: 0 10px 28px rgba(52,211,153,0.08);
}

.lang-switch input:checked + .slider::before {
    transform: translateX(26px);
    box-shadow: 0 10px 28px rgba(2,6,23,0.18);
}

.diagram-section {
    margin: 28px auto;
    padding: clamp(12px, 3vw, 22px);
    max-width: 1200px;
}

.diagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 2rem;
    justify-items: center;
}

.diagram-card {
    width: 100%;
    max-width: 520px;
    transition: transform .32s ease, box-shadow .32s ease;
}

.diagram-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(2,6,23,0.10);
}

.diagram-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: transform .32s ease, filter .32s ease;
}

.diagram-card:hover .diagram-image {
    transform: scale(1.02);
    filter: saturate(1.04);
}

.diagram-caption {
    font-weight: 700;
    color: var(--muted);
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    margin: 6px 0 0;
    text-align: center;
}

@media (max-width: 768px) {
    .tech-card {
        margin: 20px auto;
    }

    .cool-effect::after {
        bottom: -8px;
        height: 5px;
    }
}

@media (max-width: 420px) {
    .lang-toggle-wrap {
        gap: 6px;
    }

    .lang-toggle-wrap .lang-label {
        padding: 4px 8px;
        font-size: .88rem;
    }

    .lang-switch {
        width: 46px;
        height: 24px;
    }

    .lang-switch .slider::before {
        width: 20px;
        height: 20px;
        left: 3px;
        top: 2px;
    }

    .lang-switch input:checked + .slider::before {
        transform: translateX(22px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cool-effect .char,
    .cool-effect::before,
    .tech-card,
    .tech-media,
    .tech-content,
    .tech-image,
    .diagram-card,
    .diagram-image,
    .lang-toggle-wrap .lang-label,
    .lang-switch .slider,
    .lang-switch .slider::before {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .tech-content,
    .tech-media {
        opacity: 1 !important;
    }
}