/* Control Systems Hof – gemeinsames Stylesheet für alle Seiten */

/* ── Schriften (lokal, keine Verbindung zu Google) ── */
@font-face {
  font-family: 'Syne';
  src: url('../fonts/syne-latin.woff2') format('woff2');
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ── Design Tokens ── */
:root {
  --bg: #0f1117;
  --surface: #161b27;
  --surface2: #1e2536;
  --accent: #4f8ef7;
  --accent2: #a259f7;
  --ok: #22c55e;
  --warn: #eab308;
  --alarm: #ef4444;
  --text: #e8ecf4;
  --muted: #8a93aa;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --font-head: 'Syne', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --wrap: 1100px;
}

/* ── Grundlagen ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.7; font-size: 16px; font-variant-numeric: lining-nums; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
strong { color: var(--text); font-weight: 600; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 40px; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 200; }
.skip-link:focus { left: 8px; }

/* ── Navigation ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 64px;
  background: rgba(15, 17, 23, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nav-logo img { height: 38px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; }
.nav-links a, .nav-drop > button {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; letter-spacing: 0.03em;
  background: none; border: 0; cursor: pointer; font-family: inherit; transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current='page'], .nav-drop > button:hover, .nav-drop.open > button { color: var(--text); }
.nav-links .nav-cta { color: #fff; background: var(--accent); padding: 7px 18px; border-radius: 6px; }
.nav-links .nav-cta:hover { background: #3b7be6; color: #fff; }
.nav-drop { position: relative; }
.nav-drop > button::after { content: ' ▾'; font-size: 11px; }
.nav-drop ul {
  position: absolute; top: calc(100% + 14px); left: -16px; min-width: 240px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); display: none;
}
.nav-drop.open ul, .nav-drop:focus-within ul { display: block; }
.nav-drop ul a { display: block; padding: 10px 12px; border-radius: 6px; }
.nav-drop ul a:hover { background: var(--surface2); }
.nav-drop ul small { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0; font-weight: 400; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 10px; font-size: 18px; cursor: pointer; }

/* ── Seitenkopf / Hero ── */
.hero { margin-top: 64px; position: relative; overflow: hidden; }
.hero-banner { position: relative; }
.hero-banner img { width: 100%; height: 200px; object-fit: cover; object-position: center top; opacity: 0.8; }
.hero-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--bg) 100%); }
.hero-content { text-align: center; padding: 56px 40px 72px; max-width: 920px; margin: 0 auto; }
.eyebrow { display: block; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; font-weight: 600; }
.hero-title {
  font-family: var(--font-head); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; margin-bottom: 22px;
  background: linear-gradient(135deg, #e8ecf4 30%, var(--accent2) 70%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--muted); font-size: 1.08rem; max-width: 620px; margin: 0 auto 34px; }
.page-hero { margin-top: 64px; padding: 72px 0 40px; }
.page-hero .wrap { display: grid; gap: 48px; }
.page-hero .wrap > div:first-child { max-width: 780px; }
.page-hero h1 { font-family: var(--font-head); font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.15; margin-bottom: 18px; }
.page-hero p.lead { color: var(--muted); font-size: 1.08rem; margin-bottom: 28px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); margin-bottom: 16px; }
.badge.ok { color: #86efac; border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.1); }
.badge.soon { color: #fde68a; border-color: rgba(234, 179, 8, 0.35); background: rgba(234, 179, 8, 0.1); }

/* ── Knöpfe ── */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-content .btn-row { justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent; transition: background 0.2s, border-color 0.2s, color 0.2s; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3b7be6; }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Abschnitte ── */
section { padding: 80px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 52px; }
.section-head h2 { font-family: var(--font-head); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; margin-bottom: 14px; }
.section-head p { color: var(--muted); }
h2.title { font-family: var(--font-head); font-size: 1.55rem; margin-bottom: 14px; }
h3 { font-family: var(--font-head); font-size: 1.15rem; margin-bottom: 8px; }
p + p { margin-top: 1em; }

/* Bilder: helle Diagramme bekommen einen ruhigen Rahmen */
.figure { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--surface2); }
.figure.light { background: #f7f8fb; padding: 14px; }
.figure img { width: 100%; height: auto; }
.figure figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); }
.figure.light figcaption { margin: 14px -14px -14px; }
.shot { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); overflow: hidden; }
.shot img { width: 100%; }

