@font-face { font-family: 'Codystar'; src: url('/assets/fonts/Codystar.ttf') format('truetype'); font-display: block }
@font-face { font-family: 'RubikScribble'; src: url('/assets/fonts/RubikScribble.ttf') format('truetype'); font-display: block }
@font-face { font-family: 'SpecialElite'; src: url('/assets/fonts/SpecialElite.ttf') format('truetype'); font-display: block }
@font-face { font-family: 'SpaceMono'; src: url('/assets/fonts/SpaceMono-Regular.ttf') format('truetype'); font-display: block }
/* DEFAULT */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    margin: 0;
    height: 100svh;
}
body {
    margin: 0;
    background-color: #000;
    height: 100%;
    color: #fff;
    font-family: 'SpaceMono', sans-serif;
    overflow-x: hidden;
    display: flex;
}
.container {
    min-height: 100%;
    display: flex;
    flex: 1;
    overflow: hidden;
}
.content {
    height: 100%;
    width: 100%;
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    margin: auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}
.page-header {
    width: 100%;
}
.page-header h1 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(3rem, 8vw, 5rem);
    opacity: 0.9;
    margin: 0;
}
.header-underline {
    width: 10rem;
    height: 0.4rem;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), transparent);
    margin-top: 0.5rem;
}
.page-content {
    width: 100%;
    padding: 3%;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}
.page-content h2 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    opacity: 0.9;
    margin-bottom: 1.5rem;
}
.page-content h3 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    opacity: 0.85;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}
.page-content p {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.7;
    opacity: 0.75;
    margin-bottom: 1rem;
}
.page-content a {
    color: #367ae7;
    text-decoration: underline;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}
