:root {
    --paper: #f4ead5;
    --ink: #1a1713;
    --muted-ink: #554d44;
    --grid: #d6c8b3;
    --grid-focus: #706554;
    --line: #dcd3c6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "IBM Plex Mono", monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--paper);
    background-image: radial-gradient(var(--grid) 1.2px, transparent 1.2px);
    background-position: 0 0;
    background-size: 35px 35px;
    color: var(--ink);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    background-image: radial-gradient(var(--grid-focus) 1.5px, transparent 1.5px);
    background-position: 0 0;
    background-size: 35px 35px;
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    -webkit-mask: radial-gradient(
        circle 150px at var(--mouse-x, 50%) var(--mouse-y, 50%),
        black 0%,
        transparent 100%
    );
    mask: radial-gradient(
        circle 150px at var(--mouse-x, 50%) var(--mouse-y, 50%),
        black 0%,
        transparent 100%
    );
}

body:hover::before {
    opacity: 1;
}

#scroll-track {
    position: relative;
    height: 350vh;
}

#sticky-container {
    display: grid;
    position: sticky;
    top: 0;
    place-items: center;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.line {
    max-height: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.l1,
.l2 {
    font-size: 2rem;
    font-weight: normal;
}

.l3 {
    font-size: 1.5rem;
    line-height: 1.6;
}

.l4 {
    font-size: 1.3rem;
}

.highlight {
    border-bottom: 2px solid #443c33;
}

.inline-nav a {
    margin: 0 15px;
    color: #443c33;
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 6px;
}

.inline-nav a:hover,
.top-logo:hover,
.bottom-skip:hover {
    color: #000;
}

.top-logo,
.bottom-skip,
.bottom-scroll,
.bottom-footer {
    position: absolute;
    color: var(--muted-ink);
    font-size: 1rem;
    text-decoration: none;
    transition: opacity 0.5s ease;
}

.top-logo {
    top: 30px;
    left: 30px;
}

.bottom-skip {
    right: 30px;
    bottom: 30px;
    text-decoration: underline;
}

.bottom-scroll {
    bottom: 40px;
    left: 50%;
    line-height: 1.4;
    text-align: center;
    transform: translateX(-50%);
}

.bottom-footer {
    bottom: 30px;
    left: 0;
    width: 100%;
    text-align: center;
}

.state-0 .l1,
.state-1 .l1 {
    max-height: 60px;
    margin-bottom: 10px;
    opacity: 1;
}

.state-1 .l2 {
    max-height: 60px;
    opacity: 1;
}

.state-2 .l1 {
    max-height: 0;
    margin-bottom: -20px;
    opacity: 0;
    transform: translateY(-20px);
}

.state-2 .l2 {
    max-height: 60px;
    margin-bottom: 25px;
    opacity: 1;
}

.state-2 .l3 {
    max-height: 100px;
    margin-bottom: 25px;
    opacity: 1;
}

.state-3 .l1 {
    display: none;
}

.state-3 .l2 {
    max-height: 60px;
    margin-bottom: 25px;
    opacity: 1;
}

.state-3 .l3 {
    max-height: 100px;
    margin-bottom: 35px;
    opacity: 1;
}

.state-3 .l4 {
    max-height: 50px;
    opacity: 1;
}

.state-0 .top-logo,
.state-0 .bottom-footer,
.state-1 .top-logo,
.state-1 .bottom-footer,
.state-2 .top-logo,
.state-2 .bottom-footer {
    opacity: 0;
    pointer-events: none;
}

.state-0 .bottom-scroll,
.state-0 .bottom-skip,
.state-1 .bottom-scroll,
.state-1 .bottom-skip,
.state-2 .bottom-scroll,
.state-2 .bottom-skip {
    opacity: 1;
}

.state-3 .top-logo,
.state-3 .bottom-footer {
    opacity: 1;
}

.state-3 .bottom-scroll,
.state-3 .bottom-skip {
    opacity: 0;
    pointer-events: none;
}

.state-0 .bottom-skip,
.state-1 .bottom-skip,
.state-2 .bottom-skip {
    pointer-events: auto;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.project-card:hover {
    background-color: #f6efe6;
    transform: translateY(-3px);
}

.project-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.text-section strong {
    font-weight: 500;
}

a {
    transition: color 0.2s ease;
}

a:focus-visible {
    outline: 2px solid var(--grid-focus);
    outline-offset: 4px;
}

@media (max-width: 700px) {
    .sub-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        padding: 25px;
    }

    .text-page-content {
        margin: 50px auto 90px;
        padding: 0 25px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .top-logo {
        top: 20px;
        left: 20px;
    }

    .bottom-skip {
        right: 20px;
        bottom: 20px;
    }

    .l1,
    .l2 {
        font-size: 1.6rem;
    }

    .l3 {
        max-width: 90vw;
        font-size: 1.15rem;
    }

    .l4 {
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
