/* FONT IMPORT (optional, but recommended for the aesthetic) */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* --- GENERAL RESET & SETUP --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    background-color: #0d1117;
    color: #c9d1d9;
    font-family: 'Share Tech Mono', monospace;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

/* --- BACKGROUND EFFECTS --- */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: repeating-linear-gradient(to bottom, transparent, transparent 1px, rgba(0, 255, 255, 0.03) 3px);
    pointer-events: none;
    z-index: 1000;
}

#vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    box-shadow: inset 0 0 150px 50px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 999;
}

/* --- LAYOUT & CONTAINERS --- */
#container {
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: 1px solid #30363d;
    background-color: rgba(13, 17, 23, 0.8);
    padding: 1.5rem;
}

header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #21262d;
    padding-bottom: 1rem;
}

main {
    flex-grow: 1;
    display: flex;
    gap: 1.5rem;
    overflow: hidden;
}

#schematic-container {
    flex-basis: 40%;
    position: relative;
    border: 1px solid #21262d;
    background: radial-gradient(circle, rgba(88,166,255,0.05) 0%, rgba(13,17,23,0) 60%);
}

#display-panel {
    flex-basis: 60%;
    border: 1px solid #30363d;
    background-color: #010409;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- TYPOGRAPHY & HEADER/NAV --- */
h1 {
    font-size: 1.2rem;
    color: #58a6ff;
    letter-spacing: 2px;
}

#system-nav a {
    color: #8b949e;
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.3s ease;
}

#system-nav a:hover {
    color: #58a6ff;
    text-shadow: 0 0 5px rgba(88, 166, 255, 0.5);
}

#system-nav a.active_page {
    color: #388bfd;
    font-weight: bold;
}

em {
    color: #f778ba;
    font-style: normal;
}

/* --- SCHEMATIC NET LAYOUT --- */
#net-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#net-lines line {
    stroke: #21262d;
    stroke-width: 1;
    transition: stroke 0.3s ease;
    animation: glow 5s infinite ease-in-out;
}

@keyframes glow {
    0%, 100% {
        stroke: #21262d;
        stroke-width: 1;
    }
    10% {
        stroke: #58a6ff;
        stroke-width: 1.5;
    }
    20% {
        stroke: #21262d;
        stroke-width: 1;
    }
}

.project-node {
    position: absolute;
    width: 110px;
    height: 40px;
    background-color: #0d1117;
    border: 1px solid #30363d;
    color: #8b949e;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: translate(-50%, -50%); /* Center the node */
    transition: all 0.3s ease;
    z-index: 10;
    animation: fadeInNode 0.8s ease-out forwards;
}

@keyframes fadeInNode {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.project-node:hover {
    border-color: #58a6ff;
    color: #c9d1d9;
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

.project-node.active {
    border-color: #f778ba;
    color: #f0f6fc;
    box-shadow: 0 0 15px rgba(247, 120, 186, 0.5);
}

/* --- DISPLAY PANEL & CUSTOM SCROLLBAR --- */
.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    font-size: 0.9rem;
    color: #8b949e;
    flex-shrink: 0;
}

.display-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#display-content {
    padding: 1rem;
    overflow-y: auto;
}

#display-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #a7b3be;
}

#display-content img {
    display: block;
    max-width: 100%;
    margin: 1rem 0;
    border: 1px solid #30363d;
}

.standby-text {
    color: #8b949e;
    font-size: 1.1rem;
    text-align: center;
    margin-top: 4rem;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
  from, to { background-color: transparent; }
  50% { background-color: #8b949e; }
}

/* Minimalist Scrollbar Styling */
#display-content {
    scrollbar-width: thin;
    scrollbar-color: #30363d #010409;
}
#display-content::-webkit-scrollbar {
    width: 6px;
}
#display-content::-webkit-scrollbar-track {
    background: #010409;
}
#display-content::-webkit-scrollbar-thumb {
    background-color: #30363d;
    border-radius: 6px;
    border: 1px solid #010409;
}
#display-content::-webkit-scrollbar-thumb:hover {
    background-color: #58a6ff;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1200px) {
    body {
        overflow: auto;
        padding: 0;
    }
    #container {
        height: auto;
        min-height: 100vh;
        max-height: none;
        padding: 1rem;
    }
    main {
        flex-direction: column;
    }
    #schematic-container {
        flex-basis: auto;
        height: 350px;
    }
    #display-panel {
        flex-basis: auto;
        min-height: 300px;
        height: 50vh;
    }
    h1 { font-size: 1rem; }
    #system-nav a { margin-left: 1.5rem; }
}

@media (max-width: 780px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    #system-nav a { margin-left: 0; margin-right: 1rem; }

/* --- STYLES FOR ABOUT ME PAGE --- */

/* Adapt main layout for a single, full-width content panel */
#about-main {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
    gap: 0; /* Override default gap to allow full width */
}

#display-panel.full-width {
    flex-basis: 100%;
}

/* De-cramp the text by adjusting vertical margins */
#display-content p {
    margin-bottom: 1.25rem; /* Increased from 1rem */
    line-height: 1.7; /* Increased for more space between lines */
}

/* Styling for headings inside the content panel */
.content-heading {
    font-size: 1.1rem;
    color: #58a6ff;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    font-weight: normal;
}

/* Styling for dividers between sections */
.content-divider {
    border: none;
    height: 1px;
    background-color: #21262d;
    margin: 3rem 0; /* Increased margin for more separation */
}

/* Style links within the content to be consistent */
#display-content a {
    color: #f778ba; /* Use accent color for links */
    text-decoration: none;
    transition: all 0.2s ease;
}

#display-content a:hover {
    color: #ffaddb;
    text-shadow: 0 0 5px rgba(247, 120, 186, 0.5);
}

/* --- STYLES FOR RESPONSIVE PROJECT LAYOUT --- */

/* Default state for project nodes (for desktop net layout) */
.desktop-layout .project-node {
    position: absolute;
    transform: translate(-50%, -50%); /* Center the node */
    animation: fadeInNode 0.8s ease-out forwards;
}

/* Styles for the mobile grid container */
.mobile-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
}
.mobile-layout .project-node {
    width: 100%;              /* fill the grid cell */
    max-width: none;
    min-width: 0;
    height: 40px;
    transform: none;          /* <-- add this */
    left: auto !important;    /* safety */
    top:  auto !important;
}

.mobile-layout::-webkit-scrollbar {
    width: 6px;
}
.mobile-layout::-webkit-scrollbar-track {
    background: #0d1117;
}
.mobile-layout::-webkit-scrollbar-thumb {
    background-color: #30363d;
    border-radius: 6px;
}

/* Hide the SVG net lines in mobile view */
.mobile-layout #net-lines {
    display: none;
}

/* ==========  MOBILE-GRID FIX  ========== */
.mobile-layout {
    position: static !important;          /* kill the relative container */
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
}

.mobile-layout #net-lines {
    display: none;                        /* hide the SVG lines */
}

.mobile-layout .project-node {
    position: static !important;          /* remove absolute */
    transform: none !important;
    left: auto !important;
    top:  auto !important;
    width: 100%;                          /* fill the cell */
    max-width: none;
    min-width: 0;
    height: 40px;
    margin: 0;                            /* no extra margin */
}



