/* ============================================================
   FLAIR — „Bento" theme for Quarto  (Option E)
   Single source of truth: alle Farben, Typo & Layout-Tokens
   stehen hier. index.qmd enthält nur Struktur (Fenced-Divs)
   und Inhalt — keine Inline-Styles.
   ============================================================ */

/* ---- Self-hosted Schriften ------------------------------------------------
   Keine externen Abhängigkeiten / kein CDN. Die woff2-Dateien gehören nach
   fonts/ (siehe fonts/README.md). Fehlen sie, greift automatisch der
   System-Fallback aus den Font-Stacks weiter unten — die Seite bleibt
   benutzbar.
   --------------------------------------------------------------------------- */
@font-face { font-family:"Space Grotesk"; font-style:normal; font-weight:500;
  font-display:swap; src:url("fonts/SpaceGrotesk-Medium.woff2") format("woff2"); }
@font-face { font-family:"Space Grotesk"; font-style:normal; font-weight:600;
  font-display:swap; src:url("fonts/SpaceGrotesk-SemiBold.woff2") format("woff2"); }
@font-face { font-family:"Space Grotesk"; font-style:normal; font-weight:700;
  font-display:swap; src:url("fonts/SpaceGrotesk-Bold.woff2") format("woff2"); }

@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:400;
  font-display:swap; src:url("fonts/IBMPlexSans-Regular.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:500;
  font-display:swap; src:url("fonts/IBMPlexSans-Medium.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:600;
  font-display:swap; src:url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); }

@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:400;
  font-display:swap; src:url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:500;
  font-display:swap; src:url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

/* ---- Tokens --------------------------------------------------------------- */
:root {
  /* Spektrum — Reihenfolge blue→red wird bewusst für Sequenzen genutzt */
  --flair-blue:        #2c2f88;
  --flair-purple:      #6b3e91;
  --flair-light-purple:#a35494;
  --flair-pink:        #d35378;
  --flair-orange:      #ec6707;
  --flair-red:         #e30613;
  --flair-light-blue:  #aaddf9;
  --flair-spectrum: linear-gradient(90deg,
    var(--flair-blue), var(--flair-purple), var(--flair-light-purple),
    var(--flair-pink), var(--flair-orange), var(--flair-red));

  /* Neutrale Flächen & Text */
  --page:     #f0eff3;
  --surface:  #ffffff;
  --dark:     #16161f;
  --ink:      #16161f;
  --ink-soft: #56556a;
  --muted:    #8a8794;
  --muted-2:  #9a99ab;
  --hair:     #efeef4;

  /* Schrift-Stacks (self-hosted zuerst, dann System-Fallback) */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body:    "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Geometrie */
  --r-tile: 22px;   /* große Kacheln / Panels */
  --r-card: 16px;   /* Forschungs-Kacheln */
  --r-pill: 20px;   /* Buttons / Tags */
  --gap: 16px;
}

