/* NovaCube AG – Farben aus dem Logo */
:root {
  --copper: #c68a65;
  --copper-light: #d3a689;
  --copper-dark: #a86e4b;
  --charcoal: #1e1e1e;
  --steel: #5e5e5e;

  --bg: #f7f4f0;
  --surface: #ffffff;
  --surface-2: #efe9e3;
  --text: #1e1e1e;
  --muted: #5e5e5e;
  --line: #e2dad2;
  --accent: var(--copper);
  --accent-hover: var(--copper-dark);
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(30, 30, 30, .05), 0 8px 24px rgba(30, 30, 30, .06);
  --radius: 10px;
  --header-h: 76px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131313; --surface: #1c1c1c; --surface-2: #242322; --text: #ece7e2;
    --muted: #a39d97; --line: #302d2a; --accent: var(--copper-light); --accent-hover: #e2bba1;
    --on-accent: #1e1e1e; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #131313; --surface: #1c1c1c; --surface-2: #242322; --text: #ece7e2;
  --muted: #a39d97; --line: #302d2a; --accent: var(--copper-light); --accent-hover: #e2bba1;
  --on-accent: #1e1e1e; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  transition: background .2s, color .2s;
}
main { flex: 1; }
h1, h2, h3, h4 { font-family: Outfit, Inter, sans-serif; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .container { padding: 0 28px; } }

/* Logo je nach Modus */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.logo { height: 44px; width: auto; }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px; transition: color .15s, background .15s;
}
.main-nav a:hover { background: var(--surface-2); }
.main-nav a.active { color: var(--accent); }
.header-icons { display: flex; align-items: center; gap: 2px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text); border-radius: 8px; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
.badge {
  position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--copper); color: #fff; font-size: 11px; font-weight: 600;
  line-height: 17px; text-align: center;
}
.menu-btn { display: none; }
@media (max-width: 920px) {
  .menu-btn { display: grid; }
  .header-icons { margin-left: auto; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    display: none; margin: 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; font-size: 1.05rem; }
  .logo { height: 38px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
  border: 0; cursor: pointer; font-size: .98rem; font-family: inherit; transition: background .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }

/* Abschnitte */
.section { padding: 72px 0; }
.section + .section { padding-top: 0; }
.section-title { margin-bottom: 28px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.rich p, .rich ul { max-width: 72ch; color: var(--text); }
.rich ul { padding-left: 1.2em; margin: 0 0 1em; }
.rich h3 { margin-top: 1.4em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.page-head { padding: 64px 0 8px; }
.page-head .rich p { color: var(--muted); font-size: 1.12rem; }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding-top: 88px; padding-bottom: 88px; }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-bottom: 28px; }
.hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; transform: skewY(-6deg); width: 100%; max-width: 400px; justify-self: end; }
.hero-art span { aspect-ratio: 1.6; border-radius: 4px; background: var(--copper); }
.hero-art span:nth-child(2n) { background: var(--copper-light); }
.hero-art span:nth-child(3n) { background: var(--copper-dark); }
.hero-art span:nth-child(5) { background: var(--charcoal); }
:root[data-theme="dark"] .hero-art span:nth-child(5) { background: var(--steel); }
.hero.has-image { color: #fff; border: 0; }
.hero.has-image .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,20,20,.82), rgba(20,20,20,.35)); }
.hero.has-image .hero-inner { position: relative; z-index: 1; grid-template-columns: 1fr; padding-top: 130px; padding-bottom: 130px; }
.hero.has-image .lead { color: rgba(255,255,255,.85); }
.hero.has-image .btn { background: var(--copper); color: #fff; }
@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 56px; }
  .hero-art { max-width: 280px; justify-self: start; }
}

/* Leistungen */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.feature-num { font-family: Outfit, sans-serif; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.feature p { color: var(--muted); margin: 0; }

/* Bild + Text */
.image-text { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.image-text.reverse .it-image { order: 2; }
.it-image img { width: 100%; border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; }
@media (max-width: 800px) { .image-text { grid-template-columns: 1fr; gap: 24px; } .image-text.reverse .it-image { order: 0; } }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 0; }
.stat-value { font-family: Outfit, sans-serif; font-size: 2.4rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.stat-label { color: var(--muted); }

/* Projektkarten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
@media (max-width: 400px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 4/3; background: var(--surface-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img.empty { display: grid; place-items: center; }
.card-img.empty img { width: 64px; height: auto; opacity: .35; }
.card-body { padding: 20px 22px 24px; }
.card-meta { color: var(--muted); font-size: .88rem; margin-bottom: 6px; }
.card-body h3 { margin: 0 0 6px; }
.card-body p { color: var(--muted); margin: 0; font-size: .95rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.empty-note { color: var(--muted); padding: 32px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

/* Projektdetail */
.detail-head { padding: 48px 0 24px; }
.back-link { color: var(--muted); text-decoration: none; font-size: .92rem; display: inline-block; margin-bottom: 18px; }
.back-link:hover { color: var(--accent); }
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); cursor: zoom-in; margin-bottom: 16px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 32px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; }

/* Ratgeber */
.article-cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); margin: 8px 0 32px; }
.article { max-width: 760px; }

/* CTA */
.cta { background: var(--charcoal); color: #f2ede8; border-radius: 14px; padding: 48px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; position: relative; overflow: hidden; }
:root[data-theme="dark"] .cta { background: var(--surface-2); }
.cta h2 { margin: 0 0 6px; }
.cta p { margin: 0; color: rgba(242,237,232,.75); }
.cta::before { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; background: var(--copper); opacity: .14; transform: rotate(18deg); border-radius: 10px; }
.cta .btn { background: var(--copper); color: #fff; position: relative; }
@media (max-width: 600px) { .cta { padding: 32px 24px; } }

/* Kontakt */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info dl { margin: 24px 0 0; }
.contact-info dt { color: var(--muted); font-size: .85rem; }
.contact-info dd { margin: 0 0 16px; white-space: pre-line; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; }
.form input, .form textarea, .form select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.form textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-msg { font-size: .95rem; }
.form-msg.ok { color: #3b8a55; }
.form-msg.err { color: #c0453b; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 48px 0 24px; background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-logo { height: 40px; width: auto; margin-bottom: 14px; }
.site-footer p, .footer-contact { color: var(--muted); font-size: .92rem; }
.footer-contact div { white-space: pre-line; margin-bottom: 6px; }
.footer-contact a { color: var(--muted); }
.footer-nav { display: flex; flex-direction: column; gap: 6px; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,10,10,.92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 4px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; padding: 12px 18px; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; } .lb-next { right: 4px; }

.loading { padding: 120px 0; text-align: center; color: var(--muted); }
