@font-face {
    font-family: 'Space Grotesk';
    src: url('../fonts/space-grotesk-var.woff2') format('woff2');
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

h1, h2, h3, h4,
.showcase-title,
.showcase-tab-label,
.stat-number {
    font-family: 'Space Grotesk', var(--sans);
    font-weight: 700;
    letter-spacing: -0.015em;
}

::selection {
    background: var(--accent);
    color: #ffffff;
}

@view-transition {
    navigation: auto;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

@media (prefers-reduced-motion: no-preference) {
    .section-header h2 {
        clip-path: inset(-5% 103% -10% -3%);
        transition: clip-path 0.9s cubic-bezier(0.19, 1, 0.22, 1) 0.15s;
    }

    .section-header.in-view h2 {
        clip-path: inset(-5% -3% -10% -3%);
    }
}

@keyframes plot-in {
    from { clip-path: inset(-5% 103% -10% -3%); }
    to { clip-path: inset(-5% -3% -10% -3%); }
}

[data-sheet] {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

[data-sheet]::before {
    content: attr(data-sheet);
    position: absolute;
    z-index: -1;
    top: 0.5rem;
    right: 1.2rem;
    font-family: 'Space Grotesk', var(--sans);
    font-weight: 700;
    font-size: clamp(6rem, 16vw, 13rem);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(85, 142, 213, 0.16);
    pointer-events: none;
    user-select: none;
}

.btn-primary { will-change: transform; }

.schriftfeld {
    background: var(--paper);
    border-top: 2px solid var(--ink);
    padding: 0;
    position: relative;
}

.schriftfeld .container { padding-top: 0; padding-bottom: 0; }

.sf-grid {
    display: grid;

    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

.sf-cell {
    padding: 2.2rem 1.6rem;
    border-right: 1px solid var(--line);
}

.sf-cell:last-child { border-right: none; }

.sf-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 26ch;
}

.sf-cell h4 {
    margin: 0 0 0.9rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

.sf-cell ul { list-style: none; margin: 0; padding: 0; }
.sf-cell li { margin-bottom: 0.55rem; }

.sf-cell a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease, padding-left 0.25s var(--ease);
}

.sf-cell a:hover { color: var(--accent); padding-left: 4px; }

.sf-meta {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border: 1px solid var(--line);
}

.sf-meta > div {
    padding: 0.75rem 1.1rem;
    border-right: 1px solid var(--line);
    min-width: 0;
}

.sf-meta > div:last-child { border-right: none; }

.sf-meta span {
    display: block;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.sf-meta strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-bottom {
    border: 1px solid var(--line);
    border-bottom: none;
    padding: 0.85rem 1.1rem;
    text-align: center;
}

.sf-bottom p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.sf-bottom a {
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

@media (max-width: 900px) {
    .sf-grid { grid-template-columns: 1fr 1fr; }
    .sf-cell { border-bottom: 1px solid var(--line); }
    .sf-brand { grid-column: 1 / -1; }
    .sf-meta { grid-template-columns: repeat(3, 1fr); }
    .sf-meta > div:nth-child(3n) { border-right: none; }
    .sf-meta > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}

@media (max-width: 540px) {
    .sf-grid { grid-template-columns: 1fr; }
    .sf-cell { border-right: none; }
    /* Jedes Meta-Feld in eigener Zeile: sonst wird ein langer Wert wie
       „Geprüft: A&L Electric Systems" in der halben Spalte abgeschnitten. */
    .sf-meta { grid-template-columns: 1fr; }
    .sf-meta > div { border-right: none; }
    .sf-meta > div + div { border-top: 1px solid var(--line); }
    .sf-meta strong { white-space: normal; }
}

[data-sheet]::after {
    content: '';
    position: absolute;
    top: 1.4rem;
    left: 1.4rem;
    width: 14px;
    height: 14px;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(var(--accent) 0 0) center / 100% 1px no-repeat,
        linear-gradient(var(--accent) 0 0) center / 1px 100% no-repeat;
    opacity: 0.4;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 5px;
    border: 2px solid var(--canvas);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

.hero .kicker::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 0.95em;
    background: var(--accent);
    margin-left: 0.15rem;
    vertical-align: text-bottom;
}

@media (prefers-reduced-motion: no-preference) {
    .hero .kicker::after { animation: caret-blink 1.1s steps(2, start) infinite; }
}

@keyframes caret-blink {
    50% { opacity: 0; }
}

.site-header { transition: box-shadow 0.3s ease; }
.site-header.is-scrolled { box-shadow: var(--shadow-md); }

@media (prefers-reduced-motion: no-preference) {
    .service-detail-hero h1,
    .contact-head h1,
    .legal-content h1 {
        animation: plot-in 1.1s cubic-bezier(0.19, 1, 0.22, 1) 0.15s both;
    }
}

.sf-meta.sf-compact { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 540px) {
    .sf-meta.sf-compact { grid-template-columns: 1fr; }
    .sf-meta.sf-compact > div { border-right: none; }
    .sf-meta.sf-compact > div + div { border-top: 1px solid var(--line); }
}

.tw-live {
    animation: none !important;
    clip-path: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.tw-char {
    opacity: 0;
    transition: opacity 0.05s ease-out;
    display: inline;
}

.tw-live em { background: none; }
.tw-live em .tw-char {
    transition: opacity 0.05s ease-out, background 0.1s ease-out;
}
.tw-live em .tw-char[style*="opacity: 1"] {
    background: linear-gradient(to top, rgba(85, 142, 213, 0.1) 35%, transparent 35%);
}

.tw-caret {
    display: inline-block;
    width: 0.5ch;
    height: 0.85em;
    margin-left: 0.06em;
    background: var(--accent);
    vertical-align: -0.06em;
}
.tw-caret.tw-done {
    animation: caret-blink 1.1s steps(2, start) infinite;
}
