@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #f4f4f1;
    --container-bg: #ffffff;
    --text-color: #171717;
    --heading-color: #101010;
    --secondary-text: #565656;
    --muted-text: #737373;
    --card-bg: #f7f7f4;
    --border-color: #dddddb;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --accent-color: #e04f38;
    --accent-strong: #b73524;
    --accent-soft: #fff0ec;
    --control-bg: #eeeeeb;
    --control-hover: #e4e4df;
}

[data-theme="dark"] {
    --bg-color: #111111;
    --container-bg: #1b1b1b;
    --text-color: #f2f2f2;
    --heading-color: #ffffff;
    --secondary-text: #d0d0d0;
    --muted-text: #a7a7a7;
    --card-bg: #242424;
    --border-color: #3b3b3b;
    --shadow-color: rgba(0, 0, 0, 0.35);
    --accent-color: #ff765f;
    --accent-strong: #ff9a88;
    --accent-soft: #321d18;
    --control-bg: #2e2e2e;
    --control-hover: #383838;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    transition: background-color 0.25s ease, color 0.25s ease;
}

img,
video {
    max-width: 100%;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2000;
    transform: translateY(-160%);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    background: var(--text-color);
    color: var(--container-bg);
    text-decoration: none;
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

.main-container {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(260px, 1fr);
    gap: 2rem;
    max-width: 1440px;
    margin: 0 auto;
    align-items: start;
}

.container {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 16px 45px var(--shadow-color);
}

.left-container {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    padding: 2rem;
}

.right-container {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    padding: 1.5rem;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--heading-color);
    line-height: 1.12;
    letter-spacing: 0;
}

h1 {
    max-width: 920px;
    margin-bottom: 1rem;
    font-size: clamp(2.35rem, 5vw, 4.8rem);
    font-weight: 800;
}

h2 {
    margin-bottom: 1rem;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    font-weight: 800;
}

h3 {
    margin-bottom: 0.6rem;
    font-size: 1.55rem;
    font-weight: 800;
}

.eyebrow,
.project-type {
    margin-bottom: 0.7rem;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-panel,
.compact-section {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
}

.hero-summary,
.about p,
.project-description {
    color: var(--secondary-text);
    font-size: 1.04rem;
    font-weight: 500;
}

.hero-summary {
    max-width: 840px;
    margin-bottom: 1.6rem;
}

.hero-actions,
.project-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.primary-action,
.secondary-action,
.project-btn,
.download-btn,
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.primary-action {
    padding: 0.8rem 1.1rem;
    background: var(--text-color);
    color: var(--container-bg);
}

.secondary-action,
.project-btn,
.download-btn {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--container-bg);
    color: var(--text-color);
}

.primary-action:hover,
.secondary-action:hover,
.project-btn:hover,
.download-btn:hover,
.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px var(--shadow-color);
}

.proof-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--border-color);
}

.proof-strip div {
    min-height: 118px;
    padding: 1.2rem;
    background: var(--container-bg);
}

.proof-strip strong {
    display: block;
    color: var(--heading-color);
    font-size: 1.35rem;
    line-height: 1.15;
}

.proof-strip span {
    display: block;
    margin-top: 0.45rem;
    color: var(--muted-text);
    font-size: 0.92rem;
    font-weight: 600;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.skill-category {
    min-height: 200px;
    padding: 1.4rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--container-bg);
}

.skill-category h3 {
    font-size: 1.25rem;
}

.skill-category ul,
.impact-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.skill-category li,
.impact-list li {
    position: relative;
    margin-bottom: 0.58rem;
    padding-left: 1.1rem;
    color: var(--secondary-text);
    font-weight: 600;
}

.skill-category li::before,
.impact-list li::before {
    content: "";
    position: absolute;
    top: 0.72em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-color);
}

.projects {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    margin-top: 0.4rem;
}

.section-heading {
    padding: 0 0.3rem;
}

.project-card {
    display: grid;
    grid-template-columns: minmax(330px, 1fr) minmax(0, 1.15fr);
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
}

.feature-project {
    background: var(--accent-soft);
}

.project-media {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 320px;
    border-radius: 10px;
    background: #050505;
    aspect-ratio: 16 / 9;
}

.project-media video,
.project-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-media video,
.project-media img,
.pdf-thumbnail {
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.project-media:hover video,
.project-media:hover img {
    transform: scale(1.025);
}

.video-container::after {
    content: "\f04b";
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 2;
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.52);
    color: #fff;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: opacity 0.2s ease;
}

.video-container:hover::after,
.video-container:focus-within::after {
    opacity: 0;
}

.project-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
}

.impact-list {
    margin-top: 0.55rem;
}

.itch-btn {
    background: #fa5c5c;
    color: #ffffff;
    border-color: transparent;
}

