@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Source+Code+Pro:wght@500;700&display=swap');

:root {
    /* Animation controls */
    --typewriterSpeed: 1.5s;
    --amountSteps: 10;
    --typeSpeedDivStepSpeed: 750ms;

    /* Design tokens */
    --bg: #EDF2F4;
    --bg-dark: #0E131F;
    --text: #0E131F;
    --text-inverse: #EDF2F4;
    --surface: #FFFFFF;
    --surface-tint: rgba(255, 255, 255, 0.65);
    --surface-dark: #0B1020;
    --surface-dark-tint: rgba(255, 255, 255, 0.06);
    --primary: #4361EE;
    --accent: #FF0035;
    --warning: #FFD200;
    --muted: #6B7280;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-1: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-2: 0 10px 25px rgba(16, 24, 40, 0.14), 0 4px 12px rgba(16, 24, 40, 0.08);

    --container-max: 1100px;
}

/* Global reset and base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Noto Sans', 'Helvetica Neue', Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.content-container {
    margin: auto;
    padding: 0 0 50px;
    width: min(var(--container-max), 92%);
    font-size: 16px;
}

/* New container utility */
.container {
        width: min(var(--container-max), 92%);
        margin: 0 auto;
}

/* Header / Nav */
.site-header {
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(14, 19, 31, 0.5);
        backdrop-filter: saturate(120%) blur(10px);
        border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: 0.5px; font-family: 'Source Code Pro', monospace; }
.nav a { color: #fff; text-decoration: none; margin-left: 18px; opacity: 0.9; transition: opacity .2s ease; }
.nav a:hover { opacity: 1; }
.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 4px 0; background: #fff; }
@media (max-width: 768px) {
    .nav { display: none; position: absolute; right: 16px; top: 64px; background: rgba(14,19,31,0.96); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-2); }
    .nav a { display: block; margin: 8px 0; }
    .nav[aria-expanded="true"] { display: block; }
    .nav-toggle { display: inline-block; }
}

/* Sections */
.section-light { background: var(--bg); padding: 72px 0; }
.section-dark  { background: var(--bg-dark); padding: 72px 0; }
.section-title { margin: 0 0 24px; font-size: clamp(24px, 3.6vw, 36px); color: inherit; font-weight: 800; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.section-link { color: var(--primary); text-decoration: none; font-weight: 600; }

/* Hero */
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.kicker { color: var(--muted); margin: 8px 0 8px 2%; }
.lead { margin-left: 2%; font-size: clamp(16px, 2.2vw, 18px); color: var(--text); }
.cta-row { margin-left: 2%; display: flex; gap: 12px; margin-top: 16px; }
.btn { background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; font-weight: 700; transition: transform .1s ease, box-shadow .2s ease, background .2s ease; }
.btn:hover { background: #3353ef; box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--primary); border-color: rgba(67,97,238,0.5); }
.btn-outline:hover { background: rgba(67,97,238,0.08); }
.btn-sm { padding: 8px 10px; font-weight: 600; }

/* Emphasized Resume button: black text on white background */
.btn.btn-resume { background: #fff; color: #000; border: 1px solid #000; }
.btn.btn-resume:hover { background: #f3f4f6; color: #000; box-shadow: var(--shadow-2); }

.hero-media img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-2); display: block; }
.hero-media { display: flex; flex-direction: column; gap: 8px; }

/* Featured */
.featured-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: start; }
@media (max-width: 950px) { .featured-grid { grid-template-columns: 1fr; } }
.featured-copy { color: var(--text); }

/* Compact Featured layout for small logo-style media */
.featured-compact .featured-grid { grid-template-columns: 0.7fr 1.3fr; align-items: center; }
@media (max-width: 950px) { .featured-compact .featured-grid { grid-template-columns: 1fr; } }
.featured-compact .featured-media { display: flex; align-items: center; justify-content: center; }
.featured-compact .featured-logo { width: 128px; height: 128px; object-fit: contain; border-radius: var(--radius); box-shadow: var(--shadow-2); display: block; }

/* Tags */
.tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 100px; background: rgba(67,97,238,0.12); color: var(--primary); font-weight: 600; font-size: 12px; }

