/* nickcotterill.co.uk — Editorial theme */

@font-face {
    font-family: "League Gothic";
    src: url("../fonts/LeagueGothic-latin.woff2") format("woff2");
    font-weight: 400;
    font-stretch: 75% 100%;
    font-display: swap;
}

@font-face {
    font-family: "Hanken Grotesk";
    src: url("../fonts/HankenGrotesk-latin.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

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

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

:root {
    color-scheme: dark;

    --ground: #121110;
    --ground-2: #1b1917;
    --bone: #f2ebe1;
    --bone-2: #a59e95;
    --rule: rgba(242, 235, 225, 0.22);
    --ember: #e8b99a;

    --display: "League Gothic", "Arial Narrow", sans-serif;
    --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --serif: "Instrument Serif", Georgia, serif;

    --edge: clamp(16px, 2vw, 28px);
    --gutter: clamp(20px, 7.8vw, 112px);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 88px;
    scrollbar-color: var(--bone-2) var(--ground);
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--bone);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

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

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

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

::selection {
    background: var(--ember);
    color: var(--ground);
}

:focus-visible {
    outline: 2px solid var(--ember);
    outline-offset: 4px;
    border-radius: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: var(--edge);
    top: -60px;
    z-index: 100;
    padding: 10px 18px;
    border: 1px solid var(--bone);
    border-radius: 999px;
    background: var(--ground);
    font-size: 14px;
    text-transform: uppercase;
}

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

/* Type */

.display {
    font-family: var(--display);
    font-weight: 400;
    line-height: 0.86;
    letter-spacing: -0.005em;
    text-transform: uppercase;
}

.serif {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.statement {
    font-size: clamp(18px, 1.9vw, 27px);
    font-weight: 500;
    line-height: 1.24;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    text-wrap: pretty;
}

.statement--indent {
    text-indent: 34%;
}

.label {
    font-size: clamp(15px, 1.2vw, 17px);
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

/* Links and actions */

.link {
    padding-bottom: 2px;
    background: linear-gradient(currentColor, currentColor) left 100% / 0% 1px no-repeat;
    transition: background-size 0.5s var(--ease), color 0.3s ease;
}

.link:hover,
.link:focus-visible {
    background-size: 100% 1px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    min-height: 48px;
    padding: 0.18em 0.6em 0.12em;
    border: 1px solid var(--bone);
    border-radius: 999px;
    font-size: clamp(22px, 2.6vw, 38px);
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.pill:hover,
.pill:focus-visible {
    background: var(--bone);
    color: var(--ground);
}

.pill svg {
    width: 0.8em;
    height: 0.8em;
    flex: none;
}

/* Section marks */

.mark {
    width: 1em;
    height: 1em;
    flex: none;
    color: var(--ember);
}

/* Top bar */

.bar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0 var(--edge);
    background: color-mix(in srgb, var(--ground) 80%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    border-bottom: 1px solid var(--rule);
}

.bar__id {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 28px);
}

.bar__name {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--serif);
    font-size: 20px;
}

.bar__role {
    font-size: 15px;
    text-transform: uppercase;
}

.bar__nav {
    display: flex;
    gap: clamp(12px, 2vw, 28px);
    font-size: 15px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.bar__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
}

.bar__nav a[aria-current="page"] {
    color: var(--ember);
}

/* Hero */

.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    min-height: min(calc(100svh - 69px), 70vw);
    padding: clamp(28px, 4vh, 48px) var(--edge);
    overflow: hidden;
}

.hero__portrait {
    position: absolute;
    z-index: -1;
    right: clamp(-120px, -4vw, 0px);
    bottom: 0;
    width: min(64vw, 118vh, 1024px);
    opacity: 0.9;
    -webkit-mask-image: radial-gradient(closest-side at 50% 50%, #000 62%, transparent 100%);
    mask-image: radial-gradient(closest-side at 50% 50%, #000 62%, transparent 100%);
}

.hero__badge {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 4%;
}

.hero__badge .mark {
    width: 54px;
    height: 54px;
}

.hero__badge-text {
    display: grid;
    line-height: 1.05;
}

.hero__badge-text .serif {
    color: var(--ember);
    font-size: 28px;
}

.hero__badge-text span:last-child {
    font-size: 15px;
    text-transform: uppercase;
}

.hero__title {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: end;
    font-size: clamp(96px, min(26vh, 19vw), 300px);
}

.hero__title .tail {
    display: block;
    text-wrap: balance;
    margin-top: 0.12em;
    color: var(--ember);
    font-size: 0.2em;
    line-height: 1;
}

.hero__title .amp {
    display: inline-block;
    margin-left: 0.04em;
    color: var(--ember);
    font-size: 0.15em;
    vertical-align: 0.1em;
}

.hero__aside {
    position: relative;
    grid-column: 2;
    grid-row: 3;
    display: grid;
    justify-items: end;
    gap: 28px;
    margin-top: 32px;
}

.hero__aside .statement {
    max-width: 34ch;
    font-size: clamp(17px, 1.45vw, 22px);
    text-align: right;
}

/* A soft shade so the statement reads cleanly over the portrait's shoulders. */
.hero__aside::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -40% -12% -30% -20%;
    background: radial-gradient(closest-side at 70% 60%, rgba(18, 17, 16, 0.82), transparent);
    pointer-events: none;
}

/* Sections */

.section {
    padding: clamp(96px, 14vw, 200px) var(--gutter);
}

.section--flush {
    padding-top: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: clamp(48px, 7vw, 96px);
}

.section-title .mark {
    width: 40px;
    height: 40px;
}

.section-title .label {
    font-size: clamp(22px, 2.2vw, 32px);
}

/* Intro */

.intro {
    display: grid;
    max-width: 1080px;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(32px, 6vw, 96px);
    align-items: end;
}

.intro__hello {
    display: inline-block;
    font-size: clamp(64px, 8vw, 128px);
}


.intro .statement {
    margin-top: clamp(32px, 4vw, 56px);
    font-size: clamp(19px, 2vw, 28px);
}





/* Catalogue: a staggered list of projects */

.catalogue {
    display: grid;
    gap: clamp(28px, 3vw, 44px);
}

.case {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
    gap: 0 clamp(16px, 1.6vw, 24px);
}

.case__name {
    font-size: clamp(56px, 7vw, 112px);
}

.case__meta {
    display: block;
    margin-top: 6px;
    font-size: clamp(14px, 1.1vw, 16px);
    font-weight: 500;
    text-transform: uppercase;
}

.case__body {
    max-width: 34ch;
    margin-top: 16px;
    color: var(--bone-2);
    font-size: 16px;
}

.case__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin-top: 12px;
    font-size: 15px;
    text-transform: uppercase;
}

.case__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.case__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--ember);
}

