@media (max-width: 1024px) {
    .header-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}
@media (max-width: 768px) {
    .header-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}
@media (max-width: 480px) {
    .header-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}
/* Restore arrow icon hover animation for CTA */
.cta-icon-wrapper {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
}
.cta-arrow-icon {
    display: inline;
    vertical-align: middle;
    filter: brightness(0) invert(1);
    transition: transform 0.2s;
}
.cta-button:hover .cta-arrow-icon {
    transform: translateY(2px);
}
/* Petrol SVG filter for secondary button icon */
:root {
    /* Petrol SVG filter for #034C53 */
    --petrol-svg-filter: invert(16%) sepia(25%) saturate(2227%) hue-rotate(153deg) brightness(97%) contrast(101%);
}
/* Secondary button for CV (white background, border) */
.btn-secondary {
    height: 40px;
    padding: 0 var(--sp-6);
    background: var(--n-0);
    color: var(--btn-primary-bg, #1a1a1a);
    border: 2px solid var(--btn-primary-bg, #1a1a1a);
    border-radius: 6px;
    font-size: var(--fs-button, 1rem);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
    width: fit-content;
    align-self: flex-start;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.btn-secondary:hover {
    border-color: var(--p-base, #034C53);
    color: var(--p-base, #034C53);
    background: var(--p-tint);
    outline: none;
}

.btn-secondary:focus-visible {
    border-color: var(--color-focus-ring);
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
}

@supports not selector(:focus-visible) {
    .btn-secondary:focus {
        border-color: var(--color-focus-ring);
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
    }
}
/* Card-like section over pattern background */
.pattern-card {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    left: 50%;
    background: var(--n-0);
    box-shadow: -4px 0 24px 0 rgba(20, 34, 36, 0.10);
    border-radius: 0;
    padding: 3rem 3rem 3rem 2.5rem;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: unset;
    max-width: unset;
}

/* Prevent horizontal scroll on mobile */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.pattern-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: var(--fs-h2);
    color: var(--n-900);
}

.pattern-card p {
    margin: 0;
    color: var(--n-600);
    font-size: 1.1rem;
    line-height: 1.6;
}
/* Fonts: Source Sans 3 (variable) and Lora — loaded via the link in your HTML head */
:root {
    --ff-sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --ff-serif: 'Lora', Georgia, Cambria, 'Times New Roman', Times, serif;
}
/* Pattern background section for SVG scaling and cropping (container-relative) */
.pattern-bg {
    background: var(--n-900);
    width: 100vw;
    min-width: 100vw;
    height: 650px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
.pattern-img {
    width: 122%;
    height: 122%;
    object-fit: contain;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 122%;
    min-height: 122%;
    max-width: none;
    max-height: none;
    pointer-events: none;
    user-select: none;
}
/* Pattern background section for SVG scaling and cropping */
/* duplicate removed, see above for main .pattern-bg rule */
.pattern-bg img {
    width: 122%;
    height: 122%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Line grid accent — section background pattern */
.line-grid-accent {
    position: relative;
}

.line-grid-accent::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 50%;
    left: calc(-50vw + 50%);
    z-index: 0;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Crect x='15.5' y='12' width='1' height='8' fill='%23E1E8E8'/%3E%3Crect x='12' y='15.5' width='8' height='1' fill='%23E1E8E8'/%3E%3Cpath d='M16 4 L16 6 M16 12 L16 14 M16 18 L16 20 M16 26 L16 28 M4 16 L6 16 M12 16 L14 16 M18 16 L20 16 M26 16 L28 16' stroke='%23E1E8E8' stroke-width='1' stroke-linecap='square'/%3E%3C/svg%3E");
    opacity: 1;
    mask-image: linear-gradient(to right, black 30%, transparent 100%), linear-gradient(to bottom, black 50%, transparent 95%);
    mask-composite: intersect;
    -webkit-mask-image: linear-gradient(to right, black 30%, transparent 100%), linear-gradient(to bottom, black 50%, transparent 95%);
    -webkit-mask-composite: source-in;
}

.line-grid-accent::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    right: calc(-50vw + 50%);
    z-index: 0;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Crect x='15.5' y='12' width='1' height='8' fill='%23E1E8E8'/%3E%3Crect x='12' y='15.5' width='8' height='1' fill='%23E1E8E8'/%3E%3Cpath d='M16 4 L16 6 M16 12 L16 14 M16 18 L16 20 M16 26 L16 28 M4 16 L6 16 M12 16 L14 16 M18 16 L20 16 M26 16 L28 16' stroke='%23E1E8E8' stroke-width='1' stroke-linecap='square'/%3E%3C/svg%3E");
    opacity: 1;
    mask-image: linear-gradient(to left, black 0%, transparent 60%), linear-gradient(to bottom, black 50%, transparent 95%);
    mask-composite: intersect;
    -webkit-mask-image: linear-gradient(to left, black 0%, transparent 60%), linear-gradient(to bottom, black 50%, transparent 95%);
    -webkit-mask-composite: source-in;
}

.line-grid-accent > * {
    position: relative;
    z-index: 1;
}

/* Flip the vertical fade for the video section (fade in from top to bottom) */
.video-section.line-grid-accent::before {
    mask-image: linear-gradient(to right, black 30%, transparent 100%), linear-gradient(to bottom, transparent 0%, black 100%);
    -webkit-mask-image: linear-gradient(to right, black 30%, transparent 100%), linear-gradient(to bottom, transparent 0%, black 100%);
}

.video-section.line-grid-accent::after {
    mask-image: linear-gradient(to left, black 0%, transparent 60%), linear-gradient(to bottom, transparent 0%, black 100%);
    -webkit-mask-image: linear-gradient(to left, black 0%, transparent 60%), linear-gradient(to bottom, transparent 0%, black 100%);
}

/* Typography scale (use rems for accessibility and scalability)
   Base font-size: var(--fs-body) = 1rem. Based on Figma text styles. */
:root {
  /* Display */
  --fs-display-lg: 3.75rem;   /* 60px */
  --lh-display-lg: 4.5rem;    /* 72px */
  --fs-display-sm: 3rem;      /* 48px */
  --lh-display-sm: 3.5rem;    /* 56px */

  /* Headings */
  --fs-h1: 2.25rem;           /* 36px */
  --lh-h1: 2.75rem;           /* 44px */
  --fs-h2: 2rem;              /* 32px */
  --lh-h2: 2.5rem;            /* 40px */
  --fs-h3: 1.5rem;            /* 24px */
  --lh-h3: 2.25rem;           /* 36px */

  /* Body */
  --fs-body: 1rem;            /* 16px */
  --lh-body: 1.5rem;          /* 24px */
  --fs-body-sm: 0.875rem;     /* 14px */
  --lh-body-sm: 1.25rem;      /* 20px */
  --fs-body-compact: 0.75rem; /* 12px */
  --lh-body-compact: 1rem;    /* 16px */

  /* Label */
  --fs-label-lg: 0.875rem;    /* 14px */
  --lh-label-lg: 1.25rem;     /* 20px */
  --fs-label: 0.75rem;        /* 12px */
  --lh-label: 1rem;           /* 16px */

  /* Common aliases */
  --fs-button: var(--fs-body-sm);
  --fs-table: var(--fs-body-sm);
}

/* Spacing scale (multiples of 4)
   Use these for consistent vertical rhythm */
:root {
  --sp-1: 0.25rem;   /* 4px */
  --sp-2: 0.5rem;    /* 8px */
  --sp-3: 0.75rem;   /* 12px */
  --sp-4: 1rem;      /* 16px */
  --sp-5: 1.25rem;   /* 20px */
  --sp-6: 1.5rem;    /* 24px */
  --sp-8: 2rem;      /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */
  --sp-20: 5rem;     /* 80px */
}

/* Color system: core neutrals, brands, shadows, interactions, forms, feedback */
:root {
  /* --- Neutral Scale --- */
  --n-0: #FFFFFF;
  --n-50: #F9FAFA;
  --n-100: #F0F4F4;
  --n-200: #E1E8E8;
  --n-300: #9BA9A9;
  --n-400: #7A8B8D;
  --n-500: #5E6E70;
  --n-600: #455456;
  --n-800: #233D4D;
  --n-900: #142224;

  /* --- Brand Petrol --- */
  --p-base: #034C53;
  --p-hover: #023D42;
  --p-active: #012629;
  --p-tint: #E6EDEE;

  /* --- Teal --- */
  --teal-base: #007074;
  --teal-hover: #005B5E;
  --teal-active: #004547;
  --teal-vivid: #00C4C8;
  --teal-light: #E6F1F1;

  /* --- Peach --- */
  --peach-base: #F79B72;
  --peach-hover: #DF8C67;
  --peach-active: #C77D5C;
  --peach-light: #FFF7F1;

  /* --- Accent Orange --- */
  --a-base: #FE7F2D;
  --a-hover: #E57229;
  --a-active: #CC6624;
  --a-light: #FFF3E6;
  --a-text: #142224;

  /* --- Semantic Red --- */
  --red-base: #DA1E28;
  --red-hover: #C41B24;
  --red-active: #AE1820;
  --red-light: #FBE8E9;

  /* --- Semantic Green --- */
  --green-base: #4A9A51;
  --green-hover: #428A49;
  --green-active: #3B7B41;
  --green-light: #EDF5EE;

  /* --- Functional UI Mappings --- */
  /* Text */
  --color-ink: var(--n-800);
  --color-text-secondary: var(--n-500);
  --color-text-disabled: var(--n-300);

  /* Backgrounds */
  --color-bg-body: var(--n-50);
  --color-bg-surface: var(--n-0);
  --color-bg-surface-alt: var(--n-100);
  --color-bg-surface-raised: var(--n-200);
  --color-bg-disabled: var(--n-200);

  /* Borders */
  --color-border-default: var(--n-200);
  --color-border-strong: var(--n-300);

  /* Brand / Pattern-safe variants */
  --color-brand-ink-base: var(--n-800);
  --color-brand-ink-wash: var(--n-100);
  --color-brand-ink-pattern: var(--n-50);

  --color-teal-base: var(--p-base);
  --color-teal-wash: var(--teal-light);
  --color-teal-pattern: var(--p-tint);

  --color-camel-base: var(--peach-base);
  --color-camel-wash: var(--peach-light);
  --color-camel-pattern: var(--a-light);

  /* Elevation / Shadows */
  --shadow-level-1: var(--shadow-sm);
  --shadow-level-2: var(--shadow-md);
  --shadow-level-3: 0 8px 16px rgba(20, 34, 36, 0.14);
  --shadow-sm: 0 2px 4px rgba(20, 34, 36, 0.08);
  --shadow-md: 0 4px 12px rgba(20, 34, 36, 0.12);

  /* Motion */
  --motion-fast: 150ms ease-in-out;

  /* --- Link Blue --- */
  --blue-base: #0066CC;
  --blue-hover: #004C99;
  --blue-active: #003366;
  --blue-visited: #551A8B;

  /* Interactive States */
  --color-link-default: var(--blue-base);
  --color-link-hover: var(--blue-hover);
  --color-link-active: var(--blue-active);
  --color-link-visited: var(--blue-visited);
  --color-focus-ring: var(--p-base); /* Brand petrol color for focus states */

  /* Hover tints: subtle translucent variations of base colours */
  --ink-hover-bg: rgba(35, 61, 77, 0.06);
  --camel-hover-bg: rgba(247, 155, 114, 0.12);
  --teal-hover-bg: rgba(0, 112, 116, 0.08);
  --surface-hover: rgba(35, 61, 77, 0.03);

  --btn-primary-bg: var(--p-base);
  --btn-primary-text: var(--n-0);
  --btn-primary-hover-bg: var(--p-hover);
  --btn-primary-disabled-bg: var(--n-200);
  --btn-primary-disabled-text: var(--n-300);

  --btn-secondary-text: var(--n-800);
  --btn-secondary-border: var(--n-800);
  --btn-secondary-hover-bg: var(--n-100);

  /* Forms */
  --input-bg: var(--n-100);
  --input-border: var(--n-300);
  --input-border-hover: var(--n-500);
  --input-border-focus: var(--p-base);
  --input-focus-ring: var(--teal-light);
  --input-inset-shadow: inset 0 1px 2px rgba(20, 34, 36, 0.06);

  --input-error-border: var(--red-base);
  --input-error-bg: var(--red-light);

  /* Semantic Feedback */
  --info-base: var(--teal-base);
  --info-bg: var(--teal-light);

  --success-base: var(--green-base);
  --success-bg: var(--green-light);

  --warning-base: var(--n-800); /* Dark text for accessibility - never use orange for text */
  --warning-bg: var(--a-light);
  --warning-accent: var(--a-base); /* Use only for icons/borders, not text */

  --error-base: var(--red-base);
  --error-bg: var(--red-light);
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable; /* Prevent layout shift when scrollbar appears/disappears */
}

body {
    font-family: var(--ff-sans);
    font-weight: 400;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--color-bg-body);
    color: var(--color-ink);
}

/* Default heading styles use the serif face */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-serif);
    font-weight: 400;
    margin: 0;
}

h1 {
    font-size: var(--fs-display-lg);
    line-height: var(--lh-display-lg);
}

h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
}

