/* Self-hosted Fonts */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/outfit-v15-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/outfit-v15-latin-800.woff2') format('woff2');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-v12-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-v12-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-v12-latin-600.woff2') format('woff2');
}

:root {
    /* Color Palette - Brand (Teal & Slate Gray) */
    --brand-teal: #78b1c4;
    --brand-slate: #3d5a64;
    --brand-light-blue: #a8ceda;
    --brand-dark: #1e3a45;

    /* Color Palette - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f8fa;
    --bg-tertiary: #eef3f6;
    --text-primary: #1a2f38;
    --text-secondary: #4a5a64;
    --text-muted: #4d6570;
    --accent-primary: var(--brand-teal);
    --accent-secondary: var(--brand-slate);
    --border-color: #d8e2e8;
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Filled call-to-action surfaces (.btn-primary, .about-badge, .step-number,
       .filter-btn.active, .skip-to-content). White does not pass on the brand
       teal in either theme (2.36:1 on #78b1c4, 1.68:1 on #a8ceda), and the
       accent tokens swap roles between themes, so these are pinned to fixed
       brand colours rather than to --accent-*. Light: white on slate->dark
       (7.4:1 and 12:1). Dark: brand-dark text on the pale teals (7.2:1 and
       5.1:1). Every stop clears WCAG AA for normal text. */
    --cta-gradient: linear-gradient(135deg, var(--brand-slate), var(--brand-dark));
    --cta-fill: var(--brand-slate);
    --cta-fg: #ffffff;

    /* Accent-coloured TEXT (pills, breadcrumbs, prose links, active nav). The
       brand teal is only 1.9 to 2.4:1 on the light surfaces, so light mode uses
       slate (7.4:1 on white, 6.9:1 on bg-secondary). Dark mode keeps the pale
       teal it always had (8 to 10:1). Use --accent-primary for borders, washes
       and icons, and this for anything that has to be read. */
    --accent-text: var(--brand-slate);
}

/* Dark Mode Variables */
[data-theme='dark'] {
    --cta-gradient: linear-gradient(135deg, var(--brand-light-blue), var(--brand-teal));
    --cta-fill: var(--brand-teal);
    --cta-fg: var(--brand-dark);
    --accent-text: var(--brand-light-blue);
    --bg-primary: #0d1a1f;
    --bg-secondary: #142228;
    --bg-tertiary: #1a2f38;
    --text-primary: #eef5f8;
    --text-secondary: #a0b5c0;
    --text-muted: #8a9fac;
    --accent-primary: var(--brand-light-blue);
    --accent-secondary: var(--brand-teal);
    --border-color: #2a4550;
    --card-bg: #1a2f38;
    --glass-bg: rgba(13, 26, 31, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
}

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

html {
    /* Native smooth scrolling was removed (D-08): it compounded the heavy-scroll
       feel. Smooth scrolling now lives in JS (scrollSpy, site-common, main),
       where each scroll call falls back to an instant jump when the user prefers
       reduced motion, so no scroll-behavior override is needed here. */

    /* The header is fixed and 80px tall. Without this, /#quote, /#portfolio, the
       skip link, scrollIntoView() and Shift+Tab all park their target under it
       (WCAG 2.4.11). 96px leaves a 16px breath below the header. Do not add a
       scroll-margin-top to sections as well: the two add up. */
    scroll-padding-top: 96px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    transition:
        background-color var(--transition-slow),
        color var(--transition-slow);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
}

p {
    color: var(--text-secondary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Height-driven so the logo's own aspect ratio sets the width. Pinning both
   dimensions is what cropped it */
.logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
    display: block;
}

.footer-info .logo-img {
    height: 43px;
}

/* Narrow phones: the header row is the 252px logo, the 44px hamburger and 2rem of
   container padding either side, which needs about 376px to fit. Below that the flex
   row used to resolve the overflow by shrinking the hamburger below its tap-target
   minimum. The button now refuses to shrink, so buy the space back here instead by
   trimming the header padding and stepping the logo down one notch. Desktop keeps
   the full 52px. */
@media (max-width: 400px) {
    #header .container {
        padding: 0 1rem;
    }

    .logo-img {
        height: 44px;
    }
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition-fast);
}

.nav-links a:hover {
    color: var(--accent-text);
}

.nav-links a.active {
    color: var(--accent-text);
}

.nav-links a.active:not(.btn)::after {
    transform: scaleX(1);
}

/* Ensure focus states remain visible when link is active
   The aria-current="page" attribute provides screen reader announcement
   that the link corresponds to the current section */
.nav-links a.active:focus-visible {
    outline: 3px solid var(--cta-fill);
    outline-offset: 3px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-icon-left {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--cta-gradient);
    color: var(--cta-fg);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--accent-secondary) 35%, transparent);
}

.btn-primary:hover {
    box-shadow: 0 6px 28px color-mix(in srgb, var(--accent-secondary) 50%, transparent);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-text);
}

/* Theme Toggle */
#theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    /* Tap-target floor. Like #mobile-menu-btn, this is a flex item in a row that
       overruns on narrow viewports, so width/height alone can be shrunk below 44px. */
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    transition: var(--transition-fast);
}

#theme-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

[data-theme='dark'] #theme-icon-light {
    display: none;
}

[data-theme='light'] #theme-icon-dark {
    display: none;
}

/* Mobile Menu Button */
#mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    /* The 44px above is a tap-target minimum, not a suggestion. As a flex item this
       button shrank to 26px on narrow phones once the logo and padding overran the
       row, so pin the floor and opt out of shrinking. */
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

#mobile-menu-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

/* ========================================
   HERO SECTION WITH ANIMATED BACKGROUND
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Pause animations when hero is not visible */
.hero-bg.paused,
.hero-bg.paused * {
    animation-play-state: paused !important;
}

/* Flowing Grid Lines Animation */
.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--accent-primary) 1px, transparent 1px),
        linear-gradient(to bottom, var(--accent-primary) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.08;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    animation: grid-glow 4s ease-in-out infinite;
}

@keyframes grid-glow {
    0%,
    100% {
        opacity: 0.05;
    }

    50% {
        opacity: 0.12;
    }
}

.grid-lines::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        color-mix(in srgb, var(--accent-secondary) 15%, transparent) 50%,
        transparent 100%
    );
    animation: grid-flow 8s ease-in-out infinite;
}

.grid-lines::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        color-mix(in srgb, var(--accent-secondary) 10%, transparent) 50%,
        transparent 100%
    );
    animation: grid-flow-vertical 12s ease-in-out infinite;
}

@keyframes grid-flow {
    0%,
    100% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
    }
}

@keyframes grid-flow-vertical {
    0%,
    100% {
        transform: translateY(-100%);
    }

    50% {
        transform: translateY(100%);
    }
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--brand-teal);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--brand-slate);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--brand-light-blue);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(20px, 40px) scale(1.02);
    }
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 2rem;
    min-height: calc(100vh - 80px);
}

.hero-content {
    max-width: 600px;
}

.hero-3d {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
}

#hero-canvas {
    width: 100%;
    height: 100%;
    max-height: 600px;
}

.hero h1 {
    margin-bottom: 1.5rem;
    font-weight: 800;
    text-wrap: balance;
    line-height: 1.1;
}

.hero h1 .gradient-text {
    display: block;
    margin-top: 0.2rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.about-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--cta-gradient);
    color: var(--cta-fg);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.badge-number {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    font-family: var(--font-heading);
}

.badge-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.section-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: color-mix(in srgb, var(--accent-secondary) 10%, transparent);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-slate);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme='dark'] .section-tag {
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

/* .about-content animation handled by GSAP from() */

.about-content h2 {
    margin-bottom: 1.5rem;
}

.about-content p {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: left;
}

.stat-number {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--accent-text);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ========================================
   CLIENT LOGOS SECTION
   ======================================== */
.clients {
    padding: 60px 0;
    background: var(--bg-primary);
    overflow: hidden;
}

.clients .section-header {
    margin-bottom: 3rem;
}

.clients .section-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.clients .section-tag {
    font-size: clamp(0.75rem, 1.2vw, 0.85rem);
}

.logo-scroll {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logo-track {
    display: flex;
    gap: 4rem;
    width: fit-content;
    /* Animation handled by GSAP in animations.js */
}

.logo-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    min-width: 150px;
}

.logo-item picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.logo-item img {
    max-width: 150px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s ease;
}

.logo-item:hover img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

/* Dark mode client logos */
[data-theme='dark'] .logo-item img {
    filter: brightness(0) invert(1) grayscale(0%) opacity(0.8) !important;
    transition: all 0.3s ease;
}

[data-theme='dark'] .logo-item:hover img {
    filter: none;
    opacity: 1;
    transform: scale(1.05);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .clients {
        padding: 40px 0;
    }

    .logo-track {
        gap: 2rem;
    }

    .logo-item {
        min-width: 120px;
        height: 60px;
    }

    .logo-item img {
        max-width: 120px;
        max-height: 50px;
    }
}

/* ========================================
   SERVICES SECTION
   ======================================== */
.services {
    padding: 120px 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem;
}

.section-title {
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    color: var(--text-muted);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    position: relative;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-slow);
    /* Progressive enhancement: visible by default, GSAP will animate if available */
    opacity: 1;
    transform: translateY(0);
    overflow: hidden;
}

