@font-face {
    font-family: 'Dream Orphans';
    src: url('Dream Orphans Bd.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Linux Libertine';
    src: url('LinLibertine_DR.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg: #050505;
    --text: #FFFFFF;
    --text-dim: #FFFFFF;
    --glow-color: rgba(255, 255, 255, 0.7);
    --transition-fast: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ACCESSIBILITY UTILITIES */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

a:focus-visible, button:focus-visible, .video-container:focus-visible {
    outline: 2px solid var(--glow-color);
    outline-offset: 4px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Linux Libertine', serif;
    -webkit-font-smoothing: antialiased;
}

body.home-page {
    min-height: 100vh;
}

/* CRT SCANLINE & ARCADE OVERLAY */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Adapted to use transparency so your content stays visible beneath it */
    background: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15));
    background-size: 100% 4px;
    pointer-events: none; /* CRITICAL: Ensures you can still click links and play videos */
    z-index: -1; /* Placed behind the text/content for legibility */
    animation: scanlines 110s infinite linear; /* Slowed down halfway */
    /* Subtle vignette to mimic the darkened edges of an old arcade monitor */
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

@keyframes scanlines {
    from { background-position: 0 0; }
    to { background-position: 0 -400px; } /* Ensures the 4px pattern loops seamlessly */
}

/* DYNAMIC "PS3 WAVE" BACKGROUND */
.wave-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Pushed further back to sit behind the CRT scanlines */
    overflow: hidden;
}

.wave {
    position: absolute;
    background: linear-gradient(90deg, rgba(20,20,20,0.5), rgba(40,40,40,0.5));
    border-radius: 50%;
    filter: blur(50px);
    will-change: transform, opacity;
}

.wave-1 { width: 1200px; height: 1000px; top: -25%; left: -10%; animation: wave-flow 25s infinite linear alternate; }
.wave-2 { width: 1000px; height: 800px; bottom: -30%; right: -15%; animation: wave-flow 20s infinite linear alternate-reverse; }
.wave-3 { width: 800px; height: 600px; top: 10%; right: -20%; animation: wave-flow 30s infinite linear; }

@keyframes wave-flow {
    from { transform: translate3d(-5%, -5%, 0) rotate(-10deg); }
    to { transform: translate3d(5%, 5%, 0) rotate(10deg); }
}

/* HEADER */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    position: relative;
    width: 100%;
    text-align: center;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.logo {
    font-family: 'Dream Orphans', sans-serif;
    font-weight: 900;
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
    letter-spacing: 0.1em;
}

/* GENERAL IMAGE STYLES */
img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* SECTIONS */
main {
    padding: 4vh 5vw;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

section {
    padding: 0 2%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#home {
    justify-content: flex-start;
}

/* HOME DASHBOARD LAYOUT */
.home-dashboard {
    padding-top: 20px;
    margin-top: 40px;
    min-height: 85vh;
    width: 100%;
    display: flex;
    align-items: center;
}

.home-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 80px;
    max-width: 1800px;
    width: 96%;
    align-items: start;
    margin: 0 auto;
}

.about-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.side-panel {
    margin: 0;
    padding: 20px;
}

.side-panel.about-flex {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 40px;
    width: 100%;
    box-sizing: border-box;
}

.side-panel.about-flex .about-image {
    flex: 1.8;
    min-width: 250px;
}

.side-panel.about-flex .about-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.side-panel .about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.side-panel .about-content p {
    font-size: 1rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

.home-layout .portfolio-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0;
    max-width: 100%;
}

/* PORTFOLIO ROWS */
.portfolio-container {
    width: 100%;
    max-width: 1100px;
}

.portfolio-row {
    width: 100%;
}

.video-row {
    grid-column: 1 / -1;
}

.video-row .glass-grid {
    grid-template-columns: repeat(3, 1fr);
}

.row-title {
    font-family: 'Dream Orphans', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 1rem;
    margin-left: 0px; /* Perfectly left aligns with the icons below */
}

/* GRID LAYOUT */
.glass-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1000px;
}

/* GLASS COMPONENTS */
.glass-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left aligns the content */
    justify-content: flex-start;
    text-decoration: none;
    color: var(--text);
    padding: 0;
    transition: var(--transition-slow);
    position: relative;
    will-change: transform;
    width: 100%;
}

.glass-item:hover {
    transform: scale(1.05);
}

.glass-icon {
    margin-bottom: 5px;
    width: 100%;
    display: flex;
    justify-content: flex-start; /* Left aligns the image inside its container */
}

.glass-icon img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    transition: var(--transition-fast);
}

.glass-label {
    font-family: 'Dream Orphans', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}

