/* Sketchbook design system (https://claude.ai/artifact/Nmqxyf3GSWXyuF49HeTA9v), layered over
   styles.css: same markup and behaviour, restyled with the system's tokens.
   Load after styles.css, with Fuzzy Bubbles added to the Google Fonts request. */

/* Tokens, as named in the design system */
:root {
    --paper: #f7f5ee;
    --paper-warm: #efe7de;
    --ink: #1c1b19;
    --ink-muted: #5c5850;
    --line: #c5bcb4;
    --marker: #f6da33;
    --cobalt: #6a88f0;
    --tangerine: #fe7348;
    --chair-red: #e4502e;
    --leaf: #cedaa4;

    --font-serif: "DM Serif Text", Georgia, serif;
    --font-sans: "Montserrat", system-ui, sans-serif;
    --font-hand: "Fuzzy Bubbles", "Comic Sans MS", cursive;

    --space-2: 0.5rem;
    --space-4: 1rem;
    --space-8: 2rem;
    --space-16: 4rem;

    --radius-none: 0;
    --radius-sm: 0.25rem;
    --radius-full: 9999px;
}

/* Map the site's variables onto the system (day) */
:root,
[data-theme="light"] {
    --bg-color: var(--paper);
    --bg-secondary: var(--paper-warm);
    --text-main: var(--ink);
    --title-color: var(--ink);
    --text-muted: var(--ink-muted);
    --text-desc: var(--ink);
    --showcase-desc: var(--ink);
    --metric-text: var(--ink);
    --metric-label: var(--ink-muted);
    --metric-bg: var(--paper);
    --accent: var(--ink);
    --on-accent: var(--ink);
    --border-color: var(--line);
    --mouse-border: var(--ink);
    --contact-btn-border: var(--ink);
    --highlight-color: var(--chair-red);
    --ticker-bg: var(--marker);
    --pill-bg: #e4d9cb;
    --pill-border: #a99d90;
    --overlay-dark: transparent;
    --card-bg: var(--paper-warm);
    --about-bg: var(--leaf);
    --focus: var(--ink);
}

/* Night: not in the system yet; the same tokens inverted (paper on ink).
   Colour blocks keep their values and ink text. */
[data-theme="dark"] {
    --bg-color: var(--ink);
    --bg-secondary: #2a2825;
    --text-main: var(--paper);
    --title-color: var(--paper);
    --text-muted: #b8b1a6;
    --text-desc: var(--paper);
    --showcase-desc: var(--paper);
    --metric-text: var(--paper);
    --metric-label: #b8b1a6;
    --metric-bg: var(--ink);
    --border-color: #4a463f;
    --mouse-border: var(--paper);
    --contact-btn-border: var(--paper);
    --pill-bg: #46423c;
    --pill-border: #736c62;
    --card-bg: #2a2825;
    --about-bg: #2a2825;
    --focus: var(--paper);
}

body {
    font-size: 1rem;
    line-height: 1.625rem;
}

::selection {
    background: var(--marker);
    color: var(--ink);
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 0.1875rem;
}

a:hover {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--marker);
    text-decoration-thickness: 0.2em;
    text-underline-offset: 0.15em;
}

.showcase-link:hover {
    text-decoration: none;
}

/* Type: serif headings (display-xl / display / title) */
h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: 0;
}

/* label: tags, nav, metadata */
.showcase-meta,
.hero-skills,
.metric h4 {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Nav */
.navbar {
    padding: var(--space-2) var(--gutter);
    border-bottom: 1px solid var(--border-color);
}

/* Nav words and the theme toggle take chair red on hover (strokes follow currentColor) */
.nav-word-link {
    transition: color 0.3s ease;
}

.nav-word-link:hover,
.nav-word-link:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--chair-red);
    text-decoration: none;
}

/* Hero */
.hero-statement {
    font-family: var(--font-sans);
    color: var(--title-color);
}

.hero-statement-lead {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 4.5rem;
    line-height: 0.95;
    letter-spacing: -0.0625rem;
    margin-bottom: var(--space-8);
}

