/* --- CSS Reset & Variables --- */
@font-face {
    font-family: 'NothingFont';
    src: url('nothing-font-5x7.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    /* Nothing Brand Dark Palette */
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-muted: #a1a1aa;
    --text-lighter: #52525b;
    --accent: #ff0000;
    --accent-hover: #ff4d4d;
    --border-color: #27272a;
    --card-bg: #0a0a0a;

    /* Typography */
    --font-heading: 'NothingFont', monospace;
    --font-body: 'Space Grotesk', -apple-system, sans-serif;
    --base-size: 16px;
    --line-height: 1.6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--base-size);
    line-height: var(--line-height);
    /* Dotted background pattern */
    background-image: radial-gradient(#27272a 1px, transparent 1px);
    background-size: 20px 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

h1::after,
h2::after,
.section-title::after {
    content: '.';
    color: var(--accent);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

a:hover {
    color: var(--accent);
}

.accent {
    color: var(--text-muted);
    font-weight: 400;
}

/* --- Layout --- */
.layout {
    display: flex;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    gap: 4rem;
}

.master {
    flex: 0 0 320px;
    position: sticky;
    top: 2rem;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.details {
    flex: 1;
    max-width: 900px;
}

.toc {
    flex: 0 0 50px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.section {
    margin-bottom: 4rem;
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Staggered animation delays for sections */
.section:nth-child(1) {
    animation-delay: 0.1s;
}

.section:nth-child(2) {
    animation-delay: 0.2s;
}

.section:nth-child(3) {
    animation-delay: 0.3s;
}

.section:nth-child(4) {
    animation-delay: 0.4s;
}

.section:nth-child(5) {
    animation-delay: 0.5s;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 2rem;
    border: 3px solid var(--bg-color); /* Separates it from banner */
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.name {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.role {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.objective {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 650px;
    margin-bottom: 2rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.right-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 0;
}

.right-nav .nav-link {
    width: 2px;
    height: 24px;
    background-color: var(--border-color);
    transition: height 0.3s ease, background-color 0.3s ease;
    display: block;
    color: transparent;
    overflow: hidden;
}

.right-nav .nav-link.active {
    height: 48px;
    background-color: var(--accent);
}

@media (hover: hover) {
    .right-nav .nav-link:hover {
        height: 48px;
        background-color: var(--accent);
    }
}

.right-nav .nav-link::before {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.skip-link:focus {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    background-color: var(--accent);
    color: var(--text-primary);
    z-index: 1000;
    border-radius: 4px;
    font-weight: bold;
}

.contact-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.contact-link {
    color: var(--text-primary);
    border-bottom: 1px solid transparent;
}

.contact-link:hover {
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
}

/* --- Common Section Styles --- */
.section-title {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-lighter);
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.item {
    margin-bottom: 2.5rem;
}

.item:last-child {
    margin-bottom: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.item-title {
    font-size: 1.1rem;
}

.item-date {
    font-size: 0.9rem;
    color: var(--text-lighter);
    white-space: nowrap;
    margin-left: 1rem;
}

.item-list {
    list-style: none;
    color: var(--text-muted);
}

.item-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.item-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-lighter);
}

/* --- Projects Section --- */
.project-card {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.1);
    border-color: var(--accent);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.project-title {
    font-size: 1.1rem;
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.project-badges {
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    background: var(--border-color);
    color: var(--text-primary);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-weight: 500;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-link {
    font-size: 0.9rem;
    color: var(--text-lighter);
}

.project-link:hover {
    color: var(--accent);
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.skill-items {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Footer --- */
.footer {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-lighter);
    font-size: 0.9rem;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

/* --- Media Queries --- */
@media (max-width: 860px) {
    .layout {
        flex-direction: column;
        gap: 2rem;
        padding-right: 3rem;
        /* Make room for the scrollspy */
    }

    .master {
        position: relative;
        top: 0;
        height: auto;
    }

    .profile-img {
        width: 140px;
        height: 140px;
        margin-bottom: 1.5rem;
    }

    .toc {
        display: flex;
        position: fixed;
        top: 50%;
        right: 1rem;
        bottom: auto;
        left: auto;
        transform: translateY(-50%);
        height: auto;
        width: auto;
        background-color: transparent;
        backdrop-filter: none;
        padding: 0;
        z-index: 100;
        border: none;
    }

    .right-nav {
        flex-direction: column;
        gap: 1rem;
        width: auto;
    }

    .right-nav .nav-link {
        width: 2px;
        height: 16px;
        transition: height 0.3s ease, background-color 0.3s ease;
    }

    .right-nav .nav-link.active {
        width: 2px;
        height: 32px;
    }

    @media (hover: hover) {
        .right-nav .nav-link:hover {
            width: 2px;
            height: 32px;
        }
    }

    .item-header {
        flex-direction: column;
    }

    .item-date {
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .name {
        font-size: 2.2rem;
        text-align: center;
    }

    .role {
        font-size: 1.1rem;
        text-align: center;
    }

    .contact-links {
        align-items: center;
        text-align: center;
    }

    .hero {
        margin-bottom: 2.5rem;
        align-items: center;
    }
}