/* latin-ext */
@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 100%;
    font-display: swap;
    src: url('/fonts/InstrumentSans-LatinExt.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 100%;
    font-display: swap;
    src: url('/fonts/InstrumentSans-Latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Dennis Rembecki — scroll-driven theme: --dark (0..1) is set by script.js */
:root {
    --dark: 0;
    --ink: #16161a;
    --paper: #f1f2f4;
    --light: #f4f4f2;
    --bg: color-mix(in srgb, #181818 calc(var(--dark) * 100%), var(--paper));
    --fg: color-mix(in srgb, var(--light) calc(var(--dark) * 100%), var(--ink));
    --line: color-mix(in srgb, var(--fg) 24%, transparent);
    --pad: clamp(1.25rem, 3.2vw, 3rem);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box
}

html {
    background-color: var(--bg);
    overflow-x: clip;
    /* clip statt hidden: kein Scroll-Container, sticky bleibt intakt */
}

body {
    margin: 0;
    overflow-x: clip;
    color: var(--fg);
    font: 400 1.0625rem/1.4 var(--font);
    letter-spacing: -.02em;
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg);
}

h1,
h2,
h3,
p,
ul {
    margin: 0
}

ul {
    padding: 0;
    list-style: none
}

a {
    color: inherit;
    text-decoration: none
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px
}

/* Hintergrund-Canvas: bewusst NICHT position:fixed.
   iOS Safari beschneidet fixed-Elemente auf den Bereich zwischen den Bars, normaler
   Dokument-Inhalt (wie das clarity-Canvas) laeuft dagegen unter die Bars.
   Loesung: sticky Canvas in einer Schiene, die so hoch ist wie die ganze Seite.
   - lvh = grosse Viewport-Hoehe (Bars eingeklappt) -> aendert sich beim Scrollen nicht
   - overflow: clip (NICHT hidden!) schneidet am Seitenende ab, ohne einen Scroll-Container
     zu erzeugen (sonst wuerde sticky nicht mehr am Viewport kleben) */
body {
    position: relative;
}

#bg-rail {
    position: absolute;
    top: -120px;
    /* Ueberhang nach oben: deckt Status-/Top-Bar ab */
    left: 0;
    width: 100%;
    /* +120px oben (Ueberhang), unten kein Extra-Scrollraum */
    height: calc(100% + 120px);
    z-index: 0;
    overflow: clip;
    pointer-events: none;
}

#bg {
    display: block;
    position: sticky;
    top: -120px;
    /* klebt 120px ueber dem Scrollport-Rand */
    width: 100%;
    height: 140vh;
    /* Fallback fuer alte Browser */
    height: calc(100lvh + 200px);
    /* 120px oben + 80px unten Reserve */
}

main,
footer {
    position: relative;
    z-index: 1
}

/* header sits above light and dark: difference blend keeps it readable */
.brand {
    position: absolute;
    top: var(--pad);
    left: var(--pad);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--fg);
}

.brand svg {
    height: 1.5em;
    width: auto
}

.bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: var(--pad);
    color: var(--fg);
    pointer-events: none
}

.bar a {
    pointer-events: auto
}

/* type */
h1,
h2,
h3 {
    font-weight: 400
}

h1 {
    font-size: clamp(3.4rem, 12vw, 13rem);
    line-height: .9;
    letter-spacing: -.055em;
    max-width: 11ch;
    will-change: transform
}

h2 {
    font-size: clamp(2.5rem, 6.6vw, 7rem);
    line-height: .95;
    letter-spacing: -.045em;
    max-width: 14ch
}

h3 {
    font-size: clamp(1.75rem, 3.6vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -.04em
}

.lead {
    max-width: 34ch;
    font-size: 1.25rem;
    opacity: .7
}

section {
    padding: clamp(5rem, 12vw, 11rem) var(--pad)
}

/* section label on a hairline */
.label {
    grid-column: 1/-1;
    align-self: stretch;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
    font-size: .75rem;
    margin-bottom: clamp(2rem, 5vw, 4rem)
}

/* word-mask reveal */
.w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: .1em;
    margin-bottom: -.1em
}