/* Projects grid */
.projects-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
@media (max-width: 1200px){ .projects-grid { grid-template-columns: repeat(8, 1fr); } }
@media (max-width: 800px){ .projects-grid { grid-template-columns: repeat(4, 1fr); } }
.card { grid-column: span 6; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); transition: transform .2s ease, box-shadow .2s ease; display: flex; flex-direction: column; }
@media (max-width: 800px){ .card { grid-column: span 4; } }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card-media { width: 100%; display: block; }
/* Ensure image media has a consistent aspect so text starts at the same height */
.projects-grid img.card-media { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.ratio-16x9 { position: relative; padding-bottom: 56.25%; }
.ratio-16x9 iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* Normalize spacing between title, text, and tags */
.card-body .tags { margin-top: auto; }
.card-body { padding: 16px; color: var(--text-inverse); display: flex; flex-direction: column; flex: 1 1 auto; }
.card-title { margin: 4px 0 8px; font-size: 20px; font-weight: 800; }
.projects-grid .card-text { color: #E5E7EB; flex: 1 1 auto; }
.card-actions { display: flex; gap: 10px; margin-top: 12px; }
/* Make cards stretch to equal heights per row so tags/actions align from the bottom */
.projects-grid > .card { height: 100%; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.card-text { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: var(--text-inverse); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow-1); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-1); }
.skill-card h3 { margin: 0 0 10px; }
.logo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.logo-grid img { width: 100%; height: auto; object-fit: contain; filter: saturate(0.95); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; align-items: center; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-left .section-title { color: var(--text-inverse); }
.contact-right { display: flex; align-items: center; justify-content: center; }
.socials { display: grid; gap: 12px; width: 100%; justify-items: stretch; }
.social { display: flex; align-items: center; gap: 12px; color: var(--text-inverse); text-decoration: none; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.06); transition: transform .2s ease, background .2s ease; width: 100%; }
.social img { width: 28px; height: 28px; object-fit: contain; }
.social:hover { transform: translateY(-2px); background: rgba(255,255,255,0.1); }

/* Footer */
.site-footer { text-align: center; color: var(--text); }
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer .container { padding: 28px 0; }

/* Reveal on scroll */
.reveal-on-scroll { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal-on-scroll.is-visible { opacity: 1; transform: none; }


/*#region                                                                           COLORED CONTAINERS*/

.color-container-white {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    max-width: 100vw;
    background-color: var(--bg);
    width: 100%;
    display: grid;
    place-items: center;
}

.color-container-black {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    max-width: 100vw;
    background-color: var(--bg-dark);
    width: 100%;
    display: flex;
    display: grid;
    place-items: center;
}


/*#endregion*/

/* ===============================
   Type Racer Overlay
   =============================== */
.tr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}
.tr-overlay.is-open { display: flex; }
.no-scroll { overflow: hidden; }
.tr-modal {
    width: min(900px, 92vw);
    max-height: 86vh;
    background: var(--bg-dark);
    color: var(--text-inverse);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 0;
    box-shadow: none;
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
}
.tr-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.4);
}
.tr-close { background: transparent; color: var(--text-inverse); border: 1px solid rgba(255,255,255,0.6); padding: 4px 10px; cursor: pointer; }
.tr-stats { display: flex; gap: 16px; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.2); }
.tr-text {
    font-family: 'Source Code Pro', monospace;
    line-height: 1.6;
    letter-spacing: 0.2px;
    padding: 18px 14px;
    overflow: auto;
    background: #000;
    position: relative; /* for absolute caret positioning */
}
.tr-actions { display: flex; gap: 8px; padding: 10px 14px 14px; }