.full-project {
    grid-template-columns: 1fr;
}

.full-copy {
    max-width: 920px;
}

.image-gallery {
    cursor: pointer;
}

.portrait-gallery {
    aspect-ratio: 9 / 16;
    min-height: 560px;
    max-height: 680px;
    width: min(100%, 420px);
    margin: 0 auto;
}

.landscape {
    aspect-ratio: 16 / 9;
    min-height: 440px;
}

.gallery-img {
    opacity: 0;
}

.gallery-img.active {
    opacity: 1;
}

.gallery-nav {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: center;
    transform: translateX(-50%);
}

.dots-container {
    display: flex;
    gap: 0.45rem;
}

.gallery-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.gallery-dot.active {
    background: #ffffff;
}

.progress-bar {
    width: 112px;
    height: 2px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.35);
}

.progress-bar-fill {
    width: 0;
    height: 100%;
    background: #ffffff;
}

.pdf-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pdf-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.pdf-page {
    position: relative;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    aspect-ratio: 1 / 1.414;
}

.pdf-page:hover .pdf-thumbnail {
    transform: scale(1.02);
}

.pdf-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-number {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
}

.profile-sidebar header {
    text-align: center;
}

.profile-photo {
    display: block;
    width: 176px;
    height: 176px;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 28px var(--shadow-color);
    aspect-ratio: 1 / 1;
}

.profile-sidebar h2 {
    margin-bottom: 0.35rem;
    font-size: 1.8rem;
}

.title,
.subtitle {
    margin-bottom: 0.2rem;
    color: var(--secondary-text);
    font-weight: 700;
}

.subtitle {
    color: var(--muted-text);
    font-size: 0.92rem;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.social-grid a {
    display: grid;
    min-height: 46px;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--control-bg);
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.18rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.social-grid a:hover {
    transform: translateY(-2px);
    background: var(--control-hover);
}

.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.nav-btn {
    justify-content: flex-start;
    padding: 0.75rem 0.95rem;
    border: 1px solid var(--border-color);
    background: var(--control-bg);
    color: var(--text-color);
}

.nav-btn:hover {
    background: var(--control-hover);
}

.theme-toggle {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;
}

.dark-mode-btn {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--container-bg);
    color: var(--text-color);
    box-shadow: 0 8px 18px var(--shadow-color);
    cursor: pointer;
    font-size: 1.1rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: min(1100px, 92vw);
    max-height: 90vh;
}

.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    object-fit: contain;
}

.lightbox-close,
.lightbox-arrow {
    position: absolute;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 42px;
    height: 42px;
}

.lightbox-arrow {
    top: 50%;
    width: 52px;
    height: 52px;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: -72px;
}

.lightbox-next {
    right: -72px;
}

.fade-in {
    animation: fadeIn 0.45s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Resume and CV pages */
.resume,
.cv-container {
    padding: 2rem;
}

.resume-section,
.resume-item {
    margin-bottom: 2rem;
}

.resume-item {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
}

.resume-item ul {
    margin: 1rem 0 0;
    padding-left: 1.2rem;
}

.cv-images {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.cv-image {
    width: 100%;
    max-width: 820px;
    height: auto;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px var(--shadow-color);
}

@media (max-width: 1100px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .right-container {
        position: static;
        order: -1;
    }

    .profile-sidebar {
        display: grid;
        grid-template-columns: minmax(220px, 0.8fr) minmax(240px, 1fr) minmax(220px, 1fr);
        align-items: center;
    }

    .nav-buttons {
        align-self: stretch;
        justify-content: center;
    }
}

@media (max-width: 820px) {
    body {
        padding: 1rem;
    }

    .left-container,
    .hero-panel,
    .compact-section,
    .project-card {
        padding: 1rem;
    }

    .profile-sidebar {
        display: flex;
    }

    .proof-strip,
    .skills-grid,
    .project-card,
    .pdf-preview-grid {
        grid-template-columns: 1fr;
    }

    .project-media,
    .landscape {
        min-height: 250px;
    }

    .portrait-gallery {
        min-height: 480px;
        max-height: none;
    }

    .hero-actions,
    .project-buttons {
        flex-direction: column;
    }

    .primary-action,
    .secondary-action,
    .project-btn,
    .download-btn {
        width: 100%;
    }

    .lightbox-arrow {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev {
        left: 0.7rem;
    }

    .lightbox-next {
        right: 0.7rem;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 2.25rem;
    }

    .profile-photo {
        width: 140px;
        height: 140px;
    }

    .social-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .nav-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-btn {
        justify-content: center;
        min-width: 0;
        padding: 0.72rem;
    }

    .nav-btn span {
        display: none;
    }
}