.w>span {
    display: inline-block;
    transform: translateY(112%);
    transition: transform 1.15s var(--ease) calc(var(--i) * 60ms)
}

.in .w>span,
.in.w>span {
    transform: none
}

/* hero */
.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: clamp(2rem, 5vw, 4rem);
    padding-top: 8rem;
    padding-bottom: var(--pad)
}

.hero h1 {
    transform: translateY(calc(var(--hs, 0) * -14vh));
    opacity: calc(1 - var(--hs, 0) * 1.15)
}

.hero-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    flex-wrap: wrap;
    opacity: calc(1 - var(--hs, 0) * 1.6)
}

.hero-foot p {
    max-width: 40ch;
    font-size: 1.25rem
}

/* buttons: fill rises from below, text inverts */
.cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    padding: 1rem 1.75rem;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    white-space: nowrap;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer
}

.cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: currentColor;
    transform: translateY(101%);
    transition: transform .6s var(--ease)
}

.cta:hover::before {
    transform: none
}

.cta span {
    position: relative;
    z-index: 2;
    pointer-events: none;
    transition: color .5s var(--ease)
}

.cta:hover span {
    color: var(--bg)
}

/* services: pinned intro, list brightens as it crosses the viewport centre */
.split {
    display: grid;
    gap: 3rem
}

.sticky {
    display: flex;
    flex-direction: column;
    gap: 2rem
}

.svc li {
    padding-block: clamp(2rem, 5vw, 4.5rem);
    border-top: 1px solid var(--line);
    display: grid;
    gap: 1.25rem;
    opacity: calc(.18 + var(--f, 0) * .82);
    transform: translateX(calc((1 - var(--f, 0)) * 2rem))
}

.svc p {
    max-width: 32ch;
    opacity: .7
}

@media (min-width:900px) {
    .split {
        grid-template-columns: 1fr 1fr;
        align-items: start;
        min-height: 130svh;
        grid-template-rows: auto 1fr
    }

    .sticky {
        position: sticky;
        top: 20vh
    }
}

/* work */
.block {
    display: flex;
    flex-direction: column;
    gap: 2rem
}

.work {
    margin-top: clamp(3rem, 8vw, 7rem)
}

.work li {
    border-top: 1px solid var(--line);
    transition: opacity .4s
}

.work li:last-child {
    border-bottom: 1px solid var(--line)
}

.work a,
.work li>div {
    display: grid;
    gap: 1rem 3rem;
    padding-block: clamp(1.75rem, 4vw, 3.25rem);
    align-items: center
}

.work p {
    max-width: 46ch;
    opacity: .7
}

.work h3 {
    transition: transform .6s var(--ease)
}

/*
.work:has(a:hover) li:not(:hover) {
    opacity: .3
}

.work a:hover h3 {
    transform: translateX(1.25rem)
}*/
/* Hover-Effekte nur für Geräte mit echtem Mauszeiger (Desktop) aktivieren */
@media (hover: hover) {
    .work:has(a:hover) li:not(:hover) {
        opacity: .3;
    }

    .work a:hover h3 {
        transform: translateX(1.25rem);
    }

    .work a:hover .go {
        transform: rotate(45deg);
    }
}

.go {
    display: none;
    width: 3.25rem;
    height: 3.25rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    position: relative;
    transition: transform .6s var(--ease), background .4s
}

.go::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: .9rem;
    height: .9rem;
    border: solid currentColor;
    border-width: 2px 2px 0 0;
    translate: -.2rem .2rem;
    transform: rotate(0)
}

.go-mobile {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    position: relative;
    vertical-align: middle;
    margin-left: 0.5rem;
    margin-top: -0.2rem;
}

.go-mobile::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0.4rem;
    height: 0.4rem;
    border: solid currentColor;
    border-width: 1.5px 1.5px 0 0;
    translate: -0.05rem 0.05rem;
    transform: rotate(45deg)
}

.work a:hover .go {
    transform: rotate(45deg)
}

