/* RESET */

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

* {
    margin: 0;
}

html:focus-within {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* TOKENS */

:root {
    --font-body:
        "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    --font-heading:
        "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;

    /* Fluid type scale */
    /* Aiming for ~18px body on mobile, ~21px on desktop */
    --size--1: clamp(0.95rem, 0.9rem + 0.3vw, 1.0625rem);
    --size-0: clamp(1.125rem, 1.05rem + 0.45vw, 1.3125rem); /* ~18px → ~21px */
    --size-1: clamp(1.45rem, 1.3rem + 0.65vw, 1.8rem);
    --size-2: clamp(1.9rem, 1.6rem + 1.2vw, 2.4rem);
    --size-3: clamp(2.45rem, 2rem + 1.7vw, 3.1rem);
    --size-4: clamp(3.1rem, 2.5rem + 2.4vw, 4.2rem);

    /* Spacing */
    --space-1: clamp(0.75rem, 0.6rem + 0.5vw, 1rem);
    --space-2: clamp(1rem, 0.8rem + 1vw, 2rem);
    --space-3: clamp(2rem, 1.5rem + 2vw, 4rem);
    --space-4: clamp(3rem, 2.2rem + 3vw, 6rem);
    --space-5: clamp(4.5rem, 3.2rem + 4.5vw, 9rem);

    /* Measure */
    --measure: 65ch;
    --prose-width: 60ch;

    /* Colours */
    --color-text: #111;
    --color-muted: #666;
    --color-bg: #fff;
    --color-accent: #39a3ff;
    --color-border: #111;

    /* Borders */
    --radius-sm: 2px;
    --radius-md: 6px;
    --radius-lg: 12px;

    /* Borders */
    --nav-bg: #f1f2f7;
    --nav-fg: var(--color-muted);
    --nav-h: 3.25rem;
}

/* BASE TYPOGRAPHY */

html {
    background-color: #111;
}

body {
    font-family: var(--font-body);
    font-size: var(--size-0);
    color: var(--color-text);
    background: var(--color-bg);
    border-top: 2px solid var(--color-text);
    border-bottom: 2px solid var(--color-text);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h1 {
    font-size: var(--size-4);
}

h2 {
    font-size: var(--size-3);
}

h3 {
    font-size: var(--size-2);
}

h4 {
    font-size: var(--size-1);
}

p,
li {
    max-width: var(--measure);
}

p {
    font-size: var(--size-0);
    color: var(--color-text);
}

small {
    font-size: var(--size--1);
    color: var(--color-muted);
}

/*
.container → controls horizontal width + centering
.flow → controls vertical rhythm / spacing between elements
*/

/* FLOW */

.flow > * + * {
    margin-top: var(--space-2);
}

/* LAYOUT */

.container {
    /* Fluid width with a max cap: full width on small screens (with side gutters),
       but never wider than 72rem on large displays */
    width: min(100% - 2rem, 72rem);
    margin-inline: auto;
}

section {
    padding-block: var(--space-3);
}

.columns {
    display: grid;
    gap: var(--space-2);
}

@media (min-width: 48rem) {
    .columns-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .columns-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 48rem) {
    .columns-1-3 {
        grid-template-columns: 1fr 3fr;
    }
}

/* LINKS */

a {
    color: var(--color-accent);
    text-decoration: underline;
}

a:hover {
    text-decoration: underline;
}

/* LISTS */

ul,
ol {
    padding-left: 1.2rem;
}

/* FORMS */

.contact-form > p + p {
    margin-top: var(--space-2);
}

/* Spacing only inside flowing content */
.flow ul > li + li,
.flow ol > li + li {
    margin-top: 0.5rem;
}

/* FIGURES & IMAGES */

.flow figure {
    margin-block: var(--space-2);
}

.flow figcaption {
    margin-top: 0.5rem;
    font-size: var(--size--1);
    color: var(--color-muted);
}

/* FORMS */

label {
    display: block;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

textarea {
    min-height: 8rem;
}

button {
    margin-top: var(--space-1);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-accent);
    color: white;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

/* HEADER, NAV */

.site-header {
    padding-block: var(--space-4) 0;
    text-align: center;
}

.site-header h1 {
    font-weight: 700;
    font-size: var(--size-2);
}

.site-header h1 a,
.site-header h2 a {
    color: inherit;
    text-decoration: none;
}

.site-header h1 a:hover,
.site-header h2 a:hover {
    text-decoration: none;
}

.site-header h2 {
    font-size: var(--size-0);
    text-transform: uppercase;
    color: var(--color-accent);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Navigation strip */
.site-nav {
    border-top: 1px solid var(--color-text);
    border-bottom: 1px solid var(--color-text);
    margin-top: var(--space-4);
}

/* Inner alignment */
.site-nav__inner {
    display: flex;
    justify-content: center;
    padding-block: 0.75rem;
}

/* List */
.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
}

/* Links */
.site-nav a {
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--size--1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* Hover */
.site-nav a:hover {
    color: var(--color-text);
}

/* Selected state */
.site-nav a[aria-current="page"] {
    color: var(--color-accent);
}

@media (max-width: 47.999rem) {
    .site-nav ul {
        gap: var(--space-1);
    }
}

/* FOOTER */
/* =========================
   Footer strip (nav-like)
   ========================= */

/* Inner alignment */
.site-footer__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-1);
    padding-block: 1rem;
    border-top: 1px solid var(--color-text);
}

/* Footer nav list */
.site-footer nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Footer links */
.site-footer nav a {
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--size--1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.site-footer nav a:hover {
    color: var(--color-text);
}

/* Meta line */
.site-footer .footer-meta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--size--1);
    color: var(--color-text);
    font-weight: 600;
}

.site-footer .footer-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text);
    text-decoration: none;
}

