:root {
  --ink: #0A0A0A;
  --paper: #FFFFFF;
  --rule: #DEDEDE;
  --mute: #666666;
  --shade: #F7F7F7;
  --font-display: "Archivo", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --measure: 640px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Header — barre noire, comme demandé, collante au scroll */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
}
.brand { text-decoration: none; display: flex; align-items: center; gap: 0.75rem; color: var(--paper); }
.brand-logo { border-radius: 50%; display: block; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1rem;
  color: var(--paper);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #B8B8B8;
}
.main-nav { display: flex; gap: 1.5rem; align-items: center; font-family: var(--font-mono); font-size: 0.85rem; }
.main-nav a { text-decoration: none; color: var(--paper); margin-left: 1.5rem; }
.main-nav a:first-child { margin-left: 0; }
.main-nav a:hover { color: #B8B8B8; }
.nav-cta {
  border: 1px solid var(--paper);
  padding: 0.4rem 0.8rem;
  transition: background .15s, color .15s;
}
.nav-cta:hover { background: var(--paper); color: var(--ink) !important; }

/* Menu mobile — case à cocher cachée, pas de JS nécessaire */
.nav-toggle-checkbox { display: none; }
.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.nav-toggle-label span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--paper);
  margin-bottom: 6px;
}
.nav-toggle-label span:last-child { margin-bottom: 0; }

/* Main content column */
main { max-width: var(--measure); margin: 0 auto; padding: 3rem 1.5rem 4rem; }
main.wide { max-width: 1040px; }

h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0.4rem 0 1rem; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; margin-top: 2.5rem; }
h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.4rem;
  display: block;
}
.hero { text-align: center; padding: 2rem 0 1rem; }
.hero .eyebrow { text-align: center; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); max-width: 16ch; margin-left: auto; margin-right: auto; }
.lede { font-size: 1.1rem; font-weight: 500; color: var(--mute); max-width: 42ch; letter-spacing: -0.01em; }
.hero .lede { margin-left: auto; margin-right: auto; }

.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  margin-top: 1.2rem;
  transition: background .15s, color .15s;
}
.button:hover { background: var(--paper); color: var(--ink); }

.button-ghost {
  display: inline-block;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  transition: background .15s, color .15s;
}
.button-ghost:hover { background: var(--ink); color: var(--paper); }
.hero-actions { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-actions > *:not(:first-child) { margin-left: 0.75rem; }
.hero .hero-actions { justify-content: center; }

/* Order-slip motif (Bestellschein) — repris du design du site existant */
.order-slip {
  border: 1px solid var(--ink);
  padding: 1.2rem 1.1rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
}
.slip-line { margin: 0.5rem 0; font-size: 0.8rem; letter-spacing: 0.02em; }

/* Kurzantwort box */
.kurzantwort {
  border-left: 3px solid var(--ink);
  padding: 0.9rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--shade);
}
.kurzantwort-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 0.4rem;
}
.kurzantwort p:last-child { margin: 0; }

/* Article list (fallback, encore utilisé nulle part après la migration en grille) */
.article-list { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 1px solid var(--ink); }
.article-list li { border-bottom: 1px solid var(--rule); padding: 1.3rem 0; transition: background .15s; }
.article-list li:hover { background: var(--shade); }
.article-list a { text-decoration: none; display: flex; flex-direction: column; gap: 0.3rem; }
.article-list a > * { margin-bottom: 0.2rem; }
.article-list a > *:last-child { margin-bottom: 0; }
.article-cluster { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.article-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.article-desc { color: var(--mute); font-size: 0.95rem; font-family: system-ui, sans-serif; }

/* En-tête de section : titre + lien "tout voir" */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 2.5rem;
}
.section-header h2 { margin-top: 0; }
.section-header a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mute);
  text-decoration: none;
  white-space: nowrap;
}
.section-header a:hover { color: var(--ink); }