@media (min-width:900px) {

    .work a,
    .work li>div {
        grid-template-columns: 1.1fr 1fr 3.25rem
    }

    .work li>div {
        grid-template-columns: 1.1fr 1fr
    }

    .go {
        display: block
    }

    .go-mobile {
        display: none
    }
}

/* approach */
.center {
    align-items: center;
    text-align: center;
    min-height: 90svh;
    justify-content: center
}

.center h2 {
    max-width: 16ch
}

.center .lead {
    max-width: 40ch
}

#approach {
    position: relative;
    overflow-x: clip
}

#approach>*:not(.clarity) {
    position: relative;
    z-index: 1
}

.clarity {
    position: absolute !important;
    inset: 0;
    z-index: 0 !important;
    pointer-events: none
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem
}

/* stories */
.stories {
    display: grid;
    gap: 0;
    margin-top: clamp(3rem, 8vw, 7rem)
}

.stories article {
    border-top: 1px solid var(--line);
    padding: 2rem 0 3rem;
    display: grid;
    gap: 1.25rem;
    align-content: start
}

.stories p {
    max-width: 30ch;
    opacity: .7
}

@media (min-width:900px) {
    .stories {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem
    }

    .stories article {
        min-height: 36svh
    }
}

/* ai: label and logos start stacked in the centre, then slide apart */
.ai {
    display: flex;
    justify-content: center;
    padding-block: clamp(5rem, 12vw, 9rem)
}

.ai-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem
}

.ai-label {
    font-size: 1.25rem;
    white-space: nowrap
}

.ai-list {
    display: flex;
    align-items: center;
    gap: .75rem
}

.ai-list a {
    display: block;
    line-height: 0;
    transition: opacity .2s
}

.ai-list a:hover {
    opacity: .6
}

.ai-list svg {
    width: 48px;
    height: 48px
}

@media (min-width:768px) {
    .ai-band {
        flex-direction: row;
        gap: 2rem
    }
}

.ai-band[data-reveal]>* {
    transform: translateX(calc(-1 * var(--shift, 0px)))
}

.ai-band[data-reveal] li,
.ai-band[data-reveal] .aw {
    opacity: 0
}

.ai-band[data-reveal=in]>* {
    transform: none;
    transition: transform 1s cubic-bezier(.3, 0, 0, 1) .75s
}

.ai-band[data-reveal=in] li {
    opacity: 1;
    transition: opacity 1s calc(var(--i) * .1s)
}

.ai-band[data-reveal=in] .aw {
    opacity: 1;
    transition: opacity 1.2s calc(.75s + var(--i) * .1s)
}

/* footer */
footer {
    padding: clamp(3rem, 8vw, 6rem) var(--pad) var(--pad);
    display: flex;
    flex-direction: column;
    gap: 3rem
}

footer nav {
    display: grid;
    gap: 3rem
}

.big {
    display: grid;
    gap: .5rem;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -.04em;
    line-height: 1.1
}

.big a,
.small a {
    display: inline-block;
    background: linear-gradient(currentColor, currentColor) 0 100%/0 1.5px no-repeat;
    transition: background-size .6s var(--ease)
}

.big a:hover,
.small a:hover {
    background-size: 100% 1.5px
}

.small {
    display: grid;
    gap: .75rem;
    align-content: end
}

.legal {
    opacity: .45;
    font-size: .8125rem
}

.mark {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    font-size: clamp(2.6rem, 12.5vw, 16rem);
    line-height: .8;
    letter-spacing: -.055em;
    overflow: hidden;
    padding-top: 2rem
}

.mark svg {
    height: .55em;
    width: auto;
    flex: none
}

@media (min-width:900px) {
    footer nav {
        grid-template-columns: 1fr 1fr
    }
}


@media (prefers-reduced-motion:reduce) {
    .ai-band[data-reveal]>* {
        transform: none !important;
        transition: none !important
    }

    .ai-band[data-reveal] li,
    .ai-band[data-reveal] .aw {
        opacity: 1 !important
    }

    html {
        scroll-behavior: auto
    }

    .w>span {
        transform: none;
        transition: none
    }

    .svc li {
        transform: none;
        opacity: 1
    }

    .hero h1,
    .hero-foot {
        transform: none;
        opacity: 1
    }
}