/* ABOUT, CONTACT & PROJECT PANELS */
.about-container {
    height: 100%;
    background: rgba(20, 20, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.about-flex {
    display: flex;
    gap: 40px;
    align-items: center;
}

.about-flex .about-content {
    flex: 1.5;
}

.about-flex .about-image {
    flex: 1;
}

.about-image figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    aspect-ratio: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.about-image figcaption {
    margin-top: 20px !important;
    margin-bottom: 0;
}

.about-content h1, .about-content h2, .contact-panel h2 {
    font-family: 'Dream Orphans', sans-serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
    color: var(--text);
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* ANIMATED INSIGHTS (JOHN DEERE) */
.animated-insight {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text);
    margin: 15px 0;
    animation: text-pulse 2.5s infinite alternate;
}

@keyframes text-pulse {
    from { text-shadow: 0 0 4px rgba(255, 255, 255, 0.1); opacity: 0.85; }
    to { text-shadow: 0 0 15px rgba(255, 255, 255, 0.9); opacity: 1; }
}

.about-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.video-container video, .about-content img {
    width: 100%;
    border-radius: 12px;
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-fast);
    will-change: transform;
}

.video-container video:hover, .about-content img:hover {
    transform: scale(1.03);
    z-index: 2;
    position: relative;
}

.video-container {
    position: relative;
    overflow: hidden; /* Ensures controls don't spill out */
    border-radius: 12px; /* Match the video's border-radius */
    margin: 30px 0;
}

.video-container video {
    margin: 0; /* Override the default margin */
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: all var(--transition-fast);
    z-index: 3;
}

.video-container:hover .video-controls,
.video-container.paused .video-controls {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.video-controls button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.video-controls button:hover {
    color: var(--text);
    text-shadow: 0 0 8px var(--glow-color);
}

.progress-bar {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background: var(--text);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(20, 20, 20, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 5px; /* Optical alignment for play icon */
    z-index: 2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
    opacity: 0;
    visibility: hidden;
}

.video-container.paused .big-play-btn {
    opacity: 1;
    visibility: visible;
}

.big-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    border-color: var(--text);
    text-shadow: 0 0 8px var(--glow-color);
}

.image-row {
    display: flex;
    gap: 20px;
    margin: 30px 0;
}

.about-content .image-row img {
    margin: 0;
    flex: 1;
    min-width: 0;
    width: auto; /* Override width to let flexbox handle sizing */
}

figure .video-container {
    margin-bottom: 0;
}

figcaption {
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-dim);
    margin-top: 15px;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--text);
    color: var(--bg);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 5px;
    margin-top: 20px;
    transition: var(--transition-fast);
}

.btn:hover {
    opacity: 0.8;
}

.stats-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* CONTACT SPECIFIC */
.contact-panel {
    text-align: center;
}

.contact-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.contact-links a {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
    transition: var(--transition-fast);
}

.contact-links a:hover {
    color: #fff;
    border-bottom-color: #fff;
    text-shadow: 0 0 8px var(--glow-color);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-item h3 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-family: 'Dream Orphans', sans-serif;
    color: var(--text);
    margin-bottom: 5px;
}

.stat-item p {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin: 0;
}

/* FOOTER LINKS & BACK BUTTON */
.footer-links {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 40px 0 20px;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    margin: 0 10px;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.85rem;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* BACK TO TOP BUTTON */
#back-to-top {
    display: none !important; /* Disabled since scrolling is removed */
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 1.5rem;
    font-family: 'Dream Orphans', sans-serif;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: rgba(40, 40, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
    text-shadow: 0 0 8px var(--glow-color);
    transform: translateY(-5px);
}

/* RESPONSIVENESS */
@media (max-width: 1024px) {
    body, body.home-page {
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }
    main, section, .home-dashboard, body.home-page main {
        height: auto;
        min-height: calc(100vh - var(--nav-height));
    }
    .home-layout {
        grid-template-columns: 1fr;
    }
    .about-column {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    html { scroll-snap-type: none; }
    header { flex-direction: column; justify-content: center; gap: 10px; height: auto; padding: 15px; }
    nav a { margin-left: 10px; margin-right: 10px; font-size: 0.7rem; }
    main { padding-top: 80px; }
    .glass-grid { grid-template-columns: 1fr 1fr; }
    .portfolio-container { grid-template-columns: 1fr; }
    .video-row { grid-column: auto; }
    .contact-links { flex-direction: column; gap: 15px; }
    .about-flex { flex-direction: column; }
    .side-panel.about-flex { flex-direction: column; }
    .image-row { flex-direction: column; }
    
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .glass-grid { grid-template-columns: 1fr; }
}
