/* ==========================================================================
   Prosop.ai — lab notebook stylesheet
   Sections:
     01  Tokens
     02  Reset & base
     03  Typography
     04  Layout primitives
     05  Surfaces & graph paper
     06  Skip link & focus
     07  Scroll ruler
     08  Header
     09  Slide menu
     10  Buttons
     11  Annotations
     12  Figure plates
     13  Hero
     14  Service cards
     15  Protocol
     16  A note from a client
     17  Trusted by
     18  Contact
     19  About
     20  Service pages
     21  Not found
     22  Footer
     23  Reveal
     24  Responsive
     25  Motion & print
   ========================================================================== */

/* 01  TOKENS ============================================================== */

:root {
    /* Brand orange sampled from the logo mark */
    --orange: #FFB203;
    --orange-soft: #FFC94D;
    --ochre: #D4A237;
    /* Accent text on paper: 4.71:1, passes AA where --orange cannot */
    --ochre-deep: #96660F;

    --paper: #FAF8F3;
    --paper-deep: #F2EEE4;
    --white: #FFFFFF;

    --grey: #8C8A85;
    --grey-deep: #6E6B66;
    --grey-line: #DEDBD3;

    --charcoal: #2B2B2B;
    --charcoal-soft: #3A3A3A;
    --black: #121212;

    /* Graph paper */
    --grid-size: 26px;
    --grid-line: rgba(43, 43, 43, 0.055);
    --grid-line-strong: rgba(212, 162, 55, 0.15);

    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --font-hand: 'Caveat', 'Bradley Hand', cursive;

    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --space-2xl: 8rem;

    --measure: 66ch;
    --shell: 1180px;

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --t-fast: 0.18s var(--ease);
    --t-mid: 0.32s var(--ease);
    --t-slow: 0.6s var(--ease);
}

/* 02  RESET & BASE ======================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Clears the fixed header when jumping to #contact and friends */
    scroll-padding-top: 7rem;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--charcoal);
    background-color: var(--paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

img,
video {
    height: auto;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t-fast);
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

::selection {
    background: var(--orange);
    color: var(--charcoal);
}

/* Shared sketch filter lives in a zero-size SVG at the top of each page */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* 03  TYPOGRAPHY ========================================================== */

h1,
h2,
h3,
h4 {
    font-family: var(--font-mono);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--charcoal);
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.25rem, 5.2vw, 3.75rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.75rem, 3.6vw, 2.75rem);
}

h3 {
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
}

h4 {
    font-size: 1.125rem;
}

p {
    text-wrap: pretty;
}

p + p {
    margin-top: var(--space-sm);
}

strong {
    font-weight: 600;
    color: var(--charcoal);
}

code,
.mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Inline term with a notebook highlighter swipe behind it */
.term {
    position: relative;
    font-weight: 600;
    white-space: nowrap;
}

.term::after {
    content: '';
    position: absolute;
    inset: auto -0.15em -0.05em;
    height: 0.42em;
    background: var(--orange);
    opacity: 0.32;
    z-index: -1;
    transform: rotate(-0.6deg);
}

/* 04  LAYOUT PRIMITIVES =================================================== */

.container {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding-inline: var(--space-md);
}

.section {
    position: relative;
    padding-block: var(--space-xl);
}

.section-head {
    max-width: var(--measure);
    margin-bottom: var(--space-lg);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--grey-deep);
    margin-bottom: var(--space-sm);
}

.section-head--center .section-label {
    justify-content: center;
}

.section-label b {
    color: var(--ochre-deep);
    font-weight: 700;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--grey-line);
    /* Tick marks, like the edge of a ruler */
    background-image: repeating-linear-gradient(90deg, var(--grey-line) 0 1px, transparent 1px 8px);
    max-width: 140px;
}

.section-head--center .section-label::after {
    display: none;
}

.section-lede {
    margin-top: var(--space-sm);
    font-size: 1.1875rem;
    color: var(--grey-deep);
}

.section-head--center .section-lede {
    margin-inline: auto;
}

/* 05  SURFACES & GRAPH PAPER ============================================= */

.surface-paper {
    background-color: var(--paper);
    color: var(--charcoal);
}

.surface-white {
    background-color: var(--white);
    color: var(--charcoal);
}