/* Mouse-follow spotlight. Every panel on the site carries .spotlight-card;
   spotlight.js (loaded on every page) moves the glow. isolation plus
   z-index: -1 keeps the glow above the panel's background and below its
   content, so children need no z-index of their own. */
.spotlight-card {
    position: relative;
    isolation: isolate;
}

.spotlight-card::before {
    content: '';
    pointer-events: none;
    position: absolute;
    inset: 0;
    opacity: var(--spotlight-opacity, 0);
    transition: opacity 0.2s ease;
    border-radius: inherit;
    background: radial-gradient(
        600px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
        color-mix(in srgb, var(--accent-secondary) 25%, transparent),
        transparent 70%
    );
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent-secondary) 15%, transparent),
        color-mix(in srgb, var(--brand-slate) 10%, transparent)
    );
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--accent-primary);
}

.service-card h3 {
    position: relative;
    z-index: 1;
    margin-bottom: 0.75rem;
}

.service-card p {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.hidden-card {
    display: none !important;
}

.view-more-container {
    text-align: center;
    margin-top: 3rem;
}

/* ========================================
   QUOTE SECTION
   ======================================== */
.quote-section {
    padding: 120px 0;
    background: var(--bg-primary);
}

.quote-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.quote-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.quote-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Type Cards (Step 1) */
.project-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0;
}

/* Steps 1 and 2 are rendered by quoteGenerator.js as <button>s so they can be
   reached and activated from the keyboard. The first block of each rule undoes
   the UA button styling; the visual design below it is unchanged. */
.project-type-card {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.project-type-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

/* --cta-fill, not --accent-primary: the selected border is the only visual
   state cue, and teal was 2.2:1 against the card in light mode (6.9 and 5.9:1
   now). */
.project-type-card.selected {
    border-color: var(--cta-fill);
    background: color-mix(in srgb, var(--accent-secondary) 8%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-secondary) 15%, transparent);
}

.type-icon {
    width: 40px;
    height: 40px;
    background: var(--cta-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--cta-fg);
}

.type-icon i {
    width: 20px;
    height: 20px;
}

.type-content {
    display: block;
    min-width: 0;
}

/* Spans, not <h4>/<p>: a heading inside a <button> is invalid HTML. These
   restore the heading face the h4 used to inherit. */
.type-content .type-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

.type-content .type-desc {
    display: block;
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Category Cards (Step 2) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.category-card {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    margin: 0;
    font: inherit;
    color: inherit;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.category-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.category-card.selected {
    border-color: var(--cta-fill);
    background: color-mix(in srgb, var(--accent-secondary) 8%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-secondary) 15%, transparent);
}

.cat-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent-secondary) 15%, transparent),
        color-mix(in srgb, var(--brand-slate) 10%, transparent)
    );
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--accent-primary);
}

.cat-icon i {
    width: 22px;
    height: 22px;
}

.category-card .cat-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.category-card .cat-desc {
    display: block;
    color: var(--text-secondary); /* what the global p rule gave the old <p> */
    font-size: clamp(0.75rem, 1.1vw, 0.85rem);
    line-height: 1.4;
}

.quote-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.quote-footer > div:last-child {
    display: flex;
    justify-content: space-between;
}

.validation-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: color-mix(in srgb, #ef4444 10%, transparent);
    border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
    border-radius: 12px;
    /* #ef4444 itself was 3.3:1 on its own wash; this darker red is 5.7:1 */
    color: #b91c1c;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
}

[data-theme='dark'] .validation-error {
    background: color-mix(in srgb, #ef4444 15%, transparent);
    border-color: color-mix(in srgb, #ef4444 35%, transparent);
    color: #fca5a5;
}

.validation-error i {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    /* 10px matches the buttons. This used to read var(--radius-sm), which
       does not exist, so the fields rendered with square corners. */
    border-radius: 10px;
    /* --border-color alone is 1.2 to 1.4:1 against the field, so the edges
       vanished. This mix clears the 3:1 a control boundary needs in both themes. */
    border: 1px solid color-mix(in srgb, var(--text-muted) 70%, var(--bg-secondary));
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

/* No outline: none here. The global focus-visible ring is the focus cue; the
   border change below is only a supporting hint. */
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--cta-fill);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-secondary) 10%, transparent);
}

.progress-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    /* Full width, scaled down to the current step. Scaling animates without
       re-laying out the page, which animating width does. */
    transform: scaleX(var(--progress, 0));
    transform-origin: left center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   QUOTE GENERATOR - DYNAMIC STATE CLASSES
   ======================================== */

/* Button visibility toggle */
.btn-hidden {
    visibility: hidden;
}

/* Small button icons (16x16) */
.btn-icon-sm {
    width: 16px;
    height: 16px;
}