.tr-ok { color: #b3ffb3; }
.tr-miss { color: #ff6b6b; text-decoration: underline; text-decoration-thickness: 2px; }
.tr-rem { color: #9ca3af; }
.tr-caret-line { position: absolute; width: 1px; height: 1.2em; background: var(--accent); box-shadow: 0 0 6px rgba(57,255,20,0.6); animation: caret-blink 1s steps(2) infinite; pointer-events: none; z-index: 2; }
/* Input removed; feedback now via caret flash */

@keyframes caret-blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.tr-result { margin: 12px 14px 16px; padding: 12px; border: 1px solid rgba(255,255,255,0.5); background: rgba(0,0,0,0.6); }
.tr-result h4 { margin: 0 0 8px; }
.tr-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 10px; }
.tr-label { display: inline-block; min-width: 80px; color: #d1d5db; }
.tr-result-actions { display: flex; gap: 8px; }
.tr-input.tr-miss { border-color: #ff6b6b; box-shadow: 0 0 0 2px rgba(255,107,107,0.2) inset; }
.tr-input.tr-finished { border-color: var(--accent); }

/* Leaderboard + submit */
.tr-submit { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 10px 0; }
.tr-submit input { background: #111; color: #fff; border: 1px solid rgba(255,255,255,0.5); border-radius: 4px; padding: 6px 8px; }
.tr-status { margin-left: 8px; color: #d1d5db; font-size: 12px; }
.tr-leaderboard { margin: 10px 0; }
.tr-leaderboard h5 { margin: 6px 0; }
.tr-leaderboard ol { margin: 0; padding-left: 18px; max-height: 200px; overflow: auto; }
.tr-leaderboard li { padding: 2px 0; color: #e5e7eb; }


/*#region                                                                           HIGHLIGHTED TEXT*/

.highlight-text-red {
    color: var(--accent);
    font-weight: bold;
}

.highlight-text-yellow {
    color: var(--warning);
    font-weight: bold;
}

.highlight-text-blue {
    color: var(--primary);
    font-weight: bold;
}


/*#endregion*/


/*#region                                                                           SITE TITLE*/


.title {
    font-family: 'Source Code Pro', monospace;
    margin: 50px 0 40px 2%;
    font-size: clamp(28px, 4vw, 56px);
    line-height: 1.15;
    font-weight: 700;
    background-image: linear-gradient(90deg, #50808E 0%, #66A6A9 100%);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}


.headingIntro {
    background-image: linear-gradient(90deg, #50808E, #66A6A9);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}

.headingName {
    background-image: linear-gradient(90deg, #4361EE, #5E7BFF);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}


/*#endregion*/


/*#region                                                                           SECTION TOPIC*/

.topicHeader {
    padding: clamp(36px, 6vw, 60px) 0 24px;
    margin-left: 2%;
    font-family: 'Source Code Pro', monospace;
    position: relative;
}
.topicHeader::after {
    content: "";
    position: absolute;
    left: 2%;
    right: 8%;
    bottom: 12px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.3;
}



.topicHeaderType {
    color: #50808E;
    font-family: 'Source Code Pro', monospace;
}

.topicHeaderName {
    color: var(--primary);
    font-family: 'Source Code Pro', monospace;
}


/*#endregion*/


/*#region                                                                           INTRO-ANIMATION*/

.introAnimation {
    margin-left: 2%;
    margin-right: min(50%, 600px);
    font-size: clamp(18px, 2.4vw, 24px);
    width: max-content;
    height: max-content;
    position: relative;
    color: var(--text);
}

.introAnimation::before,
.introAnimation::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

.introAnimation::before {
    background: var(--bg);
    animation: typewriter var(--typewriterSpeed) steps(var(--amountSteps)) 1s forwards;
    ;
    ;
}

.introAnimation::after {
    width: 0.125em;
    background: var(--text);
    animation: typewriter var(--typewriterSpeed) steps(var(--amountSteps)) 1s forwards, blink var(--typeSpeedDivStepSpeed) steps(var(--amountSteps)) infinite;
    -webkit-animation: typewriter var(--typewriterSpeed) steps(var(--amountSteps)) 1s forwards, blink var(--typeSpeedDivStepSpeed) steps(var(--amountSteps)) infinite;
}

@keyframes typewriter {
    to {
        left: 100%;
    }
}

@keyframes blink {
    to {
        background: transparent;
    }
}

/* JS-driven typewriter override for the greeting line */
.introAnimation.js-typewriter {
    /* Make element shrink to text so border-caret aligns at the end */
    width: max-content;
    /* Keep a stable height even when text is fully deleted */
    line-height: 1.4;
    min-height: 1.9em; /* reserve one text line */
    padding-block: 4px; /* small vertical padding to prevent layout jump */
    white-space: nowrap;
    overflow: hidden;
    border-right: 0.12em solid var(--text);
    /* Blink the border caret */
    animation: caret-blink-border 1s steps(2) infinite;
}
.introAnimation.js-typewriter::before,
.introAnimation.js-typewriter::after {
    /* Disable the original CSS typewriter overlay/caret */
    content: none !important;
    animation: none !important;
}
@keyframes caret-blink-border {
    0%, 50% { border-right-color: var(--text); }
    50.01%, 100% { border-right-color: transparent; }
}


/*#endregion*/


/*#region                                                                           INTRO-TEXT*/

@media (orientation: landscape){ .intro-container { display: flex; gap: 24px; } }


.intro {
    flex: 1;
    max-width: 700px;
    margin-left: 2%;
    font-size: clamp(18px, 2.4vw, 22px);
    opacity: 0;
    transform: translateY(3rem);
    -webkit-transform: translateY(3rem);
    -moz-transform: translateY(3rem);
    -ms-transform: translateY(3rem);
    -o-transform: translateY(3rem);
    animation: fadeInUp 2s ease calc(var(--typewriterSpeed) + 1s) forwards;
    color: var(--text);
}


/*#endregion*/


/*#region                                                                           PROJECT-SLIDER*/


.project-slider {
    margin-top: 12px;
    position: relative;
    width: 100%;
    /* Reserve space for exactly two lines to avoid layout jumping */
    line-height: 1.4;
    min-height: calc(2 * 1.4em);
    font-size: clamp(16px, 2.2vw, 20px);
    text-align: left;
    color: var(--text);
    opacity: 0;
    transform: translateY(1rem);
    animation: fadeInUp 0.8s ease calc(var(--typewriterSpeed) + 0.6s) forwards;
}

#current-word {
    top: 0;
    left: 0;
    opacity: 1;
    transition: opacity 1s ease;
    color: var(--accent);
    background-color: var(--bg);
    font-weight: bold;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        -ms-transform: translateY(0);
        -o-transform: translateY(0);
    }
}


/*#endregion*/

/*#region                                                                           FEEDBACK-SLIDER*/


.feedback-slider {
    position: relative;
    height: auto;
    /* Reserve space for exactly five lines to avoid layout jumping */
    line-height: 1.4;
    min-height: calc(7 * 1.4em);
    color: var(--text);
    opacity: 0;
    animation: fadeInUp 2s ease calc(var(--typewriterSpeed) + 1s) forwards;
    padding-bottom: 24px;
    padding-top: 10px;
}

#current-feedback {
    top: 0;
    left: 0;
    opacity: 1;
    transition: opacity 1s ease;
    color: var(--accent);
    background-color: var(--bg);
    font-weight: bold;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        -ms-transform: translateY(0);
        -o-transform: translateY(0);
    }
}


/*#endregion*/


/*#region                                                                           about-me*/

.about-container { color: var(--text-inverse); }
@media (orientation: landscape){
    .about-container {
        display: flex;
        align-content:center;
        justify-content:space-around;
        gap: 24px;
    }
}



.about-introduction {
    flex: 1;
    max-width: 700px;
    padding: 24px;
}

.about-softskills {
    flex: 1;
    max-width: 700px;
    padding: 24px;
    align-content:center;
}


/*#endregion*/


/*#region                                                                           UNIVERSE*/

.universe-gen-container {
    margin: 0 auto;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}
@media (orientation: landscape){
    .universe-gen-container {
        display: flex;
        justify-content: space-between;
        gap: 24px;
    }
}
.color-container-white .universe-gen-container {
    background: var(--surface);
}



.project-video {
    flex: 4;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: left;
    position: relative;
    /* Added for video container */
    overflow: hidden;
    /* Added to hide any overflow from video */
    text-align: left;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-container {
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio (9 / 16 * 100) */
    position: relative;
    overflow: hidden;
    text-align: left;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-1);
}


@media (orientation: portrait)
{
    .universe-description {
        flex: 3;
        flex-basis: 0;
        padding-top: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: var(--text);
    }
}

@media (orientation: landscape){
    .universe-description {
        flex: 3;
        flex-basis: 0;
        padding-left: clamp(16px, 6vw, 100px);
        padding-right: clamp(16px, 6vw, 100px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: var(--text);
    }
}


.universe-image {
    flex: 4;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    justify-content: center;
    align-items: flex-start;
}

.universe-image img {
    max-width: 100%;
    height: auto;
    padding-top: 24px;
    padding-bottom:0px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-1);
}


/*#endregion*/


/*#region                                                                           WORK*/

.work-container {
    margin: 0 auto;
    padding-top: 20px;
}
@media (orientation: landscape){
    .work-container {
        display: flex;
        text-align: left;
        gap: 24px;
    }
}

.work-image {
    flex: 4;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.work-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-1);
}


@media (orientation: portrait){
    .work-description {
        flex: 3;
        flex-basis: 0;
        padding-top: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: left;
        color: var(--text);
    }
}

@media (orientation: landscape){
    .work-description {
        flex: 3;
        flex-basis: 0;
        padding-left: clamp(16px, 6vw, 100px);
        padding-right: clamp(16px, 6vw, 100px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: var(--text);
    }
}


.work-tags {
    color: white;
    padding: 5px;
}

.inline-link {
    display: inline;
    text-align: left;
    align-items: left;
}

/*#endregion*/


/*#region                                                                           PROJECT*/

.project-title {
    padding-left: 2%;
    font-size: clamp(22px, 3vw, 32px);
    color: var(--text-inverse);
    padding-top: 36px;
    font-weight: 700;
}

.project-container {
    margin: 16px auto 24px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface-dark-tint);
    border: 1px solid rgba(255,255,255,0.08);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
@media (orientation: landscape){
    .project-container {
        display: flex;
        text-align: left;
        gap: 24px;
    }
}
.project-container:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

.project-image {
    flex: 4;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.project-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform .25s ease;
}
.project-image img:hover { transform: scale(1.02); }


@media (orientation: portrait){
    .project-description {
        flex: 3;
        flex-basis: 0;
        padding-top: 20px;
        display: inline;
        flex-direction: column;
        justify-content: center;
        align-items: left;
        color: var(--text-inverse);
    }
}

@media (orientation: landscape){
    .project-description {
        flex: 3;
        flex-basis: 0;
        padding-left: clamp(16px, 6vw, 100px);
        padding-right: clamp(16px, 6vw, 100px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: var(--text-inverse);
    }
}


.project-tags {
    color: var(--text-inverse);
    padding: 5px;
}

.inline-link {
    display: inline;
    text-align: left;
    align-items: left;
}


/*#endregion*/


/*#region                                                                           EXPERIENCE*/

.experience {
    width: 80%;
    margin: auto;
    justify-content: center;
}

@media (orientation: portrait){
    .experience-container {
        max-width: 1200px;
        margin: auto;
    }
}

@media (orientation: landscape){
    .experience-container {
        display: flex;
        justify-content: space-between;
        max-width: 1200px;
        margin: auto;
    }
}



.experience-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding-bottom: 10px;
    padding-top: 20px;
    background-image: linear-gradient(90deg, #50808E, #66A6A9);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}

.experience-column {
    flex: 1;
    padding: 10px;
}

.column-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.column-images img {
    margin: 0 auto;
    max-width: 70%;
    max-height: auto;
    object-fit: contain;
    filter: saturate(0.9);
}


/*#endregion*/


/*#region                                                                           CONTACT-FORM*/

.contact-container { align-items: center; gap: 24px; }
@media (orientation: landscape){
    .contact-container {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}


@media (orientation: portrait)
{
    .form-container { display: none; padding: 24px; content-align: center; flex: 1; }
}
@media (orientation: landscape){
    .form-container {
        padding: 24px;
        content-align: center;
        flex: 1;
    }
}



form {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.04);
    box-shadow: var(--shadow-1);
}

label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-inverse);
    font-weight: 600;
}

input[type="text"],
input[type="email"],
textarea {
    width: 96%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    resize: vertical;
    color: var(--text);
    background: #fff;
}

button[type="submit"] {
    width: 100%;
    background-color: var(--primary);
    color: #fff;
    padding: 12px 16px;
    margin-top: 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    content-align: center;
    font-weight: 600;
    transition: box-shadow .2s ease, transform .1s ease, background-color .2s ease;
}

button[type="submit"]:hover {
    background-color: #3353ef;
    box-shadow: var(--shadow-2);
}
button[type="submit"]:active { transform: translateY(1px); }
button[type="submit"]:focus-visible { outline: 3px solid #93A5FF; outline-offset: 2px; }

.status-message {
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
}


/*#endregion*/


/*#region                                                                           CONTACT-SOCIALS*/

.social-media-container {
    flex: 1;
}

.social-media-flex-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    justify-content: center;
    align-items: center;
    max-height: 10%;
}

.social-media-flex-container img {
    margin: 0 auto;
    width: 40%;
    max-width: 100px;
    max-height: auto;
    object-fit: contain;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: transform .2s ease, filter .2s ease;
}
.social-media-flex-container img:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }

.social-media-image {}

.social-media-image img {
    padding: 20px;
    max-width: 20% 100px;
    max-height: auto;
    content-align: center;
    align-items: center;
}

.social-media-text {
    color: var(--text-inverse);
    text-align: center;
    content-align: left;
    align-items: left;

}

/* Accessibility & utilities */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    left: 12px;
    top: 12px;
    width: auto;
    height: auto;
    padding: 10px 14px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    z-index: 9999;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ===============================
     Retro Black & White Theme
     Apply by adding class="retro-bw crt" on <body>
     =============================== */
.retro-bw {
    /* Monochrome tokens */
    --bg: #0A0A0A;
    --bg-dark: #000000;
    --text: #EAEAEA;
    --text-inverse: #F5F5F5;
    --surface: #0F0F0F;
    --surface-dark: #000000;
    --primary: #EAEAEA;
    --accent: #39FF14;
    --warning: #EAEAEA;
    --muted: #B3B3B3;
    --shadow-1: none;
    --shadow-2: none;
    --radius: 6px;
    --radius-sm: 4px;
    font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0.2px;
}

/* Global look: no soft shadows, crisp borders */
.retro-bw .site-header { background: rgba(0,0,0,0.85); border-bottom: 1px solid #FFF; }
.retro-bw .brand { color: #FFF; text-shadow: none; }
.retro-bw .nav a { color: #FFF; border-bottom: 1px dotted transparent; }
.retro-bw .nav a:hover { border-bottom-color: #FFF; }
.retro-bw .nav-toggle span { background: #FFF; }
.retro-bw .section-light, .retro-bw .section-dark { background-image: none; }

/* Hero */
.retro-bw .kicker { color: var(--muted); }
.retro-bw .lead { color: var(--text); }

/* Buttons */
.retro-bw .btn { background: transparent; color: #FFF; border: 1px solid #FFF; box-shadow: none; border-radius: 0; }
.retro-bw .btn:hover { background: #FFF; color: #000; box-shadow: none; }
.retro-bw .btn-outline { background: transparent; color: #FFF; border-color: #FFF; }
.retro-bw .btn-sm { padding: 6px 10px; }

/* Ensure resume button remains black on white in retro theme */
.retro-bw .btn.btn-resume { background: #FFF; color: #000; border: 1px solid #000; }
.retro-bw .btn.btn-resume:hover { background: #EDEDED; color: #000; }

/* Cards and containers */
.retro-bw .card,
.retro-bw .card-text,
.retro-bw .skill-card,
.retro-bw form,
.retro-bw .social { background: transparent; border: 1px solid #FFF; border-radius: 0; box-shadow: none; }
.retro-bw .card-body { color: var(--text); }
.retro-bw .card-title { color: #FFF; }
.retro-bw .projects-grid { gap: 18px; }

/* Tags: square bracket vibe */
.retro-bw .tag { background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 0; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* Links */
.retro-bw a { color: #FFF; text-decoration: none; }
.retro-bw a:hover { background: #FFF; color: #000; }
.retro-bw .section-link { border-bottom: 1px dotted #FFF; }

/* Keep media in full color in retro mode */
.retro-bw img,
.retro-bw iframe { filter: none; }

/* Forms */
.retro-bw label { color: #FFF; }
.retro-bw input[type="text"],
.retro-bw input[type="email"],
.retro-bw textarea { background: #000; color: #FFF; border: 1px solid #FFF; border-radius: 0; }
.retro-bw button[type="submit"] { background: transparent; color: #FFF; border: 1px solid #FFF; border-radius: 0; }
.retro-bw button[type="submit"]:hover { background: #FFF; color: #000; }

/* Socials */
.retro-bw .social { border: 1px solid #FFF; background: transparent; }
.retro-bw .social:hover { background: #FFF; color: #000; }

/* Footer */
.retro-bw .site-footer { color: #EAEAEA; }
.retro-bw .site-footer a { color: #FFF; border-bottom: 1px dotted #FFF; }

/* Headings: keep gradient off, use pure white */
.retro-bw .title,
.retro-bw .headingIntro,
.retro-bw .headingName { background: none; -webkit-text-fill-color: #FFF; -moz-text-fill-color: #FFF; color: #FFF; }

/* Highlighted inline text uses accent */
.retro-bw .highlight-text-red,
.retro-bw .highlight-text-yellow,
.retro-bw .highlight-text-blue {
    color: var(--accent) !important;
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.5), 0 0 8px rgba(57, 255, 20, 0.35);
}

/* Also glow the rotating accent words */
.retro-bw #current-word,
.retro-bw #current-feedback {
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.5), 0 0 8px rgba(57, 255, 20, 0.35);
}

/* Topic/header lines */
.retro-bw .topicHeader::after { background: #FFF; opacity: 0.3; }

/* CRT Scanline effect (optional) */
.crt::before {
    content: "";
    position: fixed; inset: 0; pointer-events: none; z-index: 999;
    /* More apparent global scanlines: higher opacity and tighter spacing */
    background: repeating-linear-gradient(0deg, rgba(255,255,255,0.18) 0 1px, transparent 1px 3px);
    mix-blend-mode: overlay;
    /* Subtle vertical drift to simulate running CRT */
    animation: crt-scan-move 2s linear infinite;
}
.crt::after {
    content: "";
    position: fixed; inset: 0; pointer-events: none; z-index: 998;
    /* Slightly lighter vignette so scanlines remain visible */
    box-shadow: inset 0 0 140px rgba(0,0,0,0.82);
}

/* Keyframes for global CRT scanline movement */
@keyframes crt-scan-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(-0.3px); }
}

/* Monospace link underline behavior only for nav/body text, not buttons */
.retro-bw .nav a.btn { border: none; }

/* Retro image treatment: return to normal color; scanlines provide the retro feel */
.retro-bw .hero-media img,
.retro-bw .universe-image img,
.retro-bw .project-image img,
.retro-bw .card .card-media {
    filter: none;
    transition: filter .2s ease;
}
.retro-bw .hero-media:hover img,
.retro-bw .universe-image:hover img,
.retro-bw .project-image:hover img,
.retro-bw .card:hover .card-media {
    filter: none;
}

/* Add local scanlines over image areas only (hide on hover) */
.retro-bw .hero-media,
.retro-bw .universe-image,
.retro-bw .project-image { position: relative; }
.retro-bw .hero-media::after,
.retro-bw .universe-image::after,
.retro-bw .project-image::after {
    content: "";
    position: absolute; inset: 0; pointer-events: none;
    /* Stronger, tighter horizontal scanlines over media */
    background: repeating-linear-gradient(0deg, rgba(255,255,255,0.18) 0 1px, transparent 1px 3px);
    mix-blend-mode: overlay;
    opacity: .5;
    transition: opacity .2s ease;
    /* Gentle drift for local scanlines too */
    animation: local-scan-move 8s linear infinite;
}
.retro-bw .hero-media:has(img:hover)::after,
.retro-bw .universe-image:has(img:hover)::after,
.retro-bw .project-image:has(img:hover)::after { opacity: 0; }

/* Keyframes for local scanline movement */
@keyframes local-scan-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

/* Respect reduced motion: stop scanline animation */
@media (prefers-reduced-motion: reduce) {
    .crt::before,
    .retro-bw .hero-media::after,
    .retro-bw .universe-image::after,
    .retro-bw .project-image::after { animation: none !important; }
}


/*#endregion*/