/* GPW RegenrinnenBot M2 — Stylesheet für grünepixelwelt.de/regenrinnenbot/
 * Nutzt ausschließlich lokal gehostete Schriften (/fonts/fonts.css: Playfair Display & Nunito).
 * 100 % DSGVO-konform — null externe Abhängigkeiten.
 */
:root {
  --gpw-lime: #8bcb30;
  --gpw-green: #4b9636;
  --gpw-deep: #2e5020;
  --gpw-orange: #f68712;
  --gpw-blue: #3a61b6;
  --gpw-navy: #253660;
  --bg: #fafbf9;
  --surface: #ffffff;
  --surface-soft: #f2f7ef;
  --surface-muted: #f3f4f2;
  --ink: #182016;
  --ink-muted: #525d4f;
  --border: #dfe6dc;
  --shadow-sm: 0 2px 8px rgba(24, 32, 22, 0.05);
  --shadow-md: 0 10px 28px rgba(24, 32, 22, 0.08);
  --radius: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gpw-green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Header (exakt abgestimmt auf grünepixelwelt.de) ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--ink);
  text-decoration: none !important;
}
.brand-link img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--gpw-lime);
}
.brand-pixel {
  color: var(--gpw-green);
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.top-nav a {
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
  transition: color 0.15s ease;
}
.top-nav a:hover {
  color: var(--gpw-green);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none !important;
}
.btn-back:hover {
  border-color: var(--gpw-green);
  color: var(--gpw-green);
}
.btn-yt {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border-radius: 10px;
  background: #e11414;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.86rem;
  text-decoration: none !important;
}
.btn-yt:hover {
  background: #bd0f0f;
}

@media (max-width: 980px) {
  .top-nav {
    display: none;
  }
}

/* ===== Hero ===== */
.hero {
  padding: 6.2rem 0 2.8rem;
  background: radial-gradient(circle at 85% 15%, rgba(139, 203, 48, 0.18), transparent 48%),
              linear-gradient(180deg, #f1f8ec 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.2rem;
  align-items: center;
}
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.78rem;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.pill-green {
  background: rgba(75, 150, 54, 0.14);
  color: var(--gpw-deep);
  border: 1px solid rgba(75, 150, 54, 0.3);
}
.pill-orange {
  background: rgba(246, 135, 18, 0.14);
  color: #9a4f00;
  border: 1px solid rgba(246, 135, 18, 0.35);
}
.pill-blue {
  background: rgba(58, 97, 182, 0.12);
  color: var(--gpw-navy);
  border: 1px solid rgba(58, 97, 182, 0.28);
}

.hero h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1.15;
  margin: 0 0 0.9rem;
  color: var(--ink);
}
.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-muted);
  margin: 0 0 1.35rem;
  max-width: 44rem;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.82rem 1.35rem;
  border-radius: 12px;
  background: var(--gpw-green);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.98rem;
  text-decoration: none !important;
  box-shadow: 0 6px 18px rgba(75, 150, 54, 0.28);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary:hover {
  background: var(--gpw-deep);
  transform: translateY(-1px);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.82rem 1.25rem;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink) !important;
  border: 1.5px solid var(--border);
  font-weight: 800;
  font-size: 0.98rem;
  text-decoration: none !important;
}
.btn-secondary:hover {
  border-color: var(--gpw-green);
  color: var(--gpw-green) !important;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
}
@media (max-width: 640px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
.kpi-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  box-shadow: var(--shadow-sm);
}
.kpi-val {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--gpw-deep);
  line-height: 1.2;
}
.kpi-lbl {
  font-size: 0.76rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.hero-media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem;
  box-shadow: var(--shadow-md);
}
.hero-media-card img,
.hero-media-card video {
  width: 100%;
  display: block;
  border-radius: 11px;
}
.hero-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.35rem 0.2rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 600;
}

/* ===== Sections ===== */
.sec {
  padding: 3.2rem 0;
}
.sec-alt {
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.sec-head h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  margin: 0.2rem 0 0;
  line-height: 1.2;
}
.sec-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--gpw-green);
}
.sec-sub {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  max-width: 48rem;
}

/* ===== Download Cards (4er Grid) ===== */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}
@media (max-width: 820px) {
  .dl-grid {
    grid-template-columns: 1fr;
  }
}
.dl-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dl-card:hover {
  border-color: var(--gpw-lime);
  box-shadow: var(--shadow-md);
}
.dl-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.dl-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dl-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.14rem;
  line-height: 1.3;
}
.dl-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}
.dl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.dl-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.73rem;
  color: var(--ink-muted);
  background: var(--surface-muted);
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
}
.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border-radius: 10px;
  background: var(--gpw-green);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none !important;
}
.btn-dl:hover {
  background: var(--gpw-deep);
}