.btn-icon-sm-left {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.btn-icon-sm-right {
    width: 16px;
    height: 16px;
    margin-left: 6px;
}

/* Centered quote step (loading/success/error states) */
.quote-step-centered {
    text-align: center;
    padding: 3rem 2rem;
}

/* Centered loader spinner */
.loader-spinner-centered {
    margin: 0 auto 1.5rem;
}

/* Quote result heading margin */
.quote-heading-mb {
    margin-bottom: 1rem;
}

/* Quote result icon container - base styles */
.quote-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

/* Success icon container (green gradient) */
.quote-result-icon-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Error icon container (red gradient) */
.quote-result-icon-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Inline mailto inside the failure copy. --accent-secondary on --card-bg is
   7.4:1 light / 5.9:1 dark; --accent-primary would fail in light. */
.quote-mailto {
    color: var(--accent-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

/* Result icon sizing (check/x icons) */
.quote-result-icon-img {
    width: 40px;
    height: 40px;
    color: white;
}

/* Text with small margin */
.quote-text-mb-sm {
    margin-bottom: 0.5rem;
}

/* Muted text with larger margin */
.quote-text-muted-mb {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    padding: 80px 0 40px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-info .logo {
    display: block;
    margin-bottom: 1.25rem;
}

.footer-info p {
    margin-bottom: 1.5rem;
    max-width: 300px;
}

.email-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /* Matches .footer-links a. The accent teal on the footer's --bg-tertiary is
       2.07:1 in light mode, well under the 4.5:1 text requirement. */
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.email-link:hover {
    color: var(--accent-secondary);
}

.email-link i {
    width: 18px;
    height: 18px;
}

/* h2, not h4, so the outline does not skip levels on every page. The size is
   pinned here or the base h2 clamp would make these headings huge. */
.footer-links h2 {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.footer-links a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-text);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Hide mobile break by default */
.mobile-break {
    display: none;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1200px) {
    /* Fix About Section Layout early */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .about-image {
        order: -1;
        /* Image on top */
        max-width: 500px;
        margin: 0 auto;
    }

    .about-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .about-badge {
        right: 0;
        bottom: -20px;
        padding: 1rem;
    }

    .badge-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .hero-actions {
        justify-content: center;
        margin-bottom: 3rem;
    }

    .hero-3d {
        min-height: 300px;
        order: -1;
    }

    @media (max-width: 768px) {
        .hero h1 {
            font-size: 2.5rem;
        }

        .hero-subtitle {
            font-size: 1rem;
        }

        /* Reduce Section Padding for Tablet/Mobile */
        .about,
        .services,
        .testimonials,
        .quote-section {
            padding: 60px 0;
        }

        .section-header {
            margin-bottom: 2.5rem;
        }

        .footer-grid {
            grid-template-columns: 1fr;
            gap: 2rem;
        }

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

        .project-type-grid {
            grid-template-columns: 1fr;
        }

        /* Compact quote section for mobile */
        .quote-container {
            padding: 1.25rem;
            border-radius: 16px;
        }

        .project-type-card {
            padding: 0.75rem;
            gap: 0.5rem;
        }

        .type-icon {
            width: 36px;
            height: 36px;
        }

        .type-icon i {
            width: 18px;
            height: 18px;
        }

        .type-content .type-title {
            font-size: 0.9rem;
        }

        .type-content .type-desc {
            font-size: 0.75rem;
            line-height: 1.3;
        }

        .category-card {
            padding: 0.75rem;
        }

        .cat-icon {
            width: 36px;
            height: 36px;
            margin-bottom: 0.5rem;
        }

        .cat-icon i {
            width: 18px;
            height: 18px;
        }

        .category-card .cat-title {
            font-size: 0.85rem;
            margin-bottom: 0.25rem;
        }

        .category-card .cat-desc {
            font-size: 0.7rem;
            line-height: 1.3;
        }

        .quote-footer {
            gap: 0.5rem;
            margin-top: 1rem;
            padding-top: 1rem;
        }

        .form-group {
            margin-bottom: 0.75rem;
        }

        .form-group label {
            font-size: 0.85rem;
            margin-bottom: 0.35rem;
        }

        .form-group input,
        .form-group textarea {
            padding: 0.6rem 0.75rem;
            font-size: 0.9rem;
        }

        .progress-bar {
            margin-bottom: 1rem;
        }
    }

    @media (max-width: 480px) {
        .category-grid {
            grid-template-columns: 1fr;
        }
        .mobile-break {
            display: block;
        }
    }
}

/* Header nav collapses to the hamburger at 1000px, not 768px. The desktop row
   (logo + five links + CTA + theme toggle) needs roughly 944px of layout width,
   so between 769px and ~958px it overflowed the viewport: the CTA was sliced in
   half and the toggle sat entirely off-screen, hidden by body{overflow-x:hidden}.
   That band is iPad portrait and most phones in landscape. This block is a
   top-level query on purpose: it used to be nested inside the 992px block
   above, which capped it at 992 regardless of the value written here. */
@media (max-width: 1000px) {
    #mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        /* dvh tracks the mobile address bar; 100vh above is the fallback */
        height: calc(100dvh - 80px);
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        /* Closed means hidden, not just off-screen: without visibility the seven
           drawer controls stayed in the tab order and the accessibility tree.
           Visibility flips only after the slide-out finishes. */
        visibility: hidden;
        transition:
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s linear 0.3s;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .nav-links a:not(.btn):not(#theme-toggle) {
        display: block;
        /* Override previous hide */
    }

    /* Mobile active state styles */
    .nav-links a.active {
        font-weight: 600;
    }

    .nav-links a:not(.btn)::after {
        bottom: -6px;
        height: 3px;
        border-radius: 2px;
    }
}

/* ========================================
   TESTIMONIALS SECTION - Two-Card Grid
   ======================================== */
.testimonials {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.testimonial-carousel {
    max-width: 100%;
    margin: 0 auto;
    margin-top: 2rem;
}

.carousel-container {
    position: relative;
    overflow: visible;
}

.carousel-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.testimonial-slide {
    opacity: 1;
    transform: none;
    width: 100%;
}

.testimonial-slide:nth-child(n + 3) {
    display: none;
}

.testimonial-slide.visible {
    display: block;
}

.testimonial-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: left;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.quote-icon {
    width: 32px;
    height: 32px;
    background: var(--cta-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--cta-fg);
    flex-shrink: 0;
}

.quote-icon svg {
    width: 16px;
    height: 16px;
}

.testimonial-quote {
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-style: italic;
    flex-grow: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-primary);
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    text-align: left;
}

.author-info h3 {
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
    color: var(--text-primary);
}

.author-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.author-website {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-tertiary, var(--bg-secondary));
    color: var(--text-secondary);
    transition:
        color 0.2s,
        background 0.2s;
}

/* --accent-primary-alpha never existed, so the hover fell back to an indigo
   wash from some other palette */
.author-website:hover {
    color: var(--accent-text);
    background: color-mix(in srgb, var(--accent-secondary) 12%, transparent);
}

.author-website svg {
    width: 16px;
    height: 16px;
}

/* Carousel Navigation */
.carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.carousel-btn:hover {
    background: var(--cta-fill);
    color: var(--cta-fg);
    border-color: var(--cta-fill);
    transform: scale(1.1);
}

.carousel-btn svg {
    width: 20px;
    height: 20px;
}

/* No gap: each 24px dot button already carries 6px of padding either side of
   the drawn dot, so the dots keep their old 12px spacing. */
.carousel-dots {
    display: flex;
    gap: 0;
}

/* Each dot is a 24px button (WCAG 2.5.8) that draws a 12px dot. The active dot
   uses --cta-fill, which clears 3:1 against the section in both themes; the
   old teal-on-grey difference was colour alone at under 3:1. */
.dot {
    position: relative;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.dot::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--border-color);
    transition:
        background-color 0.3s ease,
        transform 0.3s ease;
}

.dot:hover::before {
    background: var(--accent-secondary);
}

.dot.active::before {
    background: var(--cta-fill);
    transform: scale(1.2);
}

/* Dark mode carousel styles */
[data-theme='dark'] .testimonial-card {
    background: var(--bg-secondary);
}

[data-theme='dark'] .carousel-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Mobile responsive - single card carousel */
@media (max-width: 768px) {
    .testimonials {
        padding: 60px 0;
    }

    .carousel-track {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .testimonial-card {
        padding: 1.25rem;
    }

    .carousel-nav {
        margin-top: 1.5rem;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 900;
    /* The arrow is the button's only identifier; teal was 2.2:1 in light */
    color: var(--accent-text);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background: var(--cta-fill);
    color: var(--cta-fg);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   ACCESSIBILITY - Skip to Content Link
   ======================================== */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cta-fill);
    color: var(--cta-fg);
    padding: 1rem 2rem;
    border-radius: 0 0 10px 10px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* ========================================
   FOCUS STATES - Accessibility
   ======================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    /* --cta-fill: slate in light (7.4:1 on white), teal in dark (7.5:1). The
       brand teal used before was 2.2 to 2.4:1 in light, below the 3:1 a focus
       indicator needs. */
    outline: 3px solid var(--cta-fill);
    outline-offset: 2px;
}

/* ========================================
   LEGAL PAGES (Terms & Privacy)
   ======================================== */
.legal-page {
    padding: 120px 0 80px;
    min-height: calc(100vh - 200px);
}

.breadcrumb {
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 0.9rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.breadcrumb li + li::before {
    content: '/';
    margin-right: 0.5rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.breadcrumb a {
    color: var(--accent-text);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.breadcrumb [aria-current='page'] {
    color: var(--text-secondary);
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h1 {
    margin-bottom: 0.5rem;
}

.legal-content .last-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 3rem;
}

.legal-content section {
    margin-bottom: 2.5rem;
}

.legal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.legal-content h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-content ul {
    margin: 1rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.legal-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Underlined at rest: colour alone did not set links apart from the body text
   (WCAG 1.4.1). Same pattern as .quote-mailto. */
.legal-content a {
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content a:hover {
    text-decoration-thickness: 2px;
}

.legal-content .back-link {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   CANVAS LOADER (Three.js)
   ======================================== */
.hero-3d {
    position: relative;
}

.canvas-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 5;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.canvas-loader.hidden {
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   3D HERO CANVAS STATE CLASSES
   ======================================== */

/* Canvas loading state - initial hidden state with transition */
#hero-canvas.canvas-loading {
    opacity: 0;
    transition: opacity 1.5s ease;
}

/* Canvas visible state - shown after initialization */
#hero-canvas.canvas-visible {
    opacity: 1;
}

/* ========================================
   PROCESS SECTION - Compact Horizontal Layout
   ======================================== */

.process {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.process-timeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;
    position: relative;
}

/* Horizontal connecting line */
.process-timeline::before {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    top: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.4;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--cta-fill);
    color: var(--cta-fg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: bold;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    border: 3px solid var(--bg-secondary);
    margin-bottom: 1rem;
}

.step-content {
    flex: 1;
    padding: 0 0.5rem;
}

.step-content:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-secondary) 40%, transparent);
}

.step-content h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.step-duration {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--accent-text);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    margin-bottom: 0.75rem;
}

.step-deliverables {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.deliverable {
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* Dark mode process styles */
[data-theme='dark'] .step-number {
    border-color: var(--bg-primary);
}

[data-theme='dark'] .step-duration {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

[data-theme='dark'] .deliverable {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Tablet - 3 column layout */
@media (max-width: 992px) {
    .process-timeline {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem 1rem;
    }

    .process-timeline::before {
        display: none;
    }
}

/* Small tablet - 2 column layout */
@media (max-width: 768px) {
    .process-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1rem;
    }

    .step-number {
        width: 44px;
        height: 44px;
        font-size: clamp(1.1rem, 2vw, 1.3rem);
    }

    .step-content h3 {
        font-size: clamp(0.9rem, 1.5vw, 1rem);
    }

    .step-content p {
        font-size: clamp(0.8rem, 1.2vw, 0.9rem);
        margin-bottom: 0.5rem;
    }

    .step-deliverables {
        gap: 0.25rem;
    }

    .deliverable {
        font-size: clamp(0.65rem, 1vw, 0.75rem);
        padding: 0.2rem 0.4rem;
    }
}

/* Mobile - single column stacked layout */
@media (max-width: 480px) {
    .process-timeline {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        position: relative;
        padding-left: 2rem;
    }

    /* Vertical connecting line for mobile */
    .process-timeline::before {
        content: '';
        position: absolute;
        left: 20px;
        top: 20px;
        bottom: 20px;
        width: 2px;
        background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
        opacity: 0.6;
        display: block;
    }

    .process-step {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        position: relative;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: clamp(1rem, 2vw, 1.2rem);
        margin-bottom: 0;
        margin-right: 1rem;
        margin-left: -20px;
        flex-shrink: 0;
        position: relative;
        z-index: 2;
        border: 3px solid var(--bg-secondary);
    }

    .step-content {
        padding: 0;
        flex: 1;
        background: var(--bg-secondary);
        padding: 1rem;
        border-radius: 12px;
        border: 1px solid var(--border-color);
    }

    .step-content h3 {
        font-size: clamp(0.95rem, 1.5vw, 1.1rem);
        margin-bottom: 0.25rem;
    }

    .step-content p {
        font-size: clamp(0.8rem, 1.2vw, 0.9rem);
        display: block;
        margin-bottom: 0.5rem;
    }

    .step-deliverables {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .deliverable {
        font-size: clamp(0.7rem, 1vw, 0.8rem);
        padding: 0.25rem 0.5rem;
    }

    /* Dark mode mobile adjustments */
    [data-theme='dark'] .step-number {
        border-color: var(--bg-primary);
    }

    [data-theme='dark'] .step-content {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
}

/* ========================================
   PORTFOLIO SECTION
   ======================================== */

.portfolio {
    padding: 5rem 0;
    background: var(--bg-primary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.portfolio-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.portfolio-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}

.portfolio-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.portfolio-content h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-type {
    display: inline-block;
    /* A flex item in the column-flex .portfolio-content, so without this it
       stretched into a full-width bar instead of a pill */
    align-self: flex-start;
    padding: 0.25rem 0.6rem;
    background: color-mix(in srgb, var(--accent-secondary) 10%, transparent);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-text);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.portfolio-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    margin-bottom: 1rem;
}

.portfolio-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.75rem;
}

.metric {
    background: var(--bg-tertiary);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-text);
    border: 1px solid var(--border-color);
}

/* Dark mode portfolio styles */
[data-theme='dark'] .portfolio-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme='dark'] .metric {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

[data-theme='dark'] .portfolio-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .project-type {
    background: color-mix(in srgb, var(--accent-secondary) 15%, transparent);
}

[data-theme='dark'] .tag-badge {
    background: color-mix(in srgb, var(--accent-secondary) 15%, transparent);
}

[data-theme='dark'] .project-gallery img {
    border-color: var(--border-color);
}

[data-theme='dark'] .filter-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme='dark'] .filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-tertiary));
}

/* Mobile responsive portfolio */
@media (max-width: 768px) {
    .portfolio-listing {
        padding: 6rem 0 3rem;
    }

    .portfolio-filters {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portfolio-content {
        padding: 1.25rem;
    }

    .project-results {
        gap: 0.75rem;
    }

    .metric {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .grid-lines,
    .gradient-orb {
        animation: none;
    }
}

/* ========================================
   CODE BLOCKS - Shiki Dual-Theme Syntax Highlighting
   ======================================== */

/* Base code block styles */
.astro-code {
    position: relative;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 1.5rem 0;
}

/* Light theme (default) - CSS variable mapping */
.astro-code,
.astro-code span {
    color: var(--shiki-light) !important;
    background-color: var(--shiki-light-bg) !important;
    font-style: var(--shiki-light-font-style) !important;
    font-weight: var(--shiki-light-font-weight) !important;
    text-decoration: var(--shiki-light-text-decoration) !important;
}

/* Dark theme - activated by data-theme attribute */
[data-theme='dark'] .astro-code,
[data-theme='dark'] .astro-code span {
    color: var(--shiki-dark) !important;
    background-color: var(--shiki-dark-bg) !important;
    font-style: var(--shiki-dark-font-style) !important;
    font-weight: var(--shiki-dark-font-weight) !important;
    text-decoration: var(--shiki-dark-text-decoration) !important;
}

/* Language label indicator (no line numbers per user decision) */
.astro-code::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    font-family: var(--font-body);
}

/* ========================================
   PORTFOLIO LISTING PAGE
   ======================================== */

.portfolio-listing {
    padding: 8rem 0 5rem;
}

.portfolio-listing .portfolio-grid {
    margin-top: 0;
}

a.portfolio-card {
    text-decoration: none;
    color: inherit;
}

.portfolio-listing .portfolio-card {
    display: flex;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: capitalize;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-text);
    background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-secondary));
}

.filter-btn.active {
    background: var(--cta-fill);
    border-color: var(--cta-fill);
    color: var(--cta-fg);
}

.portfolio-card.hidden {
    display: none;
}

/* Portfolio CTA */
.portfolio-cta {
    text-align: center;
    margin-top: 2.5rem;
}

.portfolio-cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.portfolio-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
    color: var(--text-muted);
}

