body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    font-family: Inter, Arial, sans-serif;
    background: #191919;
    margin: 0;
    padding: 0;
    color: #ffffff;
}
  
header {
    background: #191919;
    padding: 1rem;
    border-bottom: 0.2rem solid #de0be6;
    box-shadow: 0 0.2rem 1rem #de0be6;
}

/* Update your nav styles */
nav {
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    align-items: center;
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 75rem;
    margin-inline: auto;
    box-sizing: border-box;
}

/* For larger screens */
@media (min-width: 768px) {
    nav {
        flex-direction: row; /* Horizontal layout on desktop */
        justify-content: space-between;
    }
}

.main-links, .social-links {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap on small screens */
    justify-content: center;
    gap: 0.5rem; /* Reduce gap on mobile */
    padding: 0.5rem 0;
}

@media (min-width: 768px) {
    .main-links {
        margin-right: auto;
    }
    .social-links {
        margin-left: auto;
    }
    .main-links, .social-links {
        gap: 1rem; /* Restore original gap on desktop */
    }
}

nav a {
    position: relative;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
}
  
nav .social-links a,
nav .main-links a {
    position: relative;
    margin: 0 10px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.8s ease;
}

nav .social-links a:hover {
    color: #de0be6;
}

nav .main-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px; /* distance below the text */
    width: 0;
    height: 2px;
    background-color: #de0be6;
    transition: width 0.8s ease;
}

nav .social-links a:hover::after,
nav .main-links a:hover::after,
nav .main-links a[aria-current="page"]::after {
    width: 100%;
}

nav .main-links a[aria-current="page"] {
    color: #eaabec;
}

h1,
.section-heading {
    border-bottom: 1px solid #de0be6; /* Adjust color and thickness as needed */
    padding-bottom: 10px; /* Adds space between text and line */
}

a {
    color: #eaabec; /* Orange color */
}
a:hover {
    color: #de0be6; /* Darker red on hover */
}
a:visited {
    color: #de0be6; /* Different color for visited links */
}

aside {
    width: 200px;
    padding-right: 1rem;
}

aside h3 {
    color: #333;
    font-size: 1rem;
    margin-top: 1rem;
}

aside ul {
    list-style: none;
    padding-left: 0;
}

aside ul li {
    margin: 5px 0;
}

main section {
    margin-bottom: 30px;
}

.container {
    display: flex;
    flex: 1;
    padding: 1rem;
    position: relative;
    width: 100%;
    max-width: 75rem;
    margin-inline: auto;
    box-sizing: border-box;
}