.hero-statement .ticker {
    background: var(--marker);
    color: var(--ink);
    border-radius: var(--radius-full);
}

.hero-statement .ticker-dot {
    background: var(--chair-red);
}

.hero-statement .ticker-cursor {
    background: var(--ink);
}

.hero-skills {
    gap: var(--space-2);
    margin-top: var(--space-8);
    color: var(--ink);
}

/* Tags: square paper cut-outs. The hero's four take the system's blocks. */
.showcase-tag {
    border-radius: var(--radius-none);
    background: var(--pill-bg);
    border: 1px solid var(--pill-border);
    color: var(--text-main);
    padding: var(--space-2) 0.75rem;
    letter-spacing: 0.1em;
}

.hero-skills .showcase-tag {
    border-color: transparent;
    color: var(--ink);
}

.hero-skills .showcase-tag:nth-child(1) { background: var(--cobalt); }
.hero-skills .showcase-tag:nth-child(2) { background: var(--tangerine); }
.hero-skills .showcase-tag:nth-child(3) { background: var(--marker); }
.hero-skills .showcase-tag:nth-child(4) { background: var(--leaf); }

/* Selected work */
.showcases {
    padding: var(--space-16) var(--gutter);
}

.section-header {
    margin-bottom: var(--space-16);
}

.section-header h2 {
    font-size: 2.75rem;
    line-height: 1.05;
    margin-bottom: var(--space-4);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.625rem;
    font-weight: 400;
    max-width: 68ch;
}

/* Cards: square, no shadow, set apart by a paper-warm ground */
.showcase-item {
    gap: var(--space-8);
    padding: var(--space-8);
    margin-bottom: var(--space-16);
    border: none;
    border-radius: var(--radius-none);
    background: var(--card-bg);
}

.showcase-visuals {
    gap: var(--space-8);
}

.showcase-image-container {
    border: none;
    border-radius: var(--radius-none);
}

.showcase-metrics {
    gap: var(--space-4);
}

.metric {
    padding: var(--space-4);
    border-radius: var(--radius-none);
    background: var(--metric-bg);
}

.metric h4 {
    color: var(--metric-label);
    margin-bottom: var(--space-2);
}

.metric p {
    font-size: 0.875rem;
    line-height: 1.375rem;
    font-weight: 400;
}