/* ========================================
   PORTFOLIO DETAIL PAGE
   ======================================== */

.project-detail {
    padding: 8rem 0 5rem;
}

.project-detail .container {
    max-width: 900px;
}

.project-hero {
    margin-bottom: 2rem;
    border-radius: 16px;
    overflow: hidden;
}

.project-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.project-meta {
    margin-bottom: 2.5rem;
}

.project-meta h1 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: color-mix(in srgb, var(--accent-secondary) 10%, transparent);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.project-body {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.project-body h2 {
    font-size: 1.4rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

.project-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.project-body ul {
    margin: 1rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.project-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.project-gallery h2 {
    grid-column: 1 / -1;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.project-gallery img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.project-links .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.related-projects {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.related-projects h2 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0;
    color: var(--text-primary);
}

/* Portfolio Detail - Responsive */
@media (max-width: 768px) {
    .project-meta h1 {
        font-size: 1.6rem;
    }

    .project-detail .container {
        padding: 0 1rem;
    }
}

/* ==========================================
   SERVICES PAGES
   ========================================== */

/* Services listing page */
.services-listing {
    padding: 8rem 0 5rem;
}

/* Service card link wrapper */
a.service-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
}

a.service-card-link .service-card {
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.service-card-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: all var(--transition-fast);
    color: var(--accent-primary);
    z-index: 1;
}

a.service-card-link:hover .service-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Service detail page */
.service-detail {
    padding: 8rem 0 5rem;
}

.service-detail .container {
    max-width: 900px;
}

.service-detail-header {
    text-align: center;
    margin-bottom: 3rem;
}

.service-detail-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent-secondary) 15%, transparent),
        color-mix(in srgb, var(--brand-slate) 10%, transparent)
    );
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--accent-primary);
}

.service-detail-icon svg {
    width: 36px;
    height: 36px;
}

.service-detail-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* What's Included features card */
.service-features {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3rem;
}

.service-features h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.features-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.features-list li svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
    margin-top: 2px;
}

