:root {
    --ink: #111111;
    --muted: #5f6368;
    --line: #d5d5d5;
    --soft: #f7f7f7;
}

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

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: #ffffff;
    color: var(--ink);
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    line-height: 1.7;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.45;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, #000000, transparent 88%);
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0 3rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
    margin-bottom: 4.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ink);
}

.site-mark {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid #888888;
    color: #333333;
    font-size: 0.76rem;
    font-weight: 650;
}

.back-link:hover,
.back-link:focus-visible {
    color: #000000;
    border-bottom-color: #000000;
    outline: none;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    align-items: end;
    gap: 3rem;
    margin-bottom: 4rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    color: #3f3f3f;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.eyebrow::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--ink);
}

h1 {
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.055em;
}

.hero-note {
    padding-left: 1.4rem;
    border-left: 1px solid var(--ink);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.9;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

.project-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1.8rem 1.5rem;
    border-bottom: 1px solid var(--line);
    transition: background 0.2s ease;
}

.project-card:last-child {
    border-bottom: 0;
}

.project-card:hover {
    background: var(--soft);
}

.project-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.project-index,
.project-type {
    color: #666666;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.project-title {
    margin-bottom: 0.9rem;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
}

.project-description {
    margin-bottom: 1.25rem;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.82;
}

.project-state {
    margin-top: auto;
    margin-bottom: 1rem;
    padding-left: 0.65rem;
    border-left: 2px solid var(--ink);
    color: #555555;
    font-size: 0.7rem;
    font-weight: 650;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #888888;
    color: #333333;
    font-size: 0.74rem;
    font-weight: 700;
}

.project-link:hover,
.project-link:focus-visible {
    color: #000000;
    border-bottom-color: #000000;
    outline: none;
}

.data-state {
    grid-column: 1 / -1;
    padding: 3rem 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.boundary {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ink);
}

.boundary h2 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.boundary p {
    max-width: 780px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.85;
}

.site-footer {
    position: relative;
    margin-top: 4rem;
    padding: 3rem 2rem 0;
    color: #666666;
    text-align: center;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 60px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #333333, #666666);
    transform: translateX(-50%);
}

.footer-page-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid currentColor;
    color: #4b5563;
    font-size: 0.76rem;
    font-weight: 650;
}

.footer-author,
.footer-copyright,
.footer-records {
    font-size: 0.78rem;
}

.footer-author {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.footer-author a,
.footer-records a {
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-records {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.7rem;
}

.footer-page-link:hover,
.footer-page-link:focus-visible,
.footer-author a:hover,
.footer-author a:focus-visible,
.footer-records a:hover,
.footer-records a:focus-visible {
    color: #000000;
    border-bottom-color: currentColor;
    outline: none;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1.5rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
    outline: none;
    transform: translateY(-2px);
}

@media (max-width: 760px) {
    .topbar {
        margin-bottom: 3rem;
    }

    .hero,
    .portfolio-grid,
    .boundary {
        grid-template-columns: 1fr;
    }

    .hero {
        gap: 2rem;
        margin-bottom: 3.5rem;
    }

    .boundary {
        gap: 0.75rem;
    }

    .site-footer {
        padding-right: 0;
        padding-left: 0;
    }

    .footer-records {
        flex-direction: column;
    }
}