/* ===== License Banner ===== */
.license-card {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1.5px solid rgba(75, 150, 54, 0.35);
  border-left: 6px solid var(--gpw-green);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.2rem;
  align-items: center;
}
@media (max-width: 820px) {
  .license-card {
    grid-template-columns: 1fr;
  }
}
.license-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ===== 3D Viewer Layout ===== */
.viewer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.95fr);
  gap: 1.15rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .viewer-shell {
    grid-template-columns: 1fr;
  }
}
.viewer-stage-card {
  background: #141a14;
  color: #eef4ec;
  border-radius: var(--radius);
  border: 1px solid #2a3629;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  background: #1b231b;
  border-bottom: 1px solid #2b382b;
}
.cam-btn {
  border: 1px solid #334233;
  background: #222c22;
  color: #dce6da;
  border-radius: 8px;
  padding: 0.36rem 0.68rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.cam-btn:hover,
.cam-btn.active {
  background: var(--gpw-lime);
  border-color: var(--gpw-lime);
  color: #131c10;
}
.canvas-wrap {
  position: relative;
  height: 540px;
  background: radial-gradient(circle at 50% 38%, #263326 0%, #111611 78%);
}
@media (max-width: 640px) {
  .canvas-wrap {
    height: 390px;
  }
}
#gl-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#gl-canvas:active {
  cursor: grabbing;
}
.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #cfe0ca;
  background: rgba(17, 22, 17, 0.72);
  pointer-events: none;
}
.canvas-hud {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
}
.hud-chip {
  background: rgba(20, 26, 20, 0.86);
  border: 1px solid #314031;
  color: #ced9cc;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}
.inspector-bar {
  background: #1b231b;
  border-top: 1px solid #2b382b;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}
.insp-main h3 {
  margin: 0.15rem 0;
  font-size: 1rem;
  color: #fff;
}
.insp-main p {
  margin: 0;
  font-size: 0.83rem;
  color: #b4c3b1;
}
.insp-specs {
  font-size: 0.78rem;
  color: #cfe0ca;
  background: #131913;
  border: 1px solid #2b382b;
  padding: 0.5rem 0.75rem;
  border-radius: 9px;
}

.viewer-controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.ctrl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.ctrl-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}
.ctrl-head h3 {
  margin: 0;
  font-size: 0.96rem;
}
.dial-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
#rotary-dial {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  cursor: pointer;
}
.preset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.mini-btn {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
  border-radius: 7px;
  padding: 0.28rem 0.55rem;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.mini-btn:hover,
.mini-btn.active {
  background: var(--gpw-green);
  border-color: var(--gpw-green);
  color: #fff;
}
.tool-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.tool-btn {
  border: 1.5px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}
.tool-btn.active {
  border-color: var(--gpw-green);
  background: rgba(139, 203, 48, 0.16);
  color: var(--gpw-deep);
}
.toggle-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.55rem;
}
.part-list-scroll {
  max-height: 195px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding-right: 0.2rem;
}
.part-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.36rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.part-pill:hover,
.part-pill.active {
  border-color: var(--gpw-green);
  background: rgba(139, 203, 48, 0.14);
}
.part-swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.part-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gpw-green);
}

/* ===== Gallery & Feature Cards ===== */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
@media (max-width: 960px) {
  .card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .card-grid-3 {
    grid-template-columns: 1fr;
  }
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.info-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  background: #161c16;
}
.info-card-body {
  padding: 1rem 1.15rem;
}
.info-card-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.04rem;
}
.info-card-body p {
  margin: 0;
  font-size: 0.89rem;
  color: var(--ink-muted);
}

/* ===== Blueprint Split ===== */
.bp-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) {
  .bp-split {
    grid-template-columns: 1fr;
  }
}
.bp-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  box-shadow: var(--shadow-sm);
}
.bp-frame img {
  width: 100%;
  display: block;
  border-radius: 10px;
  cursor: zoom-in;
}

/* ===== Tables & Search ===== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-bar {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-muted);
}
.search-input {
  padding: 0.48rem 0.8rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.88rem;
  min-width: 240px;
  background: #fff;
}
.table-scroll {
  overflow-x: auto;
  max-height: 460px;
  overflow-y: auto;
}
table.gpw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
table.gpw-table th,
table.gpw-table td {
  padding: 0.62rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table.gpw-table th {
  position: sticky;
  top: 0;
  background: #eef3ec;
  font-weight: 800;
  color: var(--ink);
  z-index: 2;
}
table.gpw-table tr:hover td {
  background: rgba(139, 203, 48, 0.07);
}

.warn-box {
  background: #fff8ee;
  border: 1.5px solid rgba(246, 135, 18, 0.45);
  border-left: 6px solid var(--gpw-orange);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.warn-box strong {
  color: #934b00;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12, 16, 12, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #fff;
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

/* ===== Footer (exakt abgestimmt auf grünepixelwelt.de) ===== */
.site-footer {
  background: #1b211a;
  color: #e4ebe2;
  padding: 2.4rem 0;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
}
.footer-links a {
  color: #bfd0bb;
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--gpw-lime);
}
