:root {
    --text-color: #000000;
    --background-color: #ffffff;
    --highlight-color: #f5f5f5;
    --button-color: #f0f0f0;
    --link-color: #FFF134;
    --border-color: #000000;
    --gap: 10px;
    --ui-padding: 0.5em 0.8em;
    --border-radius: 0px;
    --big-border-radius: 0px;
    --muted-color: #555555;
    --hover-contrast: #000000;
    --font-mono: 'Atkinson Hyperlegible Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
}

html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
}

body {
    line-height: 1.6;
    background-color: var(--background-color);
}

.content {
    width: 100%;
    margin: 0 auto;
    max-height: 100%;
    overflow: auto;
}

a {
    color: var(--text-color);
    text-decoration: none;
    max-width: max-content;
}

a:hover {
    text-decoration: underline;
}

a.big-link {
    font-size: 1.5em;
}

.pill {
    border-radius: var(--border-radius);
    padding: var(--ui-padding);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    max-width: max-content;
    white-space: nowrap;
    font-size: 0.9em;
}

.flex, .flex-v {
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
}

.flex-v {
    flex-direction: column;
}

button, input, textarea {
    padding: var(--ui-padding);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-color);
    color: var(--text-color);
    height: max-content;
    font-size: 1em;
}

button {
    cursor: pointer;
}

button:hover, input:hover, textarea:hover {
    background: var(--highlight-color);
}

button:hover * {
    color: var(--text-color);
}

#modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

#modal.open {
    display: flex;
}

.modal {
    position: relative;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--big-border-radius);
    padding: 1rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.modal .modal-image,
.modal img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    width: auto;
    border-radius: var(--border-radius);
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius);
}

.modal-close:hover {
    background: var(--highlight-color);
}

.material-icons {
    font-size: 1em !important;
}

.small-gap {
    gap: calc(var(--gap) / 2);
}

.modal-close .material-icons {
    font-size: 20px;
    line-height: 1;
}

.no-border {
    border: none !important;
}

.full-width {
    width: 100%;
    max-width: 100%;
}

.big-inline-padding {
    padding: 1em 2em;
}

.small-inline-padding {
    padding: 0 1em;
    height: max-content;
}

h2 {
    font-weight: normal;
}

.huge-title {
    font-size: 3em;
}

.center-self {
    align-self: center;
}

.align-children {
    align-items: center;
}

.nopointer {
    pointer-events: none;
}

/* ── Page layout ── */

.page-outer {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-container {
    width: 100%;
    padding: 2rem 2rem 0;
}

button {
    font-weight: 500;
}

button.selected {
    background: var(--link-color);
    color: var(--hover-contrast);
    border-color: var(--border-color);
}

button.selected * {
    color: var(--hover-contrast);
}

.link-button {
    color: var(--text-color);
    padding: var(--ui-padding);
    font-weight: 500;
    height: max-content;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

.link-button.alt {
    background: var(--background-color);
    font-weight: normal;
}

.link-button:hover {
    background: var(--link-color);
    color: var(--hover-contrast);
    text-decoration: none;
}

.link-button:hover * {
    color: var(--hover-contrast);
}

.space-between {
    justify-content: space-between;
}

hr {
    border: none;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.bold {
    font-weight: bold;
}

.italic {
    font-style: italic;
}

.no-break {
    white-space: nowrap;
}

.header-image {
    height: 2em;
    width: auto;
    align-self: center;
    border-radius: var(--border-radius);
}

.hidden {
    display: none;
}

mark {
    background: var(--text-color);
    color: var(--background-color);
    padding: 0 4px;
}

ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 1em;
}

.dimmed {
    opacity: 0.75;
}

.big-gap {
    gap: calc(var(--gap) * 2);
}

.noflexwrap {
    flex-wrap: nowrap;
}

/* ── Hero / site title ── */

.site-hero {
    padding: 0 2rem 0.6rem;
    width: 100%;
}

.site-title {
    font-size: 10vw;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    white-space: nowrap;
    display: block;
    width: 100%;
    background-image: linear-gradient(
        135deg,
        var(--text-color) 0%,
        color-mix(in oklab, var(--text-color), var(--background-color) 10%) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Navigation (sticky, transparent + blur) ── */

.navigation {
    position: sticky;
    top: 0;
    background: transparent;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    width: 100%;
    z-index: 100;
    padding: 0.6rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

/* All nav-left children share the same box style — 1px black border, no gaps */
.nav-box {
    border: 1px solid var(--border-color);
    border-left: none;
    padding: var(--ui-padding);
    font-size: 0.9em;
    background: var(--background-color);
    display: flex;
    align-items: center;
    font-weight: 400;
    font-style: normal;
}

.nav-box:first-child {
    border-left: 1px solid var(--border-color);
}

.nav-box.nav-box--icon {
    padding: 0;
}

.nav-logo {
    height: 2.2rem;
    width: auto;
    display: block;
}

/* ── Projects list ── */

.projects-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 0 1.5rem;
}

.project-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem 0;
    margin: 0 -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    cursor: pointer;
    transition: background .15s, transform .2s;
}

.project-row:hover {
    background: var(--highlight-color);
    transform: scale(1.008);
}

.project-thumb {
    width: 320px;
    min-width: 320px;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: zoom-in;
    transition: transform .2s;
    flex-shrink: 0;
}

.project-thumb:hover {
    transform: scale(1.02);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.project-name {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1.1;
}

.project-desc {
    font-size: 1rem;
    font-style: italic;
}

.project-name-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.project-star {
    width: 5rem;
    height: 5rem;
    display: block;
    will-change: transform;
    opacity: 0;
    transition: opacity .15s;
    animation: project-star-shake 1.5s ease-in-out infinite, project-star-rainbow 3s linear infinite;
}

.project-row:hover .project-star {
    opacity: 1;
}

@keyframes project-star-shake {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-12px); }
}

@keyframes project-star-rainbow {
    0% { color: #ff0000; }
    16% { color: #ffff00; }
    33% { color: #00ff00; }
    50% { color: #00ffff; }
    66% { color: #0000ff; }
    83% { color: #ff00ff; }
    100% { color: #ff0000; }
}

.project-open-btn {
    margin-top: 0.25rem;
}

/* ── About / ToS pages ── */

.about-content {
    padding: 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
}

/* ── Footer ── */

.footer {
    margin-top: auto;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.9em;
    text-align: center;
    color: var(--muted-color);
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--muted-color);
}

.inline-image {
    height: 1em;
    width: auto;
}

.payment-pill {
    border: none;
    padding: 1px 0.5em;
    line-height: 1;
    align-self: center;
}

.back-to-top-button {
    position: fixed;
    bottom: 1em;
    right: 1em;
}

/* Consistent sizing for interactive elements */
button, .nav-box, .link-button, .pill {
    font-size: 1rem;
    line-height: 1.2;
}

/* ── Dark mode ── */

@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f4f1ea;
        --background-color: #0E0E0F;
        --highlight-color: #1A1A1C;
        --button-color: #2a2a39;
        --border-color: #4b4b5c;
        --muted-color: #888888;
    }
}

@media only screen and (max-width: 600px) {
    .project-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-thumb {
        width: 100%;
        min-width: unset;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .navigation {
        padding: 0.6rem 1rem;
    }

    .nav-box:not(.nav-box--icon) {
        display: none;
    }

    .site-hero {
        padding: 1rem 1rem 0;
    }

    .page-container {
        padding: 0 1rem;
    }
}

@media only screen and (max-width: 912px) {
    .project-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-thumb {
        width: 100%;
        min-width: unset;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .project-name {
        font-size: 2.5rem;
    }
}