.surface-dark {
    background-color: var(--charcoal);
    color: var(--paper);
    --grid-line: rgba(255, 255, 255, 0.05);
    --grid-line-strong: rgba(255, 178, 3, 0.11);
    --grey-line: rgba(255, 255, 255, 0.14);
    --grey-deep: rgba(255, 255, 255, 0.68);
    --ochre-deep: var(--orange);
}

.surface-dark h1,
.surface-dark h2,
.surface-dark h3,
.surface-dark h4,
.surface-dark strong {
    color: var(--paper);
}

.grid-paper {
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        linear-gradient(var(--grid-line-strong) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line-strong) 1px, transparent 1px);
    background-size:
        var(--grid-size) var(--grid-size),
        var(--grid-size) var(--grid-size),
        calc(var(--grid-size) * 5) calc(var(--grid-size) * 5),
        calc(var(--grid-size) * 5) calc(var(--grid-size) * 5);
    background-position: center top;
}

/* Torn-edge divider between a paper and a dark section */
.edge {
    height: 1px;
    background: var(--grey-line);
    background-image: repeating-linear-gradient(90deg, var(--grey-line) 0 6px, transparent 6px 14px);
}

/* 06  SKIP LINK & FOCUS ================================================== */

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-sm);
    z-index: 3000;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--charcoal);
    background: var(--orange);
    border: 2px solid var(--charcoal);
    transition: top var(--t-fast);
}

.skip-link:focus {
    top: var(--space-sm);
}

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

.surface-dark :focus-visible {
    outline-color: var(--orange);
}

/* 07  SCROLL RULER ======================================================= */

.scroll-ruler {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    z-index: 1200;
    background: rgba(250, 248, 243, 0.7);
    pointer-events: none;
}

.scroll-ruler__fill {
    height: 100%;
    width: 0;
    background: var(--orange);
    transform-origin: left center;
}

/* Ruler ticks sit above the fill so it reads as a measuring scale */
.scroll-ruler::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(90deg, rgba(43, 43, 43, 0.28) 0 1px, transparent 1px 12px);
}

/* 08  HEADER ============================================================= */

.header {
    position: fixed;
    top: 5px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    transition: background-color var(--t-mid), box-shadow var(--t-mid), padding var(--t-mid);
}

.header.is-scrolled {
    background-color: rgba(250, 248, 243, 0.88);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    box-shadow: 0 1px 0 var(--grey-line);
    padding-block: var(--space-2xs);
}

.header__logo img {
    height: 80px;
    width: auto;
    transition: height var(--t-mid), opacity var(--t-fast);
}

.header.is-scrolled .header__logo img {
    height: 56px;
}

.header__logo a:hover img {
    opacity: 0.75;
}

/* The owl blinks now and then, because it is up late */
.header__logo img.is-blinking {
    animation: blink 0.34s steps(1, end);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 46px;
    height: 46px;
    padding: 0.5rem;
    align-items: flex-end;
}

.menu-toggle .hamburger {
    display: block;
    height: 2px;
    background-color: var(--charcoal);
    transition: width var(--t-mid), transform var(--t-mid);
}

/* Staggered widths read like a signal trace rather than a stock icon */
.menu-toggle .hamburger:nth-child(1) { width: 30px; }
.menu-toggle .hamburger:nth-child(2) { width: 22px; }
.menu-toggle .hamburger:nth-child(3) { width: 26px; }

.menu-toggle:hover .hamburger,
.menu-toggle:focus-visible .hamburger {
    width: 30px;
}

/* Running head: numbered like the drawer, quiet like a notebook margin */
.site-nav {
    display: none;
}

.site-nav ul {
    display: flex;
    align-items: stretch;
    list-style: none;
}

.site-nav a {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.2rem;
    min-height: 2.6rem;
    padding: 0.15rem 1rem 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--charcoal);
    white-space: nowrap;
}

.site-nav li:first-child a {
    padding-left: 0;
}

.site-nav li:last-child a {
    padding-right: 0;
}

.site-nav li + li {
    position: relative;
}

.site-nav li + li::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0.45rem;
    width: 1px;
    height: 0.8rem;
    background: var(--grey-line);
}

.site-nav__num {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--ochre-deep);
    line-height: 1;
    min-height: 0.625rem;
}

.site-nav__label {
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: border-color var(--t-mid), color var(--t-fast);
}

.site-nav a:hover {
    color: var(--ochre-deep);
}

.site-nav a:hover .site-nav__num {
    color: var(--ochre);
}