/* Marker swipe behind the key phrases */
.highlight {
    font-weight: 600;
    color: var(--ink);
    background: var(--marker);
    border-radius: var(--radius-full);
    padding: 0 0.3em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.showcase-meta {
    color: var(--text-main);
    border-bottom-color: var(--border-color);
}

.showcase-meta.showcase-tags {
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.showcase-title {
    font-size: 2.75rem;
    line-height: 1.05;
    margin-bottom: var(--space-4);
}

.showcase-desc {
    font-size: 1.125rem;
    line-height: 1.75rem;
    margin-bottom: var(--space-4);
}

/* How-might-we notes: flat colour blocks with a handwritten note, tilted, no shadow */
.showcase-hmw {
    background: var(--marker);
    color: var(--ink);
    border-radius: var(--radius-none);
    box-shadow: none;
    max-width: 26rem;
    padding: 1.5rem;
    font-family: var(--font-hand);
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 400;
    -webkit-text-stroke: 0.45px currentColor; /* a touch heavier than regular; bold is too much */
}

/* Keep the lead-in line and the note right under the description instead of pinned to
   the bottom of the column; the extra top margin clears the tape strip. */
.showcase-desc--lead {
    margin-top: 0;
}

.showcase-hmw {
    margin-top: var(--space-4);
}

.showcase-desc--lead + .showcase-hmw {
    margin-top: var(--space-4);
}

.showcase-hmw::before {
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: none;
}

.showcase-hmw--blue {
    background: var(--cobalt);
}

.showcase-hmw--green {
    background: var(--leaf);
}

.showcase-hmw--lilac {
    background: #C9B6F0;
}

.showcase-hmw--pink {
    background: #F6C9D6;
}

/* "View case study" cursor pill */
.view-cursor {
    background-color: var(--ink);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
}

[data-theme="light"] .view-cursor {
    box-shadow: none;
}

[data-theme="dark"] .view-cursor {
    background-color: var(--marker);
}

.view-cursor-label {
    color: var(--paper);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

[data-theme="dark"] .view-cursor-label {
    color: var(--ink);
}

/* About: a leaf wash */
.about {
    padding: var(--space-16) var(--gutter);
    background: var(--about-bg);
    border-top: none;
    border-bottom: none;
}

.about-content {
    gap: var(--space-16);
}

.about-img-container {
    border: none;
    border-radius: var(--radius-none);
    box-shadow: none;
}

.about-content h2 {
    font-size: 2.75rem;
    line-height: 1.05;
    margin-bottom: var(--space-4);
}

/* note: the subtitle is a margin note */
.about-content .about-subtitle {
    font-family: var(--font-hand);
    font-style: normal;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: var(--space-8);
    transform: rotate(-1deg);
    transform-origin: left center;
}

.about-content p {
    font-size: 1rem;
    line-height: 1.625rem;
    margin-bottom: var(--space-4);
}

/* About page */
.about-page-title {
    font-size: 2.75rem;
    line-height: 1.05;
    margin-bottom: var(--space-4);
}

.about-beyond-note {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.625rem;
}

/* Margin note, like the about subtitle */
.beyond-caption {
    font-family: var(--font-hand);
    line-height: 1.4;
}

/* Photo prints as plain white instant-film prints, outlined in ink like the rest of
   the sketchbook (no shadow). Ink captions in both themes. */
.beyond-card {
    background: #fdfdfb;
    border-color: var(--ink);
    color: var(--ink);
    --focus: var(--ink);
}

/* Footer */
/* Ink block with paper text in both themes; the site variables are re-pointed inside
   the footer. At night it lifts a step off the ink page so it still reads as a block. */
.footer {
    padding: var(--space-16) var(--gutter) var(--space-8);
    background: var(--ink);
    border-top: none;
    color: var(--paper);
    --text-main: var(--paper);
    --title-color: var(--paper);
    --text-muted: #b8b1a6;
    --border-color: rgba(247, 245, 238, 0.18);
    --contact-btn-border: var(--paper);
    --focus: var(--paper);
}

[data-theme="dark"] .footer {
    background: #2a2825;
}

.footer-statement {
    letter-spacing: -0.0625rem;
}

.footer-hand {
    font-family: var(--font-hand);
    -webkit-text-stroke: 0.45px currentColor;
}

/* Email underlined by hand: one uneven marker stroke (not a repeating wave) that dips,
   rises and lifts off at the end. The stroke keeps its weight however wide the address is. */
.footer-email {
    font-family: var(--font-serif);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 8.5C22 6.5 38 10.5 58 8.6S96 5.2 121 7.4 160 10.6 186 8.1 228 4.9 252 7.2 284 7.6 297 4.2' fill='none' stroke='%23f6da33' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") left bottom / 100% 0.5em no-repeat;
    color: var(--paper);
    padding: 0 0.15em 0.3em;
}

/* Key words in case-study copy get the same hand-drawn marker stroke */
.cs-mark {
    font-weight: 700;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 14' preserveAspectRatio='none'%3E%3Cpath d='M3 8.5C22 6.5 38 10.5 58 8.6S96 5.2 121 7.4 160 10.6 186 8.1 228 4.9 252 7.2 284 7.6 297 4.2' fill='none' stroke='%23f6da33' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") left bottom / 100% 0.5em no-repeat;
    padding-bottom: 0.2em;
}

.footer-email:hover {
    text-decoration: none;
    background: var(--marker);
    color: var(--ink);
}

.footer-copy {
    border: 2px solid var(--contact-btn-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-copy:hover,
.footer-copy.is-copied {
    background: var(--marker);
    color: var(--ink);
    border-color: var(--ink);
}

.footer-links a {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.625rem;
}

/* Small print: quiet on purpose, paper at low strength */
.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-color);
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    line-height: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: rgba(247, 245, 238, 0.5);
}


@media (max-width: 1024px) {
    .showcase-item {
        gap: var(--space-8);
        padding: var(--space-4);
        margin-bottom: var(--space-16);
    }

    .showcase-metrics {
        gap: var(--space-4);
    }

    .hero-statement-lead {
        font-size: 2.75rem;
        line-height: 1.05;
    }

    .section-header h2,
    .showcase-title,
    .about-content h2 {
        font-size: 1.625rem;
        line-height: 1.2;
    }

    .about-content {
        gap: var(--space-8);
    }

    .about-content .about-subtitle {
        transform-origin: center;
    }
}

@media (min-width: 1025px) {
    .hero-statement-lead {
        font-size: 4.5rem;
    }
}

/* ------------------------------------------------------------------
   Case study pages (.cs wireframe and the older .case-study layout)
   ------------------------------------------------------------------ */

.cs p,
.case-section p {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.625rem;
    font-weight: 400;
}

.cs h2,
.case-section h2 {
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: var(--space-4);
}

.cs h3 {
    font-weight: 600;
}

/* Hero */
.cs-title,
.case-hero .showcase-title {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.05;
    margin-bottom: var(--space-4);
}

.cs-subtitle {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

/* Tags: the same square paper cut-outs as the home page */
.cs-tags {
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.cs-tags li {
    border-radius: var(--radius-none);
    background: var(--pill-bg);
    border: 1px solid var(--pill-border);
    color: var(--text-main);
    padding: var(--space-2) 0.75rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

/* label: eyebrows, detail terms, back link */
.cs-details dt,
.cs-eyebrow,
.cs-toc-title,
.case-back,
.cs-quote cite,
.cs-card h3 {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cs-section > .cs-eyebrow {
    font-size: 0.75rem;
    color: var(--chair-red);
    margin-bottom: var(--space-4);
}

/* When the eyebrow is the section's only heading (an h2), keep it looking like a label */
.cs .cs-section > h2.cs-eyebrow {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.case-back {
    border-bottom-color: var(--border-color);
}

.cs-details,
.cs-next {
    border-top-color: var(--border-color);
}

.cs-details dd {
    color: var(--text-main);
}

/* A second term stacked in the same column (e.g. Duration under Partners) */
.cs-details dd + dt {
    margin-top: var(--space-8);
}

.cs-partner-logo {
    border-radius: var(--radius-none);
}

/* Table of contents */
.cs-toc a {
    color: var(--text-muted);
}

.cs-toc a:hover,
.cs-toc a:focus-visible {
    color: var(--text-main);
}

/* Media: square, no frame */
.cs-img,
.cs-video,
.cs-ph,
.case-cover {
    border-radius: var(--radius-none);
}

.case-cover {
    border: none;
}

.cs-ph {
    border-color: var(--line);
    background-color: var(--card-bg);
}

.cs .cs-caption {
    font-size: 0.875rem;
    line-height: 1.375rem;
    color: var(--text-muted);
}

/* Cards: paper-warm ground, square, no border */
.cs-card {
    padding: var(--space-8);
    border: none;
    border-radius: var(--radius-none);
    background: var(--card-bg);
}

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

/* Key numbers: flat colour blocks with ink text, like the hero's skill tags */
.cs-grid {
    gap: var(--space-4);
}

.cs-stat {
    padding: var(--space-8);
    border-radius: var(--radius-none);
    background-color: var(--cobalt);
}

.cs-stat:nth-child(2) { background-color: var(--tangerine); }
.cs-stat:nth-child(3) { background-color: var(--leaf); }

.cs-stat-num {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 4.5rem;
    line-height: 0.95;
    letter-spacing: -0.0625rem;
    color: var(--ink);
    margin-bottom: var(--space-4);
}

.cs .cs-stat p {
    color: var(--ink);
    font-size: 0.875rem;
    line-height: 1.375rem;
}

/* Frame: a thin ink outline grouping related blocks under a label (e.g. Impact stats) */
.cs-frame {
    margin-top: var(--space-8);
    padding: var(--space-8);
    border: 1px solid var(--text-main);
}

.cs .cs-frame-title {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-main);
    margin-bottom: var(--space-4);
}

.cs-frame .cs-grid {
    margin-top: 0;
}

/* Phases (wheelchair process): ink-outlined box, one expandable row per phase.
   The name + summary line is the toggle; the write-up opens under the summary. */
.cs-phases {
    margin-top: var(--space-8);
    padding: 0 var(--space-8);
    border: 1px solid var(--text-main);
}

.cs-phases-row + .cs-phases-row {
    border-top: 1px solid var(--line);
}

.cs-phases-head {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr) auto;
    gap: var(--space-4);
    align-items: baseline;
    padding: var(--space-8) 0;
    cursor: pointer;
    list-style: none;
}

.cs-phases-head::-webkit-details-marker {
    display: none;
}

.cs-phases-name {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    line-height: 1.3;
}

.cs-phases-desc {
    max-width: 68ch;
    font-size: 1rem;
    line-height: 1.625rem;
}

/* Hover: the site's marker underline, on the phase name only */
.cs-phases-head:hover .cs-phases-name {
    text-decoration: underline;
    text-decoration-color: var(--marker);
    text-decoration-thickness: 0.2em;
    text-underline-offset: 0.15em;
}

.cs-phases-head:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Bold chevron: points down when closed, flips up when open. While a row is closed it
   nudges downward every few seconds to invite a click; hovering makes it bob faster. */
.cs-phases-head::after {
    content: "";
    align-self: center;
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.35rem;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translateY(-25%) rotate(45deg);
    transition: transform 0.2s ease;
}

.cs-phases-row:not([open]) > .cs-phases-head::after {
    animation: cs-phases-nudge 2.4s ease-in-out infinite;
}

.cs-phases-row:not([open]) > .cs-phases-head:hover::after {
    animation-duration: 0.9s;
}

@keyframes cs-phases-nudge {
    0%, 55%, 100% {
        transform: translateY(-25%) rotate(45deg);
    }
    70% {
        transform: translateY(35%) rotate(45deg);
    }
    85% {
        transform: translateY(-10%) rotate(45deg);
    }
}

.cs-phases-row[open] > .cs-phases-head::after {
    transform: translateY(25%) rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
    .cs-phases-head::after {
        transition: none;
    }

    .cs-phases-row:not([open]) > .cs-phases-head::after {
        animation: none;
    }
}

/* Write-up lines up with the summary text, not the phase name */
.cs-phases-body {
    margin-top: calc(-1 * var(--space-4));
    padding: 0 0 var(--space-8) calc(7rem + var(--space-4));
}

/* Same measure and rhythm as paragraphs sitting directly in a section */
.cs-phases-body > p {
    max-width: 68ch;
    margin-bottom: 1.25rem;
}

/* Captions run the full width of the image above them */
.cs-phases-body > .cs-caption {
    max-width: none;
}

.cs-phases-body > :last-child {
    margin-bottom: 0;
}

.cs-phases-body h4 {
    margin: var(--space-8) 0 var(--space-2);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 600;
}

.cs-phases-body > h4:first-child {
    margin-top: 0;
}

/* Phase 1 process map (wheelchair): a bracket per stage on a 28-column grid, with the
   stage's steps as sized boxes under it, so overlaps between stages show directly.
   Rows 1–2 are empty (they held the Understand / Make bands and names). */
.cs-proc {
    margin: 0 0 var(--space-8) calc(-1 * (7rem + var(--space-4)));
}

.cs-proc-grid {
    display: grid;
    grid-template-columns: repeat(28, minmax(0, 1fr));
}

/* Through line across the top, left to right, ending in an arrowhead: reads as time */
.cs-proc-axis {
    position: relative;
    grid-row: 1;
    grid-column: 1 / -1;
    height: 0;
    margin: 0.5rem var(--space-4) var(--space-8);
    border-top: 1px solid var(--text-main);
}

.cs-proc-axis::after {
    content: "";
    position: absolute;
    top: calc(-0.25rem - 0.5px);
    right: 0.05rem;
    width: 0.5rem;
    height: 0.5rem;
    border-top: 1px solid var(--text-main);
    border-right: 1px solid var(--text-main);
    transform: rotate(45deg);
}

/* Bracket: label and question over an ink line with a tick at each end */
.cs .cs-proc-span {
    position: relative;
    margin: 0 var(--space-4) var(--space-4);
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--text-main);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
}

.cs-proc-span::before,
.cs-proc-span::after {
    content: "";
    position: absolute;
    bottom: -0.3rem;
    height: 0.55rem;
    border-left: 1px solid var(--text-main);
}

.cs-proc-span::before {
    left: 0;
}

.cs-proc-span::after {
    right: 0;
}

/* Analyzing data: the lower tier, set apart from the steps above it */
.cs .cs-proc-span--below {
    margin-top: var(--space-8);
}

.cs-proc-span em {
    margin-left: 0.4rem;
    font-family: var(--font-hand);
    font-style: normal;
    font-weight: 400;
    font-size: 0.6875rem;
}

/* Steps: the second tier. Each step's label sits in a thin ink box whose length shows
   how long the step ran; the description sits below. Small gaps between neighbours;
   the first and last steps under a bracket line up with its end ticks. */
.cs-proc-step {
    margin: 0 0.375rem;
    padding-bottom: var(--space-4);
}

.cs-proc-step--lead {
    margin-left: var(--space-4);
}

.cs-proc-step--last {
    margin-right: var(--space-4);
}

.cs .cs-proc-step h6 {
    margin: 0;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2rem;
    color: var(--text-main);
}

.cs .cs-proc-step > p:not(.cs-proc-loop) {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    line-height: 1.1rem;
    color: var(--text-main);
}

/* Methods list under a step: small, plain lines with no markers */
.cs .cs-proc-list {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.cs .cs-proc-list li {
    font-size: 0.75rem;
    line-height: 1.1rem;
    color: var(--text-main);
}

/* Loop note: hand-written, with a small cycle mark */
.cs .cs-proc-step .cs-proc-loop {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin: var(--space-2) 0 0;
    font-family: var(--font-hand);
    font-size: 0.75rem;
    line-height: 1.1rem;
    color: var(--text-main);
}

.cs-proc-loop svg {
    flex: none;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cs-proc-photos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-4);
}

/* Mixed 4:3 and 16:9 photos, cropped to one 4:3 frame so the row lines up */
.cs-proc-photos img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Narrow screens: everything stacks in reading order */
@media (max-width: 1024px) {
    .cs-proc {
        margin-left: 0;
    }

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

    .cs-proc-grid > * {
        grid-area: auto !important;
    }

    .cs .cs-proc-span {
        margin-top: var(--space-4);
    }

    .cs-proc-step,
    .cs-proc-step--lead,
    .cs-proc-step--last {
        margin: 0 var(--space-4);
    }

    .cs-proc-photos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .cs-phases {
        padding: 0 var(--space-4);
    }

    .cs-phases-head {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--space-2);
    }

    .cs-phases-desc {
        grid-column: 1 / -1;
    }

    .cs-phases-body {
        padding-left: 0;
    }
}


/* Main problem sketch (wheelchair): scattered sources on the left, act-before-discover on the right.
   Boxes use uneven radii so the ink outline reads as hand-drawn. */
.cs-problem-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--space-8);
}

/* Numbered statement heading each panel, circled like a notebook point */
.cs .cs-problem-step {
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0 0 var(--space-8);
    font-family: var(--font-serif);
    font-size: 1.375rem;
    line-height: 1.2;
    color: var(--text-main);
}

.cs-problem-num {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 1.5px solid var(--text-main);
    border-radius: 55% 45% 50% 50% / 50% 55% 45% 50%;
    font-family: var(--font-hand);
    font-size: 1rem;
}

/* "so…" arrow carrying point 1 into point 2 */
.cs-problem-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-family: var(--font-hand);
    color: var(--chair-red);
}

.cs-problem-link svg {
    width: 3.5rem;
    height: 1.25rem;
}

.cs-problem-link path {
    fill: none;
    stroke: var(--chair-red);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cs-problem-panel {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-hand);
    color: var(--text-main);
}

.cs-problem-sources {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
}

.cs-problem-sources li,
.cs .cs-problem-box {
    border: 1.5px solid var(--text-main);
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    font-family: var(--font-hand);
    color: var(--text-main);
    text-align: center;
}

.cs-problem-sources li {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.35rem 0.25rem;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.cs-problem-sources li:nth-child(odd) { transform: rotate(-2deg); }
.cs-problem-sources li:nth-child(even) { transform: rotate(1.5deg) translateY(0.4rem); }

.cs-problem-funnel {
    width: 100%;
    height: 4.5rem;
    margin: var(--space-2) 0;
}

.cs-problem-funnel path,
.cs-problem-arrow path {
    fill: none;
    stroke: var(--text-main);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.cs .cs-problem-box {
    margin: 0;
    padding: 0.5rem 1rem;
    font-size: 1.125rem;
    line-height: 1.3;
    font-weight: 400;
}

.cs-problem-box small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cs .cs-problem-who {
    padding: 0.6rem 1.5rem;
    background: var(--marker);
    color: var(--ink);
}

.cs .cs-problem-label {
    align-self: flex-start;
    margin: 0 0 var(--space-2);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cs-problem-flow {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.5rem minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
}

.cs-problem-arrow {
    width: 100%;
    height: 1.25rem;
}

.cs .cs-problem-cost {
    align-self: flex-end;
    margin: var(--space-2) 0 var(--space-8);
    font-family: var(--font-hand);
    color: var(--chair-red);
}

.cs .cs-problem-cost--center {
    align-self: center;
    margin-bottom: 0;
}

.cs .cs-problem-box--good {
    background: var(--leaf);
    color: var(--ink);
}

.cs-problem-box--good small {
    color: var(--ink-muted);
}

.cs-problem-panel figcaption {
    margin-top: auto;
    padding-top: var(--space-4);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.375rem;
    text-align: center;
}

@media (max-width: 768px) {
    .cs-problem-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .cs-problem-link svg {
        transform: rotate(90deg);
    }

    .cs .cs-problem-step {
        font-size: 1.125rem;
    }

    .cs-problem-sources li {
        font-size: 0.6875rem;
    }
}

.cs-callout {
    border-left: none;
    border-radius: var(--radius-none);
    background-color: var(--card-bg);
}

.cs .cs-statement {
    font-size: 2.75rem;
    line-height: 1.05;
    font-style: normal;
    color: var(--text-main);
}

.cs-list {
    color: var(--text-main);
    font-weight: 400;
    line-height: 1.625rem;
}

.cs-list a,
.case-section a {
    text-decoration: underline;
    text-decoration-color: var(--marker);
    text-decoration-thickness: 0.2em;
    text-underline-offset: 0.15em;
}

/* Research process steps */
.cs-process li {
    border-top: 2px solid var(--text-main);
}

.cs-process li::before {
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--chair-red);
}

.cs .cs-process p {
    font-size: 0.875rem;
    line-height: 1.375rem;
}

/* Insights fan: square paper cut-outs in the system's blocks, outlined in ink instead of shadowed */
.cs-insight {
    border-radius: var(--radius-none);
    border: 1px solid var(--ink);
    color: var(--ink);
    box-shadow: none;
}

.cs-insight:nth-child(5n+1) { --card-bg: var(--cobalt); }
.cs-insight:nth-child(5n+2) { --card-bg: var(--marker); }
.cs-insight:nth-child(5n+3) { --card-bg: var(--leaf); }
.cs-insight:nth-child(5n+4) { --card-bg: var(--tangerine); }
.cs-insight:nth-child(5n+5) { --card-bg: var(--paper-warm); }

.cs-insight:hover,
.cs-insight:focus-visible {
    box-shadow: none;
}

.cs-insight:focus-visible {
    outline-color: var(--focus);
}

.cs .cs-insight h3 {
    opacity: 1;
}

.cs .cs-insight p:last-child {
    color: var(--ink);
    font-weight: 500;
}

/* Paragraphs on the left (two thirds), a pull quote beside them on the right (one third) */
.cs-split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--space-16);
    align-items: start;
}

.cs-split-text > p {
    max-width: 68ch;
    margin-bottom: 1.25rem;
}

.cs-split .cs-quote {
    margin-top: 0;
}

/* Quotes: a paper-warm card on a solid tangerine offset, with a thin inner frame
   that breaks around a “ in the top-left corner and a ” in the bottom-right */
.cs-quote {
    --quote-inset: 0.875rem;  /* frame distance from the card edge */
    --quote-gap: 4.25rem;     /* where each frame line stops short of a quote mark */
    position: relative;
    padding: 4.25rem 3rem 3.75rem;
    border: none;
    border-radius: 1.25rem;
    background: var(--card-bg);
    box-shadow: 0.5rem 0.5rem 0 var(--tangerine);
}

/* Frame, top and right edges: starts after the opening mark, ends above the closing one */
.cs-quote::before,
.cs-quote::after {
    content: "";
    position: absolute;
    border: 0 solid var(--text-main);
    pointer-events: none;
}

.cs-quote::before {
    top: var(--quote-inset);
    right: var(--quote-inset);
    bottom: var(--quote-gap);
    left: var(--quote-gap);
    border-top-width: 1.5px;
    border-right-width: 1.5px;
    border-top-right-radius: 0.75rem;
}

/* Frame, left and bottom edges: starts below the opening mark, ends before the closing one */
.cs-quote::after {
    top: var(--quote-gap);
    right: var(--quote-gap);
    bottom: var(--quote-inset);
    left: var(--quote-inset);
    border-left-width: 1.5px;
    border-bottom-width: 1.5px;
    border-bottom-left-radius: 0.75rem;
}

/* The two marks sit in the gaps, positioned against the card */
.cs-quote p::before,
.cs-quote cite::after {
    position: absolute;
    font-family: var(--font-serif);
    font-style: normal;
    font-size: 6rem;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-main);
}

