/*
Theme Name: neogrid systems
Theme URI: https://neogridsystems.de
Author: neogrid systems
Description: Visitenkarten-Theme für neogrid systems – IT-Infrastruktur, Gebäudeautomation, Elektromobilität und PV. Ohne externe Schriften oder Tracker (DSGVO-freundlich).
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: neogrid
*/

:root {
	--paper: #F1F4F6;
	--surface: #FFFFFF;
	--ink: #13233A;
	--muted: #4A5B6E;
	--line: #C3CED8;
	--grid: #D9E1E7;
	--signal: #F2B705;
	--link: #0B6E6D;
	--on-signal: #13233A;
	--display: "Bahnschrift", "DIN Alternate", "DIN 2014", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
	--text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 72rem;
	box-sizing: border-box;
	padding-top: env(safe-area-inset-top, 0px);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #0F1B2D;
		--surface: #16253B;
		--ink: #E8EEF3;
		--muted: #A7B5C4;
		--line: #2C3E56;
		--grid: #1C2C43;
		--link: #5CC8C6;
	}
}
:root[data-theme="dark"] {
	--paper: #0F1B2D;
	--surface: #16253B;
	--ink: #E8EEF3;
	--muted: #A7B5C4;
	--line: #2C3E56;
	--grid: #1C2C43;
	--link: #5CC8C6;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 5rem); }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--text);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--surface); padding: .5rem 1rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); max-width: 18ch; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: 65ch; }

/* Kopfzeile */
.site-header {
	position: sticky;
	top: env(safe-area-inset-top, 0px);
	z-index: 10;
	background: color-mix(in srgb, var(--paper) 92%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 1.25rem; font-weight: 600; letter-spacing: .01em; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand b { font-weight: 300; }
.nav ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--link); }
.nav ul { align-items: center; }
.nav a.nav-portal { padding: .35rem .8rem; border: 2px solid var(--ink); border-radius: 4px; font-weight: 600; }
.nav a.nav-portal:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 760px) {
	.nav li { display: none; }
	.nav li:has(.nav-portal) { display: block; }
}

/* Hero */
.hero {
	background-image: radial-gradient(var(--grid) 1.2px, transparent 1.2px);
	background-size: 22px 22px;
	border-bottom: 1px solid var(--line);
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; padding-block: clamp(3rem, 8vw, 6rem); }
.hero .lead { font-size: 1.15rem; color: var(--muted); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; gap: 2rem; } }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.btn {
	display: inline-block; padding: .8rem 1.4rem; border-radius: 4px;
	font-weight: 600; text-decoration: none; border: 2px solid var(--ink);
	font-family: var(--text); font-size: 1rem; cursor: pointer;
}
.btn-primary { background: var(--signal); color: var(--on-signal); border-color: var(--signal); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--surface); }

