:root {
    --bernd-orange: #b64f00;
    --bernd-orange-deep: #8f3f08;
    --bernd-ink: #202a30;
    --bernd-steel: #536d7c;
    --bernd-paper: #f7f5f1;
    --bernd-line: rgba(32, 42, 48, 0.15);
    --bernd-shadow: 0 24px 70px rgba(24, 31, 35, 0.16);
}

html[data-theme="dark"] {
    --bernd-orange: #f09450;
    --bernd-orange-deep: #ffad70;
    --bernd-ink: #f4f6f7;
    --bernd-steel: #b8c8d0;
    --bernd-paper: #0b1217;
    --bernd-line: rgba(220, 232, 238, 0.16);
    --bernd-shadow: 0 28px 74px rgba(0, 0, 0, 0.38);
}

.bernd-page {
    background: var(--bernd-paper);
    color: var(--bernd-ink);
}

.bernd-page .site-header {
    background: color-mix(in srgb, var(--bernd-paper) 91%, transparent);
    border-bottom-color: var(--bernd-line);
}

.bernd-page #progressBar {
    background: var(--bernd-orange);
}

.bernd-nav-shell {
    width: min(1240px, calc(100% - 48px));
}

.bernd-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--bernd-ink);
    font-weight: 780;
}

.bernd-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.bernd-nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    font-size: var(--text-sm);
    font-weight: 680;
}

.bernd-nav-links a {
    transition: color 0.2s ease;
}

.bernd-nav-links a:hover,
.bernd-nav-links a:focus-visible {
    color: var(--bernd-orange);
}

.bernd-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 22px;
    border-left: 1px solid var(--bernd-line);
}

.bernd-nav-back .fas {
    font-size: 0.95rem;
}

.bernd-button i::before,
.bernd-nav-back i::before,
.bernd-project-link i::before,
.bernd-dialog-nav i::before,
.bernd-discipline i::before {
    content: "";
    width: 1em;
    height: 1em;
    display: block;
    background: currentColor;
    -webkit-mask: var(--icon, var(--icon-dot)) center / contain no-repeat;
    mask: var(--icon, var(--icon-dot)) center / contain no-repeat;
}

.bernd-hero {
    position: relative;
    min-height: calc(100svh - 76px);
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    color: #fff;
}

.bernd-hero-media,
.bernd-hero-shade {
    position: absolute;
    inset: 0;
}

.bernd-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 48%;
    transform: scale(1.025);
    animation: bernd-hero-drift 18s ease-in-out infinite alternate;
}

.bernd-hero-shade {
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(10, 15, 18, 0.9) 0%, rgba(10, 15, 18, 0.64) 42%, rgba(10, 15, 18, 0.12) 76%),
        linear-gradient(0deg, rgba(10, 15, 18, 0.55) 0%, transparent 38%);
}

.bernd-hero-content {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 60px 0 96px;
}

.bernd-hero-logo {
    width: 74px;
    height: 74px;
    margin-bottom: 24px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.25));
}

.bernd-eyebrow,
.bernd-section-label,
.bernd-project-type {
    margin: 0;
    color: var(--bernd-orange);
    font-size: 0.78rem;
    font-weight: 790;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bernd-hero .bernd-eyebrow {
    color: #ffbb82;
}

.bernd-hero h1 {
    max-width: 760px;
    margin: 12px 0 20px;
    font-size: clamp(3.4rem, 7.2vw, 7.1rem);
    line-height: 0.9;
    letter-spacing: 0;
}

.bernd-hero-lead {
    max-width: 600px;
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1.08rem, 1.6vw, 1.35rem);
    line-height: 1.55;
}

.bernd-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: 740;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.bernd-button:hover,
.bernd-button:focus-visible {
    transform: translateY(-2px);
}

.bernd-button-primary {
    background: var(--bernd-orange);
    color: #fff;
}

.bernd-button-primary:hover,
.bernd-button-primary:focus-visible {
    background: var(--bernd-orange-deep);
}

.bernd-button-secondary {
    border-color: var(--bernd-line);
    background: transparent;
    color: var(--bernd-ink);
}

