/* polinafilina.com Colours, fonts and radii come from tokens.css. */

/* ---------- Base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

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

ul,
ol {
    padding: 0;
    list-style: none;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.svg-sprite {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: var(--on-ink);
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Colour change when the theme is toggled (class added by JS for 250ms) */
@media (prefers-reduced-motion: no-preference) {
    html.theme-switching,
    html.theme-switching *,
    html.theme-switching *::before,
    html.theme-switching *::after {
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
    }
}

/* ---------- Shared pieces ---------- */

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: var(--r-pill);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.pill--small {
    font-weight: 600;
}

.pill--large {
    min-height: 52px;
    padding: 0 28px;
}

.pill--ink {
    background: var(--ink);
    color: var(--on-ink);
}

.pill--ink:hover {
    opacity: 0.85;
}

.pill--outline {
    border: 1.5px solid var(--ink);
}

.pill--outline:hover {
    background: var(--ink);
    color: var(--on-ink);
}

.section-title {
    font-size: clamp(40px, 4.6vw, 64px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

/* ---------- Header ---------- */

/* Sticks to the top; JS hides it while scrolling down and brings it back on scroll up (see header.js) */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.2s ease;
}

.site-header.is-scrolled {
    border-bottom-color: var(--line);
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
    .site-header {
        transition: none;
    }
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 24px;
}

.monogram {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 28px;
    font-size: 15px;
    font-weight: 600;
}

.site-nav__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
}

.site-nav__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
}

.site-nav__links a:hover {
    opacity: 0.7;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--ink);
}

.theme-toggle__icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Moon offers dark mode in the light theme; sun offers light mode in the dark theme */
.theme-toggle__icon--sun,
[data-theme="dark"] .theme-toggle__icon--moon {
    display: none;
}

[data-theme="dark"] .theme-toggle__icon--sun {
    display: block;
}

/* Theme only switches with JS */
html:not(.has-js) .theme-toggle {
    display: none;
}

/* ---------- Hero ---------- */

.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 48px;
    padding-top: 56px;
    padding-bottom: 120px;
}

.hero__text {
    position: relative;
    z-index: 1;
    flex: 999 1 600px;
    min-width: 0;
}

.hero__eyebrow {
    margin-bottom: 32px;
    font-size: 16px;
    color: var(--muted);
}

.hero__name {
    font-size: clamp(72px, 10.5vw, 160px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.045em;
}

/* Each line rises inside its own mask; padding keeps glyph edges unclipped */
.hero__mask {
    display: block;
    overflow: hidden;
    padding: 0.06em 0.04em 0.04em 0;
    margin: -0.06em -0.04em -0.04em 0;
}

.hero__line {
    display: block;
}

.hero__intro {
    max-width: 560px;
    margin-top: 40px;
    font-size: 21px;
    line-height: 1.55;
    color: var(--ink-2);
}

.hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.hero__availability {
    margin-top: 28px;
    padding-left: 4px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-3);
}

/* Intro start states, only when JS runs and motion is allowed (see theme-init.js) */
.motion-enabled .hero__line {
    transform: translateY(100%);
}

.motion-enabled .hero__reveal {
    opacity: 0;
    transform: translateY(16px);
}

/* Star field */
.stars {
    position: relative;
    flex: 1 1 380px;
    max-width: 480px;
    aspect-ratio: 1 / 1;
}

/* Position, size and angle come from custom properties; JS moves stars by updating them. */
.star {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: calc(var(--size) * var(--star-scale, 1));
    height: calc(var(--size) * var(--star-scale, 1));
    overflow: visible;
    fill: currentColor;
    transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
}