.cs-quote p::before {
    content: "\201C";
    top: 0.35rem;
    left: 0.75rem;
}

.cs-quote cite::after {
    content: "\201D";
    right: 0.75rem;
    bottom: -2.2rem;
}

.cs .cs-quote p {
    font-family: var(--font-sans);
    font-style: normal;
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 1.3;
    color: var(--text-main);
}

.cs-quote cite {
    margin-top: var(--space-4);
}

.cs-quote-name + .cs-quote-role::before {
    content: ", ";
}

.cs-next-card:hover {
    text-decoration: none;
}

@media (max-width: 1024px) {
    /* Too narrow for two columns: the quote drops below the paragraphs */
    .cs-split {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .cs h2,
    .case-section h2 {
        font-size: 1.625rem;
        line-height: 1.2;
    }

    .cs-stat-num,
    .cs .cs-statement {
        font-size: 2.75rem;
        line-height: 1.05;
    }
}

@media (max-width: 768px) {
    .cs-card,
    .cs-stat,
    .cs-frame {
        padding: var(--space-4);
    }

    /* Keep the text clear of the frame and corner marks */
    .cs-quote {
        padding: 4rem 2rem 3.5rem;
    }

    .cs-insight {
        border-radius: var(--radius-none);
    }

    .cs-insight:hover,
    .cs-insight:focus-visible {
        box-shadow: none;
    }

    .cs .cs-quote p {
        font-size: 1.25rem;
    }
}