h3 {
    font-size: var(--fs-h3);
    line-height: var(--lh-h3);
}

/* ============================================
   Spacing System — Project Pages
   40px between sections/content blocks
   16px from headings to their content
   ============================================ */

/* Gap between hero and first/last section */
.content-container main {
    padding-top: var(--sp-10);
    padding-bottom: var(--sp-10);
}

/* Homepage: hero and video sections go flush to header/footer */
.content-container main > .hero:first-child {
    margin-top: calc(-1 * var(--sp-10));
    padding-top: var(--sp-10);
}

.content-container main > .video-section:last-child {
    margin-bottom: calc(-1 * var(--sp-10));
    padding-bottom: var(--sp-10);
}

/* Sections within project page main content */
.content-container main > section + section,
.hero-section + .research-section,
.research-section + .research-section,
.research-section + .project-wrapup,
.value-banner-section + .research-section {
    margin-top: var(--sp-10);
}

.research-section + footer,
.project-wrapup + footer {
    margin-top: var(--sp-10);
}

/* h2: 40px above (section-level heading), 16px below to content */
.content-container main h2,
.research-section h2 {
    margin-top: var(--sp-10);
    margin-bottom: var(--sp-4);
}

/* First h2 in a section shouldn't double up spacing */
.content-container main > section > h2:first-child,
.research-section > .research-header:first-child h2 {
    margin-top: 0;
}

/* h3: 40px above, 16px below */
.content-container main h3,
.research-section h3 {
    margin-top: var(--sp-10);
    margin-bottom: var(--sp-4);
}

/* h3 immediately after h2: tighter coupling */
.content-container main h2 + h3,
.research-section h2 + h3 {
    margin-top: var(--sp-4);
}

/* h3 inside research-header blocks: tighter spacing (same section) */
.research-header h3 {
    margin-top: var(--sp-6);
    margin-bottom: var(--sp-4);
}

/* Headings inside components should not inherit section-level spacing */
.postit-card h3,
.postit-grid > h3,
.tradeoff-side h3,
.complexity-layer-title,
.context-grid h3,
.core-value-panel-label {
    margin-top: 0;
    margin-bottom: var(--sp-2);
}

/* Paragraphs following headings: no extra top margin (heading's margin-bottom handles it) */
.content-container main h1 + p,
.content-container main h2 + p,
.content-container main h3 + p,
.research-section h2 + p,
.research-section h3 + p {
    margin-top: 0;
}

/* Images within project content: 40px above */
.content-container main > section > img,
.content-container main > section > figure,
.research-section > img,
.research-section > figure {
    margin-top: var(--sp-10);
}

/* Captions immediately after images: tight */
.content-container main img + .caption,
.research-section img + .caption {
    margin-top: var(--sp-2);
}

/* Content blocks: 40px above */
.content-container main .postit-grid,
.content-container main .tradeoff-graphic,
.content-container main .synthesis-split,
.content-container main .complexity-framework,
.content-container main .publish-images,
.content-container main .context-grid,
.content-container main .scenario1-grid,
.research-section .postit-grid,
.research-section .tradeoff-graphic,
.research-section .synthesis-split,
.research-section .complexity-framework,
.research-section .publish-images,
.research-section .context-grid,
.research-section .scenario1-grid,
.research-section .core-value-panels,
.research-section .dependency-chain {
    margin-top: var(--sp-10);
}

/* Zoomable and standalone images within project content: 40px above */
.content-container main .zoomable,
.research-section .zoomable,
.research-section > img {
    margin-top: var(--sp-10);
}

/* Images immediately after headings: tighter */
.content-container main h3 + img,
.content-container main h3 + .zoomable,
.research-section h3 + img,
.research-section h3 + .zoomable {
    margin-top: var(--sp-4);
}

/* Display text styles */
.display-lg {
    font-size: var(--fs-display-lg);
    line-height: var(--lh-display-lg);
}

.display-sm {
    font-size: var(--fs-display-sm);
    line-height: var(--lh-display-sm);
}

/* Body text variants */
.body-sm {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body-sm);
}

.body-compact {
    font-size: var(--fs-body-compact);
    line-height: var(--lh-body-compact);
}

/* Label styles */
.label-lg {
    font-size: var(--fs-label-lg);
    line-height: var(--lh-label-lg);
}

.label {
    font-size: var(--fs-label);
    line-height: var(--lh-label);
}

/* Typography helpers: blockquotes, callouts, small/meta, and table text */
blockquote {
    font-family: var(--ff-serif);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    font-style: italic;
    color: var(--color-ink);
    padding: var(--sp-3) var(--sp-4);
    border-left: 4px solid var(--color-teal-base);
    background-color: var(--color-bg-surface-alt);
    margin: 0 0 var(--sp-4) 0;
}

.callout {
    padding: var(--sp-3) var(--sp-4);
    border-radius: 4px;
    background-color: var(--color-bg-surface-raised);
    border-left: 4px solid var(--color-camel-base);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

/* Small/meta text */
.small, .meta {
    font-size: var(--fs-body-compact);
    line-height: var(--lh-body-compact);
    color: var(--color-text-secondary);
}

figcaption {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
    margin-top: var(--sp-2);
}

/* Table typography */
table, th, td {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body-sm);
}

/* Links: standard blue for inline text links */
a {
    color: var(--color-link-default);
    text-decoration: underline;
    transition: color var(--motion-fast);
}

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

a:active {
    color: var(--color-link-active);
}

a:visited {
    color: var(--color-link-visited);
}

/* Keyboard-only focus styles using :focus-visible */
a:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Fallback for browsers that don't support :focus-visible */
@supports not selector(:focus-visible) {
    a:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
        border-radius: 2px;
    }
}

/* Reset link styles for navigation, cards, and buttons */
.header-container nav a,
.project-card,
footer nav a,
footer ul a,
a.cta-button,
a.btn-primary,
a.btn-secondary {
    color: inherit;
    text-decoration: none;
}

.header-container nav a:visited,
.project-card:visited,
footer nav a:visited,
footer ul a:visited,
a.cta-button:visited,
a.btn-primary:visited {
    color: inherit;
}

/* Branded link utility: use when you want camel brand color */
a.link--brand, .link--brand {
    color: var(--color-camel-base);
}

a.link--brand:hover, .link--brand:hover {
    color: var(--color-camel-base);
    text-decoration: underline;
}

/* Primary action button styling */
.btn-primary,
.cta-button,
a.cta-button,
a.cta-button:visited {
    height: 40px; /* Fixed height */
    padding: 0 var(--sp-6); /* 24px horizontal padding */
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 6px; /* 6px corner radius */
    font-size: var(--fs-button);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1); /* 4px spacing between icon and text */
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
    width: fit-content; /* Size to content */
    align-self: flex-start; /* Prevent stretching in flex containers */
}

.btn-primary svg,
.cta-button svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-primary:hover svg,
.cta-button:hover svg {
    transform: translateY(2px);
}

.btn-primary:hover,
.cta-button:hover,
a.cta-button:hover {
    background-color: var(--btn-primary-hover-bg);
    color: var(--btn-primary-text);
    text-decoration: none;
}

.btn-primary:disabled {
    background-color: var(--btn-primary-disabled-bg);
    color: var(--btn-primary-disabled-text);
    cursor: not-allowed;
}

/* ============================================
   Keyboard Focus States (:focus-visible)
   Using brand petrol color for accessibility
   ============================================ */

/* Primary buttons and CTA buttons */
.btn-primary:focus-visible,
.cta-button:focus-visible,
a.cta-button:focus-visible,
button[type="submit"]:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
}

@supports not selector(:focus-visible) {
    .btn-primary:focus,
    .cta-button:focus,
    a.cta-button:focus,
    button[type="submit"]:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
    }
}

/* Navigation links */
.header-container nav a:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

@supports not selector(:focus-visible) {
    .header-container nav a:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
        border-radius: 4px;
    }
}

/* Logo link */
.header-container .logo:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

@supports not selector(:focus-visible) {
    .header-container .logo:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
        border-radius: 4px;
    }
}

/* Project cards */
.project-card:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
    border-radius: 8px;
}

@supports not selector(:focus-visible) {
    .project-card:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
        border-radius: 8px;
    }
}

/* Footer links */
footer ul li a:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

@supports not selector(:focus-visible) {
    footer ul li a:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
        border-radius: 4px;
    }
}

/* Form inputs - use darker border for all focus states */
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus,
.contact-form-container input:focus,
.contact-form-container textarea:focus {
    border-color: var(--input-border-focus) !important;
    outline: none !important;
}

/* Explicitly remove thick outline for keyboard focus on form inputs */
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
textarea:focus-visible,
select:focus-visible,
.contact-form-container input:focus-visible,
.contact-form-container textarea:focus-visible {
    border-color: var(--input-border-focus) !important;
    outline: none !important;
}

/* Error summary */
.error-summary:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