.bernd-button-secondary:hover,
.bernd-button-secondary:focus-visible {
    border-color: var(--bernd-orange);
    color: var(--bernd-orange);
}

.bernd-hero-note {
    position: absolute;
    z-index: 2;
    right: max(24px, calc((100vw - 1240px) / 2));
    bottom: 30px;
    max-width: 330px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    text-align: right;
}

.bernd-section {
    min-height: min(960px, 100svh);
    display: flex;
    align-items: center;
    padding: 112px 0;
}

.bernd-section-inner {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.bernd-intro-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 50px 88px;
    align-items: start;
}

.bernd-intro-heading h2,
.bernd-section-heading h2,
.bernd-closing h2 {
    margin: 12px 0 0;
    color: var(--bernd-ink);
    font-size: clamp(2.3rem, 4.5vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.bernd-intro-copy {
    padding-top: 32px;
    color: var(--bernd-steel);
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
}

.bernd-intro-copy p {
    margin: 0 0 20px;
}

.bernd-disciplines {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--bernd-line);
    border-bottom: 1px solid var(--bernd-line);
}

.bernd-discipline {
    min-height: 126px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 24px;
    border-right: 1px solid var(--bernd-line);
}

.bernd-discipline:last-child {
    border-right: 0;
}

.bernd-discipline .fas {
    width: 28px;
    height: 28px;
    color: var(--bernd-orange);
}

.bernd-discipline span {
    font-weight: 720;
}

.bernd-projects {
    align-items: flex-start;
}

.bernd-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 70px;
    align-items: end;
    margin-bottom: 44px;
}

.bernd-section-heading > p {
    margin: 0 0 8px;
    color: var(--bernd-steel);
    font-size: var(--text-md);
}

.bernd-filter {
    display: flex;
    gap: 8px;
    margin: 0 0 34px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.bernd-filter button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid var(--bernd-line);
    border-radius: 999px;
    background: transparent;
    color: var(--bernd-steel);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 680;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.bernd-filter button:hover,
.bernd-filter button:focus-visible {
    border-color: var(--bernd-orange);
    color: var(--bernd-orange);
}

.bernd-filter button.is-active {
    border-color: var(--bernd-ink);
    background: var(--bernd-ink);
    color: var(--bernd-paper);
}

.bernd-project-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 22px;
}

.bernd-project-card {
    grid-column: span 4;
    min-width: 0;
}

.bernd-project-card-wide {
    grid-column: span 8;
}

.bernd-project-card[hidden] {
    display: none;
}

.bernd-project-trigger {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--bernd-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bernd-paper) 94%, var(--bernd-steel) 6%);
    color: var(--bernd-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(24, 31, 35, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.bernd-project-trigger:hover,
.bernd-project-trigger:focus-visible {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--bernd-orange) 52%, transparent);
    box-shadow: var(--bernd-shadow);
}

.bernd-project-media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #d8dddf;
}

.bernd-project-card-wide .bernd-project-media {
    aspect-ratio: 16 / 9;
}

.bernd-project-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bernd-project-trigger:hover .bernd-project-media img,
.bernd-project-trigger:focus-visible .bernd-project-media img {
    transform: scale(1.035);
}

.bernd-project-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
}

.bernd-project-copy strong {
    margin-top: 10px;
    color: var(--bernd-ink);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    line-height: 1.16;
}

.bernd-project-copy > span:not(.bernd-project-type, .bernd-project-link) {
    margin-top: 12px;
    color: var(--bernd-steel);
}

.bernd-project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 24px;
    color: var(--bernd-ink);
    font-size: var(--text-sm);
    font-weight: 740;
}

.bernd-project-link .fas {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.bernd-project-trigger:hover .bernd-project-link .fas,
.bernd-project-trigger:focus-visible .bernd-project-link .fas {
    transform: translateX(4px);
}

.bernd-empty-state {
    margin: 34px 0 0;
    color: var(--bernd-steel);
}

.bernd-about {
    background: color-mix(in srgb, var(--bernd-paper) 91%, var(--bernd-steel) 9%);
}

.bernd-story-line {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    padding-top: 36px;
}

.bernd-story-line::before {
    content: "";
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--bernd-line);
}

