/* joshmackenzie.co.uk */

:root {
    --paper: #f7f6f2;
    --ink: #1b1c1a;
    --ink-2: #4a4c47;
    --ink-3: #75776f;
    --rule: #dcdad2;
    --accent: #1e5b45;
    --accent-soft: #e3ece6;
    --dot: #8fb39f;

    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

    --measure: 38rem;
    --gutter: 11rem;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #131513;
        --ink: #e9e7e0;
        --ink-2: #b9b8b0;
        --ink-3: #8a8b84;
        --rule: #2c2f2b;
        --accent: #86c7a7;
        --accent-soft: #1d2a23;
        --dot: #5f8f75;
        color-scheme: dark;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1rem/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--rule);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--accent-soft); }

.wrap {
    max-width: calc(var(--measure) + var(--gutter));
    margin-inline: auto;
    padding-inline: 1.5rem;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.site-header__inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.5rem;
    font-size: 0.875rem;
}

.site-header__name {
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.005em;
}

.site-header__nav {
    display: flex;
    gap: 1.5rem;
}
.site-header__nav a {
    color: var(--ink-2);
    text-decoration: none;
}
.site-header__nav a:hover { color: var(--accent); }

.tag {
    font-family: var(--mono);
    font-size: 0.6875rem;
    color: var(--ink-3);
    margin-left: 0.15em;
}

/* Intro ------------------------------------------------------------- */

.intro {
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
    padding-bottom: clamp(3rem, 8vw, 5rem);
}


.intro__role {
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: var(--accent);
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.intro__name {
    font-size: clamp(2.5rem, 7vw, 3.75rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin-bottom: 1.75rem;
}

.intro__summary {
    font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
    line-height: 1.55;
    color: var(--ink-2);
    margin-bottom: 2rem;
}
.intro__summary p + p { margin-top: 0.85em; }

.intro__status {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.9375rem;
    color: var(--ink);
    margin-top: -0.75rem;
    margin-bottom: 2rem;
}
.intro__status::before {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-0.05em);
}

.intro__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
}
.intro__links a {
    text-decoration-color: var(--accent);
    text-decoration-thickness: 1.5px;
}

/* Sections ---------------------------------------------------------- */

.section {
    display: grid;
    grid-template-columns: var(--gutter) minmax(0, 1fr);
    padding-bottom: 3.5rem;
}

.section__head {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 0.75rem;
    margin-bottom: 2.25rem;
    border-bottom: 1px solid var(--accent);
}

.section__top {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-3);
    text-decoration: none;
}
.section__top:hover { color: var(--accent); }

.section__label {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.entry {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    margin-bottom: 2.75rem;
}
.entry:last-child { margin-bottom: 0; }
.entry--compact { margin-bottom: 1.75rem; }
.entry--compact .entry__sub { margin-bottom: 0.35rem; }

.entry__when {
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: var(--ink-3);
    padding-top: 0.2rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.entry__title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.entry__note {
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--ink-3);
    margin-left: 0.35rem;
}

.entry__at { font-weight: 400; color: var(--ink-2); }

.entry__sub {
    color: var(--ink-2);
    margin-bottom: 0.75rem;
}

.grade { display: block; color: var(--accent); font-weight: 500; }

.entry__intro {
    margin-bottom: 1.1rem;
}

.entry--compact p { color: var(--ink-2); }

.entry__points {
    display: grid;
    gap: 0.55rem;
}
.entry__points:has(.entry__label) { gap: 0.95rem; }

.entry__points li {
    position: relative;
    padding-left: 1.1rem;
    line-height: 26px;
    color: var(--ink-2);
}
/* Sage dots, whole-pixel size and offset so they render identically */
.entry__points li::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--dot);
}
.entry__label {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

/* Justified intro on wider screens; ragged-right on phones where gaps would open up. */
.intro__summary { text-align: justify; }

.tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0;
    margin-top: 1.1rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-3);
}
.tech li:not(:last-child)::after {
    content: "·";
    margin-inline: 0.5rem;
    color: var(--accent);
}

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

.site-footer { margin-top: 2rem; }

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    padding-block: 2rem 3rem;
    border-top: 1px solid var(--rule);
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.site-footer__links { display: flex; gap: 1.25rem; }

/* Simple pages (404) ------------------------------------------------ */

.page {
    padding-block: clamp(4rem, 14vw, 9rem);
}
.page h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}
.page p { color: var(--ink-2); }

/* Small screens ----------------------------------------------------- */

@media (max-width: 40rem) {
    .wrap { padding-inline: 1rem; }
    .intro__summary { text-align: left; }
    .site-header__nav { gap: 1rem; }
    .site-header__nav a:not(:last-child) { display: none; }
    .section { grid-template-columns: minmax(0, 1fr); }
    .entry { grid-template-columns: minmax(0, 1fr); }
    .entry__when { padding-top: 0; margin-bottom: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    a { transition: none; }
}
