/* ============================================================
   CS Design System — 02 Base, typography, bullets, utilities
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--cs-navbar-h) + 1rem);
}

body {
    margin: 0;
    background: var(--cs-canvas);
    color: var(--cs-ink);
    font-family: var(--cs-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--cs-red);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
    transition: color 0.2s var(--ease-out);
}

a:hover {
    color: var(--cs-navy);
}

:focus-visible {
    outline: 3px solid var(--cs-turquoise);
    outline-offset: 3px;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--cs-navy);
    font-family: var(--cs-display);
    font-weight: 600;
    letter-spacing: 0.005em;
    line-height: 1.1;
    margin: 0 0 0.5em;
    /* German compounds are long — never let a single word push out of its card */
    overflow-wrap: break-word;
    hyphens: auto;
}

/* FS Sinclair is a monoline face and the guide sets every big headline in its
   Regular cut — at display sizes the semibold reads as a different, heavier
   brand. Small headings keep the 600 so they hold up at text sizes. */
h1, .h1, h2, .h2 {
    font-weight: 400;
}

h1, .h1 { font-size: clamp(2.1rem, 4.4vw, 3.7rem); }
h2, .h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
h3, .h3 { font-size: clamp(1.2rem, 1.85vw, 1.55rem); }
h4, .h4 { font-size: clamp(1rem, 1.3vw, 1.2rem); font-family: var(--cs-body); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }

p { margin: 0 0 1.1em; }

/* ---------- Section head: title left, lead right (kills dead space) ---------- */

.section-head {
    display: grid;
    /* Stacked (mobile / narrow) the lead sits under the title, so it needs a real
       row gap; side by side the columns supply the separation instead. */
    gap: 1rem clamp(2rem, 5vw, 4.5rem);
    margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section-head__title {
    margin: 0;
    max-width: 22ch;
}

.section-head__lead {
    margin: 0;
    color: var(--cs-steel);
    max-width: 46ch;
}

.section-head__lead > *:last-child { margin-bottom: 0; }

/* A shared technical rule makes split title/lead layouts read as one unit. */
.section-head--connected {
    position: relative;
    border-top: 1px solid var(--cs-line);
    padding-top: clamp(1rem, 1.8vw, 1.35rem);
}

.section-head--connected::before {
    content: "";
    position: absolute;
    inset-block-start: -1px;
    inset-inline-start: 0;
    width: clamp(3.5rem, 7vw, 5.5rem);
    height: 3px;
    background: var(--cs-red);
}

@media (min-width: 62rem) {
    .section-head {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
        align-items: start;
        gap: 0 clamp(2rem, 5vw, 4.5rem);
    }

    /* Optical alignment: the lead's x-height sits with the display cap-height */
    .section-head__lead { padding-top: 0.35rem; }

    .section-head--connected {
        gap: 0 clamp(1.5rem, 3vw, 3rem);
    }

    .section-head--stacked { grid-template-columns: minmax(0, 1fr); }
}

/* Hairline divider used between major light sections */
.section-rule {
    border: 0;
    border-top: 1px solid var(--cs-line);
    margin: 0;
}

strong { font-weight: 700; }

sub, sup { font-size: 0.65em; }

.lead {
    font-size: clamp(1.2rem, 1.6vw, 1.45rem);
    line-height: 1.55;
    color: var(--cs-navy);
    font-weight: 300;
}

/* Section kicker: the guide's running-head device — white caps knocked out of a
   solid red bar ("SPECIALIZED IN EFFICIENCY", "OPTIMIERUNG UND RETROFIT").
   The bar bleeds a little to the left of the text edge, exactly as the printed
   bars run out of the page margin.

   Two-register rule for every small-caps label on the site: this bar kicker
   (loud, opens a section, --cs-kicker-* metrics) or the quiet label (steel
   caps in dense areas, --cs-label-* metrics). New labels pick one; nothing
   invents a third voice. */
.kicker,
.section-kicker {
    display: inline-block;
    font-family: var(--cs-body);
    font-size: var(--cs-kicker-size);
    font-weight: 700;
    letter-spacing: var(--cs-kicker-track);
    text-transform: uppercase;
    color: #fff;
    background: var(--cs-red);
    padding: 0.5em 0.9em 0.5em 0.8em;
    line-height: 1.25;
    margin-bottom: 1.2rem;
}

/* Dark surfaces flip the bar to the guide's orange running head
   (world-map spread p.94: orange bar, ink type). */
.section-dark .kicker,
.section-dark .section-kicker,
.black-band .kicker,
.black-band .section-kicker {
    background: var(--cs-orange);
    color: var(--cs-black);
}

/* ---------- Orange bullet markers (CS brand) ---------- */

ul {
    list-style: none;
    padding-inline-start: 0;
    margin: 0 0 1.2em;
}

ul li {
    position: relative;
    padding-inline-start: var(--cs-bullet-indent);
    margin-bottom: 0.35em;
}

ul li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: var(--cs-bullet-offset);
    /* Centred in the first line box, which is where the guide's own bullet sits
       (its top edge meets the x-height). Lists here run at line-heights from
       1.45 to 1.7, and a single em offset cannot land right in all of them. */
    top: calc((1lh - var(--cs-bullet-size)) / 2);
    width: var(--cs-bullet-size);
    height: var(--cs-bullet-size);
    background: var(--cs-bullet-color);
    border-radius: var(--cs-bullet-radius);
}

