/* ==========================================================================
   JDT Engineering — visual system
   Everything here derives from the logo: two translucent lenses, one cyan and
   one pink, overlapping into violet, with near-black letterforms. The lenses
   only read on a light ground, so the site is built on paper, not ink. The
   overlap tone carries interaction, and the three-stop "spectrum rule" is the
   one repeated device.
   ========================================================================== */

/* --- Panton -------------------------------------------------------------- */

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton ExtraLight.otf') format('opentype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton Light Italic.otf') format('opentype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton Regular Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton SemiBold Italic.otf') format('opentype');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton Bold Italic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Panton';
    src: url('../fonts/Fontfabric - Panton ExtraBold.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Narrow is the display cut: same family as the logo wordmark, but the tighter
   width gives headlines their own voice without introducing a second face. */
@font-face {
    font-family: 'Panton Narrow';
    src: url('../fonts/Fontfabric - Panton Narrow Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Panton Narrow';
    src: url('../fonts/Fontfabric - Panton Narrow ExtraBold.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Panton Narrow';
    src: url('../fonts/Fontfabric - Panton Narrow Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* --- Tokens -------------------------------------------------------------- */

:root {
    /* Sampled from the logo */
    --ink: #1b1a1d;
    --ink-80: #3a3b40;
    --ink-60: #5c6068;
    /* Dark enough to clear AA on both paper and mist: this tier carries the
       small mono metadata (dates, step numbers, the footer line). */
    --ink-40: #686e76;
    --paper: #ffffff;
    --mist: #f1f4f8;
    --mist-deep: #e7ecf3;
    --line: #dfe5ed;

    --cyan: #62cdf0;
    --violet: #5b4a9e;   /* the lens overlap, deepened to hold white text */
    --violet-soft: #7e6cc4;
    --pink: #f07db0;
    --spectrum: linear-gradient(90deg, var(--cyan) 0%, var(--violet-soft) 52%, var(--pink) 100%);

    --font-body: 'Panton', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Panton Narrow', 'Panton', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --header-h: 88px;
    --radius: 4px;
    --radius-lg: 8px;
    --shadow-1: 0 1px 2px rgba(27, 26, 29, 0.05);
    --shadow-2: 0 12px 30px -12px rgba(27, 26, 29, 0.22);
    --band-y: clamp(4rem, 8vw, 7rem);

    /* Bootstrap token bridge — retunes every stock component in one place */
    --bs-body-font-family: var(--font-body);
    --bs-body-color: var(--ink-80);
    --bs-body-bg: var(--paper);
    --bs-emphasis-color: var(--ink);
    --bs-secondary-color: var(--ink-60);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: 3px;
    --bs-border-radius-lg: var(--radius-lg);
    --bs-primary: #5b4a9e;
    --bs-primary-rgb: 91, 74, 158;
    --bs-link-color: #5b4a9e;
    --bs-link-color-rgb: 91, 74, 158;
    --bs-link-hover-color: #3f3273;
    --bs-link-hover-color-rgb: 63, 50, 115;
    --bs-light-rgb: 241, 244, 248;
    --bs-dark-rgb: 27, 26, 29;
    --bs-heading-color: var(--ink);
}

/* --- Base ---------------------------------------------------------------- */

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--ink-80);
    background: var(--paper);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

.page-body {
    padding-top: clamp(2.5rem, 5vw, 4rem);
    padding-bottom: clamp(3rem, 6vw, 5rem);
}

h1, h2, h3, .display-1, .display-2, .display-3, .display-4, .display-5 {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.04;
}

h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.005em;
}

h1, .display-4 {
    font-size: clamp(2.2rem, 4.6vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
}

h3 {
    font-size: clamp(1.3rem, 2vw, 1.6rem);
}

p {
    max-width: 68ch;
}

.lead {
    font-weight: 300;
    font-size: 1.125rem;
    color: var(--ink-60);
}

strong, b {
    font-weight: 700;
    color: var(--ink);
}

a {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: 1rem;
    z-index: 2000;
    transform: translateY(-250%);
    padding: 0.75rem 1rem;
    color: var(--paper);
    background: var(--ink);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

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

/* The signature: the logo's two lenses flattened into a rule. Used at the foot
   of the header, as the mark above each section title, and atop the footer. */
.spectrum-rule {
    height: 3px;
    background: var(--spectrum);
}

/* --- Header -------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--paper);
    border-bottom: 3px solid transparent;
    border-image: var(--spectrum) 1;
}

.site-header-inner {
    display: flex;
    align-items: center;
    /* wrap so the collapsed nav can take its own row below the brand */
    flex-wrap: wrap;
    gap: 1.5rem;
    min-height: calc(var(--header-h) - 3px);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    margin-right: auto;
    text-decoration: none;
}

/* The mark is the "stempel" cut of the logo — the two lenses merged into one
   silhouette with JDT knocked out — filled with the same spectrum as the rules.
   Being solid, it holds up on paper, mist and ink alike, which the original
   dark-letterform artwork never could. */
.site-mark {
    height: 52px;
    width: auto;
    display: block;
    flex: none;
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.site-brand-name {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.site-brand-tagline {
    margin-top: 0.4rem;
    color: var(--ink-60);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .site-brand-tagline {
        display: none;
    }

    .site-brand-name {
        font-size: 1.2rem;
    }
}

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

.site-nav a {
    position: relative;
    padding: 0.35rem 0;
    color: var(--ink-60);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 160ms ease;
}

.site-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--spectrum);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
    color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a[aria-current='page']::after {
    transform: scaleX(1);
}

.site-nav .site-nav-cta {
    padding: 0.6rem 1.15rem;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius);
}

.site-nav .site-nav-cta::after {
    display: none;
}

.site-nav .site-nav-cta:hover {
    background: var(--violet);
    color: var(--paper);
}

.site-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.site-nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink);
}

@media (min-width: 992px) {
    .site-nav-collapse {
        display: flex !important;
        height: auto !important;
        visibility: visible !important;
    }

    .site-nav-toggle {
        display: none;
    }
}

@media (max-width: 991.98px) {
    :root {
        --header-h: 70px;
    }

    .site-mark {
        height: 40px;
    }

    .site-nav-collapse {
        flex-basis: 100%;
        order: 3;
    }

    .site-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-bottom: 1rem;
        border-top: 1px solid var(--line);
        margin-top: 0.25rem;
    }

    .site-nav a {
        padding: 0.9rem 0;
        border-bottom: 1px solid var(--line);
    }

    /* Full-width here would read as a divider rather than a marker. */
    .site-nav a::after {
        right: auto;
        width: 34px;
    }

    .site-nav .site-nav-cta {
        margin-top: 1rem;
        border-bottom: 0;
        text-align: center;
    }
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
    position: relative;
    height: calc(100svh - var(--header-h));
    min-height: 520px;
    /* Raised from 880px: on a wide desktop/4K viewport the old cap capped
       height well below what the viewport could offer, stretching the box
       into an extreme wide-and-short aspect ratio that force-cropped a lot
       out of tightly-framed product photos. */
    max-height: 1080px;
    background: var(--ink);
    overflow: hidden;
}

.hero-carousel,
.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
}