/* ── Leistungen (abwechselnd Text / Bild) ── */
.topic { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; margin-bottom: 88px; }
.topic:last-child { margin-bottom: 0; }
.topic.reverse .topic-text { order: 2; }
.topic-index {
  font-family: var(--font-head); font-size: 3rem; font-weight: 800; line-height: 1; margin-bottom: 10px; opacity: 0.45;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topic-body { color: var(--muted); font-size: 0.98rem; line-height: 1.8; }
.topic-link { display: inline-block; margin-top: 16px; font-weight: 600; text-decoration: none; }
.topic-link:hover { text-decoration: underline; }

/* ── Karten ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.section-alt .card { background: var(--bg); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .icon { font-size: 22px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: rgba(79, 142, 247, 0.12); color: var(--accent); margin-bottom: 14px; }

/* Produktkarten auf der Startseite */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.product { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.2s, transform 0.2s; }
.product:hover { border-color: rgba(79, 142, 247, 0.5); transform: translateY(-3px); }
.product-img { aspect-ratio: 16 / 9; overflow: hidden; background: #f7f8fb; }
.product-img img { width: 100%; height: 100%; object-fit: contain; }
.product-img.dark img { object-fit: cover; object-position: center top; }
.product-img.dark { background: var(--surface2); }
.product-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.product-body h3 { font-size: 1.4rem; margin: 0; }
.product-body p { color: var(--muted); }
.product-body ul { list-style: none; color: var(--muted); font-size: 0.95rem; display: grid; gap: 6px; }
.product-body li::before { content: '✓  '; color: var(--ok); font-weight: 700; }
.product-body .btn-row { margin-top: auto; padding-top: 8px; }

/* Schritte */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: relative; }
.section-alt .step { background: var(--bg); }
.step::before { counter-increment: step; content: counter(step); font-family: var(--font-head); font-weight: 800; font-size: 14px; color: #fff; background: var(--accent); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 12px; }
.step p { color: var(--muted); font-size: 0.93rem; }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface2); color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td:first-child { width: 170px; white-space: nowrap; }

/* Code mit Kopier-Knopf */
code { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 0.9em; background: var(--surface2); padding: 2px 6px; border-radius: 4px; }
.code { position: relative; background: #0a0d13; border: 1px solid var(--border); border-radius: 10px; padding: 18px 100px 18px 20px; overflow-x: auto; }
.code pre { margin: 0; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6; color: #cbd5e1; }
.code .copy { position: absolute; top: 10px; right: 10px; font-size: 12px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); cursor: pointer; }
.code .copy:hover { color: var(--text); }
.note { border-left: 3px solid var(--accent); background: rgba(79, 142, 247, 0.07); padding: 14px 18px; border-radius: 0 8px 8px 0; color: var(--muted); font-size: 0.95rem; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 5px 14px; border-radius: 100px; font-weight: 500; }

/* Diagramm «Alles zusammen» */
.flow { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; overflow-x: auto; }
.flow svg { min-width: 760px; width: 100%; height: auto; display: block; }
.flow-hint { display: none; text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
@media (max-width: 768px) { .flow-hint { display: block; } }

/* ── Kontakt / Aufruf ── */
.cta { background: linear-gradient(135deg, rgba(79, 142, 247, 0.12), rgba(162, 89, 247, 0.12)); border: 1px solid var(--border); border-radius: 18px; padding: 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.cta h2 { font-family: var(--font-head); font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 12px; }
.cta p { color: var(--muted); }
.contact-list { display: grid; gap: 16px; }
.contact-row { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.contact-row svg { color: var(--accent); flex-shrink: 0; }
.contact-row a { color: var(--text); text-decoration: none; }
.contact-row a:hover { color: var(--accent); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.footer-logo img { height: 30px; width: auto; opacity: 0.6; }
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ── Rechtliches ── */
.legal { margin-top: 64px; padding: 64px 0; }
.legal .wrap { max-width: 860px; }
.legal h1 { font-family: var(--font-head); font-size: 2.2rem; margin-bottom: 6px; }
.legal h2 { font-family: var(--font-head); font-size: 1.25rem; margin: 36px 0 10px; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 20px; margin-top: 8px; }
.tabs { display: flex; gap: 6px; margin: 28px 0 8px; border-bottom: 1px solid var(--border); }
.tab-btn { background: none; border: 0; color: var(--muted); padding: 10px 16px; font-size: 15px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-top: 20px; }
.info-card p { margin: 0; color: var(--text); }
.info-card hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.info-card .label { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* 3D-IoT-Twin-Demo (Produktseite) */
.twin-demo { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: #1b1f27; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); }
.twin-demo:fullscreen { aspect-ratio: auto; border-radius: 0; border: 0; }
.td-stage, .td-stage canvas, .td-labels { position: absolute; inset: 0; width: 100%; height: 100%; }
.td-labels { pointer-events: none; }
.td-fallback { width: 100%; height: 100%; object-fit: cover; }
.twin-demo.live .td-fallback { display: none; }
.td-loading { position: absolute; inset: 0; display: none; place-items: center; color: var(--muted); font-size: 0.95rem; pointer-events: none; }
.twin-demo.live:not(.ready) .td-loading { display: grid; }
.td-top { position: absolute; top: 12px; left: 12px; display: none; align-items: center; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.td-bar { position: absolute; right: 12px; bottom: 12px; display: none; gap: 6px; }
.twin-demo.ready .td-top, .twin-demo.ready .td-bar { display: flex; }
.td-title { font-weight: 600; font-size: 13px; background: rgba(18, 21, 27, 0.82); border: 1px solid var(--border); padding: 3px 10px; border-radius: 6px; }
.td-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.td-chip.alarm { background: #ef4444; color: #fff; }
.td-chip.warning { background: #eab308; color: #1a1a1a; }
.td-chip.ok { background: rgba(34, 197, 94, 0.18); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.td-bar button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: rgba(18, 21, 27, 0.85); color: var(--text); cursor: pointer; }
.td-bar button:hover { border-color: var(--accent); }
.td-done { display: none; }
.twin-demo.active .td-done { display: inline-block; }
.td-touch { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); white-space: nowrap; }
.twin-demo:not(.ready) .td-touch, .twin-demo.active .td-touch { display: none; }
.twin-demo.active canvas { touch-action: none; }
.td-label { display: flex; flex-direction: column; align-items: center; padding: 3px 8px; border-radius: 6px; background: rgba(18, 21, 27, 0.82); border: 1px solid #9ca3af; font-size: 12px; line-height: 1.25; white-space: nowrap; user-select: none; color: var(--text); }
.td-label .td-name { color: var(--muted); font-size: 11px; }
.td-label .td-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.td-label[data-color='measure'] { border-color: #3b82f6; }
.td-label[data-color='ok'] { border-color: #22c55e; }
.td-label[data-color='warning'] { border-color: #eab308; background: rgba(234, 179, 8, 0.9); color: #1a1a1a; }
.td-label[data-color='warning'] .td-name { color: #3a3000; }
.td-label[data-color='alarm'] { border-color: #ef4444; background: rgba(239, 68, 68, 0.92); color: #fff; }
.td-label[data-color='alarm'] .td-name { color: #ffe4e4; }
.td-note { color: var(--muted); font-size: 0.88rem; margin-top: 12px; }
.td-note .touch-only { display: none; }
@media (pointer: coarse) { .td-note .touch-only { display: inline; } .td-note .mouse-only { display: none; } }

/* ── Responsive ── */
@media (max-width: 900px) {
  .cta, .products { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .wrap { padding: 0 20px; }
  section { padding: 60px 0; }
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 20px 16px; }
  .site-nav.open .nav-links { display: flex; }
  .nav-links > li > a, .nav-drop > button { display: block; padding: 12px 0; width: 100%; text-align: left; font-size: 16px; }
  .nav-links .nav-cta { text-align: center; margin-top: 8px; }
  .nav-drop ul { position: static; display: block; box-shadow: none; border: 0; background: none; padding: 0 0 0 12px; min-width: 0; }
  .nav-drop > button::after { content: ''; }
  .topic { grid-template-columns: 1fr; gap: 28px; margin-bottom: 64px; }
  .topic.reverse .topic-text { order: 0; }
  .hero-content { padding: 40px 20px 56px; }
  .page-hero { padding: 48px 0 24px; }
  .twin-demo { aspect-ratio: 1 / 1.05; }
  .td-label { font-size: 11px; padding: 1px 6px; }
  .td-label .td-name { display: none; }
  .td-touch { left: 12px; bottom: 12px; transform: none; font-size: 13px; padding: 7px 14px; }
  .twin-demo:not(.active) .td-reset { display: none; }
  .td-title { font-size: 12px; }
  .steps { grid-template-columns: 1fr; }
  .cta { padding: 28px; }
}