.site-footer {
    padding: 1.25rem 1rem;
    border-top: 1px solid rgba(222, 11, 230, 0.35);
    color: #918b94;
    font-size: 0.78rem;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

main {
    flex: 1;
    min-width: 10rem;
}

figure {
    position: relative; 
    text-align: center;
    margin: 2em auto; 
    max-width: 100%;
    z-index: 9999;
}

figure.float-right {
    float: right;
    margin: 0 0 1rem 1.5rem;
    max-width: 30rem;       /* keeps responsiveness */
    width: 22rem;           /* fixes figure width */
    text-align: center;
}

figure.float-right img.profile-pic {
    width: 22rem;           /* same as figure width */
    height: 22rem;          /* square image */
    object-fit: cover;      /* ensures image doesn’t stretch */
    border-radius: 8px;     /* optional aesthetic */
}

@media (max-width: 768px) {
    figure.float-right {
        float: none;
        margin: 2em auto;
        text-align: center;
        display: block;
        width: 12rem;       /* smaller fixed width for mobile */
    }

    figure.float-right img.profile-pic {
        width: 12rem;
        height: 12rem;
    }
}

.profile-pic {
    width: 100%;
    max-width: 30rem;
    height: auto;
    aspect-ratio: 1/1;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #de0be6;
    box-shadow: 0.2rem 0.2rem 1rem #de0be6;
    transition: opacity 0.5s ease;
}

.profile-pic:hover {
    opacity: 0.9;
    transition: opacity 0.9s ease;
    cursor: pointer;
}

.profile-pic:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

figcaption {
    font-style: italic;
    margin-top: 1em;
    margin-left: 0;
}

@media (max-width: 768px) {
    figure {
        position: relative;
        right: auto;
        top: auto;
        width: 80%;
        margin: 2em auto;
    }
    
    .profile-pic {
        max-width: 15rem;
    }
}

@media (max-width: 480px) {
    .profile-pic {
        max-width: 12rem;
    }
}

.boxed {
    border: 1px solid #de0be6;
    padding: 1rem;
    margin: 1rem 0;
    background-color: #191919; 
    border-radius: 5px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.terminal {
    position: relative;
    overflow: hidden;
    margin: 1rem 0 0.75rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background:
        linear-gradient(145deg, #080b09, #050806 65%) padding-box,
        linear-gradient(135deg, rgba(111, 229, 141, 0.75), rgba(104, 200, 255, 0.35) 38%, rgba(222, 11, 230, 0.65)) border-box;
    box-shadow:
        inset 0 0 2rem rgba(0, 0, 0, 0.28),
        0 0.75rem 2rem rgba(0, 0, 0, 0.4),
        0 0 1.25rem rgba(222, 11, 230, 0.13);
    color: #e8e8e8;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.terminal::before,
.terminal::after {
    content: "";
    position: absolute;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    pointer-events: none;
}

.terminal::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid #6fe58d;
    border-left: 2px solid #6fe58d;
    border-radius: 10px 0 0;
    filter: drop-shadow(0 0 0.3rem rgba(111, 229, 141, 0.45));
}

.terminal::after {
    right: -1px;
    bottom: -1px;
    border-right: 2px solid #de0be6;
    border-bottom: 2px solid #de0be6;
    border-radius: 0 0 10px;
    filter: drop-shadow(0 0 0.3rem rgba(222, 11, 230, 0.45));
}

.terminal-history {
    min-height: 5rem;
    padding: 1.25rem 1.25rem 0.5rem;
}

.terminal-command {
    margin-bottom: 0.85rem;
    overflow-wrap: anywhere;
}

.terminal-user {
    color: #6fe58d;
    font-weight: 700;
}

.terminal-path {
    color: #79c8ff;
    font-weight: 700;
}

.terminal-prompt {
    white-space: nowrap;
}

.terminal-command-text {
    margin-left: 0.65rem;
    color: #ffffff;
}

.terminal-command-typing::after {
    content: "█";
    margin-left: 0.12em;
    color: #de0be6;
    text-shadow: 0 0 0.5rem rgba(222, 11, 230, 0.65);
    animation: terminal-blink 0.72s steps(1, end) infinite;
}

.terminal-output {
    display: flow-root;
    position: relative;
    margin-bottom: 1rem;
    line-height: 1.65;
}

.terminal-output-streaming figure {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.985);
}

.terminal-output-waiting {
    display: none;
}

.terminal-output-streaming-active figure {
    animation: terminal-profile-resolve 0.45s steps(6, end) forwards;
}

.terminal-text-typing::after {
    content: "█";
    margin-left: 0.12em;
    color: #79c8ff;
    text-shadow: 0 0 0.5rem rgba(121, 200, 255, 0.7);
    animation: terminal-blink 0.72s steps(1, end) infinite;
}

.terminal-intro-running .terminal-input-row {
    visibility: hidden;
    opacity: 0;
    transform: translateY(0.35rem);
}

.terminal-output p:first-of-type {
    margin-top: 0;
}

.terminal-output a {
    color: #f0a9f3;
}

.terminal-output a:hover,
.terminal-output a:focus {
    color: #ff72ff;
}

.terminal-message {
    margin: 0 0 1rem;
    color: #d7d4d9;
    white-space: pre-wrap;
}

.terminal-error {
    color: #ff8c86;
}

.spotify-status {
    display: flex;
    width: 100%;
    min-height: 3.25rem;
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: flex-end;
    margin: 0 0 2.5rem;
    color: #aaa5ad;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.spotify-status-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.15rem;
    font-size: 0.76rem;
}

.spotify-status-loading i {
    color: #1ed760;
}

.spotify-now-playing {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    max-width: 30rem;
    padding: 0.4rem 0.65rem;
    border-left: 2px solid rgba(30, 215, 96, 0.55);
    border-radius: 0 5px 5px 0;
    background: linear-gradient(90deg, rgba(30, 215, 96, 0.06), transparent 80%);
}

a.spotify-now-playing {
    color: #ffffff;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

a.spotify-now-playing:hover,
a.spotify-now-playing:focus-visible {
    color: #ffffff;
    border-color: #1ed760;
    background-color: rgba(30, 215, 96, 0.06);
}

a.spotify-now-playing:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.spotify-now-playing-art {
    display: block;
    width: 3.15rem;
    height: 3.15rem;
    border-radius: 3px;
    object-fit: contain;
}

.spotify-now-playing-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.1rem;
}

.spotify-now-playing-label {
    display: flex;
    align-items: center;
    gap: 0.32rem;
    color: #1ed760;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.spotify-now-playing-track,
.spotify-now-playing-artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotify-now-playing-track {
    font-size: 0.88rem;
}

.spotify-now-playing-artist {
    color: #aaa5ad;
    font-size: 0.76rem;
}

.spotify-now-playing-idle {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: auto;
    padding: 0.35rem 0.15rem;
    border-left: 0;
    background: none;
    color: #777279;
    font-size: 0.76rem;
}

.spotify-now-playing-idle i {
    color: rgba(30, 215, 96, 0.72);
    font-size: 0.95rem;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 0 0.75rem;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.terminal-input-field {
    position: relative;
    flex: 1;
    min-width: 4rem;
    margin-left: 0.45rem;
}

.terminal-input-row input {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    outline: 0;
    background: transparent;
    color: #ffffff;
    font: inherit;
    caret-color: #de0be6;
}

.terminal-cursor {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0.6em;
    height: 1.05em;
    background: #de0be6;
    box-shadow: 0 0 0.5rem rgba(222, 11, 230, 0.65);
    transform: translateY(-50%);
    animation: terminal-blink 1s steps(1, end) infinite;
    pointer-events: none;
}

.terminal-hint {
    position: absolute;
    top: 50%;
    left: 0.9em;
    max-width: calc(100% - 0.9em);
    overflow: hidden;
    color: #827c86;
    text-overflow: ellipsis;
    transform: translateY(-50%);
    white-space: nowrap;
    pointer-events: none;
}

.terminal-input-row input:not(:placeholder-shown) ~ .terminal-cursor,
.terminal-input-row input:not(:placeholder-shown) ~ .terminal-hint {
    display: none;
}

.terminal-input-row input:focus ~ .terminal-hint {
    color: #a29ba6;
}

@keyframes terminal-blink {
    0%, 48% {
        opacity: 1;
    }

    49%, 100% {
        opacity: 0;
    }
}

@keyframes terminal-profile-resolve {
    0% {
        opacity: 0;
        transform: translateY(0.35rem) scale(0.985);
        filter: grayscale(1) contrast(1.35);
    }

    45% {
        opacity: 0.65;
        filter: grayscale(0.65) contrast(1.2);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: grayscale(0) contrast(1);
    }
}

@media (max-width: 500px) {
    .spotify-status {
        min-height: 3rem;
    }

    .terminal-input-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.35rem;
    }

    .terminal-input-field {
        width: 100%;
        min-height: 1.25em;
        margin-left: 0;
    }

    .spotify-now-playing-art {
        width: 2.85rem;
        height: 2.85rem;
    }

    .spotify-now-playing {
        max-width: calc(100vw - 3.2rem);
    }
}

@media (max-width: 480px) {
    .terminal-history {
        padding-right: 0.8rem;
        padding-left: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .terminal-cursor,
    .terminal-command-typing::after,
    .terminal-text-typing::after,
    .terminal-output-streaming-active figure {
        animation: none;
    }
}