/* ---- Basis ---------------------------------------------------------------- */
* { box-sizing: border-box; }
body.bento {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.bento a { color: inherit; text-decoration: none; }
body.bento p { margin: 0; }
body.bento ::selection { background: rgba(44,47,136,.16); }

/* Quarto-Container neutralisieren, falls aktiv */
.bento #quarto-content,
.bento main.content { padding: 0; }

.wrap {
  max-width: 1232px;
  margin: 0 auto;
  padding: 24px;
}

/* Spektrum-Animation (nur dekorativ) */
@keyframes spectrumShift { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
.spectrum-anim {
  background: linear-gradient(90deg,
    var(--flair-blue), var(--flair-purple), var(--flair-light-purple),
    var(--flair-pink), var(--flair-orange), var(--flair-red), var(--flair-blue));
  background-size: 300% 100%;
  animation: spectrumShift 16s linear infinite;
}

/* ---- Spektrum-Farbklassen (statt Inline-Farben) -------------------------- */
.c-blue   { background: var(--flair-blue); }
.c-purple { background: var(--flair-purple); }
.c-lpurple{ background: var(--flair-light-purple); }
.c-pink   { background: var(--flair-pink); }
.c-orange { background: var(--flair-orange); }
.c-red    { background: var(--flair-red); }

/* ---- Navigation ----------------------------------------------------------- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface);
  border-radius: var(--r-tile);
  padding: 18px 28px;
  margin-bottom: var(--gap);
}
.nav-brand { display: flex; align-items: baseline; gap: 10px; }
.nav-brand b {
  font-family: var(--font-display); font-weight: 700; font-size: 23px;
  letter-spacing: -.01em; color: var(--flair-blue);
}
.nav-brand span { font-size: 13px; color: var(--muted); }
.nav-links { display: flex; gap: 28px; align-items: center; font-size: 14px; color: var(--ink-soft); }
.nav-links p { display: flex; gap: 28px; align-items: center; margin: 0; }
.nav-links a:hover { color: var(--flair-blue); }
.nav-cta {
  background: var(--dark); color: #fff;
  padding: 8px 18px; border-radius: var(--r-pill); font-weight: 500;
}
body.bento a.nav-cta { color: #fff; }
.nav-cta:hover { color: #fff; opacity: .9; }

/* ---- Hero-Bento ----------------------------------------------------------- */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.tile {
  border-radius: var(--r-tile);
  background: var(--surface);
  padding: 38px;
  overflow: hidden;
}
.spectrum-text {
  background: linear-gradient(90deg,
    var(--flair-blue), var(--flair-purple), var(--flair-light-purple),
    var(--flair-pink), var(--flair-orange), var(--flair-red), 
    var(--flair-orange), var(--flair-pink), var(--flair-light-blue),
    var(--flair-purple), var(--flair-blue));
  background-size: 500% 100%;
  background-repeat: repeat-x;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
  animation: spectrumShift 14s linear infinite;
}

.tile-headline {
  grid-column: span 2; grid-row: span 2;
  display: flex; flex-direction: column; justify-content: space-between;
}
.tile-headline .tile-body { display: block; }
.hero-h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 44px; line-height: 1.08; letter-spacing: -.02em;
  margin: 0 0 18px;
}
.tile-headline p { font-size: 16px; line-height: 1.6; color: var(--ink-soft); }

.t-label {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  display: block;
}

.tile-spectrum {
  grid-column: span 2;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 30px;
  color: #fff;
  /* eigener Verlauf: schlägt .tile-Hintergrund, da später definiert */
  background: linear-gradient(90deg,
    var(--flair-blue), var(--flair-purple), var(--flair-light-purple),
    var(--flair-pink), var(--flair-orange), var(--flair-red), var(--flair-blue));
  background-size: 300% 100%;
  animation: spectrumShift 14s linear infinite;
}
.tile-spectrum::after {
  content: ""; position: absolute; top: -30px; right: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.16);
}
.spectrum-word {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 700;
  font-size: 40px; letter-spacing: -.01em; color: #fff;
}

