:root {
    color-scheme: light;
    --paper: rgba(255, 255, 255, 0.95);
    --paper-strong: #ffffff;
    --ink: #172033;
    --muted: #5f6b7a;
    --line: rgba(23, 32, 51, 0.12);
    --accent: #2b6f8f;
    --accent-strong: #174b63;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    --soft-shadow: 0 14px 38px rgba(23, 32, 51, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background-size: cover !important;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: Trebuchet MS, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    text-size-adjust: 100%;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5, 10, 20, 0.22), rgba(5, 10, 20, 0.42)),
        radial-gradient(circle at 78% 0%, rgba(255, 255, 255, 0.16), transparent 24rem);
}

a {
    color: var(--accent);
    font-weight: 650;
    text-decoration: none;
    text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
}

button,
a {
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

button:focus-visible,
a:focus-visible,
.gallery-image:focus-visible {
    outline: 3px solid rgba(43, 111, 143, 0.36);
    outline-offset: 3px;
}

h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.25rem, 5vw, 4.75rem);
    line-height: 0.96;
    letter-spacing: 0;
}

.content h1 {
    margin-bottom: 0.85rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

h4 {
    margin: 0;
    color: var(--muted);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.45;
}

p {
    margin: 0 0 1rem;
}

ul {
    margin: 0.4rem 0 1.2rem;
    padding-left: 1.2rem;
}

hr {
    width: 100%;
    margin: 1.6rem 0;
    border: 0;
    border-top: 1px solid var(--muted);
}

.bg-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    animation: background-fade-out 0.6s ease forwards;
}

body.page-transition-exit .content,
body.page-transition-exit .homepage_content {
    animation: none;
    opacity: 0;
    transform: translateY(8px) scale(0.99);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

body.project-slide-exit-next .content {
    animation: project-slide-out-left 0.26s ease forwards;
}

body.project-slide-exit-previous .content {
    animation: project-slide-out-right 0.26s ease forwards;
}

body.project-slide-enter-next .content {
    animation: project-slide-in-right 0.34s ease;
}

body.project-slide-enter-previous .content {
    animation: project-slide-in-left 0.34s ease;
}

.container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    padding: clamp(1rem, 4vw, 3rem);
    align-items: center;
    justify-content: center;
}

.homepage_content,
.content {
    --panel-padding: clamp(1.25rem, 4vw, 2.4rem);
    --back-padding: clamp(1.25rem, 4vw, 2.4rem);
    width: min(100%, 1120px);
    max-height: calc(100vh - clamp(2rem, 8vw, 6rem));
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    animation: page-fade-in 0.5s ease;
}

.content {
    width: min(100%, 880px);
}

.content1 {
    display: flex;
    flex-direction: column;
}

.content1.back {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    flex-direction: row;
    padding: 1rem var(--panel-padding);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(23, 32, 51, 0.1);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
    backdrop-filter: blur(16px);
}

.content1.back a {
    width: max-content;
    color: var(--muted);
    font-size: 0.92rem;
}

.back-link {
    display: inline-flex;
    width: max-content;
    min-height: 2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 0.8rem;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    color: #273348;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
    border-color: rgba(43, 111, 143, 0.45);
    background-color: rgba(43, 111, 143, 0.08);
    color: #273348;
    text-decoration: none;
}

.arrow-link {
    width: max-content;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.2;
}

.section-header {
    display: flex;
    margin-bottom: 0.55rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-header .section-label {
    margin-bottom: 0;
}

.content1.internal {
    padding: var(--panel-padding);
}

.content1.back + .content1.internal {
    padding-top: 1.25rem;
}

.hero-header {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.6rem;
}

.content1.internal.index {
    padding-top: 0;
}

.content1.internal.index .hero-header {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 calc(var(--panel-padding) * -1) 1.6rem;
    padding: 0.9rem var(--panel-padding);
    align-items: center;
    border-bottom: 1px solid rgba(23, 32, 51, 0.1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

.content1.internal.index .hero-header h1 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1;
}

.content1.internal.index .hero-header .eyebrow {
    margin-bottom: 0.25rem;
    font-size: 0.68rem;
}

.eyebrow,
.section-label {
    margin-bottom: 0.55rem;
    color: var(--accent-strong);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.intro {
    margin-bottom: 1.4rem;
    color: #334156;
    font-size: clamp(1rem, 2vw, 1.16rem);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.social-links a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    background: rgba(255, 255, 255, 0.7);
    color: #273348;
    font-size: 0.9rem;
}

.social-links a:hover,
.social-links a:focus-visible {
    border-color: rgba(43, 111, 143, 0.45);
    background: rgba(43, 111, 143, 0.08);
    text-decoration: none;
}

#project-div,
#work-experience-div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

#work-experience-div {
    margin-bottom: 1.4rem;
}

.project-btn {
    position: relative;
    display: flex;
    min-height: 118px;
    overflow: hidden;
    border: 1px solid rgba(23, 32, 51, 0.12);
    border-radius: 8px;
    padding: 0.75rem;
    align-items: stretch;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--soft-shadow);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.project-btn::after {
    content: none;
}

.project-btn:hover,
.project-btn:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 18px 46px rgba(23, 32, 51, 0.22);
    color: var(--ink);
    text-decoration: none;
}

.project-btn:hover .project-image,
.project-btn:focus-visible .project-image {
    transform: scale(1.04);
}

.project-image {
    display: block;
    width: 96px;
    height: auto;
    aspect-ratio: 1 / 1;
    flex: 0 0 96px;
    border: 1px solid rgba(23, 32, 51, 0.14);
    border-radius: 6px;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.35s ease;
}

.project-info {
    position: static;
    display: flex;
    min-width: 0;
    padding: 0.1rem 0;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: center;
}

.project-title {
    color: #3f4653;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.05;
}

.project-subtitle {
    display: block;
    overflow: visible;
    color: #535c69;
    font-size: 0.88rem;
    line-height: 1.35;
}

.project-meta {
    color: #535c69;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.35;
}

.gallery-image {
    display: inline-block;
    height: 200px;
    width: auto;
    max-width: min(100%, 360px);
    margin: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: contain;
    vertical-align: middle;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gallery-image:hover {
    border-color: rgba(43, 111, 143, 0.45);
    box-shadow: 0 16px 34px rgba(23, 32, 51, 0.18);
    transform: translateY(-2px);
}

.image-btn {
    background-color: var(--accent-strong);
    color: var(--paper);
}

#image-gallery > div {
    margin: 0.35rem -0.5rem 0;
}

#image-view {
    position: fixed;
    inset: clamp(1rem, 3vw, 2rem);
    z-index: 5;
    display: none;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--shadow);
}