.case__status .mark {
    width: 18px;
    height: 18px;
}

.case__media {
    position: relative;
    overflow: hidden;
    background: var(--ground-2);
}

.case__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s var(--ease), transform 1.2s var(--ease);
}

.case__media .colour {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.case:hover .case__media .colour,
.case:focus-within .case__media .colour {
    opacity: 1;
}

.case:hover .case__media img,
.case:focus-within .case__media img {
    transform: scale(1.03);
}

.case--a .case__text { grid-column: 1 / span 4; }
.case--a .case__media { grid-column: 5 / span 6; aspect-ratio: 16 / 10; }

.case--b .case__media { grid-row: 1; grid-column: 1 / span 5; aspect-ratio: 16 / 10; }
.case--b .case__text { grid-row: 1; grid-column: 6 / span 5; }

.case--c .case__media { grid-row: 1; grid-column: 5 / span 5; aspect-ratio: 16 / 10; }
.case--c .case__text { grid-row: 1; grid-column: 10 / span 3; }

.case--pixel .case__media img {
    image-rendering: pixelated;
}

/* Record */

.record {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 6vw, 96px);
}

.record__title {
    font-size: clamp(64px, 8vw, 128px);
}


.record__item {
    display: grid;
    grid-template-columns: 10ch minmax(0, 1fr);
    gap: 16px;
    padding: 22px 0;
    border-top: 1px solid var(--rule);
}

.record__item:last-child {
    border-bottom: 1px solid var(--rule);
}

.record__when {
    padding-top: 4px;
    color: var(--bone-2);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
}

.record__what {
    font-size: clamp(18px, 1.7vw, 24px);
    font-weight: 500;
    line-height: 1.25;
    text-transform: uppercase;
}

.record__more {
    margin-top: 32px;
}