.hero-slide {
    display: block;
    height: 100%;
    position: relative;
    cursor: grab;
}

.hero-carousel.is-dragging .hero-slide {
    cursor: grabbing;
}

.hero-carousel.is-dragging {
    user-select: none;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Opt-in for a photo whose own aspect ratio is far from the hero's: instead
   of cropping it hard to cover the full-bleed box, show it whole (contain)
   over a blurred, oversized copy of the same photo so there's never a flat
   empty bar on the sides. */
.hero-img-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: blur(40px) brightness(0.6);
    transform: scale(1.2);
}

.hero-img.is-contained {
    position: absolute;
    inset: 0;
    object-fit: contain;
}

/* Photo-independent legibility: one scrim, bottom-weighted, so the copy sits on
   near-solid ink no matter what the slide looks like. */
.hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(18, 17, 20, 0.88) 0%,
        rgba(18, 17, 20, 0.55) 30%,
        rgba(18, 17, 20, 0) 62%,
        rgba(18, 17, 20, 0) 100%);
    pointer-events: none;
}

/* Anchored rather than flexed: a flex item sized by an oversized headline can
   overflow its own container, which pushed the copy off the left edge. */
.hero-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding-bottom: clamp(3rem, 7vh, 5.5rem);
    z-index: 3;
    pointer-events: none;
}

.hero-inner {
    pointer-events: auto;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    max-width: none;
}

.hero-eyebrow::before {
    content: '';
    width: 34px;
    height: 3px;
    flex: none;
    background: var(--spectrum);
}