@supports not selector(:focus-visible) {
    .error-summary:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 2px;
    }
}

/* Error summary links */
.error-summary a:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
    background-color: var(--p-tint);
}

@supports not selector(:focus-visible) {
    .error-summary a:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 2px;
        background-color: var(--p-tint);
    }
}

/* Ensure footer hover uses color system */
footer ul li a:hover {
    background-color: var(--ink-hover-bg);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(3, 76, 83, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.back-to-top:hover {
    background-color: var(--btn-primary-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(3, 76, 83, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
}

@supports not selector(:focus-visible) {
    .back-to-top:focus {
        outline: 3px solid var(--color-focus-ring);
        outline-offset: 3px;
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--sp-6);
    border-bottom: 1px solid var(--color-border-default);
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
}


.header-container .logo {
    flex: 0 0 auto;
    font-family: var(--ff-serif);
    color: var(--p-base);
    text-decoration: none;
    font-size: var(--fs-h3);
    line-height: 1.2;
    font-weight: normal;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.header-container .logo:visited,
.header-container .logo:active,
.header-container .logo:focus,
.header-container .logo:hover {
    color: var(--p-base);
    text-decoration: none;
}

.back-button {
    text-decoration: none;
    color: var(--n-0);
    font-size: var(--fs-body);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--sp-16);
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.back-button:visited,
.back-button:active {
    color: var(--n-0);
}

.back-button:hover {
    opacity: 1;
}

.back-button svg {
    flex-shrink: 0;
}

.header-container nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
}

.header-container nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center; /* Align items vertically */
}

.header-container nav ul li {
    margin-left: var(--sp-6); /* Add space between nav items */
}

.header-container nav ul li a {
    text-decoration: none;
    color: inherit;
    padding: 0 var(--sp-5);
    height: 48px;
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 0;
}

.header-container nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: currentColor; /* Use the current text color */
    transition: width 0.3s ease; /* Smooth transition for the underline */
}

.header-container nav ul li a:hover::after {
    width: 0; /* No underline on hover */
}

.header-container nav ul li a:hover {
    background-color: var(--ink-hover-bg);
    border-radius: 0;
    box-shadow: none;
}

.header-container nav ul li a.active::after {
    width: 100%; /* Keep the underline for the active link */
}

.content-container {
    max-width: 1200px; /* Set a sensible max-width for the content */
    margin: 0 auto;
    padding: 0 var(--sp-6); /* Add padding to ensure content doesn't touch the edges */
}

.content-container main > section > h1,
.content-container main > section > h2,
.content-container main > section > h3,
.content-container main > section > p,
.content-container main > section > ol,
.content-container main > section > ul {
    max-width: 720px;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-6) 0; /* Add padding to the hero section */
    margin-bottom: var(--sp-10); /* 40px gap to next section */
}

.hero-text {
    flex: 1;
    display: flex;
    flex-direction: column; /* Stack text elements vertically */
    padding-right: var(--sp-6); /* Add some space between text and image */
}

.hero-text .eyebrow-text {
    margin-bottom: 0; /* Reset default margin, use gap instead */
}

.hero-text h1 {
    margin-bottom: var(--sp-6); /* 24px between h1 and text */
}

.hero-text > p {
    margin-top: 0;
    margin-bottom: var(--sp-10); /* 40px between text and button */
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px; /* Add corner radius to images */
}

.project-cards-container {
    display: flex;
    flex-direction: column; /* Stack cards vertically */
    gap: var(--sp-10);
    padding-bottom: var(--sp-6); /* Padding only at the bottom */
}

.project-card {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--n-0);
    border: 1px solid rgba(3, 76, 83, 0.25);
    box-shadow: none;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transition: background-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast);
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
}

.project-card:hover {
    background-color: var(--n-50); /* Subtle off-white on hover */
    box-shadow: var(--shadow-level-3); /* Elevated shadow on hover */
    transform: translateY(-2px); /* Subtle lift effect */
    text-decoration: none; /* No underline on hover */
}

.project-card-image-wrapper {
    width: 40%;
    min-height: 100%;
    position: relative;
    background-color: var(--color-teal-wash);
    background-image: radial-gradient(circle, rgba(0, 112, 116, 0.15) 1px, transparent 1px);
    background-size: 16px 16px;
    border-radius: 4px 0 0 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
}

.project-card-image-wrapper img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

.project-card-content {
    padding: var(--sp-8);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-card .project-card-content h3 {
    margin-top: 0;
    margin-bottom: var(--sp-2);
}

.project-card-content .tags {
    margin-top: var(--sp-2);
}

.project-card-content p {
    margin: var(--sp-3) 0 0;
}

/* Project card stats container */
.project-card-stats {
    display: flex;
    gap: var(--sp-8);
    margin-top: var(--sp-10);
}

.project-card-stat {
    display: flex;
    flex-direction: column;
    padding-left: var(--sp-4);
    border-left: 4px solid var(--peach-base); /* Vertical line next to numbers */
}

.project-card-stat-number {
    font-size: 2.5rem; /* 40px */
    font-weight: 400;
    font-family: var(--ff-serif);
    color: var(--color-ink);
    line-height: 1;
    margin-bottom: var(--sp-2);
}

.project-card-stat-label {
    font-size: var(--fs-body-sm);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* ============================================
   Breadcrumb Navigation
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) 0;
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body-sm);
}

.breadcrumb a {
    color: var(--color-link-default);
    text-decoration: none;
}

.breadcrumb a:visited {
    color: var(--color-link-visited);
}

.breadcrumb a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--color-text-secondary);
    user-select: none;
}

.breadcrumb-current {
    color: var(--color-ink);
    font-weight: 500;
}

/* Responsive breadcrumbs */
@media (max-width: 480px) {
    .breadcrumb {
        font-size: var(--fs-body-compact);
        padding: var(--sp-3) 0;
        flex-wrap: wrap;
    }
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.tag {
    background-color: var(--n-200);
    color: var(--n-800);
    padding: var(--sp-2);
    border-radius: 6px;
    border: none;
    font-size: var(--fs-label);
    line-height: var(--lh-label);
    font-weight: 400;
    display: inline-block;
    box-sizing: border-box;
}

.contact-form {
    padding: var(--sp-6) 0; /* Add padding around the contact form section */
}

.contact-form-container {
    max-width: 600px; /* Set a maximum width for the form container */
    /* Removed margin: 0 auto; to prevent centering */
}

.contact-form-container label {
    margin-bottom: var(--sp-2); /* 8px between label and form field */
    font-weight: 600;
}

.contact-form-container input,
.contact-form-container textarea {
    margin-bottom: 0; /* Remove bottom margin to control spacing with error messages */
    padding: 10px; /* Adjust padding to match GOV.UK design system */
    border: 2px solid var(--input-border); /* Use design system input border */
    border-radius: 6px;
    font-size: var(--fs-body); /* 16px base */
    width: 100%; /* Ensure inputs take full width */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    background-color: var(--input-bg); /* Slightly darker to appear recessed */
    box-shadow: var(--input-inset-shadow); /* Subtle inner shadow for depth */
}

.contact-form-container textarea {
    resize: none; /* Make the textarea non-resizable */
    height: 200px; /* Set a fixed height for the message box */
}

.contact-form-container .message-label {
    margin-top: var(--sp-6); /* Ensure the message field is 24px beneath whatever is above it */
}

.contact-form-container .error-message {
    margin-top: var(--sp-2); /* 8px between form field and error message */
    margin-bottom: 0; /* Remove bottom margin to control spacing with next element */
    color: var(--error-base);
    font-weight: bold;
    display: none; /* Hide error messages by default */
}

.contact-form-container .form-group {
    margin-bottom: var(--sp-6); /* 24px between form groups */
}

.contact-form-container .form-group:last-of-type {
    margin-bottom: var(--sp-10); /* 40px between last form group and button */
}

.contact-form-container button {
    margin-top: var(--sp-10); /* 40px between button and whatever is above it */
    height: 40px; /* Fixed height */
    padding: 0 var(--sp-6); /* 24px horizontal padding, vertical centered by height */
    background-color: var(--btn-primary-bg); /* Primary button color */
    color: var(--btn-primary-text);
    border: none;
    border-radius: 6px; /* 6px corner radius */
    font-size: var(--fs-button);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto; /* Ensure the button width is dynamic */
    display: inline-flex; /* Use flexbox for vertical centering */
    align-items: center; /* Center text vertically */
    justify-content: center; /* Center text horizontally */
    white-space: nowrap; /* Prevents text from wrapping */
}

.contact-form-container button:hover {
    background-color: var(--btn-primary-hover-bg); /* Slightly darker shade for hover effect */
}

.error-summary {
    border: 2px solid var(--error-base);
    padding: 15px;
    background-color: var(--error-bg);
    color: var(--color-ink);
    margin-bottom: var(--sp-5);
}

.error-summary p {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-weight: bold;
    margin-bottom: var(--sp-3);
}

.error-summary ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.error-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    margin-right: var(--sp-2);
}

.error-summary ul li {
    margin-bottom: 5px;
}

.error-summary ul li a {
    text-decoration: underline;
    color: var(--color-link-default);
}

.error-message {
    color: var(--error-base);
    font-weight: bold;
    margin-top: var(--sp-2); /* Adjust margin to 8px to match the requirement */
}

footer {
    background-color: var(--n-200);
    color: var(--color-ink);
    padding: var(--sp-4) var(--sp-6);
    margin-top: 0;
    text-align: center;
}

footer ul {
    list-style: none;
    padding: 0;
    margin-bottom: var(--sp-4);
    display: flex;
    justify-content: center;
    gap: var(--sp-6);
}

footer ul li {
    margin: 0;
}

footer ul li a {
    text-decoration: none;
    color: inherit;
    padding: var(--sp-3) var(--sp-5);
    display: flex;
    align-items: center;
    border-radius: 0;
}

footer ul li a:hover {
    background-color: var(--ink-hover-bg);
}

/* Video section base styles */
.video-section {
    padding: 0 0 var(--sp-16);
}

.video-section h2 {
    margin-bottom: var(--sp-6);
}

.video-section p {
    margin-bottom: var(--sp-10);
}

/* Why section — 2-col icon + text grid */
.why-section {
    padding: var(--sp-16) var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.why-section h2 {
    margin-bottom: var(--sp-8);
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8) var(--sp-16);
}

.why-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
}

.why-icon {
    flex-shrink: 0;
    color: var(--color-ink);
}

.why-item p {
    margin: 0;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

.why-item strong {
    font-weight: 600;
}

/* Work history section base styles */
.work-history {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-6);
}

.work-history h2 {
    margin-bottom: var(--sp-6);
}

/* Case study section base styles */
.case-study {
    padding: var(--sp-6) 0;
}

.case-study h2 {
    margin-bottom: var(--sp-6);
}

.case-study article {
    margin-bottom: var(--sp-8);
}

.case-study h3 {
    margin-bottom: var(--sp-3);
}

/* Activities list in case study */
.activities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activities-list li {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
    align-items: flex-start;
}

