/* Components: shell (header, nav, controls), the contour band, and the footer.
   Colours, type and the grid all come from tokens.css. The list, project and
   archive rules below are the pre-existing components carried onto the
   Seetiefe tokens; the plan-list rewrite replaces them in a later task. */

/* ---------- Shell: header ---------- */

.site-header {
    background: var(--paper);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    height: 76px;
}

.site-title {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    color: var(--ink);
    text-decoration: none;
}

.site-title__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-title__bar {
    display: block;
    flex: none;
    width: 14px;
    height: 28px;
    background: var(--accent);
}

.site-nav {
    flex: 1 1 0;
    min-width: 0;
    order: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 36px;
}

.site-actions {
    flex: 0 0 auto;
    order: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Between the 12-column desktop and the stacked mobile header the long
   wordmark leaves less room, so the nav closes its gaps before it wraps. */
@media (min-width: 761px) and (max-width: 1100px) {
    .site-nav {
        gap: 14px;
    }
}

.site-nav__link {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--ink);
    text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link.is-current {
    color: var(--accent);
}

/* Icon buttons: 40x40 hit area, 20x20 glyph. */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    color: var(--ink);
    text-decoration: none;
}

.icon-button:hover {
    color: var(--accent);
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Keep a readable label for screen readers without painting it. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------- Band ---------- */

.band {
    position: relative;
    overflow: hidden;
    background: var(--band);
    color: var(--on-band);
}

.band--home {
    min-height: var(--band-home);
}

.band--page {
    min-height: var(--band-page);
}

.band__terrain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: translate3d(0, var(--drift, 0px), 0);
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .band__terrain {
        transform: none;
    }
}

.band__field-a {
    fill: var(--band-a);
}

.band__field-b {
    fill: var(--band-b);
}

.band__lines {
    stroke: var(--contour);
}

.band__line-accent {
    stroke: var(--contour-strong);
    stroke-width: 2.5;
}

.band__inner {
    position: relative;
    align-items: end;
    padding: 40px 0 44px;
}

.band--home .band__inner {
    min-height: var(--band-home);
}

.band--page .band__inner {
    min-height: var(--band-page);
}

.band h1,
.band h2,
.band h3 {
    color: #ffffff;
}

.band a {
    color: var(--on-band);
}

/* ---------- Footer ---------- */

.site-footer {
    position: relative;
    overflow: hidden;
    margin-top: 80px;
    background: var(--band);
    color: var(--on-band);
}

.site-footer__inner {
    position: relative;
    padding: 64px 0 40px;
    row-gap: 40px;
}

.site-footer__bio {
    grid-column: 1 / 5;
}

.site-footer__mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    color: #ffffff;
    text-decoration: none;
}

.site-footer__mark-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-footer__mark .site-title__bar {
    width: 12px;
    height: 24px;
}

.site-footer__description {
    max-width: 34ch;
    margin: 16px 0 0;
    color: var(--on-band);
}