/* Grille de cartes — accueil, Prompts, clusters, Produkte (flexbox, pas de CSS grid pour compat max) */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 1.5rem -0.625rem 0.875rem;
}
.card-grid .card {
  flex: 1 1 260px;
  max-width: calc(33.333% - 1.25rem);
  margin: 0 0.625rem 1.25rem;
}
.card-grid .card.card-wide { max-width: calc(50% - 1.25rem); }
.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #D0D0D0;
  box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 20px 40px -16px rgba(0,0,0,.14);
}
.card .eyebrow {
  margin-bottom: 0;
  align-self: flex-start;
  background: var(--shade);
  border-radius: 100px;
  padding: 0.3rem 0.8rem;
  font-size: 0.68rem;
}
.card h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.card p { font-size: 0.9rem; color: var(--mute); margin: 0; flex-grow: 1; font-family: system-ui, sans-serif; }
.card .meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--mute); }

/* Image d'illustration optionnelle en haut de carte */
.card-image {
  display: block;
  width: calc(100% + 3rem);
  margin: -1.75rem -1.5rem 0.4rem;
  height: auto;
  background: var(--shade);
}

/* Bandeau "Mehr entdecken" — liens vers les clusters (flexbox + bordures individuelles) */
.discover-grid {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin: 1.5rem 0;
}
.discover-grid a {
  flex: 1 1 140px;
  background: var(--paper);
  padding: 1.3rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background .15s;
}
.discover-grid a:hover { background: var(--shade); }

/* Bloc newsletter final */
.newsletter-cta {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
  padding: 3.5rem 1.5rem;
  margin: 3rem 0 0;
}
.newsletter-cta .eyebrow { display: block; text-align: center; }
.newsletter-cta h2 { margin-top: 0; }
.newsletter-cta p { color: var(--mute); max-width: 46ch; margin: 0 auto 1rem; }

/* Feature grid (newsletter-style pages) */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin: 1rem 0; }
.feature-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin-bottom: 0.3rem; }

/* Article page */
.article-body { margin-top: 1.5rem; font-family: system-ui, sans-serif; }
/* Image d'en-tête d'article. Pas de recadrage : elle contient du texte. */
.article-cover {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 14px;
  margin-bottom: 1.6rem;
  background: var(--shade);
}
@media (max-width: 560px) {
  .article-cover { border-radius: 10px; margin-bottom: 1.2rem; }
}

/* Images et schémas dans le corps de l'article */
.article-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.8rem 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.2rem;
  background: var(--paper);
}
/* Les schémas larges restent lisibles sur mobile : on les laisse à une
   largeur minimale et on fait défiler dans le cadre plutôt que de tout
   écraser jusqu'à l'illisibilité. */
.diagram-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.8rem 0;
}
.diagram-scroll img { margin: 0; }
.diagram-hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin: -1.4rem 0 1.6rem;
}
@media (max-width: 700px) {
  .diagram-scroll img { min-width: 620px; padding: 0.9rem; }
  .diagram-hint { display: block; }
}
@media (max-width: 560px) {
  .article-body img { padding: 0.7rem; margin: 1.4rem 0; }
}
/* Liens dans le corps de l'article : nettement identifiables */
.article-body a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: #B8B8B8;
  transition: text-decoration-color .15s, background .15s;
}
.article-body a:hover {
  text-decoration-color: var(--ink);
  background: var(--shade);
}
.article-body h2 { font-size: 1.4rem; }
.article-body h3 { font-family: system-ui, sans-serif; font-size: 1rem; font-weight: 700; margin-top: 1.5rem; }
.article-body p, .article-body li { max-width: 68ch; }
.article-body ul, .article-body ol { padding-left: 1.3rem; margin-bottom: 1rem; }
.article-body li { margin-bottom: 0.35rem; }
.article-body blockquote {
  border-left: 3px solid var(--rule);
  margin: 1.2rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  color: var(--mute);
  font-style: italic;
}
/* Blocs de prompts : pas de défilement horizontal, bouton copier */
.prompt-block { position: relative; margin: 1.2rem 0; }
.article-body pre {
  background: var(--shade);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 2.8rem 1rem 1rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  /* Les lignes longues passent à la ligne au lieu de déborder.
     Sur mobile, c'est ce qui rend la sélection possible. */
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
}
.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.4rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  /* Zone tactile confortable au doigt */
  min-height: 34px;
}
.copy-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.copy-btn.copied { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 560px) {
  .article-body pre { font-size: 0.78rem; padding: 2.9rem 0.8rem 0.9rem; }
  .copy-btn { font-size: 0.7rem; padding: 0.4rem 0.7rem; }
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  /* Sur mobile, le tableau défile dans son propre cadre
     au lieu de faire déborder toute la page. */
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
@media (min-width: 700px) {
  .article-body table { display: table; white-space: normal; }
}
.article-body th, .article-body td {
  border: 1px solid var(--rule);
  padding: 0.6rem 0.8rem;
  text-align: left;
}
.article-body th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  background: var(--shade);
}
.article-body table + em {
  display: block;
  font-size: 0.8rem;
  color: var(--mute);
  margin-top: -1rem;
}
.article-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--mute); margin-top: 2rem; }

