:root {
  --primary: #7d2ee5;
  --accent:  #eb359e;
  --bg:      #fafafc;
  --bg-alt:  #ffffff;
  --bg-soft: #f4f1fb;
  --fg:      #161623;
  --fg-soft: #525266;
  --muted:   #8888a0;
  --border:  #e6e4ee;
  --shadow-sm: 0 2px 8px rgba(50, 22, 120, 0.06);
  --shadow-md: 0 8px 32px rgba(50, 22, 120, 0.10);
  --radius:  12px;
  --radius-lg: 18px;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand img {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.brand-name { letter-spacing: -0.01em; }

.site-nav nav { margin-left: auto; }
.site-nav nav ul {
  display: flex;
  list-style: none;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.site-nav nav li a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--fg-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav nav li a:hover {
  color: var(--fg);
  background: var(--bg-soft);
  text-decoration: none;
}
.site-nav nav li a.active {
  color: var(--primary);
  background: var(--bg-soft);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 56px;
}
.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(3rem, 7vw, 5.2rem);
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.0;
}
.hero-accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.18rem;
  color: var(--fg-soft);
  margin: 0 0 28px;
  max-width: 600px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: white;
  color: var(--fg);
  font-weight: 600;
  border: 1px solid var(--border);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(125, 46, 229, 0.35);
}
.button.primary:hover {
  box-shadow: 0 8px 24px rgba(125, 46, 229, 0.45);
}
.hero-image {
  text-align: center;
}
.hero-image img {
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 56px 0;
}
.feature-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}
.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.feature-card p {
  margin: 0;
  color: var(--fg-soft);
  font-size: 0.95rem;
}

/* CTA */
.cta {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin: 48px 0;
}
.cta h2 { margin-top: 0; }
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.example.small {
  background: var(--bg-soft);
  padding: 14px;
  border-radius: var(--radius);
}
.example.small h4 { margin: 0 0 6px; font-size: 1rem; }
.example.small code {
  display: inline-block;
  font-family: var(--font-mono);
  background: white;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  margin-bottom: 12px;
  word-break: break-all;
}

/* Page */
.page {
  margin-top: 32px;
  margin-bottom: 64px;
}
.page-header h1 {
  font-size: 2.4rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.page-header .lead {
  font-size: 1.1rem;
  color: var(--fg-soft);
  margin: 0 0 24px;
}
.page-content {
  max-width: 760px;
}
.page-content code {
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border);
}
.page-content pre {
  background: #1f1d2e;
  color: #f4f1fb;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}
.page-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}
.page-content h2 {
  margin-top: 36px;
  font-size: 1.5rem;
}
.page-content h3 { margin-top: 28px; }
.page-content blockquote {
  border-left: 3px solid var(--primary);
  margin-left: 0;
  padding: 8px 16px;
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.page-content img {
  display: block;
  max-width: 520px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 12px 0 20px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.page-content img:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Screenshot-Karten: Text links, Bild rechts */
.screenshot-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 28px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.screenshot-card:last-child { border-bottom: none; }
.screenshot-card-text > :first-child { margin-top: 0; }
.screenshot-card-text > :last-child { margin-bottom: 0; }
.screenshot-card-text h3 {
  margin: 0 0 6px;
  font-size: 1.18rem;
}
.screenshot-card-text .meta {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.screenshot-card-text code {
  display: inline-block;
  font-family: var(--font-mono);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  margin-top: 4px;
}
.screenshot-card-image img {
  margin: 0;
  max-width: 100%;
}
@media (max-width: 760px) {
  .screenshot-card { grid-template-columns: 1fr; gap: 12px; }
}

/* Lightbox-Overlay (per JS aktiviert) */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 5, 24, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.lightbox-overlay.active { opacity: 1; }
.lightbox-overlay img {
  max-width: min(96vw, 1600px);
  max-height: 92vh;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}
.page-content th, .page-content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.page-content th {
  background: var(--bg-soft);
  font-weight: 600;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin-top: 24px;
}
.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.card a {
  display: block;
  padding: 20px;
  color: var(--fg);
}
.card a:hover { text-decoration: none; }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--fg-soft); font-size: 0.94rem; }
.card .lead { color: var(--primary); font-weight: 500; }

/* Examples (Hilfe-Seiten) */
.examples > .example {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
}
.examples > .example h3 {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.example-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.example-pattern, .example-sample {
  background: var(--bg-soft);
  padding: 10px 12px;
  border-radius: var(--radius);
}
.example-pattern span, .example-sample span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.example-pattern code {
  font-family: var(--font-mono);
  font-size: 1rem;
  word-break: break-all;
  display: inline-block;
}
.example-sample pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
  background: transparent;
  padding: 0;
}
.example-sample mark.match {
  background: rgba(235, 53, 158, 0.25);
  color: var(--fg);
  padding: 0 2px;
  border-radius: 3px;
}
.note {
  margin: 8px 0;
  color: var(--fg-soft);
  font-size: 0.9rem;
}

/* Visualization SVG */
.viz {
  margin-top: 12px;
  padding: 12px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.viz svg {
  display: block;
  min-width: 100%;
}
.node-literal { fill: #3380d8; }
.node-escape  { fill: #7558d8; }
.node-anychar { fill: #8c8c98; }
.node-anchor  { fill: #36a665; }
.node-charclass { fill: #d8902f; }
.node-charclass-neg { fill: #d8593a; }
.node-backref { fill: #b46d1a; }
.node-empty   { fill: #aaaaaa; }
.node-text    { fill: white; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.group-rect   { fill: rgba(125, 46, 229, 0.06); stroke: rgba(125, 46, 229, 0.45); stroke-dasharray: 4 3; }
.group-label  { fill: var(--primary); font-size: 11px; font-weight: 700; }
.q-pill       { fill: #e7943f; }
.q-text       { fill: white; font-size: 11px; font-family: var(--font-mono); font-weight: 700; }
.edge         { stroke: rgba(0,0,0,0.3); stroke-width: 1.4; fill: none; }
.start-dot    { fill: #36a665; }
.end-dot      { fill: #d8593a; }

/* See also */
.see-also {
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.see-also h2 { margin-top: 0; font-size: 1.2rem; }
.see-also ul { padding-left: 18px; margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 24px 0;
  color: var(--fg-soft);
  font-size: 0.92rem;
}

/* Mobile */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; padding-bottom: 36px; }
  .hero-image { order: -1; }
  .hero-image img { max-width: 140px; }
  .site-nav nav ul { gap: 0; }
  .site-nav nav li a { padding: 6px 8px; font-size: 0.85rem; }
  .example-row { grid-template-columns: 1fr; }
}