.site-nav a[aria-current='page'] .site-nav__label {
    border-bottom-color: var(--orange);
}

.site-nav a:hover .tag,
.site-nav a:focus-visible .tag {
    background: var(--orange-soft);
}

@media (min-width: 1120px) {
    .site-nav {
        display: block;
        margin-left: auto;
    }

    .menu-toggle {
        display: none;
    }
}

@media (min-width: 1120px) and (max-width: 1280px) {
    .site-nav a {
        padding-inline: 0.7rem;
        font-size: 0.75rem;
    }

    .site-nav li:first-child a {
        padding-left: 0;
    }

    .site-nav li:last-child a {
        padding-right: 0;
    }
}

/* 09  SLIDE MENU ========================================================= */

.slide-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(380px, 100vw);
    height: 100dvh;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg) var(--space-md);
    background-color: var(--charcoal);
    color: var(--paper);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translateX(101%);
    visibility: hidden;
    transition: transform var(--t-mid), visibility var(--t-mid);
    overflow-y: auto;
    --grid-line: rgba(255, 255, 255, 0.05);
    --grid-line-strong: rgba(255, 178, 3, 0.1);
}

.slide-menu.is-open {
    transform: translateX(0);
    visibility: visible;
}

.menu-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 48px;
    height: 48px;
    font-size: 2.25rem;
    line-height: 1;
    color: var(--paper);
    transition: color var(--t-fast), transform var(--t-mid);
}

.menu-close:hover {
    color: var(--orange);
    transform: rotate(90deg);
}

.menu-links {
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
}

.menu-links li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.menu-links a {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
    font-family: var(--font-mono);
    font-size: 1.375rem;
    font-weight: 500;
    color: var(--paper);
    transition: color var(--t-fast), padding-left var(--t-mid);
}

.menu-links a::before {
    content: attr(data-num);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--orange);
    letter-spacing: 0.1em;
}

.menu-links a:hover,
.menu-links a[aria-current='page'] {
    color: var(--orange);
    padding-left: var(--space-xs);
}

/* Small status pill, e.g. flagging a live vacancy in the nav */
.tag {
    display: inline-block;
    margin-left: 0.45em;
    padding: 0.15em 0.5em;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--charcoal);
    background: var(--orange);
    vertical-align: 0.15em;
}

.menu-links a:hover .tag {
    background: var(--paper);
}

.menu-foot {
    margin-top: auto;
    padding-top: var(--space-md);
    font-family: var(--font-hand);
    font-size: 1.25rem;
    color: var(--orange);
    transform: rotate(-1.2deg);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background-color: rgba(18, 18, 18, 0.62);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-mid), visibility var(--t-mid);
}

.menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* 10  BUTTONS ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: 0.85rem 1.6rem;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 2px solid var(--charcoal);
    background: transparent;
    color: var(--charcoal);
    transition: transform var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}

/* Offset shadow reads as a sticker pressed onto the page */
.btn--primary {
    background-color: var(--orange);
    box-shadow: 4px 4px 0 var(--charcoal);
}

.btn--primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--charcoal);
}

.btn--primary:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--charcoal);
}

.btn--ghost {
    border-color: var(--charcoal);
}

.btn--ghost:hover {
    background-color: var(--charcoal);
    color: var(--paper);
}

.surface-dark .btn--ghost {
    border-color: var(--paper);
    color: var(--paper);
}

.surface-dark .btn--ghost:hover {
    background-color: var(--paper);
    color: var(--charcoal);
}

.surface-dark .btn--primary {
    box-shadow: 4px 4px 0 var(--black);
}

/* Text link with an underline that grows from the left */
.link {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ochre-deep);
    padding-bottom: 2px;
}

.link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-mid);
}

.link:hover::after {
    transform: scaleX(1);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* 11  ANNOTATIONS ======================================================== */

/* Handwritten margin notes with a little arrow, as in a marked-up printout */
.annot {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2xs);
    font-family: var(--font-hand);
    font-size: 1.375rem;
    line-height: 1.25;
    color: var(--ochre-deep);
    transform: rotate(-1.5deg);
}