.bernd-story-step {
    position: relative;
    padding-top: 56px;
}

.bernd-story-step::before {
    content: "";
    position: absolute;
    top: 13px;
    left: 0;
    width: 16px;
    height: 16px;
    border: 4px solid var(--bernd-paper);
    border-radius: 50%;
    background: var(--bernd-orange);
    box-shadow: 0 0 0 1px var(--bernd-orange);
}

.bernd-story-step > span {
    color: var(--bernd-orange);
    font-size: var(--text-xs);
    font-weight: 790;
}

.bernd-story-step h3 {
    margin: 8px 0 10px;
    color: var(--bernd-ink);
    font-size: 1.25rem;
}

.bernd-story-step p {
    margin: 0;
    color: var(--bernd-steel);
}

.bernd-closing {
    min-height: 78svh;
}

.bernd-closing-layout {
    display: grid;
    grid-template-columns: minmax(180px, 0.38fr) minmax(0, 0.62fr);
    gap: 84px;
    align-items: center;
}

.bernd-closing-mark {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bernd-orange) 10%, transparent);
}

.bernd-closing-mark img {
    width: 58%;
    height: 58%;
    object-fit: contain;
}

.bernd-closing p:not(.bernd-section-label) {
    max-width: 700px;
    margin: 24px 0 0;
    color: var(--bernd-steel);
    font-size: var(--text-md);
}

.bernd-closing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.bernd-project-dialog {
    width: min(1080px, calc(100% - 32px));
    max-height: min(860px, calc(100dvh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--bernd-line);
    border-radius: 8px;
    background: var(--bernd-paper);
    color: var(--bernd-ink);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.28);
}

.bernd-project-dialog::backdrop {
    background: rgba(10, 15, 18, 0.76);
    backdrop-filter: blur(8px);
}

.bernd-dialog-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(310px, 0.82fr);
    min-height: 580px;
}

.bernd-dialog-close {
    position: absolute;
    z-index: 4;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: rgba(15, 20, 24, 0.66);
    color: #fff;
    font: 300 1.9rem/1 var(--font-main);
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.bernd-dialog-media {
    position: relative;
    min-height: 580px;
    overflow: hidden;
    background: #11181c;
}

.bernd-dialog-media > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.bernd-dialog-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(15, 20, 24, 0.62);
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    backdrop-filter: blur(8px);
}

.bernd-dialog-prev {
    left: 14px;
}

.bernd-dialog-next {
    right: 14px;
}

.bernd-dialog-body {
    align-self: center;
    padding: 74px 42px 42px;
}

.bernd-dialog-body h2 {
    margin: 10px 0 18px;
    color: var(--bernd-ink);
    font-size: clamp(2rem, 3.4vw, 3.25rem);
    line-height: 1.02;
}

.bernd-dialog-body > p:not(.bernd-project-type) {
    margin: 0;
    color: var(--bernd-steel);
}

.bernd-dialog-thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 30px;
}

.bernd-dialog-thumbs button {
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
}

.bernd-dialog-thumbs button[aria-current="true"] {
    border-color: var(--bernd-orange);
}

.bernd-dialog-thumbs img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.bernd-reveal {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.75, 0.2, 1);
}

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

body.is-bernd-dialog-open {
    overflow: hidden;
}

html[data-theme="dark"] .bernd-project-trigger {
    background: #111c22;
}

html[data-theme="dark"] .bernd-button-primary {
    color: #0b1217;
}

html[data-theme="dark"] .bernd-about {
    background: #10191f;
}

html[data-theme="dark"] .bernd-story-step::before {
    border-color: #10191f;
}

@keyframes bernd-hero-drift {
    from { transform: scale(1.025) translate3d(0, 0, 0); }
    to { transform: scale(1.065) translate3d(-1%, -0.8%, 0); }
}