/* Boutons de partage sous l'article */
.share {
  border-top: 1px solid var(--rule);
  margin-top: 1.5rem;
  padding-top: 1.4rem;
}
.share-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.9rem;
}
.share-links { display: flex; flex-wrap: wrap; }
.share-links a {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  margin: 0 0.75rem 0.75rem 0;
  transition: background .15s, border-color .15s, color .15s;
}
.share-links a svg { margin-right: 0.5rem; flex-shrink: 0; }
.share-links a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cta-block {
  border-top: 1px dashed var(--rule);
  margin-top: 2rem;
  padding-top: 1.5rem;
}

/* Sections de cluster sans article pour l'instant */
.coming-soon {
  border: 1px dashed var(--rule);
  padding: 1.5rem;
  margin-top: 1.5rem;
  background: var(--shade);
}
.coming-soon .button { margin-top: 1rem; }

/* Footer — noir, comme le header */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 1.5rem;
  font-size: 0.85rem;
}
.disclosure { max-width: 60ch; color: #B8B8B8; font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.7; margin: 0 auto; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; font-family: var(--font-mono); font-size: 0.78rem; margin: 0.8rem auto 0; }
.footer-nav a { color: var(--paper); text-decoration: none; margin-left: 1.2rem; }
.footer-nav a:first-child { margin-left: 0; }
.footer-nav a:hover { color: #B8B8B8; }
.site-footer .disclosure, .site-footer .footer-nav { max-width: var(--measure); }
.site-footer { display: flex; flex-direction: column; align-items: center; text-align: center; }

/* Accessibility */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Animation d'entrée — sobre, une seule fois au chargement */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero .eyebrow { animation: fadeUp .5s ease-out both; }
.hero h1 { animation: fadeUp .5s ease-out .08s both; }
.hero .lede { animation: fadeUp .5s ease-out .16s both; }
.hero .hero-actions { animation: fadeUp .5s ease-out .24s both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle-label { display: flex; }
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 3;
    gap: 0;
    margin-top: 0.75rem;
  }
  .main-nav a {
    margin-left: 0;
    padding: 0.8rem 0;
    border-top: 1px solid rgba(255,255,255,0.15);
  }
  .main-nav a:first-child { border-top: none; }
  .nav-toggle-checkbox:checked ~ .main-nav { display: flex; }
  .nav-cta { margin-top: 0.5rem; text-align: center; }
  .feature-grid { grid-template-columns: 1fr; }
  .card-grid .card, .card-grid .card.card-wide { max-width: calc(50% - 1.25rem); }
}

@media (max-width: 560px) {
  .card-grid .card, .card-grid .card.card-wide { max-width: 100%; flex-basis: 100%; margin-left: 0; margin-right: 0; }
  .card-grid { margin-left: 0; margin-right: 0; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions > *:not(:first-child) { margin-left: 0; }
  .hero-actions .button, .hero-actions .button-ghost { text-align: center; }
}

@media (max-width: 480px) {
  .site-header { padding: 1rem; }
  main { padding: 2.5rem 1rem 3rem; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-sub { display: none; }
}