/* Closing */

.closing {
    display: grid;
    justify-items: start;
    gap: clamp(28px, 4vw, 48px);
}

.closing__title {
    font-size: clamp(88px, 15vw, 240px);
}


.closing__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}

/* Inner page head */

.page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: end;
    padding: clamp(48px, 8vw, 120px) var(--edge) clamp(72px, 10vw, 140px);
}

.page-head__title {
    font-size: clamp(110px, 18vw, 300px);
}


.page-head .statement {
    max-width: 32ch;
    justify-self: end;
    text-align: right;
}

/* Prose */

.prose {
    max-width: 920px;
}

.prose p {
    font-size: clamp(19px, 2vw, 28px);
    font-weight: 500;
    line-height: 1.26;
    text-transform: uppercase;
    text-wrap: pretty;
}

.prose p:first-child {
    text-indent: 20%;
}

.prose .prose__body {
    margin-top: 1.1em;
    font-size: clamp(19px, 2vw, 24px);
    font-weight: 400;
    line-height: 1.42;
    text-transform: none;
}

.prose .prose__aside {
    max-width: 62ch;
    margin-top: 2em;
    color: var(--bone-2);
    font-size: clamp(17px, 1.4vw, 19px);
    font-weight: 400;
    line-height: 1.6;
    text-transform: none;
}

/* Career */

.career__item {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr);
    gap: 12px clamp(16px, 3vw, 48px);
    padding: clamp(28px, 3vw, 44px) 0;
    border-top: 1px solid var(--rule);
}

.career__item:last-child {
    border-bottom: 1px solid var(--rule);
}

.career__when {
    color: var(--bone-2);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
}


.career__role {
    font-size: clamp(40px, 4.6vw, 72px);
}

.career__org {
    display: block;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
}

.career__detail p {
    max-width: 58ch;
    margin-top: 16px;
    color: var(--bone-2);
    font-size: 16px;
    text-wrap: pretty;
}

.career__skills {
    align-self: start;
    color: var(--bone-2);
    font-size: 14px;
    line-height: 1.9;
    text-transform: uppercase;
}

.career__skills span {
    display: inline-block;
}

.career__skills span:not(:last-child)::after {
    content: ",";
    margin-right: 0.35em;
}

/* Footer */

.foot {
    padding: 0 var(--edge);
}

.foot__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 20px 0 28px;
    border-top: 1px solid var(--rule);
    color: var(--bone-2);
    font-size: 14px;
    text-transform: uppercase;
}

.foot__inner ul {
    display: flex;
    gap: 4px 20px;
}

.foot__inner a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.foot__inner a:hover {
    color: var(--bone);
}

/* Motion: blocks resolve from a soft blur as they arrive and soften again as they leave. */

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .blur-in {
            animation: blur-through linear both;
            animation-timeline: view();
            animation-range: entry 0% exit 100%;
        }
    }
}

@keyframes blur-through {
    0% {
        filter: blur(14px);
        opacity: 0.25;
    }

    22%,
    80% {
        filter: blur(0);
        opacity: 1;
    }

    100% {
        filter: blur(10px);
        opacity: 0.4;
    }
}

/* Responsive */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto auto;
        min-height: 0;
        padding-bottom: 0;
    }

    .hero__badge {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        margin: 8px 0 40px;
    }

    .hero__title {
        grid-row: 2;
        font-size: clamp(80px, 28vw, 200px);
    }

    .hero__aside {
        grid-column: 1;
        grid-row: 3;
        justify-items: start;
    }

    .hero__aside .statement {
        max-width: none;
        text-align: left;
    }

    .hero__portrait {
        position: relative;
        grid-row: 4;
        right: auto;
        justify-self: center;
        width: min(110%, 640px);
        margin-top: 24px;
    }

    .intro,
    .record,
    .page-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-head .statement {
        justify-self: start;
        text-align: left;
    }

    .case {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .case .case__text,
    .case .case__media {
        grid-row: auto;
        grid-column: 1;
    }

    .case .case__media {
        order: -1;
    }

    .career__item {
        grid-template-columns: minmax(0, 1fr);
    }

    .statement--indent {
        text-indent: 0;
    }
}

@media (max-width: 520px) {
    .bar__role {
        display: none;
    }

    .bar__nav {
        gap: 10px;
        font-size: 12px;
    }

    .bar__name {
        font-size: 18px;
    }

}

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