.hero-title {
    max-width: 17ch;
    margin: 0 0 1.25rem;
    color: var(--paper);
    font-size: clamp(2.6rem, 6.4vw, 5.1rem);
    line-height: 0.94;
    letter-spacing: -0.025em;
}

.hero-lead {
    max-width: 46ch;
    margin: 0 0 2rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(1rem, 1.35vw, 1.2rem);
    font-weight: 300;
    line-height: 1.55;
}

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

/* The slide caption reads as a photo credit, kept clear of the headline. */
.slide-label {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 4;
    max-width: calc(100% - 3rem);
    padding: 0.45rem 0.85rem;
    background: rgba(18, 17, 20, 0.62);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 180ms ease, color 180ms ease;
}

.hero-slide:hover .slide-label,
.hero-slide:focus-visible .slide-label {
    border-color: var(--cyan);
    color: var(--paper);
}

/* Controls move out of the middle of the photo and pair up bottom-right. */
.hero .carousel-control-prev,
.hero .carousel-control-next {
    top: auto;
    bottom: clamp(3rem, 7vh, 5.5rem);
    width: 46px;
    height: 46px;
    z-index: 5;
    opacity: 1;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius);
    background: rgba(18, 17, 20, 0.4);
    backdrop-filter: blur(6px);
    transition: background-color 180ms ease, border-color 180ms ease;
}

.hero .carousel-control-prev {
    left: auto;
    right: calc(1.5rem + 46px + 0.5rem);
}

.hero .carousel-control-next {
    right: 1.5rem;
}

.hero .carousel-control-prev:hover,
.hero .carousel-control-next:hover {
    background: rgba(18, 17, 20, 0.75);
    border-color: var(--cyan);
}

.hero .carousel-control-prev-icon,
.hero .carousel-control-next-icon {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 991.98px) {
    .hero .carousel-control-prev,
    .hero .carousel-control-next {
        display: none;
    }
}

/* --- Section bands ------------------------------------------------------- */

.band {
    padding-block: var(--band-y);
}

.band-mist {
    background: var(--mist);
}

/* The closing band goes dark so the page ends on a statement instead of
   dissolving into a footer of the same colour. */
.band-ink {
    background: var(--ink);
    color: rgba(255, 255, 255, 0.78);
}

.band-ink h2 {
    color: var(--paper);
}

.band-ink .lead {
    color: rgba(255, 255, 255, 0.78);
}

.band-ink .section-eyebrow {
    color: rgba(255, 255, 255, 0.7);
}

.band-tight {
    padding-block: clamp(3rem, 5vw, 4.5rem);
}

.section-head {
    max-width: 62ch;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    color: var(--ink-60);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    max-width: none;
}

.section-eyebrow::before {
    content: '';
    width: 34px;
    height: 3px;
    flex: none;
    background: var(--spectrum);
}

.section-head h2 {
    margin: 0;
}

.section-head p {
    margin: 0.85rem 0 0;
    font-size: 1.1rem;
    color: var(--ink-60);
}

.section-foot {
    margin-top: clamp(2rem, 4vw, 3rem);
}

/* --- Buttons ------------------------------------------------------------- */

/* Deliberately uncoloured. The stock blue read as a default nobody chose; ink
   fills let the project photography carry the colour, and the brand tone shows
   up on hover and focus instead. */
.btn {
    --bs-btn-font-family: var(--font-body);
    --bs-btn-font-weight: 600;
    --bs-btn-padding-x: 1.4rem;
    --bs-btn-padding-y: 0.7rem;
    --bs-btn-border-radius: var(--radius);
    --bs-btn-focus-shadow-rgb: 91, 74, 158;
    letter-spacing: 0.01em;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn-lg {
    --bs-btn-padding-x: 1.75rem;
    --bs-btn-padding-y: 0.85rem;
    --bs-btn-font-size: 1rem;
    --bs-btn-border-radius: var(--radius);
}

.btn-sm {
    --bs-btn-padding-x: 0.9rem;
    --bs-btn-padding-y: 0.45rem;
    --bs-btn-font-size: 0.85rem;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--violet);
    --bs-btn-hover-border-color: var(--violet);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #3f3273;
    --bs-btn-active-border-color: #3f3273;
    --bs-btn-disabled-bg: var(--ink-40);
    --bs-btn-disabled-border-color: var(--ink-40);
}

.btn-outline-primary {
    --bs-btn-color: var(--violet);
    --bs-btn-border-color: var(--violet);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--violet);
    --bs-btn-hover-border-color: var(--violet);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #3f3273;
    --bs-btn-active-border-color: #3f3273;
}