.star:not(.is-visible) {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.star--tone-1 { color: var(--star-1); }
.star--tone-2 { color: var(--star-2); }
.star--tone-3 { color: var(--star-3); }

/* Starting constellation: what no-JS and reduced-motion visitors see */
.star:nth-child(1)  { --x: 22%; --y: 18%; --size: 46px; --rotation: 12deg; }
.star:nth-child(2)  { --x: 68%; --y: 30%; --size: 22px; --rotation: 40deg; }
.star:nth-child(3)  { --x: 56%; --y: 64%; --size: 48px; --rotation: 0deg; }
.star:nth-child(4)  { --x: 30%; --y: 78%; --size: 16px; --rotation: 65deg; }
.star:nth-child(5)  { --x: 86%; --y: 76%; --size: 28px; --rotation: 20deg; }
.star:nth-child(6)  { --x: 44%; --y: 10%; --size: 12px; --rotation: 30deg; }
.star:nth-child(7)  { --x: 84%; --y: 12%; --size: 36px; --rotation: 5deg; }
.star:nth-child(8)  { --x: 12%; --y: 48%; --size: 18px; --rotation: 80deg; }
.star:nth-child(9)  { --x: 40%; --y: 42%; --size: 14px; --rotation: 45deg; }
.star:nth-child(10) { --x: 74%; --y: 50%; --size: 11px; --rotation: 15deg; }
.star:nth-child(11) { --x: 10%; --y: 88%; --size: 24px; --rotation: 55deg; }
.star:nth-child(12) { --x: 62%; --y: 90%; --size: 13px; --rotation: 70deg; }
.star:nth-child(13) { --x: 92%; --y: 42%; --size: 15px; --rotation: 35deg; }
.star:nth-child(14) { --x: 26%; --y: 34%; --size: 20px; --rotation: 85deg; }

/* ---------- Recent projects ---------- */

.band {
    padding-top: 104px;
    background: var(--band-bg);
    color: var(--band-text);
}

.band :focus-visible {
    outline-color: var(--band-text);
}

.recent {
    position: relative;
    z-index: 0;
    padding-bottom: 112px;
}

.recent__title {
    margin-bottom: 40px;
    font-size: clamp(36px, 4vw, 56px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.feature {
    position: relative;
}

.feature__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    padding: 40px;
    border-radius: var(--r-feature);
    background: var(--feature-card);
    color: var(--feature-ink);
}

.feature__card :focus-visible {
    outline-color: var(--feature-ink);
}

.feature__info {
    display: flex;
    flex: 1 1 320px;
    flex-direction: column;
    gap: 18px;
    max-width: 400px;
    min-width: 0;
}

.feature__tag {
    font-size: 15px;
    font-weight: 600;
    color: var(--feature-tag);
}

.feature__name {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.feature__desc {
    font-size: 17px;
    line-height: 1.55;
}

.feature__stack {
    font-size: 15px;
    line-height: 1.6;
    color: var(--feature-meta);
}

.feature__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
    font-size: 16px;
    font-weight: 600;
}

.feature__links a,
.card__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.feature__links a:hover,
.card__links a:hover {
    text-decoration-thickness: 2px;
}

/* Browser window */
.browser {
    flex: 999 1 520px;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--r-media);
    background: var(--band-bg);
    box-shadow: 0 30px 60px -30px rgba(23, 26, 51, 0.6);
}

.browser__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    background: var(--browser-chrome);
}

.browser__dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--browser-dot);
}

.browser__url {
    min-width: 0;
    margin-left: 12px;
    overflow: hidden;
    font-size: 13px;
    color: var(--browser-url);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.browser__media,
.card__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.browser__media {
    background: var(--browser-ph-a);
}

.browser__media video,
.card__media video,
.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.browser__media--contain video,
.card__media--contain video,
.card__media--contain img {
    object-fit: contain;
    object-position: center;
}

/* Static layout (no JS): first card in full, the next two peek out below it */
html:not(.has-js) .feature:nth-child(n + 2) .feature__card {
    display: flex;
    justify-content: space-between;
    margin: -24px 24px 0;
    padding: 48px 40px 28px;
    border-radius: 0 0 var(--r-feature) var(--r-feature);
    background: var(--peek-1);
}

html:not(.has-js) .feature:nth-child(2) {
    z-index: -1;
}

html:not(.has-js) .feature:nth-child(3) {
    z-index: -2;
}

html:not(.has-js) .feature:nth-child(3) .feature__card {
    margin-inline: 48px;
    padding-bottom: 24px;
    background: var(--peek-2);
}

html:not(.has-js) .feature:nth-child(n + 4),
html:not(.has-js) .feature:nth-child(n + 2) .browser,
html:not(.has-js) .feature:nth-child(n + 2) .feature__info > :not(.feature__name) {
    display: none;
}

html:not(.has-js) .feature:nth-child(n + 2) .feature__info {
    max-width: none;
}

html:not(.has-js) .feature:nth-child(2) .feature__name {
    font-size: 24px;
}

html:not(.has-js) .feature:nth-child(3) .feature__name {
    font-size: 20px;
}

/* With JS: every card in full. Stacking on scroll is set up by js/motion/feature-stack.js. */
html.has-js .feature + .feature {
    margin-top: 32px;
}

html.has-js .features.is-stacking .feature + .feature {
    margin-top: 48px;
}

.features.is-stacking .feature__card {
    transform-origin: 50% 0;
    will-change: transform;
}

/* ---------- All projects ---------- */

.all {
    padding-top: 112px;
    padding-bottom: 120px;
}

.all__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.all__title {
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 28px;
    background: var(--tabs-bg);
}

html:not(.has-js) .tabs {
    display: none;
}

.tab {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
}

/* 44px touch target around the 40px tab */
.tab::after {
    content: "";
    position: absolute;
    inset: -2px 0;
}

.tab:hover {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.tab[aria-selected="true"] {
    background: var(--ink);
    color: var(--on-ink);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    align-content: start;
    gap: 28px;
}

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-card);
    background: var(--card);
}