ol { padding-inline-start: 1.35em; }
ol li { margin-bottom: 0.35em; }
ol li::marker { color: var(--cs-orange); font-weight: 700; }

/* RTE / prose lists — navy text on light surfaces */
.ce-bodytext {
    max-width: var(--cs-measure);
}

.ce-bodytext ul li,
.textmedia ul li,
.focus-box__copy ul li,
.node-feature__copy ul li,
.process-section__copy ul li,
.card-grid__body ul li {
    color: var(--cs-navy);
    font-weight: 500;
}

/* ---------- Layout ---------- */

.page {
    background: var(--cs-canvas);
    overflow: clip;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* The navbar is fixed, so content flows underneath it. Pages that open with a
   full-bleed plate pad themselves (the plate has to start at y=0); anything else —
   Anfahrt, the 404 — had its h1 sitting behind the bar. */
.page-content {
    flex: 1 0 auto;
    position: relative;
    padding-top: var(--cs-navbar-h);
}

.page-content:has(> .page-hero:first-child),
.page-content:has(> .cs-hero:first-child) {
    padding-top: 0;
}

.page-content > * {
    position: relative;
    z-index: 1;
}

.container,
.frame-container {
    width: 100%;
    max-width: var(--cs-maxwidth);
    margin-inline: auto;
    padding-inline: var(--cs-gutter);
}

.frame {
    padding-block: var(--cs-section);
}

@media (max-width: 700px) {
    .frame {
        padding-block: clamp(2.5rem, 8vw, 3rem);
    }
}

.frame:first-child:last-child {
    padding-block: var(--cs-section);
}

/* Body copy measure */
.ce-bodytext,
.node-feature__copy,
.process-section__copy,
.focus-box__copy,
.focus-feature__copy,
.card-grid__intro,
.patent-list__intro {
    max-width: var(--cs-measure);
}

.cs-grid {
    display: grid;
    gap: clamp(1.25rem, 2.5vw, 2.5rem);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.85em 1.6em;
    border: 2px solid transparent;
    font-family: var(--cs-body);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.btn::after {
    content: "→";
    font-family: var(--cs-body);
    transition: transform 0.25s var(--ease-out);
}

.btn:hover::after {
    transform: translateX(0.3em);
}

/* Wide tracking is what pushes two-word German labels onto a second line on a
   narrow screen, which then strands the arrow at the far edge of the button. */
@media (max-width: 700px) {
    .btn {
        font-size: 0.85rem;
        letter-spacing: 0.1em;
        padding: 0.85em 1.3em;
    }
}

.btn-primary {
    background: var(--cs-red);
    color: #fff;
    border-color: var(--cs-red);
}

.btn-primary:hover {
    background: var(--cs-navy);
    border-color: var(--cs-navy);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--cs-navy);
    border-color: var(--cs-navy);
}

.btn-outline:hover {
    background: var(--cs-navy);
    color: #fff;
}

.btn-outline--light {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline--light:hover {
    background: #fff;
    color: var(--cs-navy);
}

/* ---------- Power Ring (CSS motif) ---------- */

.cs-ring {
    display: inline-block;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--ring-energy);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-weight, 12%)), #000 calc(100% - var(--ring-weight, 12%) + 1px));
    mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-weight, 12%)), #000 calc(100% - var(--ring-weight, 12%) + 1px));
}