.btn-outline-secondary {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--mist);
    --bs-btn-hover-border-color: var(--ink-40);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--mist-deep);
    --bs-btn-active-border-color: var(--ink-40);
}

.btn-outline-light {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, 0.5);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #fff;
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: #fff;
}

/* Replaces the indigo gradient pill: same job, brand-correct, and the spectrum
   only appears on the underline so it stays a detail rather than a slab. */
.btn-jdt {
    position: relative;
    display: inline-block;
    padding: 0.9rem 1.75rem;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    overflow: hidden;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.btn-jdt::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--spectrum);
    transform: translateY(3px);
    transition: transform 200ms ease;
}

.btn-jdt:hover,
.btn-jdt:focus-visible {
    background: var(--violet);
    border-color: var(--violet);
    color: var(--paper);
}

.btn-jdt:hover::after,
.btn-jdt:focus-visible::after {
    transform: translateY(0);
}

.btn-jdt-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.45);
    color: var(--paper);
}

.btn-jdt-ghost:hover,
.btn-jdt-ghost:focus-visible {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink);
}

.btn-jdt-ghost::after {
    display: none;
}

.btn-jdt-outline {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
}

.btn-jdt-invert {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink);
}

.btn-jdt-invert:hover,
.btn-jdt-invert:focus-visible {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--ink);
}

.btn-jdt-invert::after {
    display: none;
}