/* Service body -- mirrors .project-body */
.service-body {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.service-body h2 {
    font-size: 1.4rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

.service-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.service-body ul {
    margin: 1rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.service-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* CTA block */
.service-cta-block {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    margin-bottom: 3rem;
}

.service-cta-block h2 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.service-cta-block p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.service-cta-block .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Services - Responsive */
@media (max-width: 768px) {
    .features-list {
        grid-template-columns: 1fr;
    }

    .service-detail-header h1 {
        font-size: 1.6rem;
    }

    .service-detail .container {
        padding: 0 1rem;
    }

    .service-features {
        padding: 1.5rem;
    }

    .service-cta-block {
        padding: 2rem 1.5rem;
    }
}

/* ==========================================
   BLOG PAGES
   ========================================== */

/* Blog listing page */
.blog-listing {
    padding: 8rem 0 5rem;
}

.blog-grid {
    display: grid;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.blog-card {
    display: block;
    text-decoration: none;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.blog-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* h2 on the listing and tag pages, h3 in the related-posts section where the
   cards sit under a "Related Posts" heading */
.blog-card h2,
.blog-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.blog-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Blog post detail page */
.blog-post {
    padding: 8rem 0 5rem;
}

.blog-post .container {
    max-width: 800px;
}

.blog-post-header {
    margin-bottom: 2.5rem;
}

.blog-post-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.blog-post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-post-tags .tag-badge {
    text-decoration: none;
}

.blog-post-tags .tag-badge:hover {
    background: color-mix(in srgb, var(--accent-secondary) 20%, transparent);
}

/* Prose body -- mirrors .project-body and .legal-content patterns */
.blog-post-body {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.blog-post-body h2 {
    font-size: 1.4rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

.blog-post-body h3 {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem;
    color: var(--text-primary);
}

.blog-post-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.blog-post-body ul,
.blog-post-body ol {
    margin: 1rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.blog-post-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Underlined at rest so links differ from prose by more than colour (1.4.1) */
.blog-post-body a {
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-post-body a:hover {
    text-decoration-thickness: 2px;
}

.blog-post-body blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.blog-post-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Code block copy button */
.code-block-wrapper {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.35rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition:
        opacity var(--transition-fast),
        background var(--transition-fast);
    z-index: 1;
    line-height: 1;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: var(--bg-tertiary);
}

.copy-code-btn.copied {
    color: var(--accent-text);
    border-color: var(--accent-primary);
}

.copy-code-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Dark mode blog styles */
[data-theme='dark'] .blog-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme='dark'] .blog-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .blog-post-body blockquote {
    border-left-color: var(--accent-secondary);
}

/* Mobile responsive blog */
@media (max-width: 768px) {
    .blog-listing {
        padding: 6rem 0 3rem;
    }

    .blog-grid {
        gap: 1.5rem;
    }

    .blog-card {
        padding: 1.25rem;
    }

    .blog-card h2,
    .blog-card h3 {
        font-size: 1.15rem;
    }

    .blog-post {
        padding: 6rem 0 3rem;
    }

    .blog-post-header h1 {
        font-size: 1.6rem;
    }

    .blog-post-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .blog-post-body {
        margin-bottom: 2rem;
    }

    .blog-post .container {
        padding: 0 1rem;
    }
}

/* ========================================
   PREV/NEXT POST NAVIGATION
   Shared contract consumed by blog + portfolio detail pages (plans 04-02/04-03).
   Prev pins to the left column, next to the right, so a surviving card keeps its
   side when the other end of the chain is hidden (D-02: nothing jumps).
   ======================================== */

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.post-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.post-nav-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.post-nav-link svg {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent-primary);
}

.post-nav-link--prev {
    grid-column: 1;
    text-align: left;
}

.post-nav-link--next {
    grid-column: 2;
    justify-content: flex-end;
    text-align: right;
}

.post-nav-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.post-nav-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Narrow viewports: stack to a single column; each card keeps its alignment. */
@media (max-width: 768px) {
    .post-nav {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 3rem;
        padding-top: 2rem;
    }

    .post-nav-link--prev,
    .post-nav-link--next {
        grid-column: 1;
    }
}

/* ==== ABOUT PAGE ==== */

/* Standalone routed page. 8rem 0 5rem is the literal the other routed pages
   use (.services-listing, .service-detail, .portfolio-listing, the blog pages).
   Classes here are all prefixed about-page- on purpose: animations.js parks
   .about-image and .about-content at opacity 0 for the homepage scroll reveal,
   and reusing either name would hide this page if GSAP ever loads site-wide. */
.about-page {
    padding: 8rem 0 5rem;
}

.about-page-intro {
    max-width: 760px;
    margin: 0 auto 3rem;
}

.about-page-intro h1 {
    margin: 1rem 0;
}

.about-page-lede {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-page-body {
    max-width: 760px;
    margin: 0 auto;
}

.about-page-body h2 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-page-body h3 {
    font-size: 1.05rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.about-page-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Client names carried inline in the prose. They are the proof, so they read at
   full text colour rather than the muted body grey around them. */
.about-page-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-page-body code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

.about-page-body ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    list-style: disc;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-page-body li {
    margin-bottom: 0.35rem;
}

@media (max-width: 768px) {
    .about-page {
        padding: 6rem 0 4rem;
    }
}

/* ==== BLOG FILTERS ==== */

/* Mirrors .portfolio-filters, but the controls here are anchors to the static
   tag pages rather than buttons, so they need the two properties a <button>
   already has by default. .filter-btn and .filter-btn.active are reused as-is;
   the active state already takes --cta-fill / --cta-fg, which is the pair that
   keeps filled surfaces readable in both themes. */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.blog-filters .filter-btn {
    display: inline-block;
    text-decoration: none;
}

/* No opacity: at 0.65 the counts fell to 2.7 to 3.7:1. A lighter weight than
   the 600 label keeps them secondary without losing contrast. */
.filter-count {
    margin-left: 0.35rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.blog-feed-link {
    display: block;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.blog-feed-link:hover {
    color: var(--accent-text);
}

@media (max-width: 768px) {
    .blog-filters {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .blog-filters .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   HERO EMBLEM (hero3d.js)
   ======================================== */

/* The glow sprites behind the emblem are larger than the canvas. Fade the
   canvas edges so they melt into the hero instead of ending in a hard box. */
#hero-canvas {
    -webkit-mask-image: radial-gradient(closest-side, #000 65%, transparent);
    mask-image: radial-gradient(closest-side, #000 65%, transparent);
}

/* ========================================
   LAUNCH POLISH: SHELL
   Header, mobile drawer, footer, back-to-top, focus targets.
   ======================================== */

/* The header CTA must never wrap. A two-line button is taller than the 80px
   header. */
.nav-links .btn {
    white-space: nowrap;
}

/* Belt and braces: the homepage scroll spy no longer marks the CTA active, but
   if anything does, the button keeps its own text colour rather than the
   active-link state. */
.nav-links a.btn.active {
    color: var(--text-primary);
}

/* Footer twin of the header's active link. BaseLayout sets aria-current on the
   link for the section you are in. */
.footer-links a[aria-current] {
    color: var(--text-primary);
}

/* Dark mode: the raster logo's grey "creative" wordmark read noticeably dimmer
   than the nav text on the dark header and footer. A lift brings it level
   without blowing out the teal "studio" script. A proper fix is a dark-mode
   export of the logo with a white wordmark. */
[data-theme='dark'] .logo-img {
    filter: brightness(1.35);
}

/* scrollSpy.js moves focus to the section a header link scrolls to, so the next
   Tab continues from there. The section is not a control, so no ring. */
section[tabindex='-1']:focus {
    outline: none;
}

/* Phones: smaller and tucked into the corner so it stops covering content.
   site-common.js also hides it while the quote form is on screen, where it sat
   on top of Continue and Send. */
@media (max-width: 768px) {
    #back-to-top {
        width: 44px;
        height: 44px;
        right: 12px;
        bottom: 12px;
    }
}

/* Visually hidden, still read by screen readers (live regions, extra labels) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Routed page intros (/services, /portfolio, /blog, tag pages). The 600px
   default broke a 64px H1 into a tall, cramped block. Balanced wrapping also
   stops one-word orphans in the subtitles. */
.section-header:has(> h1) {
    max-width: 760px;
}

.section-header h1,
.section-subtitle {
    text-wrap: balance;
}

/* ========================================
   HOMEPAGE COPY REFRESH (index.astro)
   ======================================== */

/* Hero headline: the MESSAGING line is longer than the old slogan and ran to
   five lines at 64px on desktop. */
@media (min-width: 993px) {
    .hero h1 {
        font-size: clamp(2.5rem, 4vw, 3.25rem);
    }
}

/* Light mode only. The gradient half of the headline started on the brand teal
   (about 2.4:1 on white, under 3:1 even for large text). This starts at about
   3.8:1 and keeps the teal-to-slate character. Dark mode is unchanged. */
:root:not([data-theme='dark']) .hero h1 {
    --hero-gradient: linear-gradient(
        135deg,
        color-mix(in srgb, var(--brand-teal) 55%, var(--brand-slate)),
        var(--brand-slate)
    );
    --hero-sheen: var(--brand-light-blue);
}

/* Light mode only. The slate orb read as a grey smudge on white, and on phones
   it washed the whole lower hero behind both buttons. */
:root:not([data-theme='dark']) .orb-2 {
    background: var(--brand-light-blue);
    opacity: 0.35;
}

/* Phones: the stacked 3D canvas pushed the primary button below the fold at
   390x844. With these, both hero buttons sit in the first screen and share one
   width instead of two slightly different ones. The canvas height is whatever
   is left above the buttons: 240px since the hero tag was removed. */
@media (max-width: 480px) {
    .hero-3d {
        min-height: 240px;
    }

    #hero-canvas {
        max-height: 240px;
    }

    .hero-grid {
        gap: 1.25rem;
    }

    .hero h1 {
        font-size: 2.125rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        line-height: 1.65;
        margin-bottom: 1.5rem;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* Value pillars under the about grid. Named about-pillar-* on purpose:
   animations.js hides .about-image and .about-content until they scroll in. */
.about-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 5rem;
}

.about-pillar {
    display: flex;
    flex-direction: column;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.about-pillar h3 {
    margin-bottom: 0.75rem;
}

.about-pillar p {
    font-size: 0.95rem;
    line-height: 1.7;
}

.about-pillar-quote {
    margin-top: 1.25rem;
    padding-left: 1rem;
    border-left: 3px solid var(--cta-fill);
}

.about-pillar-quote p {
    font-style: italic;
    color: var(--text-primary);
}

.about-pillar-quote figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .about-pillars {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 4rem;
    }
}

/* Client logos, light mode. Greyscale at 0.6 left the pale T3 Projects logo
   almost invisible on white while the others read fine. Flat silhouettes match
   the dark-mode treatment, so the strip reads as one even row. Hover still
   restores full colour. */
:root:not([data-theme='dark']) .logo-item img {
    filter: brightness(0) opacity(0.5);
}

:root:not([data-theme='dark']) .logo-item:hover img {
    filter: none;
}

/* Pause control for the looping logo strip (WCAG 2.2.2). animations.js shows
   it only when the marquee actually runs, so reduced-motion visitors never
   see it. */
.logo-pause {
    display: block;
    min-height: 24px;
    margin: 1rem auto 0;
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.logo-pause:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.logo-pause[hidden] {
    display: none;
}

/* Services: four group cards, each with an eyebrow and a list of service
   links. Still div.service-card, so GSAP and the spotlight keep working. */
@media (min-width: 769px) {
    .services-grid.service-groups {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* The card is not itself a link any more, so it should not lift */
.service-groups .service-card:hover {
    transform: none;
}

.service-groups .section-tag {
    position: relative;
    z-index: 1;
    margin-bottom: 0.75rem;
}

.service-group-list {
    position: relative;
    z-index: 1;
    list-style: none;
    display: grid;
    gap: 0.35rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* The arrow sits on the right edge so wrapped titles still line up on phones */
.service-group-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 32px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.service-group-list a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent-primary);
    transition: transform var(--transition-fast);
}

.service-group-list a:hover,
.service-group-list a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.service-group-list a:hover svg {
    transform: translateX(3px);
}

/* Process: four steps now, not five. Without this the five-column grid left an
   empty column and ran the connecting line past step 4. Phones keep the
   vertical layout from the 480px rules. */
@media (min-width: 993px) {
    .process-timeline {
        grid-template-columns: repeat(4, 1fr);
    }

    .process-timeline::before {
        left: 12.5%;
        right: 12.5%;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .process-timeline {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   QUOTE FORM POLISH (quoteGenerator.js)
   ======================================== */

/* The reset zeroes p margins, so on steps 3 and 4 the intro line sat directly
   on the first label. A class rather than .quote-step > p so the success
   screen's own spacing is left alone. */
.quote-step-intro {
    margin-bottom: 1.5rem;
}

/* A field flagged by the validation message gets the same red as the message,
   so the problem is visible on the field itself and not only announced */
.form-group [aria-invalid='true'],
.form-group [aria-invalid='true']:focus {
    border-color: #b91c1c;
}

[data-theme='dark'] .form-group [aria-invalid='true'],
[data-theme='dark'] .form-group [aria-invalid='true']:focus {
    border-color: #fca5a5;
}

/* "I read and reply to every enquiry myself" under the step 4 buttons */
.quote-footnote {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
}

/* Step headings take programmatic focus on every step change so keyboard and
   screen reader users land at the start of the new step. They are not
   controls, so no focus ring. */
.quote-step h3[tabindex='-1']:focus {
    outline: none;
}

/* Step 2 now matches step 1: horizontal cards with the filled icon tile, so the
   flow reads as one form, and step 2 is roughly half as tall on phones. Grid
   rather than flex because the icon, title and description are siblings. */
.category-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 0.75rem;
    align-items: start;
    text-align: left;
}

.cat-icon {
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
    margin: 0;
    background: var(--cta-gradient);
    color: var(--cta-fg);
}

.category-card .cat-title {
    margin-bottom: 0.15rem;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
}

.category-card .cat-desc {
    color: var(--text-muted);
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
}

/* "Not sure yet" is the seventh option. Full width reads as a deliberate
   catch-all instead of an orphan tile on the last row. */
.category-card[data-category='unsure'] {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .category-card {
        column-gap: 0.5rem;
    }

    .cat-icon {
        width: 36px;
        height: 36px;
    }

    .category-card .cat-title {
        font-size: 0.9rem;
    }

    .category-card .cat-desc {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .quote-footnote {
        text-align: left;
    }
}

/* ========================================
   PROSE: LINKS, CLIENT QUOTES, BOLD AND SMALL PRINT
   One pattern for the long-form bodies: service pages, case studies, About
   and the CTA cards (blog posts and legal pages use the same look, set in
   their own sections). Links are underlined at rest (WCAG 1.4.1) in
   --accent-text, which passes in both themes.
   ======================================== */
.service-body a,
.project-body a,
.about-page-body a,
.service-cta-block p a {
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.service-body a:hover,
.project-body a:hover,
.about-page-body a:hover,
.service-cta-block p a:hover {
    text-decoration-thickness: 2px;
}

/* Client quotes in Markdown. The reset strips all margin and padding, so
   without this a quote looked exactly like the body text around it. The first
   paragraph is the quote; a second one is the attribution line. */
.service-body blockquote,
.project-body blockquote {
    border-left: 3px solid var(--cta-fill);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
}

.service-body blockquote p:first-child,
.project-body blockquote p:first-child {
    font-style: italic;
    color: var(--text-primary);
}

.service-body blockquote p:last-child,
.project-body blockquote p:last-child {
    margin-bottom: 0;
}

.service-body blockquote p:last-child:not(:first-child),
.project-body blockquote p:last-child:not(:first-child) {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Bold step labels and the "Built with:" label */
.service-body strong,
.project-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* The secondary "Built with" or "Covers" line under a list */
.service-body small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* About page quotes are <figure> with a <figcaption> */
.about-page-body figure {
    margin: 1.75rem 0 2rem;
}

.about-page-body blockquote {
    border-left: 3px solid var(--cta-fill);
    padding-left: 1.25rem;
}

.about-page-body blockquote p {
    margin-bottom: 0.5rem;
    font-style: italic;
    color: var(--text-primary);
}

.about-page-body figcaption {
    padding-left: calc(1.25rem + 3px);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ========================================
   ROUTED PAGES: ONE LEFT EDGE, AND THE END-OF-PAGE CTA
   ======================================== */

/* Case studies and service pages: the container was 900px (836px inside) while
   the breadcrumb and body were 800px and centred, so the left edge jogged by
   18px down the page. 864px leaves exactly 800px inside, so the hero, heading,
   cards and body all share one edge. */
.project-detail .container,
.service-detail .container {
    max-width: 864px;
}

/* About: the breadcrumb was 800px over a 760px column */
.about-page .breadcrumb {
    max-width: 760px;
}

/* Service page: a Get a Quote straight under the intro, so nobody has to read
   three screens of copy to find the next step. The closing CTA card stays. */
.service-detail-cta {
    margin-top: 1.5rem;
}

/* /services/: space between the four groups. Their ids double as anchors; the
   html scroll-padding-top already clears the header. */
.service-group + .service-group {
    margin-top: 6rem;
}

.service-group .section-header {
    margin-bottom: 2.5rem;
}

/* Lets a four-card group sit on one row at desktop instead of 3 + 1 */
.service-group .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.related-services .services-grid {
    margin-top: 3rem;
}

/* The CTA card closes the page on every routed template */
.service-detail .service-cta-block {
    margin: 4rem 0 0;
}

.services-listing .service-cta-block,
.blog-listing .service-cta-block {
    max-width: 800px;
    margin: 6rem auto 0;
}

.portfolio-listing .service-cta-block {
    margin-top: 3rem;
    margin-bottom: 0;
}

.about-page .service-cta-block {
    max-width: 760px;
    margin: 4rem auto 0;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .service-group + .service-group,
    .services-listing .service-cta-block,
    .blog-listing .service-cta-block {
        margin-top: 4rem;
    }
}

@media (max-width: 600px) {
    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   BLOG: CODE BLOCKS
   ======================================== */

/* The copy button only appeared on mouse hover. Show it to keyboard focus and
   on touch screens too. */
.code-block-wrapper:focus-within .copy-code-btn,
.copy-code-btn:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .copy-code-btn {
        opacity: 1;
    }
}

/* The vitesse themes draw comments and punctuation at 2.3 to 3.9:1. Matched on
   the colour Shiki writes into each token's style, so this needs updating if
   the theme in astro.config.mjs changes. The extra attribute selector beats
   the !important token rules in CODE BLOCKS above. */
.astro-code span[style*='--shiki-light:#A0ADA0'],
.astro-code span[style*='--shiki-light:#999999'] {
    color: var(--text-muted) !important;
}

[data-theme='dark'] .astro-code span[style*='--shiki-dark:#758575'],
[data-theme='dark'] .astro-code span[style*='--shiki-dark:#666666'] {
    color: var(--text-muted) !important;
}

/* ========================================
   FINAL VISUAL PASS (launch)
   ======================================== */

/* A <button> does not inherit the page font: the browser gives it its own. So
   the quote form's Back, Continue and Send buttons rendered in Arial while
   every link styled as .btn used Plus Jakarta Sans. */
button.btn {
    font-family: inherit;
}

/* Markdown tables in blog posts had no styles at all: no cell padding, no
   rules, centred headings and the next paragraph butted against the last row.
   Two published posts use one. */
.blog-post-body table {
    width: 100%;
    margin: 1.5rem 0 2rem;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.5;
}

.blog-post-body th,
.blog-post-body td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.blog-post-body thead th {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--cta-fill);
}

.blog-post-body tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

/* Home service groups: the eyebrow pill was louder than the group heading
   under it, so "DESIGN AND BUILD" read as the title and "Your website" as a
   caption. Two-line service links also sat almost touching on phones. */
.service-groups .section-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
}

.service-groups .service-card h3 {
    font-size: 1.3rem;
}

.service-group-list {
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .blog-post-body table {
        font-size: 0.875rem;
    }

    .blog-post-body th,
    .blog-post-body td {
        padding: 0.6rem 0.5rem;
    }
}

/* ========================================
   ABOUT PAGE: VISUAL LAYOUT
   Replaces the single 760px text column with a split hero (the 3D emblem
   still), a facts band, service cards, a pull quote, a work strip and two
   text-and-quote splits. Classes keep the about-page- prefix (see the note at
   ABOUT PAGE above). Cards follow the site literals: 16px radius.
   ======================================== */
.about-page .breadcrumb {
    max-width: none;
}

.about-page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 3rem;
    margin-top: 1rem;
}

.about-page-hero h1 {
    font-size: clamp(2.25rem, 4.2vw, 3.4rem);
    line-height: 1.1;
    margin: 1.25rem 0 1.5rem;
}

.about-page-hero .about-page-lede {
    max-width: 620px;
}

.about-page-byline {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    max-width: 620px;
}

.about-page-byline strong {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
}

.about-page-byline span {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* The emblem sits in a soft wash with two dotted orbits, a quiet echo of the
   particle ring around the homepage hero. Decorative, so aria-hidden. */
.about-page-hero-visual {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    isolation: isolate;
}

.about-page-hero-visual::before {
    content: '';
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(
        circle at 45% 45%,
        color-mix(in srgb, var(--accent-primary) 38%, transparent),
        transparent 68%
    );
    filter: blur(24px);
    z-index: -1;
}

.about-page-orbit {
    position: absolute;
    border-radius: 50%;
    border: 1.5px dotted color-mix(in srgb, var(--accent-primary) 70%, transparent);
    z-index: -1;
}

.about-page-orbit-outer {
    inset: 2%;
    animation: about-orbit 80s linear infinite;
}

.about-page-orbit-inner {
    inset: 15%;
    border-style: dashed;
    border-color: color-mix(in srgb, var(--accent-primary) 40%, transparent);
    animation: about-orbit 60s linear infinite reverse;
}

/* A small marker riding each orbit, so the rotation reads */
.about-page-orbit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-primary);
}

.about-page-orbit-inner::after {
    top: 12%;
    left: 12%;
    width: 7px;
    height: 7px;
}

.about-page-emblem {
    width: 72%;
    height: auto;
    filter: drop-shadow(0 24px 40px rgba(30, 58, 69, 0.25));
    animation: about-float 7s ease-in-out infinite;
}

[data-theme='dark'] .about-page-emblem {
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.55));
}

:root:not([data-theme='dark']) .about-page-orbit {
    border-color: var(--brand-teal);
}

:root:not([data-theme='dark']) .about-page-orbit-inner {
    border-color: color-mix(in srgb, var(--brand-teal) 60%, transparent);
}

:root:not([data-theme='dark']) .about-page-hero-visual::before {
    background: radial-gradient(
        circle at 45% 45%,
        color-mix(in srgb, var(--brand-teal) 45%, transparent),
        transparent 68%
    );
}

@keyframes about-orbit {
    to {
        transform: rotate(360deg);
    }
}

@keyframes about-float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-14px) rotate(-2deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .about-page-orbit,
    .about-page-emblem {
        animation: none;
    }
}

/* Facts band: four short, checkable numbers */
.about-page-facts {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 4rem 0 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.about-page-facts li {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 2rem 1.5rem;
}

.about-page-facts li + li {
    border-left: 1px solid var(--border-color);
}

.about-page-fact-num {
    font-family: var(--font-heading);
    font-size: clamp(2.25rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.about-page-fact-label {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Sections */
.about-page-section {
    margin-top: 6rem;
}

.about-page-section-head {
    max-width: 680px;
    margin-bottom: 2.5rem;
}

.about-page-section-head h2,
.about-page-split h2 {
    margin-bottom: 0.75rem;
}

.about-page-section-head p,
.about-page-split p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-page-split p + p,
.about-page-split dl + p {
    margin-top: 1rem;
}

.about-page-section-head-row {
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.about-page-section-head-row > div {
    max-width: 680px;
}

/* What I do: four cards */
.about-page-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.about-page-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.about-page-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent-primary) 16%, transparent);
    color: var(--accent-text);
    margin-bottom: 1.25rem;
}

[data-theme='dark'] .about-page-card-icon {
    background: color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.about-page-card-icon svg {
    width: 24px;
    height: 24px;
}

.about-page-card-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.about-page-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.about-page-card p {
    line-height: 1.75;
    color: var(--text-secondary);
}

.about-page-card p + p {
    margin-top: 0.75rem;
}

.about-page-card a,
.about-page-split p a,
.about-page-checks a {
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.about-page-card a:hover,
.about-page-split p a:hover,
.about-page-checks a:hover {
    text-decoration-thickness: 2px;
}

.about-page-split strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Pull quote */
.about-page-pullquote {
    max-width: 880px;
    margin: 6rem auto 0;
    text-align: center;
}

.about-page-pullquote-mark {
    display: inline-block;
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.about-page-pullquote blockquote p {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-primary);
}

.about-page-pullquote figcaption,
.about-page-quote-card figcaption {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.about-page-pullquote figcaption {
    justify-content: center;
    margin-top: 1.75rem;
}

.about-page-pullquote figcaption strong,
.about-page-quote-card figcaption strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
}

.about-page-pullquote figcaption img,
.about-page-quote-card figcaption img {
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.about-page-pullquote figcaption img {
    width: 56px;
    height: 56px;
}

/* Work strip */
.about-page-work {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.about-page-work-item {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.about-page-work-image {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.about-page-work-image img {
    display: block;
    width: 100%;
    height: auto;
}

.about-page-work-item:hover .about-page-work-image,
.about-page-work-item:focus-visible .about-page-work-image {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.about-page-work-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.about-page-work-item:hover .about-page-work-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.about-page-work-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

@media (prefers-reduced-motion: reduce) {
    .about-page-work-image {
        transition: none;
    }

    .about-page-work-item:hover .about-page-work-image,
    .about-page-work-item:focus-visible .about-page-work-image {
        transform: none;
    }
}

/* Text beside a client quote */
.about-page-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 4rem;
    align-items: start;
}

.about-page-stack {
    margin: 1.75rem 0;
    display: grid;
    gap: 0.75rem;
}

.about-page-stack > div {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 1rem;
}

.about-page-stack dt {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.about-page-stack dd {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.about-page-stack dd span {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.about-page-quote-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin: 0;
}

.about-page-quote-card blockquote p {
    font-size: 1.1rem;
    line-height: 1.7;
    font-style: italic;
    color: var(--text-primary);
}

.about-page-quote-card figcaption {
    margin-top: 1.5rem;
}

.about-page-quote-card figcaption img {
    width: 48px;
    height: 48px;
}

.about-page-split .about-page-quote-lead {
    margin-bottom: 1.25rem;
}

.about-page-checks {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.about-page-checks li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 0.75rem;
    align-items: start;
    line-height: 1.65;
    color: var(--text-secondary);
}

.about-page-checks svg {
    width: 20px;
    height: 20px;
    margin-top: 0.2rem;
    color: var(--accent-text);
}

.about-page .service-cta-block {
    max-width: 880px;
    margin-top: 6rem;
}

@media (max-width: 992px) {
    .about-page-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .about-page-hero-visual {
        order: -1;
        width: min(300px, 70%);
        margin: 0 auto;
    }

    .about-page-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-page-facts li:nth-child(3) {
        border-left: none;
    }

    .about-page-facts li:nth-child(n + 3) {
        border-top: 1px solid var(--border-color);
    }

    .about-page-split {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .about-page-hero-visual {
        width: min(200px, 55%);
    }

    .about-page-cards,
    .about-page-work {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-page-section,
    .about-page-pullquote,
    .about-page .service-cta-block {
        margin-top: 4rem;
    }

    .about-page-facts {
        margin-top: 3rem;
    }

    .about-page-facts li {
        padding: 1.5rem 1rem;
    }

    .about-page-card,
    .about-page-quote-card {
        padding: 1.5rem;
    }

    .about-page-stack > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.4rem;
    }
}

/* ========================================
   CASE STUDY: BRAND PANEL BESIDE THE HERO
   Only on projects whose frontmatter has `brand` (Brian designed the logo).
   The website mockup keeps the left, and a logo sheet and the brand colours
   stack on the right. The logo sits on a fixed white artboard in both themes,
   because client logos are drawn for light backgrounds.
   ======================================== */
:root {
    --brand-artboard: #ffffff;
    --brand-artboard-text: #4d6570;
}

.project-hero-brand {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.project-hero-brand .project-hero {
    margin-bottom: 0;
}

.project-brand {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 1rem;
    min-width: 0;
}

.project-brand-logo {
    position: relative;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 2.5rem 1.75rem 1.75rem;
    background: var(--brand-artboard);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.project-brand-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}

.project-brand-logo figcaption,
.project-brand-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-brand-logo figcaption {
    position: absolute;
    top: 0.9rem;
    left: 1rem;
    color: var(--brand-artboard-text);
}

.project-brand-colours {
    padding: 1rem 1.25rem 1.1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.project-brand-label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.project-brand-colours ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin: 0;
    padding: 0;
}

.project-brand-colours li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.project-brand-colours svg {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    outline: 1px solid var(--border-color);
    outline-offset: 2px;
}

.project-brand-colours code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

@media (max-width: 700px) {
    .project-hero-brand {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-brand-logo {
        min-height: 160px;
    }
}

/* ========================================
   BLOG COVERS
   Covers are made with .planning/blog-covers/compose-cover.js: one topic
   illustration per post on the brand gradient. A card with a cover puts it on the
   left; the post page shows it full width under the header.
   ======================================== */
.blog-card--image {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.5rem 1rem 1rem;
}

.blog-card-image {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--brand-dark);
}

.blog-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.blog-card--image:hover .blog-card-image img {
    transform: scale(1.04);
}

.blog-card-content p:last-of-type {
    margin-bottom: 0.75rem;
}

.blog-post-hero {
    margin: 0 0 2.5rem;
    border-radius: 16px;
    overflow: hidden;
    background: var(--brand-dark);
}

.blog-post-hero img {
    display: block;
    width: 100%;
    height: auto;
}

@media (prefers-reduced-motion: reduce) {
    .blog-card-image img {
        transition: none;
    }

    .blog-card--image:hover .blog-card-image img {
        transform: none;
    }
}

@media (max-width: 640px) {
    .blog-card--image {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
        padding: 1rem 1rem 1.25rem;
    }

    .blog-card-image {
        aspect-ratio: 1600 / 840;
    }

    .blog-post-hero {
        margin-bottom: 2rem;
        border-radius: 12px;
    }
}

/* ========================================
   SCROLL REVEAL AND PAGE ENTRANCES
   One feel for motion on every page. [data-reveal] elements fade and lift in
   as they scroll into view: reveal.js decides when, and staggers elements that
   arrive together. .page-enter (each child in turn) and .page-enter-item play
   once on load in pure CSS, for headers and hero images at the top of a page,
   so the first thing a visitor reads never waits on a script.
   The pace is deliberate: the old 0.45s reveals were over before anyone
   noticed them. Reduced motion gets none of this.
   ======================================== */
:root {
    --reveal-duration: 1s;
    --reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --reveal-distance: 48px;
    --enter-gap: 130ms;
}

@keyframes reveal-up {
    from {
        opacity: 0;
        translate: 0 var(--reveal-distance);
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

/* Hidden until revealed. The theme script in BaseLayout sets .reveal-ready
   before first paint, and only when reveal.js is going to run. */
.reveal-ready [data-reveal]:not(.is-revealed) {
    opacity: 0;
}

/* `translate`, not `transform`, so the hover lift on the same cards still
   works. reveal.js adds .reveal-done when it ends, which drops the animation. */
.reveal-ready [data-reveal].is-revealed:not(.reveal-done) {
    animation: reveal-up var(--reveal-duration) var(--reveal-ease) var(--reveal-delay, 0ms) both;
}

@media (prefers-reduced-motion: no-preference) {
    .page-enter > *,
    .page-enter-item {
        animation: reveal-up var(--reveal-duration) var(--reveal-ease) both;
        animation-delay: calc(var(--enter-step, 0) * var(--enter-gap) + 120ms);
    }

    .page-enter > :nth-child(2) {
        --enter-step: 1;
    }

    .page-enter > :nth-child(3) {
        --enter-step: 2;
    }

    .page-enter > :nth-child(4) {
        --enter-step: 3;
    }

    .page-enter > :nth-child(n + 5) {
        --enter-step: 4;
    }

    /* Filters, hero images and side visuals follow the header beside them.
       An inline --enter-step overrides this where the order differs. */
    .page-enter-item {
        --enter-step: 3;
    }
}

/* ========================================
   HOMEPAGE HERO ENTRANCE
   The headline arrives word by word, each rising out of its own mask with a
   slight tilt, then a light sweeps across the gradient half. The subline and
   buttons follow while the 3D emblem plays its own intro. Pure CSS, so it
   starts with the first paint and never flashes. index.astro splits the words;
   the h1's aria-label keeps the sentence whole for screen readers.
   ======================================== */
.hero h1 {
    --hero-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --hero-sheen: var(--text-primary);
}

/* The desktop pin turns .hero-pin into a flex box, where the hero would
   shrink to its 1200px container and leave a strip down the right */
.hero-pin > .hero {
    width: 100%;
}

.hero-word {
    display: inline-block;
    /* Room for descenders and the tilt, so the mask only hides the rise */
    padding: 0.05em 0.06em 0.16em;
    margin: -0.05em -0.06em -0.16em;
    overflow: clip;
    vertical-align: top;
}

.hero-word-inner {
    display: inline-block;
}

/* Each word paints its own copy of the gradient: a transformed child does not
   show through its parent's background-clip: text */
.hero-title .gradient-text {
    background: none;
}

.hero-title .gradient-text .hero-word-inner {
    background-image:
        linear-gradient(105deg, transparent 38%, var(--hero-sheen) 50%, transparent 62%),
        var(--hero-gradient);
    background-size:
        300% 100%,
        100% 100%;
    background-position:
        100% 0,
        0 0;
    background-repeat: no-repeat;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* The gradient has to reach the descenders too */
    padding-bottom: 0.12em;
    margin-bottom: -0.12em;
}

@keyframes hero-word-rise {
    from {
        translate: 0 110%;
        rotate: 6deg;
    }

    to {
        translate: 0 0;
        rotate: 0deg;
    }
}

@keyframes hero-sheen {
    from {
        background-position:
            100% 0,
            0 0;
    }

    to {
        background-position:
            0% 0,
            0 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    /* Pivot on the bottom-left corner: the tilt lowers the right end, so no
       part of a word pokes above its mask before it rises */
    .hero-word-inner {
        transform-origin: 0 100%;
        animation: hero-word-rise 1.3s var(--reveal-ease) both;
        animation-delay: calc(var(--i, 0) * 90ms + 150ms);
    }

    .hero-title .gradient-text .hero-word-inner {
        animation:
            hero-word-rise 1.3s var(--reveal-ease) both,
            hero-sheen 1.6s cubic-bezier(0.45, 0, 0.25, 1) both;
        animation-delay: calc(var(--i, 0) * 90ms + 150ms), calc(var(--i, 0) * 70ms + 1.25s);
    }

    .hero .hero-subtitle {
        animation: reveal-up var(--reveal-duration) var(--reveal-ease) 0.95s both;
    }

    .hero .hero-actions {
        animation: reveal-up var(--reveal-duration) var(--reveal-ease) 1.15s both;
    }
}