.activities-list img {
    max-width: 100%;
    border-radius: 4px;
    flex-shrink: 0;
}

.activities-list li {
    display: flex;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
    align-items: flex-start;
}

.activities-list img {
    max-width: 200px;
    border-radius: 4px;
    flex-shrink: 0;
}

.activities-list h4 {
    margin-bottom: var(--sp-2);
}

.activities-list p {
    margin: 0;
}

/* Insights list */
.insights-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
}

.insights-list li {
    flex: 1 1 calc(33.333% - 16px);
    min-width: 200px;
}

/* Key stats section */
.key-stats {
    padding: var(--sp-6) 0;
}

.key-stats h2 {
    margin-bottom: var(--sp-4);
}

.key-stats ul {
    padding-left: var(--sp-6);
}

/* Eyebrow text */
.eyebrow-text {
    font-size: var(--fs-body-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: var(--sp-2);
}

/* Featured work section */
.featured-work {
    padding-bottom: 0;
}

.featured-work h2 {
    margin-bottom: var(--sp-6); /* 24px gap to cards */
}

/* Timeline styles for about page */
.timeline, .company-timeline { list-style: none; margin: 0; padding: 0; }
.timeline {
    margin: var(--sp-10) 0;
}
/* Remove About page timeline overrides so they don't affect other timelines */

.company-group {
    margin-bottom: 36px;
}
.company-header {
    margin-left: 0; /* keep header aligned with content */
    margin-bottom: var(--sp-3);
}
.company-name { margin: 0; font-size: 1.125rem; }
.company-meta { margin: 0; color: var(--color-text-secondary); }
.company-timeline { margin-left: 0; }

/* Two-column layout for about page timeline */
.about-page .timeline-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: var(--sp-4);
    align-items: start;
    padding: 0;
    border-left: none;
}

.about-page .timeline-date {
    font-size: var(--fs-body-sm);
    color: var(--color-text-secondary);
    text-align: right;
    padding-right: var(--sp-2);
    white-space: nowrap;
}

.about-page .timeline-content,
.about-page .timeline-container .timeline-content {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    max-width: 900px;
    box-shadow: none;
}
.about-page .timeline-container .timeline-node {
    top: 1px;
}
.about-page .timeline-content h3 { margin-bottom: var(--sp-2); }
.about-page .timeline-content .meta { margin-bottom: var(--sp-2); color: var(--color-text-secondary); font-size: var(--fs-body-compact); }
.about-page .timeline-content .description { margin: 0; line-height: var(--lh-body); }
.about-page .timeline-label { display: none; }

/* Larger heading for employment history */
.about-page .timeline-header h2 {
    font-size: var(--fs-display-sm);
    line-height: var(--lh-display-sm);
}

/* Replace fixed line with per-item segments so heading size has no effect */
.about-page .timeline-line { display: none; }

.about-page .timeline-container .timeline-item::before {
    content: '';
    position: absolute;
    left: 35px;
    top: 0;
    bottom: -40px;
    width: 2px;
    background: var(--n-200);
    z-index: 0;
}

.about-page .timeline-container .timeline-item:last-child::before {
    display: none;
}

@media (min-width: 1200px) {
    .about-page .timeline-item { grid-template-columns: 180px 1fr; }
}

@media (max-width: 900px) {
    /* Removed left: 8px; for .timeline-node.has-icon to fix alignment */
    .about-page .timeline-date {
        position: static;
        width: auto;
        text-align: left;
        margin-bottom: 6px;
        display: block;
    }
    .about-page .timeline-content { padding: var(--sp-3) 0 0 0; }
}

/* ============================================
   Timeline Component (Project pages)
   ============================================ */
.timeline-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-10) var(--sp-6);
}