.card[hidden] {
    display: none;
}

.card__media {
    display: block;
    margin: 10px 10px 0;
    border-radius: 12px;
    background: var(--ph-a);
}

.card__body {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px 24px;
}

.card__category {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.card__name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.card__summary {
    flex-grow: 1;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink-3);
}

.card__stack {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
    margin-top: -4px;
    margin-bottom: -10px;
    font-size: 15px;
    font-weight: 700;
}

/* ---------- About ---------- */

.about {
    background: var(--surface);
}

.about__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 64px;
    padding-block: 112px;
}

.about__portrait {
    display: block;
    flex: 0 1 340px;
    overflow: hidden;
    border-radius: var(--r-feature);
    aspect-ratio: 4 / 5;
    background: var(--ph-a);
}

.about__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about__text {
    flex: 999 1 520px;
    min-width: 0;
}

.about__title {
    margin-bottom: 28px;
}

.about__lead {
    max-width: 640px;
    margin-bottom: 18px;
    font-size: 21px;
    line-height: 1.55;
}

.about__body {
    max-width: 640px;
    font-size: 18px;
    line-height: 1.65;
    color: var(--ink-3);
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
}

.facts__title {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
}

.facts__list {
    font-size: 16px;
    line-height: 1.8;
}

.facts__list a {
    display: inline-block;
    padding-block: 6px;
    margin-block: -6px;
    text-underline-offset: 3px;
}

.facts__list a:hover {
    text-decoration-thickness: 2px;
}

.facts__text {
    font-size: 16px;
    line-height: 1.6;
}

/* ---------- Stack ---------- */

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 40px 64px;
    padding-top: 112px;
    padding-bottom: 112px;
}

.stack__intro {
    flex: 1 1 260px;
}

.stack__intro p {
    max-width: 280px;
    margin-top: 16px;
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink-3);
}

.stack__groups {
    display: grid;
    flex: 999 1 640px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    min-width: 0;
}

.stack__group h3 {
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ink);
    font-size: 16px;
    font-weight: 700;
}

.stack__group li {
    padding: 11px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 17px;
}

/* ---------- Experience ---------- */

.experience {
    padding-bottom: 120px;
}

.experience__title {
    margin-bottom: 48px;
}

.job {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 64px;
    padding: 40px 0;
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--line);
}

.job__meta {
    flex: 1 1 280px;
}

.job__dates {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    color: var(--muted);
}

.job__company {
    margin-top: 14px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.job__role {
    margin-top: 6px;
    font-size: 17px;
    color: var(--ink-3);
}

.job__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 20px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.job__link:hover {
    text-decoration-thickness: 2px;
}

.job__detail {
    flex: 999 1 560px;
    min-width: 0;
}

.job__summary {
    margin-bottom: 24px;
    font-size: 19px;
    line-height: 1.55;
}

.job__points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
    list-style: disc;
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink-3);
}

/* ---------- Contact and footer ---------- */

.contact-block {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--contact-border);
    background: var(--contact-bg);
    color: var(--contact-text);
}

.contact-block :focus-visible {
    outline-color: var(--contact-text);
}

/* Firework stars that follow the pointer anywhere on the page (added by JS, see star-sparks.js) */
.sparks {
    position: fixed;
    inset: 0;
    z-index: 200;
    overflow: hidden;
    pointer-events: none;
}

.spark {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    fill: currentColor;
    will-change: transform, opacity;
}

.spark--on-dark-1 { color: var(--spark-on-dark-1); }
.spark--on-dark-2 { color: var(--spark-on-dark-2); }
.spark--on-dark-3 { color: var(--spark-on-dark-3); }
.spark--on-light-1 { color: var(--spark-on-light-1); }
.spark--on-light-2 { color: var(--spark-on-light-2); }
.spark--on-light-3 { color: var(--spark-on-light-3); }

