@font-face {
    font-family: "Instrument Sans";
    src: url("assets/fonts/InstrumentSans.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Serif";
    src: url("assets/fonts/InstrumentSerif-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Instrument Serif";
    src: url("assets/fonts/InstrumentSerif-Italic.woff2") format("woff2");
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: "Instrument Sans", sans-serif;
    font-synthesis: none;
    background: #f9f9f6;
    color: #242522;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 0.25em; }
a:focus-visible { outline: 3px solid #3756d8; outline-offset: 7px; }
.page { max-width: 1440px; margin: auto; padding: 0 5%; }
.skip-link { position: absolute; top: -5rem; left: 1rem; padding: 1rem; background: #fff; z-index: 2; }
.skip-link:focus { top: 1rem; }
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 2rem 0; border-bottom: 1px solid #dcded7; }
.wordmark { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.08em; }
.wordmark-dot { color: #62763c; }
.masthead a { font-size: 0.875rem; text-decoration: none; }
.masthead a:hover { text-decoration: underline; }
.masthead a span { margin-left: 0.5rem; }
.intro { padding: 4.5rem 0 4rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }
h1 { font-family: "Instrument Serif", Georgia, serif; font-size: clamp(4.5rem, 9vw, 8.5rem); font-weight: 400; line-height: 0.95; letter-spacing: -0.045em; margin: 0; }
h1 em { font-weight: 400; }
.intro > p { max-width: 15rem; margin: 0 0 0.3rem; font-size: 1rem; color: #62645e; }
.projects { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3rem 1.5rem; }
.project { min-width: 0; grid-column: span 3; }
.project-link { display: block; text-decoration: none; border-radius: 3px; }
.artwork { height: clamp(14rem, 23vw, 20rem); position: relative; overflow: hidden; border-radius: 4px; }
.phrase-flip .artwork, .function-keys .artwork { height: clamp(19rem, 30vw, 26rem); }
.project-info { padding-top: 1.15rem; }
.project-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
h2 { margin: 0; font-size: 1.25rem; font-weight: 550; letter-spacing: -0.025em; }
.visit-arrow { font-size: 1.3rem; transition: transform 180ms ease; }
.project-link:hover .visit-arrow, .project-link:focus-visible .visit-arrow { transform: translate(3px, -3px); }
.project-link:hover h2 { text-decoration: underline; text-underline-offset: 0.2em; }
.project-info > p { margin: 0.5rem 0 0.8rem; max-width: 30rem; font-size: 0.93rem; color: #595c55; line-height: 1.6; }
.project-type { font-size: 0.75rem; color: #62645e; }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.repo-link { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; margin: -8px -8px -8px 0; border-radius: 50%; }
.repo-link:hover { background: #e9ebe4; }
.repo-link img { display: block; }
/* Page excerpts sit inside each coloured panel rather than filling it. */
.phrase-art { background: #e3e9da; }
.keys-art { background: #282d38; }
.tfl-art { background: #e4ebf4; }
.season-art { background: #f1eacb; }
.notes-art { background: #edddd5; }
.reddit-art { background: #e7c4ad; }
.preview-window { position: absolute; top: 12%; left: 9%; width: 82%; height: 78%; overflow: hidden; border: 1px solid #00000018; border-radius: 6px; background: #fff; box-shadow: 0 10px 25px #17221d20; transition: transform 220ms ease; }
.preview-window img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.reddit-art img { object-fit: contain; background: #000; }
.phrase-art .preview-window { transform: rotate(-3deg); }
.keys-art .preview-window { transform: rotate(3deg); }
.notes-art .preview-window { transform: rotate(-2deg); }
.reddit-art .preview-window { transform: rotate(2deg); }
.project-link:hover .preview-window, .project-link:focus-visible .preview-window { transform: translateY(-4px); }
footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 5rem; padding: 1.75rem 0; border-top: 1px solid #dcded7; color: #62645e; font-size: 0.8rem; }

@media (min-width: 1440px) {
    .artwork { height: 20rem; }
    .phrase-flip .artwork, .function-keys .artwork { height: 26rem; }
}

@media (max-width: 760px) {
    .intro { display: block; padding: 3rem 0; }
    .intro > p { max-width: none; margin-top: 1.5rem; }
    .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.25rem; }
    .project { grid-column: span 1; }
    .phrase-flip { grid-column: 1 / -1; }
    .artwork, .function-keys .artwork { height: 17rem; }
    .phrase-flip .artwork { height: 22rem; }
}

@media (max-width: 480px) {
    .page { padding: 0 6%; }
    .masthead { padding: 1.4rem 0; }
    h1 { font-size: 4.6rem; }
    .projects { grid-template-columns: 1fr; }
    .phrase-flip { grid-column: auto; }
    .artwork, .function-keys .artwork { height: 18rem; }
    .phrase-flip .artwork { height: 20rem; }
    .preview-window { left: 7%; width: 86%; }
    footer { margin-top: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