.timeline-container {
    max-width: 800px;
    margin: 0;
    position: relative;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: 30px;
    padding-left: var(--sp-4);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    background: var(--color-bg-surface, white);
    border: 2px solid var(--color-border-default, #e0e0e0);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.timeline-month {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-ink, #1a1a1a);
}

.timeline-line {
    position: absolute;
    left: 35px;
    top: 80px;
    bottom: 0;
    width: 2px;
    background: var(--color-border-default, #e0e0e0);
}

.timeline-container .timeline-item {
    display: flex;
    margin-bottom: var(--sp-10);
    position: relative;
    padding-left: 70px;
    line-height: normal;
    font-size: initial;
}

.timeline-container .timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-container .timeline-node {
    display: block;
    position: absolute;
    left: 27px;
    top: 8px;
    width: 18px;
    height: 18px;
    background: var(--color-text-secondary, #6b7280);
    border: 3px solid var(--color-bg-surface, white);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--color-border-default, #e0e0e0);
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    z-index: 2;
}

.timeline-container .timeline-node.has-icon {
    width: 36px;
    height: 36px;
    left: 18px;
    top: 0;
    background: var(--color-teal-base, #4a7c9c);
    border: 3px solid var(--color-bg-surface, white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-bg-surface, white);
    font-size: var(--fs-body);
}

.timeline-container .timeline-content {
    flex: 1;
    background: var(--color-bg-surface, white);
    border: 1px solid var(--color-border-default, #e0e0e0);
    border-radius: 8px;
    padding: var(--sp-5);
    box-shadow: var(--shadow-level-1, 0 1px 3px rgba(0, 0, 0, 0.05));
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
    font-size: var(--fs-body-sm, 13px);
    color: var(--color-text-secondary, #6b7280);
}

.timeline-label {
    padding: 2px var(--sp-2);
    background: var(--color-bg-surface-alt, #f3f4f6);
    border-radius: 4px;
    font-weight: 500;
}

.timeline-container .timeline-date {
    color: var(--color-text-secondary, #6b7280);
    text-align: left;
    padding-right: 0;
}

.timeline-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-ink, #1a1a1a);
    margin-bottom: var(--sp-4);
}

.timeline-section {
    margin-bottom: var(--sp-4);
}

.timeline-section:last-child {
    margin-bottom: 0;
}

/* ============================================
   Timeline Colored Variant
   ============================================ */
.timeline-colored .timeline-icon {
    background: var(--p-base);
    border-color: var(--p-hover);
    color: var(--n-0);
}

.timeline-colored .timeline-line {
    background: var(--n-200);
}

.timeline-colored .timeline-node {
    background: var(--teal-base); /* Teal inner */
    border: 3px solid var(--n-0); /* White middle ring */
    box-shadow: 0 0 0 2px var(--n-200); /* Light outer ring */
}

.timeline-colored .timeline-content {
    background: var(--n-0);
    border-color: var(--n-200);
}

.timeline-colored .timeline-label {
    background: var(--teal-light);
    color: var(--p-base);
}

.timeline-colored .sub-item-status {
    background: var(--peach-light);
    color: var(--peach-active);
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-ink, #1a1a1a);
    margin-bottom: var(--sp-2);
}

.section-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-item {
    padding-left: var(--sp-5);
    position: relative;
    margin-bottom: var(--sp-2);
    font-size: var(--fs-body-sm, 14px);
    line-height: 1.6;
    color: var(--color-ink, #374151);
}

.section-item:last-child {
    margin-bottom: 0;
}

.section-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--color-teal-base, #3b82f6);
    border-radius: 50%;
}

.section-item a {
    color: var(--color-text-secondary, #6b7280);
    text-decoration: none;
    margin-left: var(--sp-1);
}

.section-item a:hover {
    text-decoration: underline;
}

.sub-item-status {
    display: inline-block;
    padding: 2px var(--sp-2);
    background: var(--info-bg, #dbeafe);
    color: var(--info-base, #1e40af);
    border-radius: 4px;
    font-size: var(--fs-body-compact, 12px);
    font-weight: 500;
    margin-top: var(--sp-1);
}

@media (max-width: 900px) {
    /* No override needed, column layout is default */
    /* Removed left: 17px for .timeline-node to fix alignment */
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First Breakpoints
   ============================================ */

/* Tablet and below (max-width: 1024px) */
@media (max-width: 1024px) {
    .hero {
        gap: var(--sp-6);
    }

    .hero-text {
        padding-right: var(--sp-4);
    }

    .project-cards-container {
        gap: var(--sp-4);
    }

    .project-card {
        flex: 1 1 calc(50% - 16px);
    }
}

/* Tablet portrait and large phones (max-width: 768px) */
@media (max-width: 768px) {
    /* Typography scaling for smaller screens */
    :root {
        --fs-display-lg: 2.5rem;   /* 40px down from 60px */
        --lh-display-lg: 3rem;     /* 48px down from 72px */
        --fs-display-sm: 2rem;     /* 32px down from 48px */
        --lh-display-sm: 2.5rem;   /* 40px down from 60px */
        --fs-h1: 1.75rem;          /* 28px down from 36px */
        --lh-h1: 2.25rem;          /* 36px down from 44px */
        --fs-h2: 1.5rem;           /* 24px down from 32px */
        --lh-h2: 2rem;             /* 32px down from 40px */
        --fs-h3: 1.25rem;          /* 20px down from 24px */
        --lh-h3: 1.75rem;          /* 28px down from 32px */
    }

    h1 {
        font-size: var(--fs-display-lg);
        line-height: var(--lh-display-lg);
    }

    /* Header - horizontal layout with tighter spacing */
    .header-container {
        padding: var(--sp-3) var(--sp-4);
    }

    .header-container nav ul li {
        margin-left: var(--sp-2);
    }

    .header-container nav ul li a {
        padding: 0 8px;
        font-size: var(--fs-body-sm);
    }

    /* Hide Home nav item on tablet - logo serves same purpose */
    .header-container nav ul li:first-child {
        display: none;
    }

    /* Content container */
    .content-container {
        padding: 0 16px;
    }

    /* Hero section - stack vertically */
    .hero {
        flex-direction: column;
        padding: var(--sp-4) 0;
    }

    .hero-text {
        padding-right: 0;
        order: 2;
        text-align: center;
    }

    .hero-text .cta-button {
        align-self: center;
    }

    .hero-image {
        order: 1;
        width: 100%;
        margin-bottom: var(--sp-4);
    }

    .hero-image img {
        max-width: 100%;
        height: auto;
    }

    /* Project cards - single column */
    .project-cards-container {
        flex-direction: column;
        gap: var(--sp-4);
    }

    .project-card {
        flex: 1 1 100%;
        flex-direction: column; /* Stack vertically on tablet */
        min-height: auto;
    }

    .project-card-image-wrapper {
        width: 100%;
        height: 200px;
        min-height: auto;
        border-radius: 4px 4px 0 0;
        padding: var(--sp-4);
    }

    .project-card-content {
        padding: var(--sp-4);
    }

    .project-card-stats {
        gap: var(--sp-6);
        margin-top: var(--sp-4);
        margin-bottom: var(--sp-4);
    }

    .project-card-stat-number {
        font-size: var(--fs-h2);
    }

    /* Tags - allow wrapping */
    .tags {
        flex-wrap: wrap;
    }

    /* Video section */
    .video-section iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    /* Contact form */
    .contact-form-container {
        max-width: 100%;
    }

    /* Footer */
    footer {
        padding: var(--sp-4);
        margin-top: var(--sp-8);
    }

    footer ul {
        flex-wrap: wrap;
        gap: var(--sp-3);
        justify-content: center;
    }

    footer ul li a {
        padding: var(--sp-2) var(--sp-3);
    }

    /* Work history section */
    .work-history {
        padding: 0 16px;
    }

    /* Case study articles */
    .case-study article {
        padding: var(--sp-4) 0;
    }

    .activities-list li {
        flex-direction: column;
    }

    .activities-list img {
        max-width: 100%;
    }
}

/* Mobile phones (max-width: 480px) */
@media (max-width: 480px) {
    /* Further typography scaling */
    :root {
        --fs-display-lg: 2rem;     /* 32px */
        --lh-display-lg: 2.5rem;   /* 40px */
        --fs-display-sm: 1.5rem;   /* 24px */
        --lh-display-sm: 2rem;     /* 32px */
        --fs-h1: 1.5rem;           /* 24px */
        --lh-h1: 2rem;             /* 32px */
        --fs-h2: 1.25rem;          /* 20px */
        --lh-h2: 1.5rem;           /* 24px */
        --fs-h3: 1.125rem;         /* 18px down from 24px */
        --lh-h3: 1.5rem;           /* 24px down from 32px */
    }

    /* Header - compact for mobile */
    .header-container {
        padding: var(--sp-3) var(--sp-3);
        gap: var(--sp-2);
    }

    .header-container nav ul li a {
        font-size: var(--fs-body-sm);
        padding: 0 6px;
    }

    /* Content */
    .content-container {
        padding: 0 12px;
    }

    /* Hero */
    .hero {
        padding: var(--sp-3) 0;
    }

    .hero-text h1 {
        font-size: var(--fs-display-lg);
        line-height: var(--lh-display-lg);
    }

    .hero-text p {
        font-size: var(--fs-body-sm);
    }

    /* CTA Button */
    .cta-button,
    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .hero-text .cta-button {
        align-self: stretch;
    }

    /* Project cards */
    .project-card {
        flex-direction: column;
        min-height: auto;
    }

    .project-card-image-wrapper {
        width: 100%;
        height: 160px;
        min-height: auto;
        border-radius: 4px 4px 0 0;
    }

    .project-card-content {
        padding: var(--sp-3);
    }

    .project-card-content h3 {
        font-size: var(--fs-h3);
    }

    .project-card-content p {
        font-size: var(--fs-body-sm);
    }

    .project-card-stats {
        gap: var(--sp-4);
        margin-top: var(--sp-3);
        margin-bottom: var(--sp-3);
    }

    .project-card-stat-number {
        font-size: 1.75rem;
    }

    /* Tags */
    .tag {
        font-size: 0.625rem; /* 10px */
        padding: 2px 6px;
    }

    /* Featured work section */
    .featured-work h2 {
        font-size: var(--fs-h2);
    }

    /* Video section */
    .video-section {
        padding: var(--sp-4) 0;
    }

    .video-section h2 {
        font-size: var(--fs-h2);
    }

    .video-section p {
        font-size: var(--fs-body-sm);
    }

    /* Why section */
    .why-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }

    /* Contact form */
    .contact-form h1 {
        font-size: var(--fs-h1);
    }

    .contact-form-container input,
    .contact-form-container textarea {
        font-size: var(--fs-body); /* Prevent iOS zoom on focus */
    }

    .contact-form-container button {
        width: 100%;
    }

    .contact-form-container .form-group:last-of-type {
        margin-bottom: var(--sp-6);
    }

    .contact-form-container button {
        margin-top: var(--sp-6);
    }

    /* Error summary */
    .error-summary {
        padding: var(--sp-3);
        font-size: var(--fs-body-sm);
    }

    /* Footer */
    footer {
        padding: var(--sp-3);
        margin-top: var(--sp-6);
    }

    footer ul {
        flex-direction: column;
        gap: var(--sp-2);
        align-items: center;
    }

    footer ul li a {
        padding: var(--sp-3) var(--sp-4);
        display: block;
        text-align: center;
    }

    footer p {
        font-size: var(--fs-body-sm);
        margin-top: var(--sp-3);
    }

    /* Timeline adjustments for mobile */
@media (max-width: 600px) {
    .timeline-container {
        padding: 0 8px;
    }
    .timeline-container .timeline-item {
        padding-left: var(--sp-10);
    }
    .timeline-line {
        left: 26px;
    }
    .about-page .timeline-container .timeline-item::before {
        left: 18px;
    }
    .timeline-container .timeline-node {
        left: 10px;
        /* width and height unchanged for consistent alignment */
    }
    .timeline-container .timeline-node.has-icon {
        left: 4px;
        /* width, height, font-size unchanged for consistent alignment */
    }
    .timeline-container .timeline-content {
        padding: var(--sp-3);
    }
}

    .timeline-title {
        font-size: var(--fs-body);
    }

    .timeline-header {
        padding-left: var(--sp-2);
    }

    .timeline-icon {
        width: 32px;
        height: 32px;
        font-size: var(--fs-body-sm);
    }

    .timeline-month {
        font-size: var(--fs-body-sm);
    }

    /* Work history section mobile */
    .work-history {
        padding: 0 12px;
    }

    .company-group {
        margin-bottom: var(--sp-6);
    }

    .company-name {
        font-size: var(--fs-body);
    }

    /* Blockquotes */
    blockquote {
        padding: var(--sp-3) var(--sp-3);
        margin-bottom: var(--sp-3);
    }

    /* Callouts */
    .callout {
        padding: var(--sp-3) var(--sp-3);
    }

    /* Key stats section */
    .key-stats {
        padding: var(--sp-4) 0;
    }

    .key-stats ul {
        padding-left: var(--sp-5);
    }

    /* Case study sections */
    .case-study h2 {
        font-size: var(--fs-h2);
    }

    .case-study h3 {
        font-size: var(--fs-h3);
    }

    .insights-list {
        flex-direction: column;
    }

    .insights-list li {
        width: 100%;
    }
}

/* Small phones (max-width: 360px) */
@media (max-width: 360px) {
    :root {
        --fs-display-lg: 1.75rem;  /* 28px */
        --lh-display-lg: 2.25rem;  /* 36px */
        --fs-display-sm: 1.25rem;  /* 20px */
        --lh-display-sm: 1.75rem;  /* 28px */
        --fs-h1: 1.375rem;         /* 22px */
        --lh-h1: 1.75rem;          /* 28px */
        --fs-h2: 1.125rem;         /* 18px */
        --lh-h2: 1.5rem;           /* 24px */
        --fs-h3: 1rem;             /* 16px */
        --lh-h3: 1.375rem;         /* 22px */
    }

    .header-container nav ul li a {
        padding: 6px var(--sp-2);
        font-size: 0.6875rem; /* 11px */
    }

    .content-container {
        padding: 0 8px;
    }

    .project-card-image-wrapper {
        height: 140px;
    }

    .tag {
        font-size: 0.5625rem; /* 9px */
        padding: 2px var(--sp-1);
    }
}

/* ============================================
   Utility classes for responsive visibility
   ============================================ */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

/* ============================================
   Responsive images utility
   ============================================ */
img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Zoomable images + lightbox
   ============================================ */
.zoomable {
    cursor: zoom-in;
    position: relative;
}

/* Tap-to-zoom hint on touch devices */
@media (hover: none) and (pointer: coarse) {
    .zoomable {
        cursor: default;
    }
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    -webkit-overflow-scrolling: touch;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    touch-action: manipulation;
    border-radius: 4px;
    user-select: none;
    -webkit-user-select: none;
    cursor: zoom-in;
    transition: max-width 0.2s ease, max-height 0.2s ease;
}

.lightbox-img.zoomed {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--n-0);
    font-size: var(--fs-h3);
    cursor: pointer;
    line-height: 1;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Responsive video container
   ============================================ */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   Project Template Page Styles
   ============================================ */
.hero-section {
    padding: var(--sp-10) 0;
    min-height: 500px;
    background-color: var(--color-teal-base);
    background-image: linear-gradient(to bottom, var(--color-teal-base), rgba(1, 38, 41, 0.55));
    position: relative;
    display: flex;
    align-items: center;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-16);
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-wrapper > .back-button {
    width: 100%;
    margin-bottom: -40px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(255, 255, 255, 0.20) 19px, rgba(255, 255, 255, 0.20) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(255, 255, 255, 0.20) 19px, rgba(255, 255, 255, 0.20) 20px);
    background-size: 20px 20px;
    opacity: 0.6;
    mask-image:
        linear-gradient(to bottom, transparent 0%, black 100%),
        linear-gradient(to right, transparent 0%, transparent 50%, black 100%);
    mask-composite: intersect;
    -webkit-mask-image:
        linear-gradient(to bottom, transparent 0%, black 100%),
        linear-gradient(to right, transparent 0%, transparent 50%, black 100%);
    -webkit-mask-composite: source-in;
    pointer-events: none;
}

.hero-content {
    flex: 1;
    max-width: 500px;
}

.hero-content .eyebrow-text {
    font-size: var(--fs-body-compact);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
}

.hero-content h1 {
    margin: var(--sp-5) 0;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--color-bg-surface);
    font-size: 2.5rem;
    line-height: 1.2;
}

.hero-content p {
    margin: var(--sp-3) 0;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-bg-surface);
}

.hero-stats {
    display: flex;
    gap: 0;
    margin-top: var(--sp-10);
    margin-bottom: 0;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: 0 var(--sp-6);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-stat:first-child {
    padding-left: 0;
    border-left: none;
}

.hero-stat-label {
    font-size: var(--fs-body-compact);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
}

.hero-stat-number {
    font-size: var(--fs-body-sm);
    font-weight: 400;
    color: var(--color-bg-surface);
    line-height: 1.3;
    margin: 0;
}

.hero-section .hero-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section .hero-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.tabs-section {
    border-bottom: 1px solid var(--color-border-default);
    padding: 0 40px;
    margin: 0;
}

.tabs {
    display: flex;
    gap: var(--sp-10);
    list-style: none;
    margin: 0;
    padding: 0;
}

.tabs li {
    margin: 0;
}

.tabs a {
    display: block;
    padding: var(--sp-5) 0;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--fs-body-sm);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tabs a.active {
    color: var(--color-ink);
    border-bottom-color: var(--color-camel-base);
}

.tabs a:hover {
    color: var(--color-ink);
}

.tab-number {
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-right: var(--sp-2);
}

.main-content {
    display: flex;
    gap: var(--sp-16);
    padding: var(--sp-16) var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.content-text {
    flex: 0 1 400px;
}

.content-text h2 {
    font-size: var(--fs-h1);
    line-height: var(--lh-h1);
    color: var(--color-ink);
}

.stats-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-10);
}

.stat-item {
    padding-bottom: var(--sp-5);
}

.stat-number {
    font-size: var(--fs-display-sm);
    line-height: var(--lh-display-sm);
    font-weight: 300;
    color: var(--color-camel-base);
    margin-bottom: 10px;
}

.stat-label {
    font-size: var(--fs-body-sm);
    color: var(--color-text-secondary);
    line-height: var(--lh-body);
}

.stat-label a {
    color: var(--color-camel-base);
    text-decoration: underline;
}

.description-text {
    grid-column: 1 / -1;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
}

.best-practices {
    padding: var(--sp-16) var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.best-practices h2 {
    padding-bottom: var(--sp-6);
    border-bottom: 1px solid var(--color-border-default);
    margin-bottom: var(--sp-10);
}

.practice-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--sp-16);
    padding: var(--sp-10) 0;
    border-bottom: 1px solid var(--color-border-default);
    align-items: start;
}

.practice-item:last-of-type {
    border-bottom: none;
}

.practice-title {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--color-ink);
    margin: 0;
}

.practice-description {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
    margin: 0;
}

/* 5 Layers of Complexity Framework */
.complexity-framework {
    padding: var(--sp-16) var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.complexity-framework h2 {
    margin-bottom: var(--sp-6);
}

.complexity-intro {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink-subtle);
    margin-bottom: var(--sp-10);
    max-width: 720px;
}

.complexity-layer {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--sp-16);
    padding: var(--sp-10) 0;
    border-bottom: 1px solid var(--color-border-default);
    align-items: start;
}

.complexity-layer:last-of-type {
    border-bottom: none;
}

.complexity-layer-left {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
}

.complexity-pictogram {
    width: 32px;
    height: 32px;
    fill: currentColor;
    flex-shrink: 0;
    margin-top: 2px;
}

.complexity-layer-title {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--sp-2);
}

.complexity-layer-definition {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-ink-subtle);
    margin: 0;
    font-style: italic;
}

.complexity-insights {
    list-style: disc;
    padding: 0 0 0 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.complexity-insights li {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
}

.contact-header {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--sp-16);
    margin-bottom: var(--sp-16);
    align-items: start;
    border-bottom: 1px solid var(--color-border-default);
    padding-bottom: var(--sp-10);
}

.contact-intro h2 {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--sp-4);
}

.contact-intro p {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
    margin: 0;
}

.postit-card {
    background-color: var(--color-camel-wash);
    border: 1px solid var(--color-border-default);
    border-radius: 2px;
    padding: var(--sp-6);
    position: relative;
    box-shadow: 0 4px 6px rgba(31, 42, 55, 0.1);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
}

.postit-card::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 31px;
    height: 31px;
    background-color: var(--color-camel-wash);
    border-right: 1px solid var(--color-border-default);
    border-top: 1px solid var(--color-border-default);
    pointer-events: none;
}

