/* MPI GmbH — light theme, mobile-first */

/* -------------------------------------------------------------------------
   Design tokens (base = smallest screens)
   ------------------------------------------------------------------------- */
:root {
    --bg: #ffffff;
    --bg-elevated: #f4f5f7;
    --text: #1e2229;
    --text-muted: #5a616e;
    --heading: #12151a;
    --accent: #178a82;
    --accent-hover: #136f69;
    --border: rgba(15, 17, 20, 0.1);
    --on-accent: #ffffff;
    --radius: 12px;
    --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
    --max-prose: 42rem;
    --max-content: 72rem;

    /* Mobile-first spacing */
    --section-y: 1.75rem;
    --section-x: 1rem;
    --hero-padding-top: 2rem;
    --touch-target: 44px;

    /* Breakpoints (reference only — use values in @media) */
    --bp-sm: 36rem; /* 576px */
    --bp-md: 48rem; /* 768px */
    --bp-lg: 64rem; /* 1024px */
}

/* -------------------------------------------------------------------------
   Reset & global
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    padding-inline: env(safe-area-inset-left, 0);
    padding-inline-end: env(safe-area-inset-right, 0);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    -webkit-tap-highlight-color: rgba(23, 138, 130, 0.15);
}

a:hover {
    color: var(--accent-hover);
}

/* i18n visibility */
[data-lang] {
    display: none !important;
}

[data-lang].is-active {
    display: block !important;
}

header.site-header[data-lang].is-active {
    display: grid !important;
}

@media (min-width: 48rem) {
    header.site-header[data-lang].is-active {
        display: flex !important;
    }
}

h1 [data-lang].is-active {
    display: inline !important;
}

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 100;
    padding: 0.75rem 1rem;
    min-height: var(--touch-target);
    background: var(--heading);
    color: var(--bg);
}

.skip-link:focus {
    left: max(0.5rem, env(safe-area-inset-left, 0.5rem));
    top: max(0.5rem, env(safe-area-inset-top, 0.5rem));
}

/* -------------------------------------------------------------------------
   Site header — mobile: [ brand | lang ], nav full width below
   ------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.625rem var(--section-x);
    padding-top: max(0.625rem, env(safe-area-inset-top, 0));
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);

    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.75rem;
}

.site-header > .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.site-header > .lang-switch {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
}

.site-header > .nav-main {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--heading);
}

.brand:hover {
    color: var(--heading);
}

.brand__logo {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.brand__logo--vert {
    height: 44px;
    width: auto;
}

.brand__text {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.nav-main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.nav-main a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.5rem 0.35rem;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.lang-switch {
    display: flex;
    gap: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    background: var(--bg-elevated);
}

.lang-switch button {
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: var(--touch-target);
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
}

.lang-switch button[aria-pressed="true"] {
    background: var(--accent);
    color: var(--on-accent);
}

.lang-switch button:not([aria-pressed="true"]):hover {
    color: var(--text);
}

/* -------------------------------------------------------------------------
   Main & sections
   ------------------------------------------------------------------------- */
main {
    padding-bottom: 3rem;
}

.section {
    padding: var(--section-y) var(--section-x);
    max-width: var(--max-content);
    margin: 0 auto;
}

.section--hero {
    padding-top: var(--hero-padding-top);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero__title {
    margin: 0 0 0.625rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--heading);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hero__lead {
    margin: 0 auto;
    max-width: 36rem;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-muted);
    text-wrap: pretty;
}

h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--heading);
    line-height: 1.25;
    text-wrap: balance;
}

.section__prose {
    max-width: var(--max-prose);
    margin: 0;
}

.section__prose p {
    margin: 0 0 0.875rem;
}

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

.section__subhead {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.3;
}

.section__prose .section__subhead:first-of-type {
    margin-top: 1.25rem;
}

.section__inline-links {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9375rem;
}

.section__inline-links a {
    white-space: nowrap;
}

.section__lede {
    margin-bottom: 1.25rem;
}

#neriq .module-card {
    max-width: 42rem;
    margin-inline: auto;
}

/* NERIQ product screenshot (tall UI — contain, not crop) */
#neriq .module-card__media--neriq-shot {
    aspect-ratio: 4 / 3;
    background: #e8ebef;
}

#neriq .module-card__media--neriq-shot img {
    object-fit: contain;
    object-position: center top;
}

/* Product card banner (no store image) */
.module-card__media--product-banner {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0c3d38 0%, #178a82 42%, #4db5aa 100%);
    border-bottom: 1px solid var(--border);
}

