/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #090a0d;
    color: #e0e0e0;
    line-height: 1.6;
}
a { color: #00d4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 6rem 0; position: relative; z-index: 2; }
.section__title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === NAV === */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 2rem;
    transition: background 0.3s;
}
.nav--scrolled { background: rgba(9, 10, 13, 0.95); backdrop-filter: blur(8px); }
.nav__logo { font-weight: 700; font-size: 1.25rem; color: #fff; }
.nav__links { display: flex; gap: 1.5rem; }
.nav__links a { color: #ccc; font-size: 0.9rem; transition: color 0.2s; }
.nav__links a:hover { color: #00d4ff; text-decoration: none; }
.nav__toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* === HERO === */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    position: relative;
    z-index: 2;
    overflow: hidden;
}
.hero__content { position: relative; z-index: 1; }
.hero__name { font-size: 3.5rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.hero__title {
    font-size: 1.5rem; font-weight: 300;
    background: linear-gradient(90deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero__tagline { margin-top: 1rem; color: #999; font-size: 1.1rem; }
.hero__scroll {
    position: absolute; bottom: 2rem;
    animation: bounce 2s infinite;
}
.hero__scroll-arrow {
    display: block; width: 24px; height: 24px;
    border-right: 2px solid #00d4ff; border-bottom: 2px solid #00d4ff;
    transform: rotate(45deg);
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* === ABOUT === */
.about__text { max-width: 750px; margin: 0 auto; font-size: 1.1rem; color: #bbb; text-align: center; }

/* === SKILLS === */
.skills__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
.skills__category {
    background: #111220; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 1.5rem; position: relative; z-index: 3;
}
.skills__category h3 { font-size: 1rem; color: #00d4ff; margin-bottom: 1rem; }
.skills__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge {
    display: inline-block; padding: 0.3rem 0.75rem; font-size: 0.8rem;
    border-radius: 50px; background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3); color: #00d4ff;
}

/* === PROJECTS === */
.projects__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.project-card {
    background: #111220; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s;
    position: relative; z-index: 3;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0, 212, 255, 0.1); }
.project-card__video { position: relative; }
.project-card__video video { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #12121a; display: block; }
.video-placeholder {
    width: 100%; aspect-ratio: 16/9; background: #12121a;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
}
.play-icon { font-size: 2.5rem; color: rgba(255,255,255,0.3); }
.video-label { font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.project-card__body { padding: 1.5rem; }
.project-card__body h3 { font-size: 1.2rem; color: #fff; margin-bottom: 0.25rem; }
.project-card__subtitle { color: #999; font-size: 0.9rem; margin-bottom: 0.75rem; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.project-card__body p { color: #aaa; font-size: 0.9rem; margin-bottom: 1rem; }

/* === BUTTONS === */
.btn {
    display: inline-block; padding: 0.6rem 1.5rem; border-radius: 6px;
    font-size: 0.9rem; font-weight: 500; transition: background 0.2s;
}
.btn--github { background: rgba(0, 212, 255, 0.15); color: #00d4ff; border: 1px solid #00d4ff; }
.btn--github:hover { background: #00d4ff; color: #0a0a0f; text-decoration: none; }
.btn--download {
    display: inline-block; margin-top: 2rem; padding: 0.8rem 2rem;
    background: #1a1a2e; color: #00d4ff; border: 1px solid #00d4ff;
    border-radius: 6px; font-weight: 600; transition: background 0.2s;
}
.btn--download:hover { background: #00d4ff; color: #0a0a0f; text-decoration: none; }

/* === CV SECTION (WHITE) === */
.cv {
    background: #090a0d; color: #333; padding: 5rem 0;
}
.cv__container { max-width: 850px; margin: 0 auto; padding: 3rem 2rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08); border-radius: 8px; background: #fff;
}
.cv__title {
    font-size: 2rem; text-align: center; margin-bottom: 2.5rem;
    background: none; -webkit-text-fill-color: #222; color: #222;
}
.cv__section { margin-bottom: 2rem; }
.cv__section h3 { font-size: 1.2rem; color: #222; border-bottom: 2px solid #00d4ff; padding-bottom: 0.4rem; margin-bottom: 1rem; }
.cv__entry { margin-bottom: 1.5rem; }
.cv__entry-header { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 0.25rem; }
.cv__entry-header strong { color: #111; }
.cv__entry-header span { color: #666; font-size: 0.9rem; }
.cv__entry-meta { color: #777; font-size: 0.85rem; margin-bottom: 0.5rem; }
.cv__section ul { list-style: disc; padding-left: 1.5rem; }
.cv__section li { margin-bottom: 0.4rem; font-size: 0.9rem; color: #444; }

/* === CONTACT === */
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; text-align: center; }
.contact__item { padding: 2rem 1.5rem; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); overflow-wrap: break-word; word-break: break-word; }
.contact__label { display: block; font-size: 0.8rem; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.contact__hint { text-align: center; color: #666; font-size: 0.9rem; margin-bottom: 1.5rem; }
.contact__reveal { cursor: pointer; transition: border-color 0.3s, box-shadow 0.3s; }
.contact__reveal:hover { border-color: rgba(0, 212, 255, 0.3); box-shadow: 0 0 12px rgba(0, 212, 255, 0.1); }
.contact__hidden { color: #555; letter-spacing: 2px; }
.contact__revealed { animation: revealSlide 0.4s ease-out; }
@keyframes revealSlide {
    0% { opacity: 0; transform: translateY(8px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* === FOOTER === */
.footer { text-align: center; padding: 2rem; color: #555; font-size: 0.85rem; border-top: 1px solid rgba(255,255,255,0.05); }

/* === ANIMATIONS === */
.animate { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.animate--visible { opacity: 1; transform: translateY(0); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero__name { font-size: 2.2rem; }
    .hero__title { font-size: 1.2rem; }
    .nav__links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: rgba(9,10,13,0.98); padding: 1rem 2rem; gap: 1rem; }
    .nav__links--open { display: flex; }
    .nav__toggle { display: block; }
    .projects__grid { grid-template-columns: 1fr; }
    .cv__entry-header { flex-direction: column; }
    .cv__container { padding: 2rem 1.25rem; }
}

/* === BACKGROUND CANVAS === */
.bg-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}
@media (max-width: 768px) {
    .bg-canvas { display: none; }
}

/* === PROJECT CARD THUMBNAILS === */
.project-card { cursor: pointer; }
.project-card__thumb {
    width: 100%; aspect-ratio: 16/9; background: #12121a;
    display: flex; align-items: center; justify-content: center;
}
.project-card__play {
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(0, 212, 255, 0.15); border: 2px solid rgba(0, 212, 255, 0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #00d4ff; transition: transform 0.2s, background 0.2s;
}
.project-card:hover .project-card__play {
    transform: scale(1.1); background: rgba(0, 212, 255, 0.25);
}

/* === PROJECT MODAL === */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    position: relative; width: 90%; max-width: 800px;
    background: #111220; border-radius: 12px; overflow: hidden;
    transform: scale(0.95); transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-close {
    position: absolute; top: 12px; right: 16px; z-index: 10;
    background: none; border: none; color: #fff; font-size: 2rem;
    cursor: pointer; line-height: 1; opacity: 0.7; transition: opacity 0.2s;
}
.modal-close:hover { opacity: 1; }

/* Slider */
.modal-slider { overflow: hidden; position: relative; width: 100%; clip: rect(0, auto, auto, 0); }
.modal-slides {
    display: flex; transition: transform 0.4s ease; width: 100%;
}
.modal-slide { min-width: 100%; width: 100%; flex-shrink: 0; position: relative; overflow: hidden; }
.modal-slide__video { background: #000; position: relative; overflow: hidden; clip-path: inset(0); }
.modal-slide__video video {
    width: 100%; max-height: 400px; object-fit: contain; display: block;
}
.modal-slide__info { padding: 1.5rem; overflow: hidden; text-overflow: ellipsis; }
.modal-slide__info h3 { font-size: 1.2rem; color: #fff; margin-bottom: 0.25rem; }
.modal-slide__subtitle { color: #999; font-size: 0.9rem; margin-bottom: 0.75rem; }
.modal-slide__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.modal-slide__info p { color: #aaa; font-size: 0.9rem; margin-bottom: 1rem; }

/* Arrows */
.modal-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff; font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}
.modal-arrow:hover { background: rgba(0, 212, 255, 0.2); box-shadow: 0 0 12px rgba(0, 212, 255, 0.3); }
.modal-arrow--left { left: -56px; }
.modal-arrow--right { right: -56px; }

/* Dots */
.modal-dots {
    display: flex; justify-content: center; gap: 8px; padding: 1rem 0;
}
.modal-dot {
    width: 10px; height: 10px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, 0.3); cursor: pointer; transition: background 0.2s;
}
.modal-dot.active { background: #00d4ff; }

/* Modal responsive */
@media (max-width: 900px) {
    .modal-arrow--left { left: 8px; }
    .modal-arrow--right { right: 8px; }
    .modal-arrow { background: rgba(0, 0, 0, 0.5); }
}
@media (max-width: 768px) {
    .modal-content { width: 95%; border-radius: 8px; }
    .modal-slide__video video { max-height: 250px; }
    .modal-slide__info { padding: 1rem; }
}

/* === CUSTOM VIDEO PLAYER === */
.player {
    position: relative;
    background: #000;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.player video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    cursor: pointer;
}
.player__loader {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 5;
    color: #00d4ff;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.player__loader::before {
    content: 'Please wait';
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}
.player__loader::after {
    content: 'Your video is loading';
    font-size: 0.85rem;
    opacity: 0.7;
}
.player.loading .player__loader { display: flex; }
@keyframes spin { to { transform: rotate(360deg); } }

.player__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 10;
    box-sizing: border-box;
    overflow: hidden;
}
.player.hide-controls .player__controls { opacity: 0; pointer-events: none; }

.player__btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s, text-shadow 0.2s;
}
.player__btn:hover { color: #00d4ff; text-shadow: 0 0 8px rgba(0,212,255,0.5); }

.player__time {
    font-size: 0.75rem;
    color: #ccc;
    white-space: nowrap;
    min-width: 80px;
}

.player__progress {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.15s;
}
.player__progress:hover { height: 6px; }
.player__buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    pointer-events: none;
}
.player__filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #00d4ff;
    border-radius: 2px;
    pointer-events: none;
}
.player__thumb {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #00d4ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(0,212,255,0.6);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.player__progress:hover .player__thumb { opacity: 1; }

.player__vol {
    width: 60px;
    height: 4px;
    accent-color: #00d4ff;
    cursor: pointer;
}

@media (max-width: 768px) {
    .player video { max-height: 250px; }
    .player__vol { display: none; }
    .player__controls { gap: 6px; padding: 8px 10px; }
}