.contact__inner {
    position: relative;
    padding-top: 120px;
    padding-bottom: 56px;
}

.contact__kicker {
    margin-bottom: 24px;
    font-size: 18px;
    color: var(--contact-meta);
}

.contact__headline {
    font-size: clamp(56px, 9vw, 136px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.95;
}

.contact__headline-link {
    display: block;
    text-decoration: none;
}

/* Underline the plain text, or each word once JS has split the headline into letters */
.contact__headline-link:hover,
.contact__headline-link:hover .contact__word {
    text-decoration: underline;
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.12em;
}

.contact__word {
    display: inline-block;
    white-space: nowrap;
}

.contact__letter {
    display: inline-block;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 40px;
    margin-top: 72px;
    padding-top: 28px;
    border-top: 1px solid var(--contact-rule);
    font-size: 17px;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-underline-offset: 4px;
}

.site-footer a:hover {
    opacity: 0.75;
}

.site-footer__email {
    font-weight: 700;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
}

.site-footer__copy {
    color: var(--contact-meta);
}

/* ---------- Commercial pages (landings.html) ---------- */

.landings {
    padding-top: 72px;
    padding-bottom: 120px;
}

.landings__kicker {
    margin-bottom: 24px;
    font-size: 16px;
    color: var(--muted);
}

.landings__intro {
    max-width: 640px;
    margin-top: 32px;
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-3);
}

.landings__back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 16px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.landings__back:hover {
    text-decoration-thickness: 2px;
}

.landings__group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 48px;
    margin-top: 72px;
    padding-top: 28px;
    border-top: 1px solid var(--ink);
}

.landings__group-head {
    flex: 1 1 240px;
}

.landings__index {
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--muted);
}

.landings__name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.landings__list {
    flex: 999 1 480px;
    min-width: 0;
}

.landings__list li + li {
    border-top: 1px solid var(--line-soft);
}

.landings__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    font-weight: 500;
    text-decoration: none;
}

.landings__list a::after {
    content: "↗";
    color: var(--muted);
    transition: transform 0.2s ease;
}

.landings__list a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.landings__list a:hover::after {
    transform: translate(2px, -2px);
}

/* Footer without the contact headline above it */
.contact__inner--footer-only {
    padding-top: 0;
}

.contact__inner--footer-only .site-footer {
    margin-top: 0;
    border-top: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .band {
        padding-top: 80px;
    }

    .recent {
        padding-bottom: 88px;
    }

    .all,
    .stack {
        padding-top: 88px;
        padding-bottom: 88px;
    }

    .about__inner {
        gap: 40px;
        padding-block: 88px;
    }

    .experience {
        padding-bottom: 96px;
    }

    .contact__inner {
        padding-top: 96px;
    }

    .contact__inner--footer-only {
        padding-top: 0;
    }

    .landings {
        padding-top: 48px;
        padding-bottom: 88px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    /* Logo, theme toggle and resume on one row; the section links wrap below */
    .site-header__inner {
        column-gap: 12px;
        padding-block: 16px;
    }

    .site-nav {
        display: contents;
    }

    .monogram {
        margin-right: auto;
    }

    .site-nav__links {
        order: 3;
        flex-basis: 100%;
        column-gap: 18px;
    }

    .hero {
        gap: 24px;
        padding-top: 32px;
        padding-bottom: 72px;
    }

    .hero__intro {
        font-size: 19px;
    }

    /* Stars move above the name as a short, wide band, so the name and buttons still fit on the first screen */
    .stars {
        order: -1;
        flex-basis: 100%;
        max-width: none;
        aspect-ratio: 5 / 2;
        margin-bottom: -8px;
        --star-scale: 0.6;
    }

    .feature__card {
        gap: 28px;
        padding: 24px;
    }

    .feature__name {
        font-size: 32px;
    }

    html:not(.has-js) .feature:nth-child(2) .feature__card {
        margin-inline: 14px;
        padding: 44px 24px 22px;
    }

    html:not(.has-js) .feature:nth-child(3) .feature__card {
        margin-inline: 28px;
        padding: 44px 24px 18px;
    }

    /* Full width on phones, like the original site */
    .about__portrait {
        flex-basis: 100%;
        max-width: none;
    }

    .about__portrait img {
        object-position: 50% 18%;
    }

    .about__lead {
        font-size: 19px;
    }

    .about__body {
        font-size: 17px;
    }

    .job__company {
        font-size: 30px;
    }

    .job__summary {
        font-size: 18px;
    }
}