.page-content a:hover {
    color: #95baf8;
    text-decoration-color: rgba(255,255,255,0.7);
}
/* SCROLLBAR */
.content::-webkit-scrollbar, /* webkit browsers */
.sidebar-content::-webkit-scrollbar {
    width: 12px;
}
.content::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track { /* track scrollbar sits on */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
.content::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb { /* draggable thumb */
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    border: 3px solid rgba(255, 255, 255, 0.05); /* padding effect around thumb */
}
.content::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4); /* more visible on hover */
}
.content, /* firefox */
.sidebar-content { 
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.05);
}
/* SIDEBAR */
.sidebar {
    width: 4.5rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    align-items: center;
    padding: 1rem 0;
    gap: 1rem;
}
.icon-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'RubikScribble', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
}
.icon-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.icon-image {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
}
/* LANDING */
.landing-content {
    height: 100%;
    width: 100%;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    margin: auto;
    padding: clamp(1.5rem, 3rem, 4rem);
}
.landing-text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    gap: 2.5rem;
}
.name-section {
    margin: 0;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    font-family: 'RubikScribble', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
}
.link-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: 'SpecialElite', sans-serif;
    gap: 1.5rem;
    padding-left: 18%;
}
.expandable-letter {
    color: #fff;
    text-decoration: none;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    width: calc(16ch + 2.5rem);
    height: 3rem;
    position: relative;
    user-select: none;
    display: flex;
    align-items: center;
}
.word-container {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0.7;
    display: flex;
    align-items: baseline;
}
.initial {
    display: inline-block;
}
.remainder {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.5s ease, opacity 0.3s ease 0.1s;
}
/* ABOUT */
.progressive-bio {
    max-width: 800px;
    margin: 2rem auto;
    animation: fadeIn 0.8s ease-out;
}
.bio-section {
    transition: opacity 0.5s ease-out, transform 0.4s ease-out, max-height 0.5s ease-out, margin-top 0.4s ease-out;
    max-height: 0;
    opacity: 0;
    transform: translateY(15px);
    overflow: hidden;
    margin-top: 0;
}
.bio-section.is-revealed {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 2.5rem;
}
.progressive-bio .bio-section:first-child {
    margin-top: 0; /* first section doesn't need top margin */
}
.bio-section p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.7;
    opacity: 0.85;
    margin-bottom: 1rem;
}
.bio-section a {
    color: #8ab4f8; 
}
.bio-section a:hover {
    color: #a7c5f9;
}
.reveal-control {
    margin-top: 1rem;
    padding-left: 50%;
}
#bio-reveal-trigger {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #fff;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
#bio-reveal-trigger:hover {
    opacity: 1;
}
/* BUILDING */
.filter-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.filter-btn {
    padding: 0.5rem 1rem;
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(0.8rem, 2vw, 1rem);
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
}
.filter-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    justify-content: center;
    position: relative;
}
.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: opacity 0.4s ease;
    overflow: hidden;
    opacity: 1;
    transform: scale(1);
    position: relative;
    background-size: cover;
    background-position: center center;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(25, 25, 25, 0.80);
    border-radius: inherit;
    transition: background-color 0.4s ease;
    z-index: 1;
}
.project-card .project-thumbnail-container,
.project-card .project-card-content {
    position: relative;
    z-index: 2;
}
.project-card.is-moving {
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card.hidden {
    position: absolute;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}
.project-card:hover {
    transform: translateY(-5px);
}
.project-card:hover::before {
    background-color: rgba(25, 25, 25, 0.70);
}
.project-thumbnail-container {
    position: relative;
}
.project-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: rgba(0, 0, 0, 0.2);
    display: none;
    transition: background-color 0.3s ease;
}
/* Thematic background colors for project cards */
.project-card[data-tags~="html"] .project-thumbnail {
    background-color: rgba(227, 76, 38, 0.15); /* Subtle orange for HTML */
}
.project-card[data-tags~="javascript"] .project-thumbnail {
    background-color: rgba(240, 219, 79, 0.15); /* Subtle yellow for JS */
}
.project-card[data-tags~="python"] .project-thumbnail {
    background-color: rgba(53, 114, 165, 0.2); /* Subtle blue for Python */
}
.project-card[data-tags~="realworld"] .project-thumbnail {
    background-color: rgba(153, 14, 65, 0.2); /* Subtle purple for Real World */
}
.project-card-content {
    padding: 1.5rem 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.project-card-content h2 {
    margin-bottom: 1rem;
}
.project-description {
    opacity: 0.7;
    margin-bottom: 1.5rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
}
.project-tags {
    display: flex;
    gap: 1rem;
}
.tag {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}
.project-links {
    margin-top: auto;
}
.project-link {
    color: #fff;
    text-decoration: none;
    opacity: 0.7;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 0.5rem;
    margin-right: 1rem;
}
.project-link:hover {
    opacity: 1;
    transform: translateX(5px);
}
/* CONTACT */
.contact-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.8s ease-out;
    width: 100%;
}
.contact-wrapper {
    width: 100%;
    max-width: 800px;
}
.contact-intro {
    font-size: clamp(1.1rem, 3vw, 1.2rem);
    line-height: 1.7;
    opacity: 0.8;
    text-align: left;
}
.contact-form {
    width: 100%;
    margin-top: 3rem
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    transition: all 0.3s ease;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}
.form-actions {
    display: flex;
    gap: 1rem;
}
.button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'SpecialElite', sans-serif;
}
.button-primary {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}
.button-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.button:hover {
    transform: translateY(-2px);
}
/* THANKS */
.thanks-page {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.thanks-message h1 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}
.thanks-message p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.7;
    opacity: 0.8;
    max-width: 50ch; /* Prevents text from getting too wide on large screens */
    margin-left: auto;
    margin-right: auto;
}
.redirect-notice {
    margin-top: 2rem;
    opacity: 0.6 !important; /* Use important to override the general p opacity */
    font-style: italic;
}
/* ARTICLE */
.project-content {
    animation: fadeIn 0.8s ease-out;
}
.project-details h2 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    opacity: 0.9;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    line-height: 1.3;
}
.project-details h3 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    opacity: 0.85;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}
.project-details h4 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(1rem, 3vw, 1.3rem);
    opacity: 0.8;
    margin-top: 1rem;
    margin-bottom: 0.8rem;
}
.project-details p {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.7;
    opacity: 0.75;
    margin-bottom: 1.5rem;
}
.project-details ul,
.project-details ol {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.7;
    opacity: 0.75;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}
.project-details li {
    margin-bottom: 0.75rem;
}
.project-details p a,
.project-details li a {
    color: #8ab4f8;
    text-decoration: underline;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}
.project-details p a:hover,
.project-details li a:hover {
    color: #a7c5f9;
    text-decoration-color: rgba(255,255,255,0.7);
}
.project-header {
    margin-bottom: 0rem;
}
.project-header h1 {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 0.5rem;
    opacity: 0.9;
}
.project-meta {
    font-size: 0.9rem;
    opacity: 0.6;
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem
}
.project-intro {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}
.code-block {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}
.code-block code {
    font-family: monospace;
    font-size: 0.9rem;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-break: break-all;
}
.feature-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}
.feature-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    opacity: 0.7;
}
.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0.5;
    color: #fff;
}
.collapsible-prompt {
    margin: 2rem 0;
}
.collapsible-prompt summary {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    opacity: 0.85;
    cursor: pointer;
    transition: opacity 0.3s ease;
    list-style-position: inside;
    outline: none;
}
.collapsible-prompt summary:hover {
    opacity: 1;
}
.collapsible-prompt[open] > summary {
    margin-bottom: 1rem;
}
.collapsible-prompt .prompt-content {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-left: 3px solid rgba(138, 180, 248, 0.5);
    border-radius: 8px;
    padding: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}
