:root {
    color-scheme: dark;
    --background: #050505;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.18);
    --border-strong: rgba(255, 255, 255, 0.34);
    --text: #ffffff;
    --muted: #b6b6b6;
    --error: #ff9d8f;
    --page-width: 760px;
}

@font-face {
    font-family: "NDot";
    src: url("../ndot-47-inspired-by-nothing.otf/ndot-47-inspired-by-nothing.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 35%), var(--background);
    color: var(--text);
    cursor: none;
    font-family: "NDot", "Lucida Console", "Monaco", "Courier New", monospace;
    letter-spacing: 0.02em;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p,
ul,
figure {
    margin-top: 0;
}

.page {
    position: relative;
    z-index: 1;
    width: min(var(--page-width), calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 56px 0;
}

.page--wide {
    --page-width: 1040px;
}

.eyebrow {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.title {
    margin-bottom: 18px;
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(2.5rem, 9vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 1;
    text-transform: uppercase;
}

.section-title {
    margin-bottom: 12px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.bio {
    margin-bottom: 0;
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.6;
}

.page-link-row {
    margin: 22px 0 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    cursor: none;
}

.page-link::after {
    content: "\2192\fe0e";
    transition: transform 160ms ease;
}

.page-link:hover::after,
.page-link:focus-visible::after {
    transform: translateX(3px);
}

.webring {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.webring-controls {
    position: absolute;
    top: clamp(12px, 2vw, 24px);
    right: clamp(12px, 2vw, 24px);
    display: inline-flex;
    gap: 4px;
    align-items: center;
    pointer-events: auto;
}

.webring-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: none;
    transition: transform 160ms ease, opacity 160ms ease;
}

.webring-link:hover,
.webring-link:focus-visible {
    opacity: 0.78;
}

.webring-link-left:hover,
.webring-link-left:focus-visible {
    transform: translateX(-2px);
}

.webring-link-right:hover,
.webring-link-right:focus-visible {
    transform: translateX(2px);
}

.webring-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 4px;
}

.webring-badge {
    display: block;
    width: clamp(42px, 7vw, 64px);
    height: auto;
}

.webring-arrow {
    display: block;
    font-size: clamp(1.45rem, 2.5vw, 1.95rem);
    line-height: 1;
}

.dot-field {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: difference;
}

.background-dot {
    position: absolute;
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 50%;
    background: #ffffff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
    transition:
        opacity var(--animation-time) ease,
        transform var(--animation-time) ease;
}

.portrait {
    margin: 40px 0;
    text-align: center;
}

.portrait img {
    display: block;
    width: min(100%, 420px);
    margin: 0 auto;
}

.portrait figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.socials {
    margin-top: 36px;
}

.social-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.text-link {
    position: relative;
    display: inline-block;
    text-decoration: none;
    cursor: none;
}

.text-link::after {
    position: absolute;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 2px;
    content: "";
    background: #ffffff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 140ms ease;
}

.text-link:hover::after,
.text-link:focus-visible::after,
.text-link:active::after {
    transform: scaleX(1);
}

.projects-hero {
    margin-bottom: 44px;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.projects-status {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.projects-status[data-state="error"] {
    color: var(--error);
}

.projects-grid {
    display: grid;
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-top: 18px;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-height: 620px;
    padding: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, var(--surface-strong), var(--surface));
    text-decoration: none;
    cursor: none;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background-color 160ms ease;
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
}

.project-card-title {
    margin: 14px 0 0;
    font-family: "IBM Plex Mono", monospace;
    font-size: 1rem;
    line-height: 1.4;
    text-transform: uppercase;
}

.project-preview {
    position: relative;
    flex: 1;
    min-height: 500px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #101010;
    cursor: auto;
}

.project-preview-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 18px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
    text-align: center;
}

.project-preview-status[data-state="error"] {
    color: var(--error);
}

.project-preview-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    cursor: auto;
}

@media (max-width: 720px) {
    .webring-controls {
        top: auto;
        right: 50%;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        transform: translateX(50%);
        gap: 3px;
    }

    .webring-arrow {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }

    .webring-badge {
        width: clamp(40px, 14vw, 52px);
    }

    .page {
        width: min(var(--page-width), calc(100% - 24px));
        padding: 40px 0 calc(70px + env(safe-area-inset-bottom, 0px));
    }

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

    .project-card {
        min-height: 540px;
    }

    .project-preview {
        min-height: 400px;
    }
}