.site-footer .footer-linkedin svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.site-footer .footer-linkedin:hover {
    color: var(--color-text);
    text-decoration: underline;
}

/* Tighten spacing on small screens */
@media (max-width: 47.999rem) {
    .site-footer nav ul {
        gap: var(--space-1);
    }
    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-footer .footer-meta {
        margin-left: 0;
    }
}

/* AESTHETICS FROM HERE ON MICKEY */

.page-title {
    font-size: var(--size-1);
    line-height: 1.15;
    font-weight: 700;
}

p.leader {
    font-family: var(--font-heading);
    font-size: var(--size-1);
    line-height: 1.4;
    font-weight: 400;
}

.previous {
    border-top: 1px solid var(--color-border);
    padding-block: var(--space-3);
}

.previous h2 {
    font-size: var(--size-2);
}

.clients {
    padding-block: var(--space-1);
    text-align: left;
}

.clients h2 {
    font-size: var(--size-0);
    font-family: var(--font-body);
    color: var(--color-muted);
}

.clients-logos {
    list-style: none;
    margin: 0;
    padding-inline: 0;
    padding-block: var(--space-1);
    display: grid;
    gap: var(--space-3);
    align-items: center;
    justify-items: start;
}

/* Small screens */
@media (max-width: 47.999rem) {
    .clients-logos {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-3); /* tighten/loosen spacing */
        padding-block: var(--space-2);
        padding-inline: 0.5rem; /* add/remove side gutter */
    }

    .clients-logos img {
        max-height: 1rem; /* shrink logos on mobile */
    }
}

/* Large screens */
@media (min-width: 70rem) {
    .clients-logos {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--space-3);
    }
}

/* Medium screens */
@media (min-width: 48rem) and (max-width: 69.999rem) {
    .clients-logos {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-3);
    }
}

.clients-logos li {
    display: flex;
    align-items: center;
}

.clients-logos img {
    width: 100%;
    height: auto;
    max-height: 2.4rem;
    object-fit: contain;
    opacity: 0.85;
}

/* BOOK */

.book {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-2);
    align-items: start;
    text-decoration: none;
    color: inherit;
}

.book:hover,
.book:focus-visible {
    text-decoration: none;
}

.book:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

.book__thumb {
    margin: 0;
}