.annot svg {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.annot--right {
    transform: rotate(1.5deg);
}

.annot--float {
    position: absolute;
    max-width: 210px;
}

.surface-dark .annot {
    color: var(--orange);
}

/* 12  FIGURE PLATES ====================================================== */

/* Every image is presented as a plate in a lab notebook: framed, captioned */
.plate {
    position: relative;
    background: var(--white);
    border: 1px solid var(--grey-line);
    padding: var(--space-2xs);
    box-shadow: 6px 6px 0 rgba(43, 43, 43, 0.07);
}

.plate__media {
    position: relative;
    overflow: hidden;
    background: var(--paper-deep);
}

.plate__media img,
.plate__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plate__caption {
    display: block;
    padding: var(--space-2xs) var(--space-3xs) var(--space-3xs);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--grey-deep);
}

.plate__caption b {
    color: var(--ochre-deep);
    font-weight: 600;
}

/* Corner registration marks */
.plate::before,
.plate::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--orange);
}

.plate::before {
    top: -5px;
    left: -5px;
    border-right: 0;
    border-bottom: 0;
}

.plate::after {
    bottom: -5px;
    right: -5px;
    border-left: 0;
    border-top: 0;
}

.surface-dark .plate {
    background: var(--charcoal-soft);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.3);
}

/* 13  HERO =============================================================== */

.hero {
    position: relative;
    padding-top: calc(var(--space-2xl) + 2rem);
    padding-bottom: var(--space-xl);
    overflow: hidden;
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: center;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey-deep);
    margin-bottom: var(--space-sm);
}

.hero__eyebrow::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 178, 3, 0.24);
}

.hero h1 {
    margin-bottom: var(--space-sm);
}

/* The damped oscillation settling under the headline */
.hero__wave {
    width: 100%;
    max-width: 460px;
    height: 46px;
    margin-bottom: var(--space-sm);
    overflow: visible;
}

.hero__wave path {
    fill: none;
    stroke: var(--orange);
    stroke-width: 2.5;
    stroke-linecap: round;
}

.hero__triad {
    font-family: var(--font-mono);
    font-size: clamp(1.0625rem, 1.9vw, 1.375rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-sm);
}

.hero__triad span:nth-child(1) { color: var(--ochre-deep); }
.hero__triad span:nth-child(2) { color: var(--grey-deep); }
.hero__triad span:nth-child(3) { color: var(--charcoal); }

.hero__lede {
    max-width: 44ch;
    font-size: 1.125rem;
    color: var(--grey-deep);
}

/* Matches the source video's 2.06:1 crop, so the owl doesn't get cut off */
.hero__plate .plate__media {
    aspect-ratio: 2 / 1;
}

.hero__note {
    margin-top: var(--space-sm);
    justify-content: flex-end;
}

/* Compact hero for interior pages: no video, keeps the pages light */
.page-hero {
    position: relative;
    padding-top: calc(var(--space-2xl) + 1rem);
    padding-bottom: var(--space-lg);
    overflow: hidden;
}

.page-hero__inner {
    max-width: 46rem;
}

.page-hero h1 {
    margin-bottom: var(--space-sm);
}

.page-hero__lede {
    font-size: 1.1875rem;
    color: var(--grey-deep);
    max-width: var(--measure);
}

/* Decorative diagram in the empty right half of interior page heroes.
   Kept fully inside the viewport so it doesn't read as a clipped mistake. */
.page-hero__deco {
    position: absolute;
    top: 16%;
    right: 2%;
    width: 300px;
    opacity: 0.45;
    pointer-events: none;
    stroke: var(--ochre);
    fill: none;
}

/* 14  SERVICE CARDS ====================================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: var(--space-md);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    background: var(--white);
    border: 1px solid var(--grey-line);
    transition: transform var(--t-mid), box-shadow var(--t-mid), border-color var(--t-mid);
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--charcoal);
    box-shadow: 8px 8px 0 rgba(43, 43, 43, 0.1);
}

.card__index {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--ochre-deep);
    margin-bottom: var(--space-sm);
}

.card__figure {
    height: 150px;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card__figure svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.card h3 {
    margin-bottom: var(--space-2xs);
}

.card__caption {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--grey);
    margin-bottom: var(--space-sm);
}

.card p {
    color: var(--grey-deep);
    font-size: 1rem;
    margin-bottom: var(--space-md);
}

.card__more {
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ochre-deep);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
}

.card__more svg {
    width: 74px;
    height: 8px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    transition: stroke-dashoffset var(--t-slow);
}

.card:hover .card__more svg {
    stroke-dashoffset: 0;
}

/* Shared styling for the hand-drawn diagrams */
.diagram {
    stroke: var(--charcoal);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.diagram .accent {
    stroke: var(--orange);
}

.diagram .accent-fill {
    fill: var(--orange);
    stroke: none;
}

.diagram .dot {
    fill: var(--charcoal);
    stroke: none;
}

.surface-dark .diagram {
    stroke: var(--paper);
}

.surface-dark .diagram .dot {
    fill: var(--paper);
}

.diagram .faint {
    stroke: var(--grey);
    stroke-width: 1.25;
    opacity: 0.7;
}

.diagram .dashed {
    stroke-dasharray: 4 5;
}

.diagram text {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--grey-deep);
    stroke: none;
    letter-spacing: 0.04em;
}