.tile-stat {
  display: flex; flex-direction: column; justify-content: center;
  padding: 26px; position: relative;
}
.tile-stat .stat-num {
  display: block;
  font-family: var(--font-display); font-weight: 600;
  font-size: 38px; line-height: 1;
}
.tile-stat .stat-label { display: block; font-size: 13px; margin-top: 6px; }
.tile-linked { position: relative; }
.tile-link-overlay { position: absolute; inset: 0; border-radius: inherit; }
.tile-linked:hover { opacity: .88; }
.stat-blue { background: var(--flair-blue); color: #fff; }
.stat-blue .stat-label { color: var(--flair-light-blue); }
.stat-accent { background: var(--surface); color: var(--ink); }
.stat-accent .stat-label { color: var(--ink-soft); }
.stat-accent::after {
  content: ""; position: absolute; bottom: -18px; right: -18px;
  width: 60px; height: 60px; background: var(--flair-orange); transform: rotate(45deg);
}
.stat-accent .stat-num, .stat-accent .stat-label { position: relative; z-index: 1; }

/* ---- Panel (weiße Karte) -------------------------------------------------- */
.panel {
  background: var(--surface);
  border-radius: var(--r-tile);
  padding: 34px;
  margin-bottom: var(--gap);
}
.panel-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.sec-more {
  margin-left: auto; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  text-decoration: none;
}
.sec-more:hover { color: var(--flair-blue); }
.sec-h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 28px; letter-spacing: -.02em; margin: 0;
}
.sec-count { font-family: var(--font-mono); font-size: 12px; color: #a3a2b3; }

/* ---- Forschungsbereiche --------------------------------------------------- */
.area-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.link-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.area-card {
  border-radius: var(--r-card);
  padding: 24px; min-height: 158px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
  position: relative;
}
a.area-card { cursor: pointer; color: #fff; text-decoration: none; transition: filter .15s ease, transform .12s ease; }
a.area-card:link, a.area-card:visited { color: #fff; }
a.area-card:hover { filter: brightness(1.12); transform: translateY(-2px); }
a.area-card::after {
  content: "↗"; position: absolute; top: 16px; right: 18px;
  font-size: 18px; opacity: .6; line-height: 1;
}
.area-n { font-family: var(--font-mono); font-size: 12px; opacity: .7; display: block; }
.area-expert { font-family: var(--font-mono); font-size: 11px; opacity: .65; display: block; }
a.area-expert { color: #fff; text-decoration: none; }
a.area-expert:link, a.area-expert:visited { color: #fff; }
a.area-expert:hover { text-decoration: underline; opacity: 1; }
.area-card .card-h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 19px; letter-spacing: -.01em; margin: 0; color: #fff;
}
.area-subtitle {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; opacity: .7; display: block; margin: 0 0 6px;
}
.area-card p { font-size: 13.5px; line-height: 1.5; opacity: .88; }

/* ---- Projekte ------------------------------------------------------------- */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.proj-card {
  background: var(--surface); border-radius: var(--r-tile);
  padding: 30px; display: flex; flex-direction: column; gap: 14px;
}
.proj-tag {
  align-self: flex-start;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: #fff;
  padding: 5px 11px; border-radius: 14px;
}
.proj-card .card-h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 21px; line-height: 1.25; letter-spacing: -.01em; margin: 0;
}
.proj-meta { font-size: 13px; color: var(--muted); margin-top: auto; display: block; }

/* ---- News + Team ---------------------------------------------------------- */
.feature-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.card-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 24px; letter-spacing: -.02em; margin: 0 0 22px;
}

.news { background: var(--surface); border-radius: var(--r-tile); padding: 32px; }
.news-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--hair);
}
.news-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.news-date { font-size: 13px; color: var(--muted-2); width: 120px; flex: none; }
.news-title { font-family: var(--font-display); font-weight: 500; font-size: 16px; }

.team { background: var(--dark); border-radius: var(--r-tile); padding: 32px; color: #fff; }
.team .card-title { color: #fff; }
.team-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-top: 1px solid #2a2a3a;
}
.team-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: repeating-linear-gradient(135deg, #2a2a3a 0 6px, #33334a 6px 12px);
}
.team-name { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.team-role { font-size: 12px; color: var(--muted-2); }
.team-more {
  display: block; margin-top: 16px; padding-top: 14px; border-top: 1px solid #2a2a3a;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-2); text-decoration: none;
}
.team-more:hover { color: var(--flair-light-blue); }

/* ---- News-Kacheln (Listing) ----------------------------------------------- */
.news-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}
.news-card {
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--page);
  display: flex;
  flex-direction: column;
  color: var(--ink);
  position: relative;
  transition: transform .12s ease, box-shadow .12s ease;
}
.news-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.news-card-overlay { position: absolute; inset: 0; border-radius: inherit; }
.listing-no-matching, .d-none { display: none; }
.news-card-img-wrap { aspect-ratio: 2/1; overflow: hidden; flex-shrink: 0; }
.news-card-img-wrap > p { height: 100%; margin: 0; }
.news-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card-img-placeholder { width: 100%; height: 100%; background: var(--hair); }
.news-card-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.news-card-date { color: var(--muted); }
.news-card-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: 17px; line-height: 1.3; letter-spacing: -.01em; margin: 0;
}
.news-card-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

/* ---- Prose (Impressum / Datenschutz) -------------------------------------- */
.prose p  { margin: 0 0 12px; }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); margin: 28px 0 8px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin-bottom: 5px; }
.prose a  { color: var(--flair-blue); }
.prose a:hover { text-decoration: underline; }
.footer a { color: inherit; }
.footer a:hover { opacity: 1; text-decoration: underline; }