/* cookie gag */
.cookie-gag {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    opacity: 0;
    transform: translateY(1rem) scale(0.9);
    transition: opacity .5s var(--ease), transform .5s var(--ease)
}

.cookie-gag.show {
    opacity: 1;
    transform: none;
    pointer-events: auto
}

.cookie-gag-bubble {
    background: var(--fg);
    color: var(--bg);
    padding: 1.5rem;
    border-radius: 1.5rem;
    border-bottom-right-radius: .25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 320px;
    transform-origin: bottom right
}

.cookie-gag-bubble p {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.2;
    margin: 0
}

.cookie-gag-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%
}

.cookie-gag-actions .cta {
    padding: .5rem 1rem;
    font-size: .9rem;
    border-color: var(--bg);
    color: var(--bg)
}

.cookie-gag-actions .cta:hover span {
    color: var(--fg)
}

.cookie-legal-link {
    font-size: .8rem;
    opacity: .7;
    text-decoration: underline;
    color: var(--bg)
}

.cookie-legal-link:hover {
    opacity: 1
}

/* Glass Popup */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
}

.popup-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.popup-glass {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: color-mix(in srgb, var(--bg) calc(90% - var(--dark) * 45%), transparent);
    backdrop-filter: blur(48px) saturate(180%);
    -webkit-backdrop-filter: blur(48px) saturate(180%);
    border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
    border-top-color: color-mix(in srgb, var(--fg) 25%, transparent);
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-radius: 2.25rem;
    padding: 3rem 2.5rem;
    color: var(--fg);
    transform: translateY(2rem) scale(0.95);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-overlay.open .popup-glass {
    transform: translateY(0) scale(1);
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: currentColor;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, background 0.3s;
}

.close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.close-btn svg {
    width: 1.2rem;
    height: 1.2rem;
}

.popup-glass h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    font-weight: 400;
}

.popup-glass p {
    opacity: 0.7;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: color-mix(in srgb, var(--fg) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    color: var(--fg);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: color-mix(in srgb, var(--fg) 40%, transparent);
    background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Re-use exact CTA logic but add full-width for form */
.popup-glass form .cta {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Lenis Smooth Scroll CSS */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}


/* stack: scroll-driven marquee */
.stack {
    overflow-x: clip
}

.mq {
    margin-inline: calc(var(--pad) * -1);
    overflow: hidden;
    padding-block: .04em;


    font-size: clamp(1.75rem, 3.6vw, 3.5rem);
    /* war: clamp(3.5rem, 11vw, 11rem) */
    line-height: .95;
    letter-spacing: -.045em
        /*
  //font-size: clamp(3.5rem, 11vw, 11rem);
  //line-height: 1.05;
  //letter-spacing: -.055em*/
}

.mq:first-of-type {
    margin-top: clamp(3rem, 8vw, 6rem)
}

.mq-track {
    display: flex;
    width: max-content;
    white-space: nowrap;
    will-change: transform
}

.mq-group {
    display: flex
}

.mq-group span {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding-right: .35em
}

.mq-group span::after {
    content: "";
    width: .1em;
    height: .1em;
    border-radius: 50%;
    background: var(--fg);
    opacity: .35
}

.mq.out .mq-track {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--fg)
}

.stack-grid {
    display: grid;
    gap: 2.5rem 2rem;
    margin-top: clamp(3rem, 8vw, 6rem)
}

.stack-grid li {
    border-top: 1px solid var(--line);
    padding-top: 1.25rem;
    display: grid;
    gap: 1rem
}

.stack-grid h3 {
    font-size: .75rem;
    letter-spacing: -.02em;
    opacity: .7
}

.stack-grid p {
    font-size: 1.25rem;
    line-height: 1.35
}

@media (min-width:900px) {
    .stack-grid {
        grid-template-columns: repeat(4, 1fr)
    }
}

@media (prefers-reduced-motion:reduce) {
    .mq-track {
        transform: none !important
    }
}