/* 15  PROTOCOL =========================================================== */

.protocol {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    position: relative;
}

/* Tick-marked connector running behind the four steps */
.protocol::before {
    content: '';
    position: absolute;
    top: 26px;
    left: 6%;
    right: 6%;
    height: 2px;
    background-image: repeating-linear-gradient(90deg, var(--grey-line) 0 8px, transparent 8px 16px);
}

.step {
    position: relative;
    text-align: center;
}

.step__dot {
    position: relative;
    width: 54px;
    height: 54px;
    margin: 0 auto var(--space-sm);
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--charcoal);
    background: var(--paper);
    border: 2px solid var(--charcoal);
    border-radius: 50%;
    transition: background-color var(--t-mid), color var(--t-mid);
}

.step:hover .step__dot {
    background: var(--orange);
}

.surface-dark .step__dot {
    background: var(--charcoal);
    color: var(--paper);
    border-color: var(--orange);
}

.surface-dark .step:hover .step__dot {
    background: var(--orange);
    color: var(--charcoal);
}

.step h3 {
    font-size: 1.1875rem;
    margin-bottom: var(--space-3xs);
}

.step__greek {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ochre-deep);
    margin-bottom: var(--space-2xs);
}

.step p {
    font-size: 0.9375rem;
    color: var(--grey-deep);
}

/* 16  A NOTE FROM A CLIENT =============================================== */

.review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.55fr);
    gap: var(--space-lg);
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
}

.review {
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--grey-line);
    background: var(--white);
    box-shadow: 6px 6px 0 rgba(43, 43, 43, 0.07);
}

.review blockquote p {
    font-size: clamp(1.125rem, 2.1vw, 1.5rem);
    line-height: 1.55;
    font-weight: 400;
}

.review cite {
    display: inline-block;
    margin-top: var(--space-md);
    padding-bottom: 3px;
    border-bottom: 2px solid var(--orange);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-style: normal;
    color: var(--charcoal);
}

.review__drawing {
    display: flex;
    justify-content: center;
}

.review__drawing .diagram {
    width: 100%;
    max-width: 280px;
    height: auto;
    overflow: visible;
}

/* 17  TRUSTED BY ========================================================= */

/* Flex rather than grid so a short final row centres instead of hanging left */
.logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    max-width: 960px;
    margin: 0 auto;
}

/* One uniform box per logo instead of per-logo height overrides.
   228px basis puts four on a row at the 960px cap. */
.logo-cell {
    flex: 0 1 228px;
    display: grid;
    place-items: center;
    height: 116px;
    padding: var(--space-sm);
    border: 1px solid var(--grey-line);
    background: var(--white);
    transition: border-color var(--t-mid), transform var(--t-mid);
}

.logo-cell:hover {
    border-color: var(--ochre);
    transform: translateY(-4px);
}

/* Wordmarks are wide, so width is the binding constraint */
.logo-cell img {
    max-width: 84%;
    max-height: 46px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.62;
    transition: filter var(--t-mid), opacity var(--t-mid);
}

/* Near-square marks need more height to carry the same optical weight */
.logo-cell--square img {
    max-height: 74px;
}

.logo-cell:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* 18  CONTACT ============================================================ */

.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    gap: var(--space-lg);
    align-items: start;
}

.contact__card {
    padding: var(--space-md);
    background: var(--white);
    border: 1px solid var(--grey-line);
    box-shadow: 8px 8px 0 rgba(43, 43, 43, 0.07);
}

.contact__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.contact__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: var(--space-sm);
    border-bottom: 1px dashed var(--grey-line);
}