@media (max-width: 900px) {
    .bernd-section {
        min-height: 0;
        padding: 92px 0;
    }

    .bernd-intro-layout,
    .bernd-section-heading,
    .bernd-closing-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .bernd-intro-copy {
        padding-top: 0;
    }

    .bernd-disciplines {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bernd-discipline:nth-child(2) {
        border-right: 0;
    }

    .bernd-discipline:nth-child(-n + 2) {
        border-bottom: 1px solid var(--bernd-line);
    }

    .bernd-project-card,
    .bernd-project-card-wide {
        grid-column: span 6;
    }

    .bernd-project-card-wide .bernd-project-media {
        aspect-ratio: 4 / 3;
    }

    .bernd-story-line {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bernd-story-line::before {
        display: none;
    }

    .bernd-story-step {
        padding-top: 32px;
        border-top: 1px solid var(--bernd-line);
    }

    .bernd-story-step::before {
        top: -9px;
    }

    .bernd-closing-mark {
        width: min(260px, 66vw);
    }

    .bernd-dialog-shell {
        grid-template-columns: 1fr;
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
    }

    .bernd-dialog-media {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .bernd-dialog-body {
        padding: 32px;
    }
}

@media (max-width: 680px) {
    .bernd-page {
        padding-top: 66px;
    }

    .bernd-nav-shell,
    .bernd-hero-content,
    .bernd-section-inner {
        width: min(100% - 28px, 1180px);
    }

    .bernd-nav-shell {
        min-height: 66px;
        gap: 12px;
    }

    .bernd-brand {
        gap: 9px;
        font-size: 0.86rem;
    }

    .bernd-brand img {
        width: 32px;
        height: 32px;
    }

    .bernd-nav-links > a:not(.bernd-nav-back) {
        display: none;
    }

    .bernd-nav-back {
        padding-left: 0;
        border-left: 0;
    }

    .bernd-nav-back span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .bernd-hero {
        min-height: calc(100svh - 66px);
        align-items: flex-end;
    }

    .bernd-hero-media img {
        object-position: 54% center;
    }

    .bernd-hero-shade {
        background: linear-gradient(0deg, rgba(9, 14, 17, 0.94) 0%, rgba(9, 14, 17, 0.68) 52%, rgba(9, 14, 17, 0.16) 100%);
    }

    .bernd-hero-content {
        padding: 72px 0 70px;
    }

    .bernd-hero-logo {
        width: 58px;
        height: 58px;
        margin-bottom: 18px;
    }

    .bernd-hero h1 {
        margin-top: 9px;
        font-size: clamp(2.9rem, 13vw, 3.3rem);
        overflow-wrap: normal;
        word-break: keep-all;
    }

    .bernd-hero-note {
        display: none;
    }

    .bernd-button {
        width: 100%;
    }

    .bernd-section {
        padding: 74px 0;
    }

    .bernd-intro-heading h2,
    .bernd-section-heading h2,
    .bernd-closing h2 {
        font-size: clamp(2.15rem, 11vw, 3.25rem);
    }

    .bernd-disciplines {
        grid-template-columns: 1fr;
    }

    .bernd-discipline,
    .bernd-discipline:nth-child(2) {
        min-height: 82px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        border-right: 0;
        border-bottom: 1px solid var(--bernd-line);
    }

    .bernd-discipline:last-child {
        border-bottom: 0;
    }

    .bernd-project-grid {
        gap: 16px;
    }

    .bernd-project-card,
    .bernd-project-card-wide {
        grid-column: 1 / -1;
    }

    .bernd-project-copy {
        padding: 20px;
    }

    .bernd-story-line {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .bernd-closing-actions {
        display: grid;
    }

    .bernd-project-dialog {
        width: calc(100% - 16px);
        max-height: calc(100dvh - 16px);
    }

    .bernd-dialog-shell {
        max-height: calc(100dvh - 16px);
    }

    .bernd-dialog-body {
        padding: 28px 22px 30px;
    }

    .bernd-dialog-close {
        top: 10px;
        right: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bernd-hero-media img {
        animation: none;
    }

    .bernd-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .bernd-project-media img,
    .bernd-project-trigger,
    .bernd-button {
        transition: none;
    }
}