.cs-ring--technology { background: var(--ring-technology); }
.cs-ring--innovation { background: var(--ring-innovation); }

/* ---------- Media helpers ---------- */

.cs-media {
    position: relative;
    overflow: hidden;
    margin: 0;
}

.cs-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

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

/* Lightbox affordance */
a.glightbox,
a.lightbox {
    cursor: zoom-in;
}

/* Skip link */
.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    top: -4rem;
    z-index: 2000;
    background: var(--cs-navy);
    color: #fff;
    padding: 0.75em 1.25em;
    text-decoration: none;
    transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

html.nav-locked,
html.nav-locked body {
    overflow: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Dot Ring (guide asset motif) ---------- */

.dot-ring {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.dot-ring__img {
    width: 100%;
    height: auto;
    opacity: 0.32;
}

.dot-ring--light .dot-ring__img { opacity: 0.18; }
.dot-ring--dark .dot-ring__img { opacity: 0.1; }
.dot-ring--energy .dot-ring__img { opacity: 0.28; }

.dot-ring--lg { width: clamp(12rem, 26vw, 20rem); }
.dot-ring--md { width: clamp(9rem, 18vw, 15rem); }
.dot-ring--sm { width: clamp(6rem, 12vw, 10rem); }

.dot-ring--right {
    inset-inline-end: -4rem;
    top: 50%;
    translate: 0 -50%;
}

.dot-ring--left {
    inset-inline-start: -4rem;
    top: 50%;
    translate: 0 -50%;
}

.dot-ring--center {
    inset-inline-start: 50%;
    top: 50%;
    translate: -50% -50%;
}

/* The homepage claim ring intentionally bleeds out of the black band. */
.quote-band > .dot-ring {
    width: clamp(20rem, 42vw, 36rem);
    inset-inline-end: clamp(-8rem, -6vw, -3rem);
}

.quote-band > .dot-ring .dot-ring__img {
    opacity: 0.38;
}

/* The Engineering band already carries a technical drawing. A second motif in
   the same right-hand zone muddies both silhouettes, so the blueprint owns it. */
.quote-band--blueprint > .dot-ring {
    display: none;
}

/* ---------- Black / Red signature bands ---------- */

.black-band,
.red-band {
    position: relative;
    overflow: hidden;
    width: 100vw;
    margin-inline-start: calc(50% - 50vw);
}

.black-band {
    background: var(--cs-black);
    color: #fff;
    padding-block: clamp(3.5rem, 8vw, 7rem);
}

.black-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.055) 1px, transparent 0) 0 0 / 20px 20px,
        radial-gradient(75% 130% at 6% 92%, var(--cs-ember-strong), transparent 58%);
    pointer-events: none;
}

.red-band {
    background-color: var(--cs-red);
    color: #fff;
    padding-block: clamp(3rem, 7vw, 5.5rem);
}

.red-band__texture,
.red-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.09) 1px, transparent 0) 0 0 / 20px 20px,
        /* Orange is an accent, not a second ground colour: a near-opaque wash turned
           the whole band amber and dropped the white figures below contrast. */
        radial-gradient(70% 120% at 100% 0%, rgba(246, 166, 20, 0.38), transparent 58%);
    pointer-events: none;
}