.contact__item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.contact__key {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--grey);
}

.contact__val {
    font-family: var(--font-mono);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--charcoal);
    word-break: break-word;
}

a.contact__val:hover {
    color: var(--ochre-deep);
}

/* Checklist of what to put in the first email */
.checklist {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2xs);
    font-size: 1rem;
    color: var(--grey-deep);
}

.checklist li::before {
    content: '';
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 5px;
    border: 2px solid var(--ochre);
}

.checklist li:hover::before {
    background: var(--orange);
}

/* "Not required" variant: the box comes pre-waived, so it stays unticked */
.checklist--waived li {
    color: var(--grey-deep);
}

.checklist--waived li::before {
    border-style: dashed;
    border-color: var(--grey);
}

.checklist--waived li:hover::before {
    background: transparent;
}

/* 19  ABOUT ============================================================== */

.about__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: var(--space-lg);
    align-items: start;
}

.about__portrait .plate__media {
    aspect-ratio: 3 / 4;
}

.about__body p {
    font-size: 1.0625rem;
}

.about__body > * + * {
    margin-top: var(--space-sm);
}

.about__body h3 {
    margin-top: var(--space-md);
}

.principles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

.principle {
    padding: var(--space-md);
    border: 1px solid var(--grey-line);
    background: var(--white);
    transition: border-color var(--t-mid), transform var(--t-mid);
}

.principle:hover {
    border-color: var(--charcoal);
    transform: translateY(-4px);
}

.principle__icon {
    width: 76px;
    height: 76px;
    margin-bottom: var(--space-sm);
}

.principle h3 {
    font-size: 1.1875rem;
    margin-bottom: var(--space-2xs);
}

.principle p {
    font-size: 0.9375rem;
    color: var(--grey-deep);
}

/* 20  SERVICE PAGES ====================================================== */

.service__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
    gap: var(--space-lg);
    align-items: start;
}

.prose > * + * {
    margin-top: var(--space-sm);
}

.prose h3 {
    margin-top: var(--space-md);
}

.prose p {
    color: var(--grey-deep);
}

/* Numbered list styled as the steps of a method section */
.method {
    list-style: none;
    counter-reset: method;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.method li {
    counter-increment: method;
    position: relative;
    padding-left: 3rem;
}

.method li::before {
    content: counter(method, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ochre-deep);
    border-bottom: 2px solid var(--orange);
    padding-bottom: 1px;
}

.method h4 {
    margin-bottom: var(--space-3xs);
}

.method p {
    font-size: 0.9375rem;
    color: var(--grey-deep);
}

/* Sticky sidebar summarising the engagement */
.spec {
    position: sticky;
    top: 7rem;
    padding: var(--space-md);
    border: 1px solid var(--grey-line);
    background: var(--white);
    box-shadow: 6px 6px 0 rgba(43, 43, 43, 0.07);
}

.spec h3 {
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-2xs);
    border-bottom: 1px solid var(--grey-line);
}

.spec dl {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.spec dt {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey);
}

.spec dd {
    font-size: 0.9375rem;
    color: var(--charcoal);
    margin-top: 2px;
}

/* Named engagements, quieter than the rest of the notebook */
.cases {
    margin-top: var(--space-xl);
}

.cases .section-label {
    margin-bottom: var(--space-md);
}

.cases__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.case {
    padding: var(--space-md);
    border: 1px solid var(--grey-line);
    background: var(--white);
    max-width: var(--measure);
}

.case__title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.case p {
    color: var(--grey-deep);
}

.case p + p {
    margin-top: var(--space-sm);
}

/* Home-page trace of the three service cases */
.cases--index {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--grey-line);
}

.case-tease-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-sm);
}

.case-tease {
    display: block;
    padding: var(--space-md);
    border: 1px solid var(--grey-line);
    background: var(--white);
    transition: border-color var(--t-mid), background-color var(--t-mid);
}

.case-tease:hover {
    border-color: var(--charcoal);
}

.case-tease__service {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ochre-deep);
    margin-bottom: var(--space-2xs);
}

.case-tease strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.0625rem;
    margin-bottom: var(--space-2xs);
}

.case-tease p {
    color: var(--grey-deep);
    font-size: 0.9375rem;
}

/* Cross-links to the other two services */
.sibling-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--grey-line);
}

.sibling {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--grey-line);
    transition: border-color var(--t-mid), background-color var(--t-mid);
}