/* ---- News-Artikel (Detailseite) ------------------------------------------- */
.news-article {
  background: var(--surface);
  border-radius: var(--r-tile);
  overflow: hidden;
  margin-bottom: var(--gap);
}
.news-article-img { width: 100%; height: auto; display: block; }
.news-article-body { padding: 40px 48px; }
.news-back {
  display: inline-block; margin-bottom: 24px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.news-back:hover { color: var(--flair-blue); }
.news-article-date { display: block; margin-bottom: 14px; color: var(--muted); }
.news-article-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 38px; line-height: 1.08; letter-spacing: -.02em;
  margin: 0 0 20px; color: var(--ink);
}
.news-article-lead {
  font-size: 18px; line-height: 1.65; color: var(--ink-soft);
  margin: 0 0 32px; padding-bottom: 32px; border-bottom: 1px solid var(--hair);
}
.news-article-content { font-size: 16px; line-height: 1.75; color: var(--ink); }
.news-article-content p { margin: 0 0 16px; }

@media (max-width: 600px) {
  .news-article-body { padding: 24px; }
  .news-article-title { font-size: 28px; }
  .news-article-lead { font-size: 16px; }
}

/* ---- Kontakt -------------------------------------------------------------- */
.contact {
  border-radius: var(--r-tile);
  padding: 48px; color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 30px;
  margin-bottom: var(--gap);
}
.contact .card-title { color: #fff; margin: 0 0 10px; font-size: 32px; }
.contact > p { margin: 0; }
.contact p { font-size: 15px; line-height: 1.55; color: rgba(255,255,255,.9); max-width: 42ch; }
.contact-cta {
  flex: none; background: #fff; color: var(--ink);
  font-weight: 600; font-size: 15px; padding: 15px 28px; border-radius: 24px;
}
body.bento a.contact-cta { color: var(--ink); }
.contact-cta:hover { color: var(--ink); opacity: .92; }

/* ---- Subpage nav ---------------------------------------------------------- */
.sub-nav {
  display: flex; align-items: center; gap: 20px; padding: 28px 0 36px;
  border-bottom: 1px solid var(--hair); margin-bottom: 36px;
}
.sub-nav-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--dark); text-decoration: none;
}
.sub-nav-back {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); text-decoration: none; margin-left: auto;
}
.sub-nav-back:hover { color: var(--flair-blue); }

/* ---- Publikationsliste (Unterseite) --------------------------------------- */
.pub-list { display: flex; flex-direction: column; gap: 14px; }
.pub-item {
  background: var(--surface); border-radius: var(--r-tile);
  padding: 28px 32px; display: flex; gap: 20px; align-items: flex-start;
}
.pub-item-tag { flex: none; }
.pub-item-body { display: flex; flex-direction: column; gap: 6px; }
.pub-item-body .card-h3 { font-size: 18px; }
.pub-year {
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  font-weight: 500; min-width: 40px; padding-top: 3px;
}
.pub-section-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-2); padding: 28px 0 10px;
}

/* ---- Footer --------------------------------------------------------------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 6px 4px; font-size: 13px; color: var(--muted); flex-wrap: wrap;
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .tile-headline { grid-column: span 2; grid-row: auto; }
  .tile-spectrum { grid-column: span 2; min-height: 120px; }
  .link-grid { grid-template-columns: repeat(2, 1fr); }
  .news-card-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid, .feature-row { grid-template-columns: 1fr; }
  .hero-h1 { font-size: 38px; }
}
@media (max-width: 600px) {
  .wrap { padding: 14px; }
  .tile, .panel, .news, .team { padding: 24px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .tile-headline, .tile-spectrum { grid-column: auto; }
  .area-grid { grid-template-columns: 1fr; }
  .link-grid { grid-template-columns: 1fr; }
  .news-card-grid { grid-template-columns: 1fr; }
  .contact { flex-direction: column; align-items: flex-start; }
  .footer { flex-direction: column; align-items: flex-start; }
}

/* ---- Bewegung reduzieren -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .spectrum-anim { animation: none; }
}