.collapsible-prompt .prompt-content h4 {
    margin-top: 0;
    color: #8ab4f8;
}
.collapsible-prompt .prompt-content code {
    white-space: pre-wrap;
    word-break: normal;
    font-size: 0.85rem;
}
.project-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}
/* GALLERY / IMAGE ARTICLE */
.gallery-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: #000; /* Ensures a black background */
    flex: 1;
    overflow: hidden;
}
.gallery-image-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: 88vh; /* Limits image height to leave space for controls */
}
#gallery-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain; /* This is key: it scales the image to fit while preserving aspect ratio */
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0; /* Will be faded in by JS */
    transition: opacity 0.6s ease-in-out;
}
#gallery-image.is-loaded {
    opacity: 1;
}
.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px; /* Keeps controls from being too far apart on wide screens */
    padding: 1rem 0;
    color: #fff;
    flex-shrink: 0; /* Prevents the controls from shrinking */
}
#gallery-caption {
    font-family: 'SpecialElite', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    text-align: center;
    opacity: 0.7;
    margin: 0 1.5rem;
    flex-grow: 1;
    line-height: 1.5;
}
.gallery-nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'SpaceMono', sans-serif;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0 1rem;
    transition: all 0.3s ease;
    user-select: none;
}
.gallery-nav-btn:hover {
    color: #fff;
    transform: scale(1.1);
}
/* ANIMATION */
.content, .landing-content {
    animation: contentFadeIn 0.5s ease-out 0.2s forwards;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
.content.is-leaving,
.landing-content.is-leaving {
    opacity: 0;
}
@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ADAPTIVE */
@media (hover: hover) {
    .expandable-letter:hover .word-container {
        transform: translateY(-50%) translateX(2rem) scale(1.2);
        opacity: 1;
    }
    .expandable-letter:hover .remainder {
        max-width: 15ch;
        opacity: 1;
    }
}
@media (hover: none) {
    .word-container {
        opacity: 1;
        transform: translateY(-50%);
        transition: none;
    }
    .remainder { /* display full word on touch devices */
        max-width: 15ch; 
        opacity: 1;
        overflow: visible;
        white-space: nowrap;
        transition: none;
    }
    .expandable-letter:hover .word-container, 
    .expandable-letter:focus .word-container {
        transform: translateY(-50%);
        opacity: 1;
    }
    .expandable-letter:hover .remainder,
    .expandable-letter:focus .remainder {
        max-width: 15ch;
        opacity: 1;
    }
}
@media (orientation: landscape) and (max-height: 480px) {
    .content {
        padding: 2rem;
    }
    .landing-text-container {
        gap: 1rem;
    }
    .name-section {
        font-size: clamp(1.1rem, 6vmin, 2rem);
    }
    .link-container {
        width: 100%;
        gap: 0;
        justify-content: space-between;
        height: clamp(7rem, 22vh, 10rem);
    }
    .link-container .expandable-letter {
        font-size: clamp(0.85rem, 4vmin, 1.2rem);
        height: 2.2rem;
        width: calc(16ch + 2rem);
    }
    @media (hover: hover) { /* nested media query */
        .expandable-letter:hover .word-container {
            transform: translateY(-50%) translateX(1.5rem) scale(1.1);
        }
        .expandable-letter:hover .remainder {
            max-width: 15ch;
            opacity: 1;
        }
    }
}
@media (max-width: 768px) { /* portrait */
    .name-section {
        white-space: normal;
    }
    .page-header h1 {
        font-size: clamp(2.5rem, 7vw, 4rem);
    }
    .page-content h2,
    .project-details h2 {
        font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    }
    .page-content h3,
    .project-details h3 {
        font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .reveal-control {
        padding-left: 35%;
        margin-top: 0.5rem;
    }
    .desktop-text { display: none; }
    .mobile-text { display: inline; }
}
@media (min-width: 1024px) {
    .projects-grid { /* force 3 columns */
        grid-template-columns: repeat(3, 1fr);
    }
}