.site-footer__social {
    grid-column: 9 / 13;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer .icon-button {
    color: var(--on-band);
}

.site-footer .icon-button:hover {
    color: #ffffff;
}

.site-footer__col {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 10px;
}

.site-footer__col--topics {
    grid-column: 6 / 9;
}

.site-footer__col--browse {
    grid-column: 9 / 11;
}

.site-footer__col--archive {
    grid-column: 11 / 13;
}

.site-footer__heading {
    margin: 0 0 4px;
    color: var(--on-band-label);
}

.site-footer__link {
    color: var(--on-band);
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
}

.site-footer__link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.site-footer__bottom {
    position: relative;
    padding: 20px 0 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer__copy {
    grid-column: 1 / 9;
    margin: 0;
    color: var(--on-band-label);
    font-size: var(--text-meta);
    letter-spacing: 0.04em;
}

/* ---------- Lists and archives (carried onto the Seetiefe tokens) ---------- */

.post-list {
    display: grid;
    gap: 4px;
}

.post-list__item {
    display: grid;
    grid-template-columns: 132px 1fr;
    column-gap: var(--gutter);
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.post-list__stamp {
    display: grid;
    align-content: start;
    gap: 4px;
    color: var(--steel);
    font-size: 16px;
    line-height: 1.4;
}

.post-list__date {
    font-variant-numeric: tabular-nums;
}

.post-list__tag {
    color: var(--accent);
    text-decoration: none;
}

.post-list__title {
    font-size: 19px;
    font-weight: 500;
}

.post-list__title a {
    text-decoration: none;
}

.post-list__locked {
    margin: 4px 0 0;
    color: var(--steel);
    font-size: var(--text-meta);
}

.post-list__excerpt {
    margin: 6px 0 0;
    max-width: 70ch;
    color: var(--steel);
    font-size: 16px;
    line-height: 1.5;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 20px;
    margin-top: 32px;
    font-size: var(--text-meta);
}

.pagination a {
    text-decoration: none;
}

.pagination a:hover {
    color: var(--accent);
}

.pagination__status {
    color: var(--steel);
}

.page-header {
    margin-bottom: 24px;
}

.band .page-header {
    grid-column: 1 / -1;
}

.page-title {
    font-size: clamp(2.5rem, 8vw, var(--text-page-title));
    max-width: 22ch;
    text-wrap: balance;
}

.page-description {
    margin: 8px 0 0;
    max-width: 60ch;
}

.page-header--author {
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

.author-portrait {
    width: 120px;
    height: 120px;
    flex: none;
    object-fit: cover;
}

.empty-state {
    margin: 0;
    max-width: 60ch;
}

.project-list,
.talk-list {
    display: grid;
    gap: 4px;
}

.project-row,
.talk-list__item {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: var(--gutter);
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.project-row:has(.project-row__logo) {
    grid-template-columns: 56px 1fr;
}

.project-row__logo {
    width: 56px;
    height: 56px;
    object-fit: cover;
}

.project-row__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.project-list__item,
.talk-list__title a {
    text-decoration: none;
}

.project-list__item:hover,
.talk-list__title a:hover {
    color: var(--accent);
}

.project-row__excerpt,
.talk-list__excerpt {
    margin: 6px 0 0;
    max-width: 70ch;
    color: var(--steel);
    font-size: 16px;
    line-height: 1.5;
}

.talk-list__item {
    grid-template-columns: 132px 1fr;
    align-items: baseline;
}

.talk-list__year {
    color: var(--steel);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.talk-list__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.talk-list__excerpt {
    grid-column: 2;
}

.archive {
    display: grid;
    gap: 40px;
}

.archive__year-block,
.archive__month-block {
    display: grid;
    gap: 4px;
}

.archive__year {
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: 600;
    line-height: 1.1;
}

.archive__month {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.2;
}

.archive__count {
    margin: 0 0 8px;
    color: var(--steel);
    font-size: var(--text-meta);
    font-variant-numeric: tabular-nums;
}

.archive__list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- Home: intro band, latest writing, what I build ---------- */

.home-portrait {
    grid-column: 1 / 4;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.home-portrait__image {
    width: 236px;
    height: 236px;
    object-fit: cover;
    box-shadow: 0 8px 28px rgba(20, 30, 40, 0.18);
}

.home-portrait__caption {
    margin: 12px 0 0;
    color: var(--on-band-label);
}

.home-intro {
    grid-column: 4 / 12;
}

.home-intro__greeting {
    font-size: var(--text-greeting);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.025em;
}

.home-intro__text {
    max-width: 30em;
    margin: 22px 0 0;
    color: var(--on-band);
    font-size: 22px;
    line-height: 1.45;
}

/* The mock keeps the home band at exactly 340px: the portrait block overflows
   into the top padding rather than stretching the band. Mobile keeps min-height
   so a stacked portrait and intro cannot be clipped. */
@media (min-width: 761px) {
    .band--home,
    .band--home .band__inner {
        height: var(--band-home);
    }
}

.home-sections {
    padding-top: 52px;
    row-gap: 40px;
}

.home-latest {
    grid-column: 1 / 9;
}

.home-build {
    grid-column: 10 / 13;
}

.home-section__title {
    margin: 0 0 18px;
    font-size: var(--text-h2);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.plan-head,
.plan-row {
    display: grid;
    grid-template-columns: 132px 1fr 160px;
    column-gap: var(--gutter);
    align-items: baseline;
}

.plan-head {
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ink);
    color: var(--steel);
    font-family: var(--font-display);
    font-size: var(--text-meta);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.plan-row {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.plan-row .post-list__date {
    color: var(--steel);
    font-size: 16px;
}

.plan-row .post-list__title {
    margin: 0;
    font-size: 19px;
    font-weight: 500;
}

.plan-row .post-list__tag {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: var(--text-meta);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.plan-row .post-list__excerpt,
.plan-row .post-list__locked {
    grid-column: 2;
}

.list-page {
    padding-top: 52px;
}

.list-page .plan-head,
.list-page .post-list,
.list-page .project-list,
.list-page .talk-list,
.list-page .pagination,
.list-page .archive,
.list-page .empty-state {
    grid-column: 1 / -1;
}

.home-latest__more {
    margin: 18px 0 0;
    font-weight: 500;
}

.home-latest__more a {
    color: var(--accent);
    text-decoration: none;
}

.home-build__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-build__item {
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.home-build__link {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
}

.home-build__excerpt {
    display: block;
    color: var(--steel);
    font-size: 15px;
    line-height: 1.4;
}

/* ---------- Mobile: links wrap under the wordmark, band and footer stack ---------- */

@media (max-width: 760px) {
    .site-header__inner {
        height: auto;
        padding: 14px 0;
        gap: 12px;
    }

    .site-title {
        flex: 1 1 0;
        min-width: 0;
        gap: 8px;
        font-size: 20px;
    }

    .site-title__bar {
        width: 10px;
        height: 20px;
    }

    .site-actions {
        flex: 0 0 auto;
        order: 1;
    }

    .site-nav {
        flex: 1 0 100%;
        order: 2;
        justify-content: flex-start;
        gap: 20px 24px;
    }

    .band__inner > * {
        grid-column: 1 / -1;
    }

    .home-latest,
    .home-build {
        grid-column: 1 / -1;
    }

    .plan-head {
        display: none;
    }

    .plan-row {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "date tag"
            "title title"
            "locked locked"
            "excerpt excerpt";
        column-gap: 16px;
        row-gap: 4px;
    }

    .plan-row .post-list__date {
        grid-area: date;
    }

    .plan-row .post-list__tag {
        grid-area: tag;
        justify-self: start;
    }

    .plan-row .post-list__title {
        grid-area: title;
    }

    .plan-row .post-list__locked {
        grid-area: locked;
    }

    .plan-row .post-list__excerpt {
        grid-area: excerpt;
    }

    .talk-list__item {
        grid-template-columns: 64px 1fr;
    }

    .site-footer__inner {
        padding: 48px 0 32px;
    }

    .site-footer__bio,
    .site-footer__col {
        grid-column: 1 / -1;
    }

    .site-footer__copy,
    .site-footer__social {
        grid-column: 1 / -1;
    }

    .site-footer__social {
        justify-content: flex-start;
    }
}
