/* Base styles */
:root {
    --steam-dark-blue: #171a21;
    --steam-blue: #1b2838;
    --steam-light-blue: #66c0f4;
    --steam-highlight: #c7d5e0;
    --steam-text: #acb2b8;
    --steam-link: #66c0f4;
    --steam-green: #a4d007;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: #2b2b2b;
    background-image: url('img/default-bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    transition: background-image 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: Arial, sans-serif;
}

/* Header styles */
header {
    color: #ffffff;
    background-color: hsl(0, 0%, 13%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 0;
    position: relative;
    z-index: 1;
    background-image: url('img/mountain.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: -2rem;
    padding-bottom: 4rem;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(26, 26, 26, 0.9) 100%
    );
    z-index: 1;
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.name-container {
    position: relative;
    padding: 0.5rem;
    background: linear-gradient(to bottom, rgba(40, 40, 40, 0.4) 0%, rgba(20, 20, 20, 0) 100%);
    border-radius: 4px;
}

.name, .title {
    position: relative;
    z-index: 2;
}

.name {
    font-family: 'Fira Code', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.title {
    font-family: Arial, sans-serif;
    font-size: 0.875rem;
    color: var(--steam-light-blue);
    margin-top: 0.5rem;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(102, 192, 244, 0.3);
}

.location {
    font-family: Arial, sans-serif;
    font-size: 0.75rem;
    color: var(--steam-text);
    margin-top: 0.75rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(172, 178, 184, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location i {
    color: var(--steam-light-blue);
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(102, 192, 244, 0.3);
}

.main-nav a {
    color: #ffffff;
    font-size: 14px;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border-radius: 2px;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 25px;
    margin-left: 2rem;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--steam-light-blue);
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1.4rem;
}

.social-button:hover {
    color: #ffffff;
    transform: translateY(-3px);
    text-shadow: 0 2px 8px rgba(102, 192, 244, 0.3);
}

/* Layout containers */
.content-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding: 2rem 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: rgba(22, 22, 22, 0.95);
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: -2rem;
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.intro-section {
    background-color: rgba(43, 43, 43, 0.8);
    border: 1px solid rgba(50, 50, 50, 0.3);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    padding: 0;
    overflow: hidden;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.intro-section h2 {
    background-color: rgba(60, 63, 65, 0.8);
    color: #a9b7c6;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    margin: 0;
    border-bottom: 1px solid rgba(50, 50, 50, 0.3);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: normal;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
}

.intro-section h2::before {
    content: "▼";
    color: #a9b7c6;
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

.intro-section p {
    color: #a9b7c6;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.intro-section ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    border: 1px solid #323232;
    border-radius: 3px;
    overflow: hidden;
}

.intro-section li {
    padding: 0.5rem 1rem;
    margin: 0;
    color: #a9b7c6;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    background-color: #2b2b2b;
    border-bottom: 1px solid #323232;
    display: flex;
    align-items: center;
}

.intro-section li:last-child {
    border-bottom: none;
}

.intro-section li::before {
    content: "⬤";
    color: #cc7832;
    margin-right: 0.75rem;
    font-size: 0.5rem;
}

.intro-section li:hover {
    background-color: #323232;
}

.intro-section img {
    margin: 0;
}

.intro-content-wrapper {
    display: flex;
    padding: 1.5rem;
    gap: 2rem;
    align-items: flex-start;
    background: linear-gradient(to bottom, rgba(43, 43, 43, 0.6), rgba(35, 35, 35, 0.8));
}

.avatar-container {
    flex-shrink: 0;
}

.intro-content {
    flex: 1;
}

/* Project sections */
.project-title {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem 0;
    text-align: center;
    font-family: 'Fira Code', monospace;
    letter-spacing: 1px;
    border-bottom: 1px solid #606060;
    padding-bottom: 0.75rem;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(43, 43, 43, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(50, 50, 50, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.project-grid-video {
    display: grid;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(43, 43, 43, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(50, 50, 50, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.project-item {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.8) 0%, rgba(50, 50, 50, 0.8) 100%);
    border: 1px solid rgba(96, 96, 96, 0.3);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #fff;
    backdrop-filter: blur(5px);
    border-radius: 8px;
}

.project-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.project-item.video {
    grid-row: span 2;
    height: 100%;
}

.project-item::before {
    background-color: rgba(27, 40, 56, 0.9);
    color: var(--steam-light-blue);
    font-size: 12px;
    text-transform: uppercase;
    content: attr(data-label);
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 4px;
}

.play-button {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
}

.play-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.play-button::after {
    content: "▶";
    font-size: 24px;
}

.play-button.paused::after {
    content: "❚❚";
}

.project-item video {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.project-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.project-details {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.8) 0%, rgba(50, 50, 50, 0.8) 100%);
    border: 1px solid rgba(96, 96, 96, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    color: #ffffff;
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-in-out;
    backdrop-filter: blur(10px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-details h2 {
    color: var(--steam-light-blue);
    border-bottom: 1px solid var(--steam-light-blue);
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.project-details img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

/* Side panels */
.side-panels {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.side-panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: calc(max(10%, (100% - 840px) / 2));
    max-width: 300px;
    overflow: hidden;
    opacity: 0.15;
    transition: opacity 0.3s ease;
    background-color: #2b2b2b;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.side-panel:hover {
    opacity: 0.9;
    pointer-events: auto;
}

.side-panel.left {
    left: 0;
    border-right: 1px solid #323232;
}

.side-panel.right {
    right: 0;
    border-left: 1px solid #323232;
}

.code-scroll {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    animation: scrollCode 60s linear infinite;
    padding: 1rem 0;
}

.code-content {
    padding: 0 0.5rem;
}

.line {
    position: relative;
    padding-left: 3.5rem;
    min-height: 1.6em;
    color: #a9b7c6;
}

.line:hover {
    background-color: #323232;
}

.line-number {
    position: absolute;
    left: 0;
    width: 3rem;
    color: #606366;
    text-align: right;
    padding-right: 1rem;
    user-select: none;
}

.line::after {
    content: '';
    position: absolute;
    left: 3rem;
    top: 0;
    bottom: 0;
    border-left: 1px solid #323232;
}

.keyword {
    color: #cc7832;
    font-weight: bold;
}

.string {
    color: #6a8759;
}

.side-panel.right .code-scroll {
    animation-delay: -30s;
}

@keyframes scrollCode {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* Hide side panels on smaller screens */
@media (max-width: 1200px) {
    .side-panels {
        display: none;
    }
}

/* Extra overlay to ensure side panels don't show through */
.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a1a1a;
    /* Same as body background */
    z-index: -1;
    width: 100%;
}

/* Footer */
footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1.5rem 0;
    background-color: #333;
    color: #fff;
    position: relative;
    z-index: 1;
    margin-top: 0;
    /* Removed margin to fix gap */
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.rockhoppers-project-title {
    color: var(--steam-light-blue);
    background: linear-gradient(to right, transparent, rgba(102, 192, 244, 0.1), transparent);
    padding: 1rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem 0;
    text-align: center;
    font-family: 'ASM-Regular', sans-serif;
    letter-spacing: 1px;
    border-bottom: 1px solid #606060;
    padding-bottom: 0.75rem;
}

.project-header {
    color: var(--steam-light-blue);
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

@font-face {
    font-family: 'ASM-Regular';
    src: url('ASM-Regular.otf');
    src: local('ASM-Regular'),
        local('ASM-Regular'),
        url('ASM-Regular.otf') format('truetype'),
        url('ASM-Regular.otf') format('svg');
}

/* Responsive design */
@media (max-width: 1024px) {
    .side-panel {
        width: 8%;
    }

    .container {
        width: 100%;
        max-width: 800px;
        padding: 1.5rem;
    }

    .header-container {
        padding: 0.5rem 1.5rem;
    }
}

@media (max-width: 840px) {
    .side-panel {
        width: 5%;
    }

    .container {
        margin: 0 1rem;
    }

    .header-container {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem 0;
    }

    .container {
        padding: 1rem;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .social-buttons {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .name-and-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .name-container {
        flex-shrink: 0;
    }

    .main-nav {
        flex-wrap: wrap;
    }

    .social-links {
        margin-top: 0;
        flex-shrink: 0;
    }

    .project-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1rem;
    }

    .project-item.video {
        grid-row: span 1;
        height: 250px;
        width: auto;
    }

    .intro-section {
        padding: 1rem;
    }

    .intro-content-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
        gap: 1rem;
    }

    .avatar-container {
        margin-bottom: 1rem;
    }

    .competencies-section {
        padding: 1rem;
    }

    .competencies-section ul {
        padding: 0.75rem;
    }

    .competencies-section li {
        padding: 0.4rem 0.75rem;
        margin: 0.4rem 0;
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .side-panel {
        display: none;
    }

    .header {
        padding: 1rem 0;
    }

    .name {
        font-size: 1.25rem;
    }

    .title {
        font-size: 0.75rem;
    }

    .location {
        font-size: 0.7rem;
    }

    .social-button {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .intro-section {
        padding: 0.75rem;
    }

    .intro-section h2 {
        font-size: 1rem;
        padding: 0.4rem 0.75rem;
    }

    .intro-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .face {
        width: 120px;
        height: 120px;
    }

    .project-header {
        font-size: 1.5rem;
    }

    .rockhoppers-project-title {
        font-size: 1.25rem;
    }

    .project-item {
        height: 180px;
    }
}

@media (max-width: 400px) {
    .name {
        font-size: 1.1rem;
    }

    .title {
        font-size: 0.7rem;
    }

    .location {
        font-size: 0.65rem;
    }

    .social-button {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
    }

    .face {
        width: 100px;
        height: 100px;
    }

    .project-item {
        height: 150px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .project-item:hover {
        transform: none;
    }

    .social-button:hover {
        transform: none;
    }

    .competencies-section li:hover {
        transform: none;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .backdrop-filter {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

.social-buttons-area,
.social-buttons-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
}

.face {
    display: block;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #404040;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Competencies section */
.competencies-section {
    background-color: rgba(43, 43, 43, 0.8);
    border: 1px solid rgba(50, 50, 50, 0.3);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    padding: 0;
    overflow: hidden;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.competencies-section h2 {
    background-color: rgba(60, 63, 65, 0.8);
    color: #a9b7c6;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    margin: 0;
    border-bottom: 1px solid rgba(50, 50, 50, 0.3);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: normal;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
}

.competencies-section h2::before {
    content: "▼";
    color: #a9b7c6;
    margin-right: 0.5rem;
    font-size: 0.8rem;
}

.competencies-section ul {
    list-style: none;
    padding: 1rem;
    margin: 0;
    background: linear-gradient(to bottom, rgba(43, 43, 43, 0.6), rgba(35, 35, 35, 0.8));
}

.competencies-section li {
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    color: #a9b7c6;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    background-color: rgba(50, 50, 50, 0.5);
    border: 1px solid rgba(64, 64, 64, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(5px);
}

.competencies-section li:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.competencies-section li::before {
    content: "⬤";
    color: #cc7832;
    margin-right: 0.75rem;
    font-size: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .competencies-section {
        margin: 1rem 0;
    }
    
    .competencies-section ul {
        padding: 0.75rem;
    }
    
    .competencies-section li {
        padding: 0.4rem 0.75rem;
        margin: 0.4rem 0;
        font-size: 0.85rem;
    }
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 24px;
    background-color: var(--steam-light-blue);
    margin-left: 5px;
    animation: cursorBlink 1s infinite;
    box-shadow: 0 0 8px rgba(102, 192, 244, 0.5);
}

@keyframes cursorBlink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}