.module-card__product-label {
    margin: 0;
    padding: 0.5rem 1rem;
    color: #fff;
    font-weight: 700;
    font-size: clamp(0.95rem, 2.8vw, 1.2rem);
    letter-spacing: 0.03em;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.product-highlights {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.product-highlights li {
    margin-bottom: 0.35rem;
}

.product-highlights li:last-child {
    margin-bottom: 0;
}

.product-stack {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Modules: single column by default */
.modules-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.module-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.module-card__media {
    margin: 0;
    aspect-ratio: 16 / 9;
    background: #e8eaee;
    border-bottom: 1px solid var(--border);
}

.module-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.module-card__media--icon {
    aspect-ratio: 2 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(165deg, #e8f5f3 0%, var(--bg-elevated) 55%);
    border-bottom: 1px solid var(--border);
}

.module-card__media--icon img {
    width: auto;
    height: auto;
    max-height: 5.5rem;
    max-width: min(200px, 85%);
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(15, 17, 20, 0.08));
}

.module-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.125rem 1.15rem;
}

.module-card h3 {
    margin: 0 0 0.625rem;
    font-size: 1rem;
    color: var(--heading);
    line-height: 1.3;
}

.module-card p {
    margin: 0 0 0.875rem;
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.module-card .module-card__link {
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.35rem 0;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

.module-card code,
.section__prose code {
    font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    font-size: 0.88em;
    background: rgba(15, 17, 20, 0.06);
    padding: 0.12em 0.35em;
    border-radius: 4px;
    word-break: break-word;
}

.disclaimer {
    margin-top: 1.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--text-muted);
    background: rgba(23, 138, 130, 0.08);
    border: 1px solid rgba(23, 138, 130, 0.22);
    border-radius: var(--radius);
}

.contact-block {
    text-align: center;
    padding: 1.75rem 1.15rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.contact-block a {
    font-weight: 600;
    font-size: 1.0625rem;
    padding: 0.5rem;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
}

.site-footer {
    padding: 1.5rem var(--section-x);
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0));
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.site-footer__inner {
    max-width: var(--max-content);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-items: center;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
}

.site-footer__legal a {
    color: var(--text);
    padding: 0.35rem 0.15rem;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

.site-footer__ai-hint {
    margin: 0;
    max-width: 36rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-muted);
    opacity: 0.9;
}

/* -------------------------------------------------------------------------
   Legal pages
   ------------------------------------------------------------------------- */
.legal-page main {
    padding-top: 0.75rem;
}

.legal-intro {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: var(--max-prose);
}

.legal-body {
    max-width: var(--max-prose);
}

.legal-body h1 {
    margin: 0 0 1.25rem;
    font-size: 1.35rem;
    color: var(--heading);
    line-height: 1.2;
    text-wrap: balance;
}

.legal-body h2 {
    margin: 1.75rem 0 0.625rem;
    font-size: 1.05rem;
    line-height: 1.3;
}

.legal-body h3 {
    margin: 1.35rem 0 0.5rem;
    font-size: 0.975rem;
    color: var(--heading);
}

.legal-body h4 {
    margin: 1.1rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
}

.legal-body p,
.legal-body li {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.55;
}

.legal-body ol {
    padding-left: 1.1rem;
    padding-inline-start: 1.25rem;
}

.legal-body li {
    margin-bottom: 0.45rem;
}

.legal-body ul {
    padding-left: 1.1rem;
    padding-inline-start: 1.25rem;
}

.legal-meta {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    padding: 0.35rem 0;
    min-height: var(--touch-target);
}

/* -------------------------------------------------------------------------
   min-width: 36rem (576px) — large phones / small tablets
   ------------------------------------------------------------------------- */
@media (min-width: 36rem) {
    :root {
        --section-y: 2.25rem;
        --section-x: 1.25rem;
        --hero-padding-top: 2.75rem;
    }

    body {
        font-size: 1.0625rem;
    }

    .brand__logo {
        height: 40px;
    }

    .brand__logo--vert {
        height: 48px;
    }

    .brand__text {
        font-size: 1.125rem;
    }

    .hero__title {
        font-size: clamp(1.65rem, 4vw, 2.25rem);
    }

    .hero__lead {
        font-size: 1.0625rem;
    }

    h2 {
        font-size: clamp(1.3rem, 2.8vw, 1.65rem);
    }

    .modules-grid {
        gap: 1.2rem;
        grid-template-columns: repeat(2, 1fr);
    }

    .module-card__body {
        padding: 1.25rem 1.35rem;
    }

    .disclaimer {
        font-size: 0.875rem;
        padding: 1rem 1.15rem;
    }

    .contact-block {
        padding: 2rem 1.35rem;
    }

    .legal-body h1 {
        font-size: clamp(1.45rem, 3vw, 1.85rem);
    }
}

/* -------------------------------------------------------------------------
   min-width: 48rem (768px) — tablet / desktop header row
   ------------------------------------------------------------------------- */
@media (min-width: 48rem) {
    :root {
        --section-y: clamp(2.5rem, 5vw, 4rem);
        --section-x: clamp(1.25rem, 4vw, 2rem);
        --hero-padding-top: clamp(3rem, 8vw, 5rem);
    }

    .site-header {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.875rem var(--section-x);
    }

    .site-header > .nav-main {
        flex: 1;
        justify-content: center;
        padding-top: 0;
        border-top: none;
        grid-column: unset;
        grid-row: unset;
    }

    .site-header > .brand,
    .site-header > .lang-switch {
        grid-column: unset;
        grid-row: unset;
    }

    main {
        padding-bottom: 4rem;
    }

    .hero__title {
        font-size: clamp(1.85rem, 4vw, 2.75rem);
    }

    .hero__lead {
        font-size: 1.125rem;
    }

    .site-footer {
        padding: 2rem var(--section-x);
    }

    .site-footer__inner {
        font-size: 0.875rem;
    }

    .legal-intro {
        font-size: 0.9375rem;
        margin-bottom: 2rem;
    }

    .legal-body h1 {
        font-size: clamp(1.55rem, 3vw, 2rem);
    }

    .legal-body h2 {
        margin-top: 2rem;
        font-size: 1.15rem;
    }
}

/* -------------------------------------------------------------------------
   min-width: 64rem (1024px) — three-column modules
   ------------------------------------------------------------------------- */
@media (min-width: 64rem) {
    .modules-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .module-card__body {
        padding: 1.35rem 1.5rem;
    }

    .module-card h3 {
        font-size: 1.05rem;
    }
}