.sibling:hover {
    border-color: var(--charcoal);
    background: var(--white);
}

.sibling span {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 2px;
}

.sibling strong {
    font-family: var(--font-mono);
    font-size: 1rem;
}

/* CTA band closing the interior pages */
.cta {
    text-align: center;
}

.cta .btn-row {
    justify-content: center;
}

/* 21  NOT FOUND ========================================================== */

.notfound {
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding-block: var(--space-2xl) var(--space-xl);
}

.notfound__code {
    font-family: var(--font-mono);
    font-size: clamp(4rem, 16vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: var(--charcoal);
    letter-spacing: -0.04em;
}

.notfound__code span {
    color: var(--orange);
}

.notfound p {
    max-width: 46ch;
    margin-inline: auto;
    color: var(--grey-deep);
    font-size: 1.125rem;
}

.notfound .annot {
    justify-content: center;
    margin-top: var(--space-md);
}

/* 22  FOOTER ============================================================= */

.footer {
    position: relative;
    background-color: var(--charcoal);
    color: var(--paper);
    padding-block: var(--space-lg) var(--space-md);
    overflow: hidden;
    --grey-line: rgba(255, 255, 255, 0.14);
}

/* Faint constellation across the top of the footer */
.footer__stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    opacity: 0.3;
    pointer-events: none;
    stroke: var(--orange);
    fill: var(--orange);
}

.footer .container {
    position: relative;
    z-index: 1;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer__logo img {
    height: 56px;
    width: auto;
    margin-bottom: var(--space-sm);
    transition: opacity var(--t-fast);
}

.footer__logo img:hover {
    opacity: 0.8;
}

.footer p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9375rem;
    max-width: 34ch;
}

.footer h4 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: var(--space-sm);
}

.footer ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.footer ul a {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9375rem;
}

.footer ul a:hover {
    color: var(--orange);
}

.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-md);
    align-items: baseline;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--grey-line);
}

.footer__bottom p,
.footer__version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
    max-width: none;
}

.footer .footer__legal {
    flex: 1 0 100%;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.42);
    max-width: none;
}

/* 23  REVEAL ============================================================= */

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Hero curve draws itself once on load */
.hero__wave path {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: draw 2.2s var(--ease) 0.35s forwards;
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

/* 24  RESPONSIVE ========================================================= */

@media (max-width: 1024px) {
    .hero__grid,
    .contact__grid,
    .about__grid,
    .service__grid,
    .review-grid {
        grid-template-columns: 1fr;
    }

    .hero__plate {
        max-width: 560px;
    }

    .protocol {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg) var(--space-md);
    }

    .protocol::before {
        display: none;
    }

    .spec {
        position: static;
    }

    .annot--float {
        position: static;
        max-width: none;
        margin-top: var(--space-sm);
    }
}

/* Below this the hero text would run under the decoration */
@media (max-width: 1200px) {
    .page-hero__deco {
        display: none;
    }
}

@media (max-width: 760px) {
    :root {
        --space-lg: 3rem;
        --space-xl: 4rem;
        --space-2xl: 5rem;
    }

    .header__logo img {
        height: 62px;
    }

    .header.is-scrolled .header__logo img {
        height: 46px;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .logo-cell {
        flex-basis: calc(50% - var(--space-sm) / 2);
        height: 100px;
        padding: var(--space-xs);
    }

    .logo-cell img {
        max-height: 38px;
    }

    .logo-cell--square img {
        max-height: 62px;
    }

    .footer__bottom {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    html {
        font-size: 15px;
    }

    .container {
        padding-inline: var(--space-sm);
    }

    .protocol {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .step {
        display: grid;
        grid-template-columns: 54px 1fr;
        gap: var(--space-sm);
        text-align: left;
        align-items: start;
    }

    .step__dot {
        margin: 0;
    }

    .card,
    .principle,
    .contact__card,
    .spec,
    .case,
    .case-tease,
    .review {
        padding: var(--space-sm);
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 25  MOTION & PRINT ===================================================== */

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero__wave path {
        stroke-dashoffset: 0;
    }

    .card:hover,
    .principle:hover,
    .logo-cell:hover,
    .btn--primary:hover {
        transform: none;
    }
}

@media print {
    .header,
    .slide-menu,
    .menu-overlay,
    .scroll-ruler,
    .skip-link {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