.black-band__inner,
.red-band__inner {
    position: relative;
    z-index: 1;
    max-width: var(--cs-maxwidth);
    margin-inline: auto;
    padding-inline: var(--cs-gutter);
}

.black-band__title {
    font-family: var(--cs-display);
    font-size: clamp(1.7rem, 3.6vw, 3rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.01em;
    text-transform: none;
    color: #fff;
    margin: 0;
    max-width: 22ch;
}

.black-band__title em,
.black-band__title .accent {
    font-style: normal;
    color: var(--cs-red);
}

.black-band__attribution {
    display: block;
    margin-top: 1.4rem;
    font-family: var(--cs-body);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.red-band__title {
    font-family: var(--cs-display);
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    font-weight: 400;
    line-height: 1.15;
    text-transform: none;
    color: #fff;
    margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
}

/* Dark-band list styling */
.black-band ul,
.red-band ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.black-band ul li,
.red-band ul li {
    margin-bottom: 0.4em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Red photo frame (guide g-07) */
.cs-photo-frame {
    position: relative;
    display: block;
    margin: 0;
}

.cs-photo-frame img {
    width: 100%;
    object-fit: cover;
}

.cs-photo-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid var(--cs-red);
    translate: 0.75rem 0.75rem;
    z-index: -1;
    pointer-events: none;
}

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

/* ---------- Brand labels & panels (from CS Guide) ---------- */

.label-red,
.label-black {
    display: inline-block;
    padding: 0.35em 0.7em;
    font-family: var(--cs-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.2;
}

.label-red { background: var(--cs-red); }
.label-black { background: var(--cs-black); }

.band-amber {
    background: var(--cs-amber);
    color: var(--cs-navy);
    position: relative;
    overflow: hidden;
}

.band-amber::after {
    content: "";
    position: absolute;
    inset-inline-end: -4rem;
    bottom: -4rem;
    width: min(40vw, 22rem);
    aspect-ratio: 1;
    background: radial-gradient(circle at 1px 1px, rgba(35, 37, 77, 0.22) 1.5px, transparent 0) 0 0 / 16px 16px;
    -webkit-mask: radial-gradient(circle, #000 40%, transparent 68%);
    mask: radial-gradient(circle, #000 40%, transparent 68%);
    pointer-events: none;
}

.band-amber .band-amber__inner {
    position: relative;
    z-index: 1;
    max-width: var(--cs-maxwidth);
    margin-inline: auto;
    padding: var(--cs-section) var(--cs-gutter);
}

.band-amber h2,
.band-amber h3 {
    color: #fff;
}

.photo-caption-bar {
    display: inline-block;
    background: #fff;
    color: var(--cs-navy);
    padding: 0.45em 0.9em;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.overlay-panel {
    position: relative;
    overflow: hidden;
    min-height: 22rem;
    display: grid;
    place-items: center;
    text-align: center;
    color: #fff;
    padding: 2.5rem;
}

.overlay-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--cs-red);
    opacity: 0.82;
    z-index: 0;
}

.overlay-panel--orange::before {
    background: linear-gradient(135deg, var(--cs-amber), var(--cs-orange));
}

.overlay-panel > * {
    position: relative;
    z-index: 1;
}

.overlay-panel__quote {
    font-family: var(--cs-display);
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    line-height: 1.15;
    max-width: 18ch;
    margin: 0;
}

/* Rainbow power-ring accent — use as decorative motif, never as text bg */
.ring-rainbow {
    width: min(20rem, 50vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, transparent 38%, #000 39%),
        conic-gradient(from 200deg, #d3243d, #f6a614, #f3f0a7, #45b8ab, #23254d, #d3243d);
    mask-image: radial-gradient(circle, transparent 36%, #000 38%, #000 62%, transparent 64%);
    -webkit-mask-image: radial-gradient(circle, transparent 36%, #000 38%, #000 62%, transparent 64%);
    opacity: 0.9;
}