.btn-jdt-outline:hover,
.btn-jdt-outline:focus-visible {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

/* --- Cards --------------------------------------------------------------- */

.card {
    --bs-card-bg: var(--paper);
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    --bs-card-inner-border-radius: var(--radius);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-x: 1.35rem;
    --bs-card-spacer-y: 1.35rem;
    position: relative;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.card:hover {
    border-color: var(--ink-40);
    box-shadow: var(--shadow-2) !important;
}

.card-title {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--ink);
    transition: color 180ms ease;
}

.card:hover .card-title {
    color: var(--violet);
}

.card-text {
    font-size: 0.94rem;
    color: var(--ink-60);
    max-width: none;
}

.card-img-top {
    background-color: var(--mist);
}

/* Project tiles: the photo is the content, so it gets the movement. */
.project-card .card-media {
    display: block;
    overflow: hidden;
    background: var(--mist);
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.project-card .card-media img {
    display: block;
    width: 100%;
    transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-card:hover .card-media img {
    transform: scale(1.04);
}

.project-card .card-body a {
    text-decoration: none;
}

/* Compact faceted navigation keeps the full portfolio browsable without
   turning the project cards themselves into control surfaces. */
.portfolio-toolbar {
    margin-bottom: clamp(2rem, 4vw, 3rem);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    background: var(--mist);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.portfolio-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.portfolio-filter {
    display: grid;
    gap: 0.45rem;
}

.portfolio-filter > span {
    color: var(--ink-60);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portfolio-filter .form-select {
    min-height: 46px;
    border-color: var(--line);
    background-color: var(--paper);
    color: var(--ink);
    font-weight: 400;
}

.portfolio-filter .form-select:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 0.2rem rgba(91, 74, 158, 0.16);
}

.portfolio-filter-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 32px;
    margin-top: 1rem;
}

.portfolio-empty {
    margin-top: 1.5rem;
}

@media (max-width: 767.98px) {
    .portfolio-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Service and process tiles carry a ghosted photo of the real work. Previously
   a white veil sat over a full-strength image, which read as a broken render;
   now the image itself is dialled back and comes forward on hover. */
.card-with-bg {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--paper);
}

/* The source photos range from near-white sketches to dark workbench shots, so
   a flat opacity made some tiles look empty and others look like grey slabs.
   Crushing contrast and lifting brightness lands every source in the same
   narrow band, and a corner mask keeps the image clear of the text. */
.card-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.55;
    filter: grayscale(1) contrast(0.4) brightness(1.28);
    -webkit-mask-image: radial-gradient(125% 105% at 100% 100%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 60%);
    mask-image: radial-gradient(125% 105% at 100% 100%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 60%);
    pointer-events: none;
    transition: opacity 400ms ease, filter 400ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card-with-bg:hover .card-bg-image {
    opacity: 0.85;
    filter: grayscale(0) contrast(0.85) brightness(1.05);
    transform: scale(1.05);
}

.card-with-bg .card-body {
    position: relative;
    z-index: 2;
}

.tile-icon {
    display: block;
    margin-bottom: 1.1rem;
}

.tile-title {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 0.6rem;
    transition: color 180ms ease;
}

.card-with-bg:hover .tile-title {
    color: var(--violet);
}

.tile-text {
    font-size: 0.94rem;
    color: var(--ink-60);
    margin-bottom: 0;
    max-width: none;
}

/* Process is an actual ordered sequence, so the steps are numbered. */
.step-index {
    display: block;
    margin-bottom: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--ink-40);
}

.card-with-bg:hover .step-index {
    color: var(--violet-soft);
}

/* --- Tags and metadata --------------------------------------------------- */

.badge.bg-primary,
.tag {
    display: inline-block;
    padding: 0.3rem 0.6rem !important;
    background: var(--mist) !important;
    border: 1px solid var(--line);
    border-radius: 3px !important;
    color: var(--ink-60) !important;
    font-family: var(--font-mono);
    font-size: 0.68rem !important;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta-line {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-40);
}

/* --- Project detail ------------------------------------------------------ */

/* Photo variant: the project's own thumbnail stands in for the generic
   homepage hero photo, with the project's own title/date/tags over it. */
.project-page-hero {
    position: relative;
    overflow: hidden;
    /* Stays full-bleed on every monitor, including 4K/ultra-wide. The height
       scales with viewport width so the box's aspect ratio stays close to a
       photo-friendly ~2.2:1 instead of the fixed low cap that, once the
       width keeps growing past a plain desktop size, turned this into a
       very wide, very short strip and force-cropped away most of the photo. */
    height: clamp(420px, 45vw, 900px);
    background: var(--ink);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* When the project has more than one photo, the hero itself is the gallery:
   a carousel fills the same fixed-height box in place of a single image. */
.project-page-hero .carousel,
.project-page-hero .carousel-inner,
.project-page-hero .carousel-item {
    height: 100%;
}

.project-page-hero .carousel-item {
    cursor: grab;
}

.project-page-hero .carousel.is-dragging .carousel-item {
    cursor: grabbing;
}

.project-page-hero .carousel.is-dragging {
    user-select: none;
}

/* The scrim lives on the overlay itself, sized to its own (text) content
   rather than the full photo height, so a taller hero or shorter caption
   both leave more of the photo visible above the readable zone. */
.project-page-hero-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 3.5rem 0 clamp(1.5rem, 4vw, 2.5rem);
    background: linear-gradient(to top,
        rgba(18, 17, 20, 0.88) 0%,
        rgba(18, 17, 20, 0.7) 45%,
        rgba(18, 17, 20, 0) 100%);
}

.project-hero-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    color: rgba(255, 255, 255, 0.86);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 160ms ease;
}

.project-hero-back:hover,
.project-hero-back:focus-visible {
    color: var(--cyan);
}

.project-hero-title {
    max-width: 34ch;
    margin: 0 0 0.85rem;
    color: var(--paper);
    font-size: clamp(1.9rem, 4.4vw, 3.3rem);
    line-height: 1;
    letter-spacing: -0.02em;
}

.project-hero-meta .meta-line {
    color: rgba(255, 255, 255, 0.78);
}

.project-hero-meta .tag {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.92) !important;
}

/* Text-only fallback for projects without a thumbnail. */
.project-hero {
    padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--line);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    color: var(--ink-60);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 160ms ease;
}

.back-link:hover {
    color: var(--violet);
}

.prose {
    font-size: 1.03rem;
}

.prose > :first-child {
    margin-top: 0;
}

.prose h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.9rem;
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
}

.prose h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.005em;
}

.prose p,
.prose li {
    max-width: 72ch;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.prose pre {
    background: var(--mist);
    border: 1px solid var(--line);
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.88rem;
}

.prose code {
    background: var(--mist);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.prose pre code {
    background: transparent;
    padding: 0;
}

.prose blockquote {
    margin: 1.75rem 0;
    padding-left: 1.25rem;
    border-left: 3px solid var(--cyan);
    color: var(--ink-60);
}

.project-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: clamp(2rem, 5vw, 5rem);
    margin-top: clamp(3rem, 6vw, 5rem);
    padding: clamp(2rem, 5vw, 3.5rem);
    overflow: hidden;
    background: var(--ink);
    border-radius: var(--radius-lg);
    color: rgba(255, 255, 255, 0.78);
    position: relative;
}

.project-cta::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--spectrum);
}