#image-view-img-container {
    display: flex;
    width: 72%;
    padding: 1rem;
    align-items: center;
    justify-content: center;
    background: #0f1724;
}

#image-view-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    object-fit: contain;
}

#image-view-text {
    display: flex;
    width: 28%;
    min-width: 250px;
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
}

#image-view-text > div:first-child {
    height: auto !important;
}

#image-view-text > div:nth-child(2) {
    height: auto !important;
    min-height: 0;
    overflow: auto;
}

#image-view-text > div:last-child {
    height: auto !important;
    gap: 0.8rem;
}

#image-view-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

#image-view-txt {
    margin: 0;
}

.image-view-img-ani {
    animation: show-gallery-img 0.35s ease;
}

.image-btn {
    display: inline-flex;
    width: auto;
    min-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0 0.85rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.14);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.image-btn:hover,
.image-btn:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.project-page-nav {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    min-height: 2rem;
    border: 1px solid rgba(23, 32, 51, 0.14);
    padding: 0;
    background-color: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(23, 32, 51, 0.1);
}

.project-page-nav:hover,
.project-page-nav:focus-visible {
    background-color: rgba(43, 111, 143, 0.08);
    color: var(--ink);
    text-decoration: none;
    transform: translateY(-1px);
}

.project-page-nav[aria-disabled="true"] {
    border-color: rgba(23, 32, 51, 0.08);
    background-color: rgba(23, 32, 51, 0.05);
    box-shadow: none;
    color: #9aa3af;
    cursor: default;
    opacity: 1;
    pointer-events: none;
    text-decoration: none;
    -webkit-text-fill-color: #9aa3af;
}

.project-page-nav[aria-disabled="true"]:hover,
.project-page-nav[aria-disabled="true"]:focus-visible {
    background-color: rgba(23, 32, 51, 0.05);
    color: #9aa3af;
    transform: none;
    -webkit-text-fill-color: #9aa3af;
}

.project-page-nav-group {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin-left: auto;
}

.image-btn-ani {
    animation: bounce 0.35s ease;
}

video {
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
}

@keyframes show-gallery-img {
    0% {
        transform: scale(0.96);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes page-fade-in {
    0% {
        transform: translateY(10px) scale(0.985);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes project-slide-out-left {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-48px);
        opacity: 0;
    }
}

@keyframes project-slide-out-right {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(48px);
        opacity: 0;
    }
}

@keyframes project-slide-in-left {
    0% {
        transform: translateX(-48px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes project-slide-in-right {
    0% {
        transform: translateX(48px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes background-fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes bounce {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.92);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 980px) {
    #image-view {
        flex-direction: column;
    }

    #image-view-img-container,
    #image-view-text {
        width: 100%;
    }

    #image-view-img-container {
        height: 65%;
    }

    #image-view-text {
        min-width: 0;
        height: 35%;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .container {
        min-height: 100svh;
        padding: 0;
        align-items: stretch;
    }

    .homepage_content,
    .content {
        width: 100%;
        max-height: none;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
    }

    .hero-header {
        gap: 1rem;
    }

    .social-links {
        justify-content: flex-start;
    }

    .content1.internal.index .hero-header {
        flex-direction: row;
        align-items: center;
    }

    .content1.internal.index .hero-header h1 {
        font-size: 1.45rem;
    }

    #project-div,
    #work-experience-div {
        grid-template-columns: 1fr;
    }

    .project-btn {
        min-height: 0;
        gap: 0.75rem;
        padding: 0.8rem;
    }

    .project-image {
        width: 86px;
        flex-basis: 86px;
        min-height: 0;
    }

    .project-info {
        gap: 0.35rem;
        padding: 0;
    }

    .project-title {
        font-size: 1.12rem;
        line-height: 1.18;
    }

    .project-subtitle,
    .project-meta {
        font-size: 0.86rem;
    }

    .gallery-image {
        width: auto;
        height: 190px;
        max-width: 100%;
        margin: 0.45rem 0.4rem;
    }

    #image-gallery > div {
        margin-right: 0;
        margin-left: 0;
    }

    #image-view {
        inset: 0;
        border-radius: 0;
    }

    #image-view-img-container {
        height: 58%;
    }

    #image-view-text {
        height: 42%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    body.page-transition-exit .content,
    body.page-transition-exit .homepage_content {
        opacity: 1;
        transform: none;
    }
}