.postit-card::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 31px 31px 0;
    border-color: transparent var(--color-bg-surface-raised) transparent transparent;
    box-shadow: -2px 2px 3px rgba(31, 42, 55, 0.15);
    pointer-events: none;
}

.postit-card-icon {
    font-size: var(--fs-h2);
    line-height: 1;
}

.postit-card h3 {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--color-ink);
    margin: 0;
}

.postit-card p {
    font-size: var(--fs-body-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.postit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: var(--sp-16) var(--sp-10);
    max-width: 100%;
    margin: 0 auto;
    background-color: var(--peach-base);
}

.postit-grid > h3 {
    grid-column: 1 / -1;
    margin: 0;
}

.page-scotaccount .postit-grid > h3 {
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--color-ink);
}

/* CS page discovery and delivery sections: full-bleed background */
.page-cs .discovery-section,
.page-cs .delivery-section {
    background-color: var(--n-100);
    max-width: none;
    padding: var(--sp-10) 40px var(--sp-16);
}

/* Re-constrain all inner content */
.page-cs .discovery-section > *,
.page-cs .delivery-section > * {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Images must not exceed their container or the 1400px content column */
.page-cs .discovery-section > img,
.page-cs .delivery-section > img {
    display: block;
    max-width: min(100%, 1400px);
    margin-left: auto;
    margin-right: auto;
}

/* CS page postit overrides */
.page-cs .postit-grid {
    background-color: transparent;
    padding: 0;
    grid-template-columns: repeat(2, minmax(0, 320px));
}

.page-cs .postit-card {
    border: none;
    padding: var(--sp-8);
}

.page-cs .postit-card::before {
    background-color: inherit;
    border: none;
}

.page-cs .postit-card:nth-child(odd) {
    background-color: var(--teal-vivid);
}

.page-cs .postit-card:nth-child(even) {
    background-color: var(--peach-base);
}

.page-cs .postit-card p {
    font-size: 1.25rem;
    color: var(--color-ink);
    font-style: italic;
    line-height: var(--lh-body);
}

.page-scotaccount .postit-card p {
    font-size: 1.25rem;
    color: var(--color-ink);
    font-weight: 400;
    line-height: var(--lh-body);
}

.page-cs .postit-card-icon {
    font-size: var(--fs-display-sm);
}

.page-cs .postit-card-icon svg {
    width: 48px;
    height: 48px;
}

.research-section {
    padding: 0 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.project-wrapup {
    padding: var(--sp-5) var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.research-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-16);
    padding-bottom: 0;
    margin-bottom: 0;
    align-items: start;
}

/* Single-child research-header: span full width (no content in column 2) */
.research-header > :only-child {
    grid-column: 1 / -1;
}

.research-header + .research-header {
    margin-top: var(--sp-6);
}

.research-header h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
    color: var(--color-ink);
    margin-top: 0;
    margin-bottom: var(--sp-4);
}

.research-header-body {
    max-width: 720px;
}

.research-header-body p {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
    margin: 0;
}

.research-header-body p + p {
    margin-top: var(--sp-4);
}

.user-need {
    margin: 0;
    padding: var(--sp-4) var(--sp-6) 16px 24px;
    border-left: 3px solid var(--color-ink);
    font-style: normal;
}

.user-need-label {
    font-family: var(--ff-sans);
    font-size: var(--fs-small);
    line-height: var(--lh-body);
    color: var(--color-ink-subtle);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-need-statement {
    font-size: var(--fs-h3);   /* 24px — scales with heading variables */
    line-height: 1.75rem;
    color: var(--color-ink);
    margin-bottom: var(--sp-6);
    font-weight: 600;
    font-style: italic;
}

.user-need-statement:last-child {
    margin-bottom: 0;
}

.research-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-10);
    margin-bottom: var(--sp-16);
}

.research-card {
    display: flex;
    flex-direction: column;
}

.research-card h3 {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--sp-3);
}

.research-card p {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
    margin-bottom: var(--sp-5);
}

.research-image {
    width: 100%;
    height: 250px;
    background-color: var(--color-bg-surface-alt);
    border-radius: 4px;
    border: 1px solid var(--color-border-default);
    margin-bottom: var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.research-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.research-meta {
    font-size: var(--fs-body-compact);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
    margin-bottom: var(--sp-3);
}

.research-tags {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.research-topic {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--sp-16);
    padding-bottom: var(--sp-16);
    margin-bottom: var(--sp-10);
    border-bottom: 1px solid var(--color-border-default);
    align-items: start;
}

.research-topic:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.research-topic-intro h3 {
    font-size: var(--fs-h3);
    line-height: var(--lh-h3);
    color: var(--color-ink);
    margin-bottom: var(--sp-3);
}

.research-topic-intro p {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
    margin: 0;
}

.research-topic .research-cards {
    margin-bottom: 0;
}

/* ============================================
   Pull Quote
   ============================================ */
.pull-quote-section {
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.pull-quote {
    background: none;
    border-left: none;
    padding: 0;
    margin: 0;
    max-width: 900px;
}

.pull-quote-icon {
    width: 36px;
    height: auto;
    margin-bottom: var(--sp-5);
    display: block;
}

.pull-quote p {
    font-family: var(--ff-serif);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.5;
    font-style: normal;
    color: var(--color-ink);
    margin-bottom: var(--sp-6);
}

blockquote footer {
    background: none;
}

.pull-quote footer {
    border-top: none;
    margin-top: 0;
    padding: 0;
    text-align: left;
}

.pull-quote cite {
    display: flex;
    flex-direction: column;
    font-style: normal;
    gap: 2px;
}

.cite-name {
    font-family: var(--ff-sans);
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--color-ink);
}

.cite-role {
    font-family: var(--ff-sans);
    font-size: var(--fs-body-sm);
    color: var(--color-text-secondary);
}

/* ============================================
   Testimonials Cards
   ============================================ */
.testimonials-section {
    padding: var(--sp-20) var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.testimonials-header {
    margin-bottom: var(--sp-10);
}

.eyebrow-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--teal-base);
    background-color: var(--teal-light);
    padding: var(--sp-1) var(--sp-3);
    border-radius: 20px;
    margin-bottom: var(--sp-4);
}

.testimonials-header h2 {
    font-size: var(--fs-h1);
    line-height: var(--lh-h1);
    color: var(--color-ink);
    margin: 0;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-6);
}

.testimonial-quote-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-surface-alt);
    border-radius: 8px;
    padding: var(--sp-8);
}

.tq-icon {
    width: 28px;
    height: auto;
    margin-bottom: var(--sp-5);
    display: block;
}

.tq-text {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
    margin: 0 0 auto 0;
    padding-bottom: var(--sp-8);
}

.tq-author {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.tq-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--n-300);
    flex-shrink: 0;
}

.tq-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tq-name {
    font-size: var(--fs-body-sm);
    font-weight: 600;
    color: var(--color-ink);
}

.tq-role {
    font-size: var(--fs-body-compact);
    color: var(--color-text-secondary);
}

/* Template page contact section (scoped to avoid conflicts) */
.contact-section {
    padding: var(--sp-16) var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.contact-section .contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-16);
}

/* ============================================
   12-Column Grid System
   ============================================ */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--sp-6);
}
.col-span-1  { grid-column: span 1; }
.col-span-2  { grid-column: span 2; }
.col-span-3  { grid-column: span 3; }
.col-span-4  { grid-column: span 4; }
.col-span-5  { grid-column: span 5; }
.col-span-6  { grid-column: span 6; }
.col-span-7  { grid-column: span 7; }
.col-span-8  { grid-column: span 8; }
.col-span-9  { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }
.col-span-11 { grid-column: span 11; }
.col-span-12 { grid-column: span 12; }

/* Gap utilities */
.gap-1  { gap: var(--sp-1); }
.gap-2  { gap: var(--sp-2); }
.gap-3  { gap: var(--sp-3); }
.gap-4  { gap: var(--sp-4); }
.gap-5  { gap: var(--sp-5); }
.gap-6  { gap: var(--sp-6); }
.gap-8  { gap: var(--sp-8); }
.gap-10 { gap: var(--sp-10); }

/* Responsive grid: collapse to full-width on tablet */
@media (max-width: 768px) {
    .col-span-md-6  { grid-column: span 6; }
    .col-span-md-12 { grid-column: span 12; }
}

/* Responsive grid: collapse to full-width on mobile */
@media (max-width: 480px) {
    .col-span-sm-12 { grid-column: span 12; }
}

/* ============================================
   Utility Classes
   ============================================ */

