@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=Karla:wght@400;500;600&display=swap');

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-body);
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
}

body.font-sans,
.font-sans {
    font-family: var(--gh-font-body);
}

body.font-serif,
.font-serif {
    font-family: var(--gh-font-heading);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* NAV */
.site-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 1.5rem 2rem;
    padding: 1.75rem 2.5rem 1.25rem;
    border-bottom: 0.5px solid var(--border);
}

.nav-mark {
    font-size: var(--font-size-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    line-height: var(--line-height-snug);
}

.nav-mark:hover {
    color: var(--text);
}

.site-nav__center {
    justify-self: center;
}

.nav-links--numbered {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    counter-reset: nav-num;
}

.nav-link {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    gap: 0.5rem;
    font-size: var(--font-size-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 400;
    line-height: var(--line-height-snug);
    padding: 0.125rem 0;
}

.nav-link:hover,
.nav-link--current {
    color: var(--text);
    font-weight: 500;
}

.nav-link__num::before {
    counter-increment: nav-num;
    content: counter(nav-num, decimal-leading-zero);
    font-variant-numeric: tabular-nums;
    color: var(--text-very-muted);
    font-weight: 500;
}

.nav-meta {
    text-align: right;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.nav-meta__time {
    font-size: var(--font-size-sm);
    color: var(--text);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.nav-meta__place,
.nav-meta__date {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* HOMEPAGE HERO */
.home-hero {
    padding: 4rem 2.5rem 4.5rem;
    border-bottom: 0.5px solid var(--border);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 2.5rem 4rem;
    align-items: end;
}

.home-hero__eyebrow {
    font-size: var(--font-size-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.home-hero__title {
    font-family: var(--gh-font-heading);
    font-size: clamp(2.75rem, 6vw, 4rem);
    line-height: 1.02;
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.01em;
}

.home-hero__title span {
    display: block;
}

.home-hero__aside {
    padding-bottom: 0.35rem;
    padding-left: 1.5rem;
    border-left: 0.5px solid var(--border);
}

.home-hero__lead {
    font-size: var(--font-size-md);
    color: var(--text);
    line-height: var(--line-height-relaxed);
    max-width: 28rem;
}

.home-hero__lead + .home-hero__lead {
    margin-top: 1.25rem;
}

/* VERTICAL SPINE SECTIONS */
.home-section {
    border-bottom: 0.5px solid var(--border);
}

.section-spine {
    display: grid;
    grid-template-columns: 3.25rem 1fr;
}

.section-spine__label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: var(--font-size-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 0.5px solid var(--border-faint);
}

.section-spine__body {
    padding: 2.75rem 2.5rem 3.25rem 2rem;
}

/* PROJECTS */
.projects-header {
    margin-bottom: 2rem;
    max-width: 40rem;
}

.projects-title {
    font-family: var(--gh-font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: var(--line-height-tight);
}

.projects-sub {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
    line-height: var(--line-height-body);
}

.proj-list {
    border-top: 0.5px solid var(--border);
}

.home-section--experiments .home-section__body {
    padding: 2.5rem 2.5rem 3.25rem calc(3.25rem + 2rem);
    counter-reset: project-num;
    border-top: 0.5px solid var(--border-faint);
}

.projects,
.section-spine__body {
    counter-reset: project-num;
}

.proj-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    gap: 1.25rem 1.5rem;
    align-items: start;
    padding: 1.5rem 0;
    border-bottom: 0.5px solid var(--border-faint);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.proj-row:hover .proj-name {
    color: var(--text-muted);
}

.proj-row:focus-visible {
    background: var(--bg-subtle);
}

.proj-num {
    font-family: var(--gh-font-heading);
    font-size: 1.375rem;
    color: var(--text-very-muted);
    font-style: italic;
    line-height: 1;
}

.proj-num::before {
    counter-increment: project-num;
    content: counter(project-num, decimal-leading-zero);
}

.proj-name {
    font-family: var(--gh-font-heading);
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: var(--line-height-snug);
    transition: color 0.15s ease;
}

.proj-hook {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: var(--line-height-body);
    font-weight: 400;
    max-width: 36rem;
    margin-bottom: 0.5rem;
}

.proj-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.proj-tag {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-faint);
    padding-bottom: 1px;
    line-height: var(--line-height-snug);
}

.proj-right {
    text-align: right;
    flex-shrink: 0;
    min-width: 5.5rem;
    padding-top: 0.15rem;
}

.proj-status {
    font-size: var(--font-size-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
}

.proj-date {
    font-size: var(--font-size-xs);
    color: var(--text-very-muted);
    display: block;
    margin-bottom: 0.625rem;
}

.proj-arrow {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    display: block;
}

/* SIMPLE PAGE (e.g. More soon) */
.page--simple {
    max-width: 36rem;
    margin: 0 auto;
    padding: 2rem 2.5rem 4rem;
    text-align: center;
}

.page--simple .breadcrumb {
    margin-bottom: 0.75rem;
}

.page--simple .hero {
    margin-bottom: 1.25rem;
    padding-bottom: 0;
    border-bottom: none;
}

.page--simple .hero-title {
    font-family: var(--gh-font-heading);
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 0;
    line-height: var(--line-height-tight);
    text-align: center;
}

.page--simple .post-tags {
    margin-bottom: 1rem;
    text-align: left;
}

.page--simple .post-content {
    font-size: var(--font-size-md);
    color: var(--text);
    line-height: var(--line-height-relaxed);
    text-align: left;
}

.page--simple .post-content p {
    margin-bottom: 1.25rem;
}

.page--simple .post-content ul,
.page--simple .post-content ol {
    margin: 0 0 1.5rem 1.25rem;
    color: var(--text-muted);
}

.page--simple .page-back {
    display: inline-block;
    margin-top: 2rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-decoration: none;
}

.page--simple .page-back:hover {
    color: var(--text);
}

/* Simple pages — centered chrome on desktop */
@media (min-width: 769px) {
    .page-template .site-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .page-template .site-footer__subscribe {
        align-items: center;
    }

    .page-template .bottom {
        justify-content: center;
    }
}

/* SITE FOOTER */
.site-footer {
    border-top: 0.5px solid var(--border);
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-footer:not(:has(.site-footer__quote)) {
    justify-content: flex-end;
}

.site-footer__quote {
    font-family: var(--gh-font-heading);
    font-style: italic;
    font-size: 1.125rem;
    max-width: 20rem;
    line-height: var(--line-height-snug);
    font-weight: 400;
    color: var(--text);
    margin: 0;
}

.site-footer__subscribe {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.site-footer__label {
    font-size: var(--font-size-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
}

.sub-row {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.sub-input {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-snug);
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text);
    outline: none;
    font-family: var(--gh-font-body);
    min-width: 12.5rem;
    border-radius: 0;
}

.sub-input::placeholder {
    color: var(--text-label);
}

.sub-btn {
    font-size: var(--font-size-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
    padding: 0.625rem 1.125rem;
    background: var(--text);
    color: var(--text-on-dark);
    border: 1px solid var(--text);
    cursor: pointer;
    font-family: var(--gh-font-body);
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sub-btn:hover {
    background: var(--text-muted);
    border-color: var(--text-muted);
}

.bottom {
    padding: 1rem 2.5rem;
    border-top: 0.5px solid var(--border-faint);
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.bottom:empty {
    display: none;
}

.bottom-link {
    font-size: var(--font-size-xs);
    color: var(--text-very-muted);
    letter-spacing: 0.04em;
    line-height: var(--line-height-snug);
    text-decoration: none;
    transition: color 0.15s ease;
}

.bottom-link:hover {
    color: var(--text);
}

/* MOBILE */
@media (max-width: 768px) {
    .site-nav {
        grid-template-columns: 1fr;
        padding: 1.25rem 1.25rem 1rem;
        gap: 1.25rem;
    }

    .site-nav__center {
        justify-self: start;
    }

    .nav-links--numbered {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
    }

    .nav-link {
        grid-template-columns: 1.5rem 1fr;
        font-size: 0.6875rem;
    }

    .nav-meta {
        text-align: left;
    }

    .home-hero {
        grid-template-columns: 1fr;
        padding: 2.5rem 1.25rem 3rem;
        gap: 1.75rem;
    }

    .home-hero__title {
        font-size: clamp(2.25rem, 10vw, 3rem);
    }

    .home-hero__aside {
        padding-left: 0;
        border-left: none;
        border-top: 0.5px solid var(--border-faint);
        padding-top: 1.5rem;
    }

    .home-hero__lead {
        font-size: var(--font-size-base);
        max-width: none;
    }

    .section-spine {
        grid-template-columns: 1fr;
    }

    .section-spine__label {
        writing-mode: horizontal-tb;
        transform: none;
        border-right: none;
        border-bottom: 0.5px solid var(--border-faint);
        padding: 1rem 1.25rem;
        justify-content: flex-start;
    }

    .section-spine__body {
        padding: 1.5rem 1.25rem 2rem;
    }

    .home-section--experiments .home-section__body {
        padding: 1.5rem 1.25rem 2rem;
    }

    .proj-row {
        grid-template-columns: 2rem 1fr auto;
        gap: 0.75rem 1rem;
        padding: 1.25rem 0;
    }

    .proj-name {
        font-size: 1.125rem;
    }

    .page--simple {
        padding: 2rem 1.25rem 3rem;
    }

    .site-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 1.75rem 1.25rem;
    }

    .site-footer:not(:has(.site-footer__quote)) {
        justify-content: stretch;
    }

    .site-footer__subscribe {
        align-items: stretch;
        width: 100%;
    }

    .sub-row {
        width: 100%;
        flex-direction: column;
    }

    .sub-input {
        flex: 1;
        min-width: 0;
        width: 100%;
    }

    .sub-btn {
        width: 100%;
    }

    .bottom {
        padding: 1rem 1.25rem;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .proj-row {
        grid-template-columns: 2rem 1fr;
    }

    .proj-right {
        grid-column: 2;
        text-align: left;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 1rem;
        min-width: 0;
        padding-top: 0.35rem;
    }

    .proj-status,
    .proj-date {
        margin-bottom: 0;
    }

    .proj-arrow {
        margin-bottom: 0;
    }
}