/* Placeholder plate until a project's screenshot is supplied. */
.case__media--pending {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--rule);
    color: var(--bone-2);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.case__media--pending .mark {
    width: 36px;
    height: 36px;
    opacity: 0.7;
}

.case__links:empty {
    display: none;
}

/* Blog index: ruled rows of posts */

.post-list {
    border-bottom: 1px solid var(--rule);
}

.post-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 2fr);
    gap: 12px clamp(16px, 3vw, 48px);
    align-items: baseline;
    padding: clamp(28px, 3vw, 44px) 0;
    border-top: 1px solid var(--rule);
}

.post-row__date,
.post-row__meta {
    color: var(--bone-2);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
}

.post-row__meta {
    justify-self: end;
}

.post-row__title {
    font-size: clamp(44px, 5.4vw, 88px);
    text-wrap: balance;
}

.post-row__standfirst {
    max-width: 60ch;
    margin-top: 18px;
    color: var(--bone-2);
    font-size: clamp(16px, 1.3vw, 18px);
    line-height: 1.55;
    text-wrap: pretty;
}

/* Article */

.read-progress {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ember);
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

@supports (animation-timeline: scroll()) {
    @media (prefers-reduced-motion: no-preference) {
        .read-progress {
            animation: read-progress linear both;
            animation-timeline: scroll(root);
        }
    }
}

@keyframes read-progress {
    to {
        transform: scaleX(1);
    }
}

.article {
    padding: clamp(48px, 7vw, 104px) var(--edge) 0;
}

.article__head {
    max-width: 1180px;
    padding-bottom: clamp(48px, 6vw, 88px);
    border-bottom: 1px solid var(--rule);
}

.article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--bone-2);
    font-size: 15px;
    text-transform: uppercase;
}

.article__meta a {
    color: var(--bone);
}

.article__title {
    margin-top: clamp(24px, 3vw, 40px);
    font-size: clamp(64px, 11vw, 180px);
}

.article__standfirst {
    max-width: 44ch;
    margin-top: clamp(28px, 3.4vw, 48px);
}

.article__body {
    max-width: 68ch;
    margin: clamp(56px, 7vw, 104px) auto 0;
    font-size: clamp(18px, 1.35vw, 20px);
    line-height: 1.7;
}

.article__body > * + * {
    margin-top: 1.1em;
}

.article__body > p:first-child {
    font-size: 1.12em;
    line-height: 1.6;
}

.article__body h2 {
    margin-top: 2.4em;
    margin-bottom: -0.2em;
    font-family: var(--display);
    font-size: clamp(40px, 4vw, 60px);
    font-weight: 400;
    line-height: 0.95;
    text-transform: uppercase;
    text-wrap: balance;
}

.article__body strong {
    color: var(--bone);
    font-weight: 600;
}

.article__body p,
.article__body li {
    color: color-mix(in srgb, var(--bone) 86%, var(--ground));
    text-wrap: pretty;
}

.article__body ul {
    display: grid;
    gap: 0.7em;
    padding-left: 0;
}

.article__body li {
    position: relative;
    padding-left: 1.6em;
}

.article__body li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 0.7em;
    height: 1px;
    background: var(--ember);
}

.pullquote {
    margin: 2.2em 0;
    padding: 1.4em 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.pullquote p {
    color: var(--ember);
    font-family: var(--serif);
    font-size: clamp(30px, 3.4vw, 46px);
    font-style: italic;
    line-height: 1.15;
    text-wrap: balance;
}

.article__end {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    max-width: 68ch;
    margin: clamp(72px, 9vw, 128px) auto 0;
    padding-top: 36px;
    border-top: 1px solid var(--rule);
}

.article__author-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ground-2);
}

.article__author {
    font-family: var(--serif);
    font-size: 26px;
}

.article__bio {
    color: var(--bone-2);
    font-size: 16px;
}

.article__links {
    display: flex;
    gap: 4px 20px;
    margin-top: 6px;
    font-size: 15px;
    text-transform: uppercase;
}

.article__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

@media (max-width: 900px) {
    .post-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-row__meta {
        justify-self: start;
    }

    .article__end {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .article__author-img {
        width: 72px;
        height: 72px;
    }
}