/* CTA button group */
.cta-group {
    display: flex;
    gap: var(--sp-4);
}

/* Button icon (inside .btn-secondary) */
.btn-icon {
    margin-right: 6px;
    display: inline;
    vertical-align: middle;
    filter: var(--petrol-svg-filter, none);
}

/* Full-width image */
.img-full {
    width: 100%;
}

/* Image with card styling */
.img-card {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--color-border-default);
    box-shadow: var(--shadow-sm);
}

/* Two-column equal grid */
.grid-2-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
    align-items: end;
}

@media (max-width: 768px) {
    .grid-2-equal {
        grid-template-columns: 1fr;
    }
}

/* Success callout box */
.callout-success {
    margin-top: var(--sp-4);
    padding: var(--sp-4);
    background-color: var(--color-bg-surface-alt);
    border-left: 4px solid var(--green-base);
    max-width: 700px;
}

.callout-success p {
    margin: 0;
    color: var(--color-ink);
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body-sm);
}

/* Large stat number inside callouts */
.callout-stat {
    font-size: 1.4rem;
}

/* Highlighted callout text */
.callout-highlight {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ============================================
   Value Proposition Banner
   ============================================ */
.value-banner-section {
    padding: var(--sp-6) 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.value-banner {
    display: flex;
    align-items: center;
    background-color: var(--n-900);
    border-radius: 8px;
    padding: 28px var(--sp-10);
    gap: var(--sp-10);
}

.value-banner-tagline {
    flex: 0 0 260px;
    padding-right: var(--sp-10);
    border-right: 1px solid var(--n-600);
}

.value-banner-tagline p {
    font-family: 'Lora', serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--n-0);
    line-height: 1.4;
    margin: 0;
}

.value-banner-stats {
    display: flex;
    flex: 1;
    gap: 0;
}

.value-banner-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 32px;
}

.value-banner-item:last-child {
    border-right: none;
}

.value-banner-eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--teal-base);
}

.value-banner-value {
    font-size: var(--fs-body);
    font-weight: 400;
    color: var(--n-0);
}

/* ScotAccount page overrides */
.page-scotaccount .value-banner {
    align-items: stretch;
    background-color: var(--teal-light);
}

.page-scotaccount .value-banner-tagline {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    border-right-color: var(--teal-light);
}

.page-scotaccount .value-banner-tagline p {
    font-size: var(--fs-h3);
    color: var(--color-ink);
}

.page-scotaccount .value-banner-eyebrow {
    font-family: 'Lora', serif;
    font-size: var(--fs-h2);
    line-height: 1.2;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--teal-base);
}

.page-scotaccount .value-banner-item {
    border-right: none;
    border-bottom: none;
}

.page-scotaccount .value-banner-value {
    font-size: var(--fs-body-sm);
    color: var(--color-text-secondary);
    line-height: var(--lh-body);
}

/* Core Value Diagram */
.core-value-section {
    padding: var(--sp-16) var(--sp-10) 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.core-value-panels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--sp-6);
    align-items: stretch;
    margin-top: var(--sp-10);
}

.core-value-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--n-200, #ddd);
    border-radius: 8px;
    padding: var(--sp-8) var(--sp-6);
    background: var(--n-0);
}

.core-value-panel-label {
    font-family: var(--ff-sans);
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--teal-base);
    margin-bottom: var(--sp-1);
}

.core-value-panel--after .core-value-panel-label {
    color: var(--teal-base);
}

.core-value-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
}

.core-value-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--n-300);
    flex-shrink: 0;
}

.core-value-panel-caption {
    font-family: var(--ff-sans);
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: var(--sp-8);
    max-width: 300px;
}

@media (max-width: 900px) {
    .core-value-panels {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
        padding: var(--sp-6) 16px;
    }

    .core-value-arrow {
        transform: rotate(90deg);
    }

    .core-value-section {
        padding: var(--sp-10) var(--sp-6) 60px;
    }
}

/* Dependency Chain Diagram */
.dependency-heading {
    font-size: var(--fs-h3);
    color: var(--color-ink);
    margin: var(--sp-10) 0 var(--sp-6);
}

.dependency-chain {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
}

.dependency-node {
    flex: 1 1 0;
    min-width: 150px;
    padding: var(--sp-6) 20px;
    border: 1.5px solid var(--n-200);
    border-radius: 4px;
    text-align: center;
    background-color: var(--n-0);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dependency-node--critical {
    border: 2px solid var(--error-base);
    background-color: var(--error-bg);
}

.dependency-label {
    font-size: var(--fs-body);
    font-weight: 600;
    line-height: var(--lh-body);
    color: var(--color-ink);
    overflow-wrap: break-word;
    word-break: break-word;
}

.dependency-node--critical .dependency-label {
    color: var(--color-ink);
}

.dependency-arrow {
    flex-shrink: 0;
    padding: 0 8px;
    color: var(--n-300);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dependency-arrow svg {
    display: block;
}

.dependency-description {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
    margin-bottom: var(--sp-6);
    max-width: 620px;
}

.dependency-summary {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    font-weight: 600;
    color: var(--n-500);
    margin: var(--sp-8) 0 var(--sp-10);
    max-width: 620px;
}

.wrapup-content p {
    max-width: 620px;
}

.caption {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
    margin-top: var(--sp-3);
    max-width: 620px;
}

@media (max-width: 900px) {
    .dependency-chain {
        flex-direction: column;
        align-items: stretch;
        overflow-x: visible;
    }

    .dependency-node {
        min-width: 0;
        padding: var(--sp-5) var(--sp-6);
    }

    .dependency-arrow {
        padding: var(--sp-3) 0;
        align-self: center;
        transform: rotate(90deg);
    }

    .dependency-arrow svg {
        display: block;
        width: 24px;
        height: 12px;
    }
}

/* Weighted Left Layout */
.weighted-left-heading {
    margin-bottom: var(--sp-10);
}

.weighted-left-heading h2 {
    font-size: var(--fs-h1);
    line-height: var(--lh-h1);
    color: var(--color-ink);
    margin: 0;
}

.weighted-left-subtitle {
    font-family: 'Lora', serif;
    font-size: var(--fs-h3);
    color: var(--teal-base);
    margin: var(--sp-1) 0 0;
    font-weight: 500;
    font-style: italic;
}

.weighted-left-columns {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--sp-10);
    align-items: start;
}

.weighted-left-main p {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-ink);
    margin: 0;
}

.weighted-left-main p + p {
    margin-top: var(--sp-4);
}

.weighted-left-sidebar {
    background-color: var(--n-50);
    padding: var(--sp-8);
    border-left: 3px solid var(--teal-base);
}

.weighted-left-sidebar h3 {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    font-weight: 700;
    color: var(--teal-base);
    margin-bottom: var(--sp-3);
}

.weighted-left-sidebar p {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-ink);
    margin-bottom: var(--sp-6);
}

.weighted-left-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.weighted-left-sidebar ul li {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-ink);
    padding-left: var(--sp-4);
    position: relative;
    margin-bottom: var(--sp-2);
}

.weighted-left-sidebar ul li::before {
    content: '+';
    position: absolute;
    left: 0;
    color: var(--teal-base);
    font-weight: 600;
}

.weighted-left-sidebar ul li:last-child {
    margin-bottom: 0;
}

/* ============================================
   Bounding Box Cards
   ============================================ */

.bbox-section {
    padding: var(--sp-10);
    max-width: 1400px;
    margin: 0 auto;
}

.bbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-8);
}

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

.bbox-card {
    position: relative;
    border: 1px solid var(--teal-vivid);
    border-radius: 2px;
    padding: 0;
    background: var(--color-bg-surface-alt);
}

.bbox-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--n-0);
    border: 1px solid var(--teal-vivid);
    z-index: 1;
}

.bbox-tl { top: -4px; left: -4px; }
.bbox-tr { top: -4px; right: -4px; }
.bbox-bl { bottom: -4px; left: -4px; }
.bbox-br { bottom: -4px; right: -4px; }

/* Inset variant – card background inset from border (original gapped look) */
.bbox-card--inset {
    padding: var(--sp-1);
    background: var(--color-bg-surface);
}
.bbox-card--inset .bbox-card-inner {
    background: var(--color-bg-surface-alt);
}

.bbox-card-inner {
    padding: var(--sp-8);
    border-radius: 2px;
}

.bbox-card-inner h3 {
    margin-bottom: var(--sp-2);
}

.bbox-card-inner p {
    margin: 0;
    color: var(--color-text-secondary);
}

.bbox-card-inner.pull-quote p {
    margin-bottom: var(--sp-6);
}

/* ============================================
   Testimonial Grid Section
   ============================================ */
.testimonial-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-20) var(--sp-6);
}

.testimonial-section .section-header {
    text-align: center;
    margin-bottom: var(--sp-12);
}

.testimonial-section .section-header h2 {
    font-size: var(--fs-h1);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--sp-3);
}

.testimonial-section .section-header p {
    font-size: var(--fs-body);
    color: var(--color-text-secondary);
    margin: 0;
}

.testimonial-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    padding: var(--sp-8);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-card.card-tall {
    min-height: 300px;
}

.testimonial-card.card-dark {
    background: var(--n-800);
    border-color: var(--n-800);
}

.testimonial-card.card-medium {
    min-height: 250px;
}

/* Responsive adjustments for Testimonial Section */
@media (max-width: 1024px) {
    .testimonial-section {
        padding: var(--sp-16) var(--sp-6);
    }

    .testimonial-section .section-header h2 {
        font-size: var(--fs-h2);
    }
}

@media (max-width: 768px) {
    .testimonial-section {
        padding: var(--sp-12) var(--sp-4);
    }

    .testimonial-section .grid-12 {
        grid-template-columns: 1fr;
        gap: var(--sp-4);
    }

    .testimonial-section .grid-12 > * {
        grid-column: span 1 !important;
    }

    .testimonial-card {
        min-height: 180px;
    }
}

@media (max-width: 480px) {
    .testimonial-section {
        padding: var(--sp-10) var(--sp-4);
    }

    .testimonial-section .section-header {
        margin-bottom: var(--sp-8);
    }

    .testimonial-card {
        min-height: 150px;
        padding: var(--sp-6);
    }
}

/* ============================================
   Masonry Image Gallery
   ============================================ */
.masonry-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-20) var(--sp-6);
}

.masonry-gallery .section-header {
    text-align: center;
    margin-bottom: var(--sp-12);
}

.masonry-gallery .section-header h2 {
    font-size: var(--fs-h1);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--sp-3);
}

.masonry-gallery .section-header p {
    font-size: var(--fs-body);
    color: var(--color-text-secondary);
    margin: 0;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 180px;
    gap: var(--sp-4);
    grid-auto-flow: dense;
}