.book__thumb img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius, 4px);
}

.book__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--size-1);
    font-weight: 500;
}

.book__description {
    font-size: var(--size-0);
    line-height: 1.35;
    color: var(--color-muted);
}

.book_cta {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: var(--size--1);
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 0.12em;
    text-decoration-thickness: 1px;
}

@media (max-width: 47.999rem) {
    .book {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .book__thumb img {
        max-width: 100%;
    }
}

/* 2-up layout for the tentacles list inside the right-hand (3/4) column */
.tentacles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
    align-items: start;
    grid-template-columns: 1fr;
}

.tentacles > li {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* if the UL sits inside a .flow container, prevent double spacing */
.flow .tentacles > li + li {
    margin-top: 0;
}

.tentacles strong {
    display: block;
    line-height: 1.15;
    font-weight: 500;
}

.tentacles span {
    display: block;
    margin-top: 0.35rem;
    line-height: 1.35;
    color: var(--color-muted);
}

@media (max-width: 47.999rem) {
    .tentacles {
        gap: var(--space-3);
    }
}

/* On larger screens, switch to two columns (6 items become 2 x 3) */
@media (min-width: 48rem) {
    .tentacles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-3);
    }
}

/* ===== Feature list ===== */

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
    align-items: stretch; /* make grid items stretch to row height */
}

/* Two-up on larger screens */
@media (min-width: 48rem) {
    .feature-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.feature-list > li {
    margin: 0;
    padding: 0;
    display: flex; /* lets the child (.feature) stretch */
}

/* Prevent global .flow list spacing from nudging items */
.flow .feature-list > li + li {
    margin-top: 0;
}

/* Entire block is clickable */
.feature {
    display: block;
    width: 100%;
    height: 100%;
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: inherit;
    text-decoration: none; /* IMPORTANT: stop link underline on the whole card */
    transition: border-color 0.2s ease;
}

/* Subtle hover/focus */
.feature:hover,
.feature:focus-visible {
    border-color: var(--color-text);
    outline: none;
    text-decoration: none; /* override global a:hover underline */
}

.feature__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--size-0);
    line-height: 1.15;
    font-weight: 500;
}

.feature__desc {
    margin-top: 0.35rem;
    font-size: var(--size--1);
    line-height: 1.35;
    color: var(--color-muted);
    max-width: none;
}

/* CTA looks like a normal link, but the whole block is clickable */
.feature__cta {
    display: inline-block;
    margin-top: 0.6rem;

    font-size: var(--size--1);
    color: var(--color-accent);

    text-decoration: underline;
    text-underline-offset: 0.12em;
    text-decoration-thickness: 1px;
}

/* Keep CTA stable on hover (no underline animation) */
.feature:hover .feature__cta,
.feature:focus-visible .feature__cta {
    text-decoration: underline;
}

.powers {
    margin-block: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* TALKS (styled like project cards) */

.talks {
    list-style: none;
    margin: 0;
    padding: 0;

    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

/* Prevent .flow list-item spacing from fighting the grid gap */
.flow .talks > li + li {
    margin-top: 0;
}

/* 2-up on larger screens */
@media (min-width: 48rem) {
    .talks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.talk {
    margin: 0;
}

.talk__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.talk__media {
    margin: 0;
}

.talk__media img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius, 4px);
    display: block;
}

.talk__body {
    margin-top: 0.75rem;
}

.talk__title {
    margin: 0;
    font-size: var(--size-0);
    font-weight: 500;
    font-family: var(--font-body);
}

.talk__desc {
    margin-top: 0.35rem;
    color: var(--color-muted);
    font-size: var(--size-0);
    line-height: 1.35;
    max-width: none;
}

.talk__cta {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: var(--size--1);
    color: var(--color-accent);
    text-decoration: underline;
}

/* Keep it editorial: no underline bleed / no hover underline */
.talk__link,
.talk__link:hover,
.talk__link:focus-visible {
    text-decoration: none;
}

/* Optional: focus ring (matches your other blocks) */
.talk__link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* Hide spam guard on contact page */
.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;
}