/* Schema-Grafik mit Energiefluss */
.schema { width: 100%; color: var(--ink); }
.schema .house { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.schema .wire, .schema .cable { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.schema .cable { stroke-width: 3; stroke-linecap: round; }
.schema .bus { fill: none; stroke: var(--link); stroke-width: 2.5; stroke-dasharray: 6 5; }
.schema .node { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.schema .node-clear { fill: none; }
.schema .core { fill: var(--ink); }
.schema .core-text { fill: var(--paper); font: 600 13px var(--display); }
.schema .lbl { fill: var(--muted); font: 500 13px var(--text); }
.schema .lbl-strong { fill: var(--ink); font: 600 14px var(--display); }
.schema .pv-cell { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.schema .pv-glow { fill: var(--signal); opacity: .55; }
.schema .sun circle { fill: var(--signal); stroke: var(--ink); stroke-width: 2; }
.schema .sun path { stroke: var(--signal); stroke-width: 3; stroke-linecap: round; }
.schema .wb-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.schema .wb-on { fill: none; stroke: var(--signal); stroke-width: 4; }
.schema .gauge { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.schema .gauge-fill { fill: var(--signal); transform-box: fill-box; }
.schema .car-fill { transform-origin: left center; }
.schema .bat-fill { transform-origin: center bottom; transform: scaleY(.6); }
.schema .flow { fill: none; stroke: var(--signal); stroke-width: 5.5; stroke-linecap: round; stroke-dasharray: .1 13; }
.schema .cap { fill: var(--ink); font: 600 15px var(--display); opacity: 0; }
.schema .c-static { opacity: 1; }
.schema .f-dis { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
	.schema .c-static { opacity: 0; }
	.schema .flow { opacity: 0; }
	.schema .sun   { animation: ng-sun 16s ease-in-out infinite; }
	.schema .pv-glow { animation: ng-glow 16s ease-in-out infinite; }
	.schema .f-pv  { animation: ng-move .9s linear infinite, ng-w-pv 16s linear infinite; }
	.schema .f-car { animation: ng-move .9s linear infinite, ng-w-car 16s linear infinite; }
	.schema .wb-on { animation: ng-w-car 16s linear infinite; }
	.schema .f-bat { animation: ng-move .9s linear infinite, ng-w-bat 16s linear infinite; }
	.schema .f-dis { animation: ng-move .9s linear infinite, ng-w-dis 16s linear infinite; }
	.schema .car-fill { animation: ng-car 16s ease-in-out infinite; }
	.schema .bat-fill { animation: ng-bat 16s ease-in-out infinite; }
	.schema .c1 { animation: ng-c1 16s linear infinite; }
	.schema .c2 { animation: ng-w-car 16s linear infinite; }
	.schema .c3 { animation: ng-c3 16s linear infinite; }
	.schema .c4 { animation: ng-w-dis 16s linear infinite; }
}
@keyframes ng-move { to { stroke-dashoffset: -13.1; } }
@keyframes ng-sun  { 0% { opacity: 0; transform: translateY(26px); } 7%, 78% { opacity: 1; transform: none; } 86%, 100% { opacity: 0; transform: translateY(26px); } }
@keyframes ng-glow { 0%, 6% { opacity: 0; } 12%, 78% { opacity: .55; } 84%, 100% { opacity: 0; } }
@keyframes ng-w-pv  { 0%, 7% { opacity: 0; } 10%, 77% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes ng-w-car { 0%, 15% { opacity: 0; } 18%, 44% { opacity: 1; } 47%, 100% { opacity: 0; } }
@keyframes ng-w-bat { 0%, 46% { opacity: 0; } 49%, 76% { opacity: 1; } 79%, 100% { opacity: 0; } }
@keyframes ng-w-dis { 0%, 82% { opacity: 0; } 85%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ng-c1 { 0%, 2% { opacity: 0; } 5%, 14% { opacity: 1; } 17%, 100% { opacity: 0; } }
@keyframes ng-c3 { 0%, 46% { opacity: 0; } 49%, 78% { opacity: 1; } 81%, 100% { opacity: 0; } }
@keyframes ng-car { 0%, 18% { transform: scaleX(.2); } 44%, 97% { transform: scaleX(1); } 100% { transform: scaleX(.2); } }
@keyframes ng-bat { 0%, 49% { transform: scaleY(.15); } 76%, 85% { transform: scaleY(1); } 100% { transform: scaleY(.15); } }

/* Abschnitte */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-intro { color: var(--muted); margin-bottom: 2.5rem; }

/* Leistungsmatrix */
.matrix { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.matrix th, .matrix td { text-align: left; vertical-align: top; padding: 1.25rem; border-bottom: 1px solid var(--line); }
.matrix thead th { font-family: var(--display); font-weight: 600; font-size: 1rem; background: var(--paper); border-bottom: 2px solid var(--ink); }
.matrix tbody th { width: 22%; }
.matrix tbody th h3 { margin: 0 0 .35rem; }
.matrix tbody th p { font-size: .9rem; color: var(--muted); font-weight: 400; margin: 0; }
.matrix td { font-size: .97rem; width: 26%; }
.matrix td ul { margin: 0; padding-left: 1.1rem; }
.matrix td li + li { margin-top: .3rem; }
.partner { display: block; margin-top: .6rem; font-size: .85rem; color: var(--muted); padding-left: .7rem; border-left: 3px solid var(--signal); }
.matrix tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 860px) {
	.matrix, .matrix tbody, .matrix tr, .matrix th, .matrix td { display: block; width: 100%; }
	.matrix thead { display: none; }
	.matrix tbody tr { border-bottom: 2px solid var(--ink); }
	.matrix tbody tr:last-child { border-bottom: 0; }
	.matrix td { border-bottom: 1px solid var(--line); padding-top: .9rem; }
	.matrix td::before { content: attr(data-col); display: block; font-family: var(--display); font-weight: 600; margin-bottom: .3rem; }
	.matrix tbody tr:last-child > td:last-child { border-bottom: 0; }
}

/* Ablauf */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.steps li { counter-increment: step; padding: 0 1.5rem 0 0; position: relative; }
.steps li::before {
	content: counter(step); display: grid; place-items: center;
	width: 2.4rem; height: 2.4rem; border-radius: 50%;
	border: 2px solid var(--ink); background: var(--paper);
	font: 600 1.05rem var(--display); margin-bottom: 1rem; position: relative; z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 1.2rem; left: 2.4rem; right: 0; border-top: 2px solid var(--ink); }
.steps li:last-child::after { display: none; }
.steps p { color: var(--muted); font-size: .97rem; }
@media (max-width: 860px) {
	.steps { grid-template-columns: 1fr; gap: 1.5rem; }
	.steps li { padding: 0 0 0 3.6rem; }
	.steps li::before { position: absolute; left: 0; top: 0; }
	.steps li::after { top: 2.4rem; bottom: -1.5rem; left: 1.2rem; right: auto; border-top: 0; border-left: 2px solid var(--ink); }
}

/* Zuständigkeit */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.split > div { padding: 1.75rem; background: var(--surface); border: 1px solid var(--line); }
.split > div.ext { background: transparent; border: 2px dashed var(--line); }
.split ul { margin: 0; padding-left: 1.1rem; }
.split li + li { margin-top: .45rem; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* Kontakt */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: 3rem; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact dl { margin: 1.5rem 0 0; }
.contact dt { font-family: var(--display); font-weight: 600; margin-top: 1rem; }
.contact dd { margin: 0; }
.form { display: grid; gap: 1rem; background: var(--surface); padding: 1.75rem; border: 1px solid var(--line); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.form input, .form select, .form textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--paper);
	border: 1px solid var(--line); border-radius: 4px; padding: .7rem .8rem;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--ink); outline: 2px solid var(--signal); outline-offset: 0; }
.form textarea { min-height: 9rem; resize: vertical; }
.form .consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; font-weight: 400; }
.form .consent input { width: auto; margin-top: .3rem; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.2rem; border-left: 4px solid var(--link); background: var(--surface); }
.notice.err { border-color: #C0392B; }

/* Fußzeile */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; font-size: .92rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--muted); }
.site-footer nav a + a { margin-left: 1.25rem; }

/* Unterseiten (Impressum, Datenschutz) */
.page-content { padding-block: 3.5rem 5rem; }
.page-content .entry { max-width: 68ch; }
.page-content h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