.project-cta h2 {
    max-width: 20ch;
    margin-bottom: 1rem;
    color: var(--paper);
}

.project-cta p:last-child {
    margin-bottom: 0;
}

.project-cta .section-eyebrow {
    color: rgba(255, 255, 255, 0.7);
}

.project-cta-action {
    display: grid;
    justify-items: start;
    gap: 0.9rem;
}

.project-cta-action > a:last-child {
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

@media (max-width: 767.98px) {
    .project-cta {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

/* Explanatory SVG diagrams inside project descriptions */
.project-diagram {
    margin: 1.75rem 0;
    padding: 1rem 1rem 0.65rem;
    background: var(--mist);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.project-diagram svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 440px;
    margin: 0 auto;
}

.project-diagram figcaption {
    margin: 0.65rem auto 0;
    max-width: 440px;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink-60);
}

/* --- Standard carousels (service and process pages) --------------------- */

.carousel-inner {
    border-radius: var(--radius);
}

.carousel-img {
    height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
}

.carousel-item a {
    text-decoration: none;
    color: inherit;
}

.carousel-indicators [data-bs-target] {
    width: 22px;
    height: 3px;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.55);
}

.carousel-indicators .active {
    background: var(--paper);
}

/* Content carousels sit directly on the page's light background rather than a
   full-bleed photo, so the stock white Bootstrap glyphs need their own dark
   backdrop to stay legible. */
.content-carousel .carousel-control-prev,
.content-carousel .carousel-control-next {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    opacity: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(18, 17, 20, 0.55);
    transition: background-color 180ms ease;
}

.content-carousel .carousel-control-prev {
    left: 0.85rem;
}

.content-carousel .carousel-control-next {
    right: 0.85rem;
}

.content-carousel .carousel-control-prev:hover,
.content-carousel .carousel-control-next:hover,
.content-carousel .carousel-control-prev:focus-visible,
.content-carousel .carousel-control-next:focus-visible {
    background: rgba(18, 17, 20, 0.8);
}

.content-carousel .carousel-control-prev-icon,
.content-carousel .carousel-control-next-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.content-carousel .carousel-indicators [data-bs-target] {
    background: rgba(18, 17, 20, 0.3);
}

.content-carousel .carousel-indicators .active {
    background: var(--ink);
}

/* Thumbnail strip under a content carousel: the number of columns is
   responsive (3 on phones, up to 5 on desktop), each a clickable
   data-bs-slide-to target kept in sync with the active slide via JS. */
.gallery-thumb-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: none;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    transition: border-color 150ms ease, opacity 150ms ease;
}

.gallery-thumb-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb-btn:not(.active) {
    opacity: 0.7;
}

.gallery-thumb-btn:hover,
.gallery-thumb-btn:focus-visible {
    opacity: 1;
}

.gallery-thumb-btn.active {
    border-color: var(--ink);
    opacity: 1;
}

/* --- Step navigation (process & service sub-pages) ----------------------- */

