/* Small overrides only. Keep most styles in base/layout/components/animations. */

/* ---- Mobile UX pass ---- */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}
body { overflow-x: hidden; }
a, button, input, select, textarea { touch-action: manipulation; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.nav-toggle { display: none; }
.mobile-panel[hidden] { display: none; }

@media (max-width: 900px) {
  nav.top .inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 24px;
  }
  nav.top .brand {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  nav.top .brand a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  nav.top .navlinks,
  nav.top .nav-right {
    display: none;
  }
  .nav-toggle {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 4px 0 14px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .nav-toggle i,
  .nav-toggle i::before,
  .nav-toggle i::after {
    display: block;
    width: 22px;
    height: 1px;
    background: currentColor;
    transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  }
  .nav-toggle i { position: relative; }
  .nav-toggle i::before,
  .nav-toggle i::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .nav-toggle i::before { transform: translateY(-7px); }
  .nav-toggle i::after { transform: translateY(7px); }
  .nav-toggle.is-open i { background: transparent; }
  .nav-toggle.is-open i::before { transform: rotate(45deg); }
  .nav-toggle.is-open i::after { transform: rotate(-45deg); }
  .mobile-panel {
    position: fixed;
    z-index: 29;
    top: 77px;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 77px);
    overflow: auto;
    padding: 10px 24px 24px;
    background: rgba(249, 248, 245, 0.98);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
  }
  .mobile-links {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
  }
  .mobile-links li { margin: 0; padding: 0; list-style: none; }
  .mobile-links a {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-primary);
  }
  .mobile-links a::after {
    content: "->";
    font-family: var(--mono);
    color: var(--text-muted);
  }
  .mobile-panel .cta {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    margin-top: 18px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  .container {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }
  .section,
  .section.tight {
    padding: 56px 0;
  }
  .display {
    font-size: clamp(42px, 14vw, 64px);
    line-height: 0.98;
  }
  .h-large {
    font-size: clamp(34px, 10vw, 48px);
    line-height: 1.05;
  }
  .lede {
    font-size: 16px;
    line-height: 1.65;
    max-width: 100%;
  }
  .eyebrow,
  .tag {
    letter-spacing: 0.16em;
  }
  .cta,
  .ghost-link {
    min-height: 46px;
    align-items: center;
  }
  .page-hero {
    padding: 56px 0 38px;
    gap: 24px;
  }
  .page-hero .container > div {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    align-items: start !important;
  }
  .page-hero h1 {
    font-size: clamp(42px, 13vw, 62px);
    line-height: 1;
    overflow-wrap: anywhere;
  }
  .section-head {
    gap: 18px;
    margin-bottom: 34px;
  }
  .section-head .h-large {
    max-width: 100%;
  }
  .section-head .tools {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .hero-left {
    min-height: calc(100dvh - 77px);
    padding: 86px 24px 34px;
  }
  .hero-left::before {
    inset: 16px;
  }
  .hero-corner {
    top: 24px;
    left: 24px;
    right: 24px;
    line-height: 1.5;
  }
  .hero-body .lede {
    margin-top: 20px;
  }
  .hero-foot {
    align-items: stretch;
    gap: 12px;
    margin-top: 30px;
  }
  .hero-foot .cta {
    justify-content: center;
  }
  .hero-foot .meta {
    line-height: 1.5;
  }
  .hero-right {
    height: 300px;
  }
  .hero-top-right {
    left: 18px;
    right: 18px;
    justify-content: space-between;
    gap: 10px;
  }
  .hero-caption {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }
  .stat {
    padding: 24px 18px;
  }
  .stat .n {
    font-size: 42px;
  }
  .comp-cell {
    min-height: auto;
    padding: 28px 22px;
  }
  .method-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 28px 0;
  }
  .method-row .d,
  .method-row .meta {
    grid-column: auto;
    text-align: left;
  }
  .service-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 30px 0;
  }
  .service-row .d,
  .service-row .more {
    grid-column: auto;
  }
  .service-row .ttl {
    font-size: 28px;
  }
  .service-row .more {
    text-align: left;
  }
  .spec-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .spec-table {
    min-width: 680px;
  }
  .gal-filters {
    display: grid;
    gap: 18px;
    align-items: start;
  }
  .filter-group {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }
  .filter-group button {
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    scroll-snap-align: start;
  }
  .filter-group button.active::after {
    display: none;
  }
  .sort {
    display: none;
  }
  .gal-grid {
    gap: 12px;
    padding: 22px 0 56px;
  }
  .gal-col {
    gap: 12px;
  }
  .gal-item .meta {
    right: 14px;
    line-height: 1.55;
  }
  .inq-wrap,
  .two,
  .single-mf_leistung .section > .container,
  .single-mf_projekt .section > .container {
    grid-template-columns: 1fr !important;
    gap: 34px !important;
  }
  .field-row,
  .sidecard .kv {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
  .field input,
  .field select {
    min-height: 44px;
  }
  .sidecard .kv .v a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .detail-card,
  .sidecard {
    padding: 22px;
  }
  .detail-table td {
    display: block;
    width: 100% !important;
  }
  .detail-table td:first-child {
    padding-bottom: 0;
  }
  .detail-table td:last-child {
    padding-top: 4px;
  }
  .kpi-row,
  .foot-grid {
    grid-template-columns: 1fr;
  }
  .foot-grid {
    gap: 30px;
    padding-bottom: 42px;
  }
  footer .fcol a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .foot-bottom {
    align-items: flex-start;
    line-height: 1.6;
  }
  .privacy-footer-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .privacy-consent a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .privacy-consent__panel,
  .privacy-modal__panel {
    width: calc(100vw - 24px);
  }
}

@media (max-width: 420px) {
  nav.top .inner,
  .mobile-panel {
    padding-left: 16px;
    padding-right: 16px;
  }
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .nav-toggle span {
    display: none;
  }
  .hero-left {
    padding-left: 20px;
    padding-right: 20px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }
  .stat:last-child {
    border-bottom: 0;
  }
  .error404-actions {
    align-items: stretch;
  }
  .error404-actions .cta,
  .error404-actions .ghost-link {
    width: 100%;
    justify-content: center;
  }
}