.gallery-item {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Varying sizes for masonry effect */
.gallery-item.size-1x1 {
    grid-column: span 1;
    grid-row: span 1;
}

.gallery-item.size-2x1 {
    grid-column: span 2;
    grid-row: span 1;
}

.gallery-item.size-1x2 {
    grid-column: span 1;
    grid-row: span 2;
}

.gallery-item.size-2x2 {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.size-3x2 {
    grid-column: span 3;
    grid-row: span 2;
}

.gallery-item.size-2x3 {
    grid-column: span 2;
    grid-row: span 3;
}

.gallery-item.size-3x3 {
    grid-column: span 3;
    grid-row: span 3;
}

/* Featured quote container */
.gallery-item.featured-quote {
    background: var(--a-base);
    border-color: var(--a-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-8);
    gap: var(--sp-2);
    z-index: 1;
}

.gallery-item.featured-quote .stat-number {
    font-size: var(--fs-display-sm);
    font-weight: 700;
    color: var(--n-0);
    line-height: 1;
    margin: 0;
}

.gallery-item.featured-quote .stat-label {
    font-size: var(--fs-body);
    font-weight: 500;
    color: var(--n-0);
    line-height: 1.4;
    margin: 0;
}

/* Responsive masonry */
@media (max-width: 1024px) {
    .masonry-gallery {
        padding: var(--sp-16) var(--sp-6);
    }

    .masonry-gallery .section-header h2 {
        font-size: var(--fs-h2);
    }

    .masonry-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 180px;
        gap: var(--sp-4);
    }

    /* Adjust sizes for better tablet layout */
    .gallery-item.size-3x2 {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item.size-2x2 {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item.size-1x2 {
        grid-column: span 1;
        grid-row: span 2;
    }
}

@media (max-width: 768px) {
    .masonry-gallery {
        padding: var(--sp-12) var(--sp-4);
    }

    .masonry-gallery .section-header {
        margin-bottom: var(--sp-8);
    }

    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
        gap: var(--sp-3);
    }

    /* Simplify to 2-column layout on mobile */
    .gallery-item.size-3x2 {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item.size-2x2 {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-item.size-1x2 {
        grid-column: span 1;
        grid-row: span 2;
    }

    .gallery-item.featured-quote {
        padding: var(--sp-6);
        grid-column: span 2;
    }

    .gallery-item.featured-quote .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .masonry-gallery {
        padding: var(--sp-10) var(--sp-4);
    }

    .masonry-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
        gap: var(--sp-3);
    }

    /* Stack everything in single column on small mobile */
    .gallery-item {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .gallery-item.size-3x2,
    .gallery-item.size-2x2 {
        grid-row: span 1;
    }

    .gallery-item.featured-quote {
        padding: var(--sp-8) 20px;
        grid-row: span 1;
    }

    .gallery-item.featured-quote .stat-number {
        font-size: 2.5rem;
    }

    .gallery-item.featured-quote .stat-label {
        font-size: var(--fs-body-sm);
    }
}

.contact-section .contact-column h3 {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--sp-8);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.contact-section .contact-icon {
    width: 40px;
    height: 40px;
    background-color: var(--color-bg-surface-alt);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-section .contact-item {
    margin-bottom: 30px;
}

.contact-section .contact-item h4 {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: var(--sp-2);
}

.contact-section .contact-item p {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
    margin: 0;
}

.contact-section .contact-item a {
    color: var(--color-camel-base);
}

/* Tradeoff Graphic */
.tradeoff-graphic {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: var(--sp-12);
    align-items: center;
    justify-content: center;
}

.tradeoff-side h3 {
    color: var(--color-teal-base);
    margin-bottom: var(--sp-4);
}

.tradeoff-side ul {
    padding-left: var(--sp-5);
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
}

.tradeoff-side ul li {
    margin-bottom: var(--sp-2);
}

.tradeoff-icon {
    display: flex;
    justify-content: center;
    padding-top: var(--sp-2);
}

.tradeoff-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: var(--teal-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tradeoff-circle svg {
    fill: var(--teal-base);
}

@media (max-width: 768px) {
    .tradeoff-graphic {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }

    .tradeoff-icon {
        order: -1;
    }

    .tradeoff-circle {
        width: 100px;
        height: 100px;
    }

    .tradeoff-circle svg {
        width: 48px;
        height: 48px;
    }

    .publish-images {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Template Page Responsive Styles
   ============================================ */

@media (max-width: 1024px) {
    .hero-section {
        padding: var(--sp-16) 0;
    }

    .hero-wrapper {
        gap: var(--sp-10);
        padding: 0 var(--sp-6);
    }

    .main-content {
        padding: var(--sp-10) var(--sp-6);
        gap: var(--sp-10);
    }

    .best-practices,
    .complexity-framework,
    .research-section,
    .project-wrapup,
    .contact-section,
    .postit-grid,
    .why-section {
        padding: var(--sp-10) var(--sp-6);
    }

    .tabs-section {
        padding: 0 var(--sp-6);
    }

    .tabs {
        gap: var(--sp-6);
    }

    .value-banner-section {
        padding: var(--sp-10) var(--sp-6);
    }

    .value-banner {
        flex-direction: column;
        gap: var(--sp-6);
        padding: var(--sp-8);
    }

    .value-banner-tagline {
        flex: none;
        padding-right: 0;
        padding-bottom: var(--sp-6);
        border-right: none;
        border-bottom: 1px solid var(--n-600);
        width: 100%;
    }

    .value-banner-stats {
        width: 100%;
    }

    .value-banner-item {
        padding: 0 var(--sp-5);
    }
}

@media (max-width: 900px) {
    .research-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-section .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-header {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .research-header,
    .research-topic,
    .practice-item {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .weighted-left-columns {
        grid-template-columns: 1fr;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .hero-section {
        padding: var(--sp-10) 0;
        min-height: auto;
    }

    .hero-wrapper {
        flex-direction: column;
        text-align: center;
        padding: 0 var(--sp-4);
    }

    .hero-wrapper > .back-button {
        order: 0;
        align-self: flex-start;
        margin-bottom: var(--sp-6);
    }

    .hero-content {
        max-width: 100%;
        order: 2;
    }

    .hero-content h1 {
        justify-content: center;
        font-size: var(--fs-h2);
    }

    .hero-section .hero-image {
        order: 1;
        width: 100%;
        min-height: 200px;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-stat {
        padding: 0 16px;
    }

    .value-banner-section {
        padding: var(--sp-6) 16px;
    }

    .value-banner {
        padding: var(--sp-6);
    }

    .value-banner-stats {
        flex-direction: column;
        gap: 0;
    }

    .value-banner-item {
        padding: var(--sp-4) 0;
    }

    .value-banner-item:last-child {
        padding-bottom: 0;
    }

    .bbox-section {
        padding: var(--sp-6) 16px;
    }

    .bbox-grid {
        grid-template-columns: 1fr;
    }

    .tabs-section {
        padding: 0 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tabs {
        gap: var(--sp-4);
        min-width: max-content;
    }

    .tabs a {
        padding: var(--sp-4) 0;
        white-space: nowrap;
    }

    .main-content {
        flex-direction: column;
        padding: var(--sp-8) 16px;
        gap: var(--sp-8);
    }

    .content-text {
        flex: 1 1 auto;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-6);
    }

    .best-practices,
    .complexity-framework,
    .research-section,
    .project-wrapup,
    .contact-section,
    .why-section {
        padding: var(--sp-8) 16px;
    }

    .practice-item {
        grid-template-columns: 1fr;
        gap: var(--sp-4);
    }

    .complexity-layer {
        grid-template-columns: 1fr;
        gap: var(--sp-4);
    }

    .complexity-insights {
        padding-left: var(--sp-12);
    }

    .postit-grid {
        padding: var(--sp-8) 16px;
        gap: var(--sp-5);
    }
}

@media (max-width: 600px) {
    .research-cards,
    .contact-section .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: var(--sp-6) 0;
    }

    .hero-wrapper {
        padding: 0 16px;
    }

    .hero-content h1 {
        font-size: var(--fs-h3);
        flex-direction: column;
        gap: var(--sp-2);
    }

    .hero-content p {
        font-size: var(--fs-body-sm);
    }

    .hero-stat-number {
        font-size: var(--fs-body);
    }

    .hero-stat {
        padding: 0 12px;
    }

    .tabs-section {
        padding: 0 12px;
    }

    .tabs {
        gap: var(--sp-3);
    }

    .tabs a {
        font-size: var(--fs-body-compact);
        padding: var(--sp-3) 0;
    }

    .tab-number {
        display: none;
    }

    .main-content {
        padding: var(--sp-6) 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-5);
    }

    .stat-number {
        font-size: var(--fs-display-sm);
        line-height: var(--lh-display-sm);
    }

    .best-practices,
    .complexity-framework,
    .research-section,
    .project-wrapup,
    .contact-section,
    .why-section {
        padding: var(--sp-6) 16px;
    }

    .best-practices h2,
    .complexity-framework h2,
    .research-header h2 {
        font-size: var(--fs-h2);
    }

    .practice-title {
        font-size: var(--fs-body);
    }

    .dependency-node {
        padding: var(--sp-4) var(--sp-5);
    }

    .dependency-label {
        font-size: var(--fs-body-sm);
    }

    .dependency-arrow svg {
        width: 28px;
    }

    .postit-grid {
        padding: var(--sp-6) 12px;
        grid-template-columns: 1fr;
    }

    .page-cs .postit-grid {
        grid-template-columns: 1fr;
    }

    .postit-card {
        padding: var(--sp-4);
    }

    .research-image {
        height: 180px;
    }

    .contact-section .contact-column h3 {
        font-size: var(--fs-body);
    }

    .contact-section .contact-icon {
        width: 32px;
        height: 32px;
    }

}

/* Synthesis split layout */
.synthesis-split {
    display: flex;
    align-items: center;
    gap: var(--sp-10);
    margin-top: var(--sp-10);
}

.synthesis-split .synthesis-text {
    flex: 1;
}

.synthesis-split .synthesis-text h3 {
    margin-bottom: var(--sp-3);
}

.synthesis-split .synthesis-text p {
    margin: 0;
}

.synthesis-split .synthesis-image {
    flex: 1;
    max-width: 50%;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .synthesis-split {
        flex-direction: column;
        gap: var(--sp-6);
    }

    .synthesis-split .synthesis-image {
        max-width: 100%;
        width: 100%;
    }
}

.context-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-6);
    margin-top: var(--sp-10);
}

@media (max-width: 768px) {
    .context-grid {
        grid-template-columns: 1fr;
    }
}

.scenario1-grid {
    display: grid;
    grid-template-columns: 360px 360px;
    column-gap: var(--sp-20);
    row-gap: var(--sp-2);
    margin-top: var(--sp-6);
}

.scenario1-img1 {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    width: 100%;
}

.scenario1-img2 {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    width: 100%;
}

.scenario1-cap1 {
    grid-column: 1;
    grid-row: 2;
}

.scenario1-cap2 {
    grid-column: 2;
    grid-row: 2;
}

@media (max-width: 768px) {
    .scenario1-grid {
        grid-template-columns: 1fr;
    }

    .scenario1-img1,
    .scenario1-img2,
    .scenario1-cap1,
    .scenario1-cap2 {
        grid-column: 1;
        grid-row: auto;
    }
}