.step-nav {
    margin: 0 0 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.step-nav-list {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step-nav-item a,
.step-nav-item span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--ink-60);
    text-decoration: none;
    transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.step-nav-item a:hover,
.step-nav-item a:focus-visible {
    border-color: var(--violet);
    color: var(--ink);
}

.step-nav-item.is-current span {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.step-nav-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: var(--mist-deep);
    color: var(--ink-60);
    font-size: 0.65rem;
    flex: none;
}

.step-nav-item.is-current .step-nav-index {
    background: rgba(255, 255, 255, 0.2);
    color: var(--paper);
}

/* --- Callout ------------------------------------------------------------- */

.callout {
    padding: clamp(2.25rem, 4vw, 3.5rem);
    background: var(--mist);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.callout h2,
.callout h3 {
    margin-top: 0;
}

.callout p {
    color: var(--ink-60);
}

.callout .contact-line {
    margin: 1.5rem 0 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.callout .contact-line a {
    color: var(--ink);
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
    margin-top: auto;
    background: var(--mist);
    border-top: 3px solid transparent;
    border-image: var(--spectrum) 1;
}

.site-footer-inner {
    display: grid;
    gap: 2rem;
    padding-block: clamp(2.5rem, 5vw, 3.5rem);
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .site-footer-inner {
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 3rem;
    }
}

.footer-logo {
    height: 46px;
    width: auto;
    margin-bottom: 1rem;
}

.site-footer p {
    color: var(--ink-60);
    font-size: 0.94rem;
    margin-bottom: 0;
}

.footer-heading {
    margin-bottom: 1rem;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.footer-list a {
    color: var(--ink-60);
    font-size: 0.94rem;
    text-decoration: none;
    transition: color 160ms ease;
}

.footer-list a:hover {
    color: var(--violet);
    text-decoration: underline;
}

.site-footer-base {
    padding-block: 1.1rem;
    border-top: 1px solid var(--mist-deep);
    color: var(--ink-40);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

/* --- Motion ------------------------------------------------------------- */

/* On narrow screens the eyebrow wraps, which leaves the rule stranded beside a
   two-line label; stacking keeps both flush to the left margin. */
@media (max-width: 575.98px) {
    .hero-eyebrow,
    .section-eyebrow {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .carousel-item {
        transition: none !important;
    }
}

/* --- Admin: local project authoring ------------------------------------- */

.admin-preview-banner {
    position: sticky;
    top: 0;
    z-index: 1040;
    padding: 0.6rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #3d2e00;
    background: #ffd766;
    border-bottom: 1px solid #e0b43c;
}

.admin-preview-banner a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 0.5rem;
}

/* Shown on the live public page itself when a signed-in admin is viewing it,
   regardless of the project's visibility, so edits can happen in place. */
.admin-edit-bar {
    position: sticky;
    /* The site header is also sticky at top:0; without this offset the two
       fight for the same slot and this bar covers half the header on scroll. */
    top: var(--header-h);
    z-index: 1040;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.85rem;
}

.admin-login-wrap {
    display: grid;
    min-height: 55vh;
    place-items: center;
}

.admin-login-card {
    width: min(100%, 30rem);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-2);
}

.admin-project-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-project-summary > div {
    display: grid;
    min-width: 9.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--mist);
}

.admin-project-summary strong {
    font: 700 1.45rem/1 var(--font-mono);
    color: var(--ink);
}

.admin-project-summary span {
    margin-top: 0.3rem;
    color: var(--ink-60);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.admin-project-table .is-hidden-project {
    --bs-table-bg: var(--mist);
    color: var(--ink-60);
}

.project-state-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.45rem;
    border-radius: 50%;
    background: #1f9d67;
    box-shadow: 0 0 0 3px rgba(31, 157, 103, 0.13);
}

.is-hidden-project .project-state-dot {
    background: var(--ink-40);
    box-shadow: none;
}

.visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink-60);
    font-size: 0.82rem;
    font-weight: 600;
}

.visibility-toggle-track {
    display: flex;
    align-items: center;
    width: 2rem;
    height: 1.15rem;
    padding: 0.13rem;
    border-radius: 999px;
    background: var(--ink-40);
    transition: background-color 160ms ease;
}

.visibility-toggle-track span {
    width: 0.89rem;
    height: 0.89rem;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
    transition: transform 160ms ease;
}

.visibility-toggle.is-visible {
    border-color: #7dc9a8;
    color: #12663f;
}

.visibility-toggle.is-visible .visibility-toggle-track {
    background: #1f9d67;
}

.visibility-toggle.is-visible .visibility-toggle-track span {
    transform: translateX(0.85rem);
}

.visibility-toggle:hover,
.visibility-toggle:focus-visible {
    border-color: var(--violet);
    box-shadow: 0 0 0 0.2rem rgba(91, 74, 158, 0.16);
}

.admin-publish-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-left: 0.3rem solid #1f9d67;
    border-radius: var(--radius);
    background: var(--mist);
}

.admin-publish-setting .form-check-input {
    width: 2.8rem;
    height: 1.4rem;
    cursor: pointer;
}

.admin-photo-tile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}

.admin-photo-tile img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: calc(var(--radius) - 0.2rem);
    background: var(--mist);
}

.admin-photo-filename {
    margin: 0;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--ink-60);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-photo-delete-form {
    margin-top: auto;
}

.thumbnail-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.thumbnail-strip-item {
    flex: none;
    width: 84px;
    height: 64px;
    padding: 0;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--mist);
    cursor: pointer;
    transition: border-color 150ms ease;
}

.thumbnail-strip-item.is-selected {
    border-color: var(--violet);
}

.thumbnail-strip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 767.98px) {
    .admin-project-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .admin-project-summary > div {
        min-width: 0;
    }
}
