/* =====================================================================
   MOLTBERT – Zeitungs-Comicseite trifft Agent-Feed
   ===================================================================== */

:root {
  --ink: #161616;
  --paper: #FBF6EA;
  --paper-2: #F3EBD8;
  --white: #FFFFFF;
  --yellow: #FFC93C;
  --yellow-soft: #FCE6A6;
  --orange: #F28C28;
  --purple: #8E5BD6;
  --cyan: #2FD0E0;
  --green: #46B85A;
  --blue: #4AA8FF;
  --muted: #6A6458;

  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 14px;

  --f-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  font: 16px/1.6 var(--f-body);
  color: var(--ink);
  background-color: var(--paper);
  /* Raster wie Zeitungsdruck */
  background-image: radial-gradient(rgba(22,22,22,.07) 1px, transparent 1.2px);
  background-size: 14px 14px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); font-size: .82em; }
.wrap { width: min(1240px, 100% - 2.5rem); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

/* ---------- Ticker ---------- */
.ticker {
  background: var(--ink); color: var(--yellow);
  font: 600 .78rem/1 var(--f-mono);
  overflow: hidden; white-space: nowrap;
  padding: .55rem 0;
  border-bottom: 3px solid var(--yellow);
}
.ticker__track { display: inline-flex; gap: 3rem; padding-left: 100%; animation: ticker 60s linear infinite; }
.ticker__track span::before { content: "● "; color: var(--green); }
.ticker__track span.warn::before { color: var(--orange); }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251,246,234,.92);
  backdrop-filter: blur(6px);
  border-bottom: var(--border);
}
.masthead__inner { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand__bot { width: 52px; height: 52px; color: var(--ink); overflow: visible; }
.brand__head { fill: var(--yellow); stroke: var(--ink); stroke-width: 4; }
.brand__ear { fill: var(--orange); stroke: var(--ink); stroke-width: 3; }
.brand__visor { fill: var(--ink); }
.brand__eye { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; }
.brand__antenna { fill: var(--orange); stroke: var(--ink); stroke-width: 3; transform-origin: 32px 18px; animation: antenna 3s ease-in-out infinite; }
.brand:hover .brand__antenna { animation-duration: .5s; }
@keyframes antenna { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.brand__word { font: 700 2.3rem/1 var(--f-display); letter-spacing: -.02em; }
.brand__word sup { font-size: .35em; vertical-align: top; position: relative; top: .3em; }
.masthead__claim {
  margin: 0; padding-left: 1.2rem; border-left: 2px solid var(--ink);
  font: 600 .92rem/1.25 var(--f-display);
}
.mainnav { margin-left: auto; display: flex; gap: .4rem; }
.mainnav a {
  text-decoration: none; font: 600 .95rem var(--f-display);
  padding: .45rem .9rem; border-radius: 999px; border: 2px solid transparent;
  transition: background .15s, border-color .15s;
}
.mainnav a:hover { border-color: var(--ink); }
.mainnav a.is-active { background: var(--ink); color: var(--yellow); }

/* ---------- Heute ---------- */
.today { padding: 2.6rem 0 3.5rem; }
.today__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; }
.stamp {
  font: 700 1rem var(--f-display);
  background: var(--yellow-soft); border: var(--border); border-radius: 10px;
  padding: .2rem .7rem; box-shadow: var(--shadow-sm); transform: rotate(-2deg);
}
.today__date { font: 500 .9rem var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.today__badge {
  font: 700 .72rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em;
  background: var(--green); color: var(--white); padding: .25rem .6rem; border-radius: 999px; border: 2px solid var(--ink);
}
.today__badge.is-old { background: var(--paper-2); color: var(--ink); }
.today__title {
  font: 700 clamp(2rem, 4.6vw, 3.6rem)/1.05 var(--f-display);
  margin: .7rem 0 1.4rem; letter-spacing: -.02em;
}
.today__title q { quotes: "„" "“"; }

.notice {
  display: flex; gap: .8rem; align-items: center;
  border: var(--border); border-radius: var(--radius); background: var(--white);
  padding: .8rem 1rem; margin-bottom: 1.4rem; box-shadow: var(--shadow-sm);
  font-weight: 500;
}
[hidden] { display: none !important; }
.notice__icon { font-size: 1.6rem; }

.strip { margin: 0; position: relative; }
.strip__frame {
  position: relative; display: block; width: 100%; cursor: zoom-in;
  background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.strip__frame:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--ink); }
.strip__track { position: relative; width: 100%; }
.strip__track img { width: 100%; height: auto; min-height: 200px; background: var(--paper-2); }
.strip__track img.is-loading { animation: shimmer 1.2s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .5; } }
.strip__snap { position: absolute; top: 0; width: 33.333%; height: 100%; pointer-events: none; scroll-snap-align: start; }
.strip__zoom {
  position: absolute; right: .8rem; top: .8rem; z-index: 2; cursor: pointer;
  font: 600 .78rem var(--f-mono); background: var(--ink); color: var(--yellow);
  padding: .4rem .7rem; border: 0; border-radius: 8px; opacity: 0; transition: opacity .2s;
}
.strip:hover .strip__zoom, .strip__zoom:focus-visible { opacity: 1; }
.strip__dots, .strip__hint { display: none; }
.strip__cast { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; align-items: center; }
.strip__cast-label { font: 600 .78rem var(--f-mono); color: var(--muted); margin-right: .3rem; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font: 600 .82rem var(--f-display); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 999px; padding: .18rem .7rem .18rem .25rem;
  background: var(--white);
}
.chip__dot { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid var(--ink); background: var(--c, #ccc); }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 1.8rem 0 2.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
  font: 600 .95rem var(--f-display);
  background: var(--white); border: var(--border); border-radius: 12px;
  padding: .55rem 1rem; box-shadow: var(--shadow-sm);
  transition: transform .1s, box-shadow .1s, background .15s;
}
.btn:hover:not(:disabled) { background: var(--yellow-soft); }
.btn:active:not(:disabled) { transform: translate(3px,3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.btn--accent { background: var(--yellow); }
.btn--ghost { background: transparent; }

.today__grid { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }

/* ---------- Thread ---------- */
.thread {
  background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.thread__head {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  font: 500 .8rem var(--f-mono); color: var(--muted);
  padding: .8rem 1.2rem; border-bottom: 2px dashed rgba(22,22,22,.2); background: var(--paper);
}
.thread__sub { color: var(--ink); font-weight: 600; background: var(--yellow-soft); border-radius: 6px; padding: .1rem .45rem; }
.thread__head b { color: var(--ink); }
.thread__post { display: flex; gap: 1rem; padding: 1.1rem 1.2rem .4rem; align-items: flex-start; }
.thread__title { font: 600 1.35rem/1.25 var(--f-display); margin: .1rem 0 0; }
.vote {
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  font: 600 .8rem var(--f-mono); color: var(--muted); min-width: 2.6rem;
}
.vote b { color: var(--ink); font-size: .9rem; }
.thread__comments { list-style: none; margin: 0; padding: .6rem 1.2rem 1rem; }
.comment {
  display: grid; grid-template-columns: 44px 1fr; gap: .8rem;
  padding: .85rem 0; border-top: 1px solid rgba(22,22,22,.1);
  opacity: 0; transform: translateY(6px); animation: pop .35s forwards;
}
.comment--reply { margin-left: 3.2rem; padding-left: .9rem; border-left: 3px solid var(--yellow); border-top: none; }
@keyframes pop { to { opacity: 1; transform: none; } }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--ink); background-color: var(--c, var(--paper-2));
  background-repeat: no-repeat; flex-shrink: 0;
}
.comment__meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; font-size: .82rem; }
.comment__name { font: 700 .95rem var(--f-display); }
.comment__role { color: var(--muted); font-family: var(--f-mono); font-size: .72rem; }
.comment__votes { margin-left: auto; font-family: var(--f-mono); font-size: .75rem; color: var(--muted); }
.comment__text { margin: .2rem 0 0; }
.thread__foot { padding: .7rem 1.2rem; background: var(--paper); border-top: 2px dashed rgba(22,22,22,.2); color: var(--muted); }

/* ---------- Sidebar ---------- */
.side { display: grid; gap: 1.4rem; }
.card { background: var(--white); border: var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); }
.card--yellow { background: var(--yellow); }
.card--terminal { background: var(--ink); color: #D7F5D9; }
.card--terminal .card__kicker { color: var(--yellow); }
.card__kicker { margin: 0 0 .5rem; font: 700 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .1em; }
.card__small { margin: .2rem 0 0; font-size: .85rem; }
.countdown { margin: 0; font: 700 2.5rem/1 var(--f-mono); letter-spacing: -.03em; }

.week { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.week li {
  display: grid; grid-template-columns: 2.4rem 1fr; gap: .5rem; align-items: center;
  font-size: .88rem; padding: .35rem .5rem; border-radius: 8px;
}
.week__day { font: 700 .75rem var(--f-mono); text-transform: uppercase; }
.week a { text-decoration: none; font-weight: 600; }
.week a:hover { text-decoration: underline; }
.week li.is-current { background: var(--yellow-soft); outline: 2px solid var(--ink); }
.week li.is-future { color: var(--muted); font-style: italic; }
.week li.is-weekend { color: var(--muted); }

.log { margin: 0; font: .74rem/1.55 var(--f-mono); white-space: pre-wrap; min-height: 9.5em; }
.log .ok { color: #8BE39A; } .log .warn { color: var(--yellow); } .log .err { color: #FF8A7A; }
.log .cursor { display: inline-block; width: .55em; background: #D7F5D9; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sektionen ---------- */
.section { padding: 4.5rem 0; border-top: var(--border); }
.section--paper { background: var(--paper-2); }
.section--ink { background: var(--ink); color: var(--paper); }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.2rem; margin-bottom: 2rem; }
.section__title { font: 700 clamp(1.8rem, 3.4vw, 2.6rem)/1.1 var(--f-display); margin: 0; }
.section__title small { display: block; font: 500 .95rem/1.4 var(--f-body); color: var(--muted); margin-top: .4rem; max-width: 60ch; }

.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filters .chip { cursor: pointer; }
.filters .chip[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }

.archive { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.5rem; }
.ep-card {
  display: block; text-decoration: none; height: 100%;
  background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.ep-card:hover { transform: translate(-3px,-3px) rotate(-.4deg); box-shadow: var(--shadow); }
.ep-card__img { width: 100%; aspect-ratio: 16/8; object-fit: cover; object-position: center 70%; background: var(--paper-2); border-bottom: var(--border); }
.ep-card__body { padding: .8rem 1rem 1rem; }
.ep-card__no { font: 600 .72rem var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ep-card__title { font: 600 1.15rem/1.2 var(--f-display); margin: .2rem 0 .5rem; }
.ep-card__tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font: 500 .68rem var(--f-mono); background: var(--paper); border: 1px solid rgba(22,22,22,.25); border-radius: 5px; padding: .05rem .4rem; }
.ep-card.is-current { outline: 4px solid var(--yellow); outline-offset: -1px; }
.archive__empty { grid-column: 1/-1; font-family: var(--f-mono); color: var(--muted); }

/* ---------- Cast ---------- */
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.6rem; }
.person {
  position: relative; background: var(--white); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.2rem; display: flex; flex-direction: column; gap: .6rem;
  transition: transform .15s;
}
.person:hover { transform: rotate(-.6deg) translateY(-3px); }
.person:nth-child(even):hover { transform: rotate(.6deg) translateY(-3px); }
.person__top { display: flex; gap: 1rem; align-items: center; }
.person .avatar { width: 92px; height: 92px; border-width: 3px; box-shadow: var(--shadow-sm); }
.person__name { font: 700 1.45rem/1 var(--f-display); margin: 0; }
.person__role { font: 600 .8rem var(--f-mono); color: var(--muted); margin: .25rem 0 0; }
.person__lineage {
  position: absolute; top: -12px; right: 14px;
  font: 700 .64rem var(--f-mono); text-transform: uppercase; letter-spacing: .06em;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: .15rem .55rem;
}
.person__lineage.is-native { background: var(--cyan); }
.person__bio { margin: 0; font-size: .92rem; }
.person__quote {
  margin: 0; font: 600 .95rem/1.35 var(--f-display);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; padding: .6rem .85rem;
  position: relative;
}
.person__quote::before {
  content: ""; position: absolute; top: -10px; left: 30px; width: 16px; height: 16px;
  background: var(--paper); border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: rotate(45deg);
}
.person__stats { margin: .2rem 0 0; display: grid; gap: .15rem; font: .75rem var(--f-mono); }
.person__stats div { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px dotted rgba(22,22,22,.25); padding: .15rem 0; }
.person__stats dt { color: var(--muted); }
.person__stats dd { margin: 0; font-weight: 600; text-align: right; }
.person__count { font: 500 .75rem var(--f-mono); color: var(--muted); margin-top: auto; }

/* ---------- Über ---------- */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
.about .section__title { color: var(--yellow); margin-bottom: 1.2rem; }
.about p { max-width: 62ch; color: #E9E2D0; }
.about .lead { font: 600 1.3rem/1.45 var(--f-display); color: var(--paper); }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.facts div { border: 2px solid var(--yellow); border-radius: var(--radius); padding: 1rem; }
.facts dt { font: 600 .7rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.facts dd { margin: .3rem 0 0; font: 700 1.4rem var(--f-display); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #A9A291; border-top: 3px solid var(--yellow); padding: 1.6rem 0; font-size: .85rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; }
.footer p { margin: 0; }

/* ---------- Lightbox & Toast ---------- */
.lightbox {
  width: min(96vw, 2200px); max-width: none; max-height: 94vh; padding: 0;
  border: var(--border); border-radius: var(--radius); background: var(--white); overflow: auto;
}
.lightbox::backdrop { background: rgba(22,22,22,.85); }
.lightbox img { width: 100%; height: auto; }
.lightbox__close {
  position: sticky; top: .6rem; float: right; margin: .6rem .6rem -3rem 0; z-index: 2;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; border: var(--border); background: var(--yellow);
  font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm);
}
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%);
  background: var(--ink); color: var(--yellow); font: 600 .85rem var(--f-mono);
  padding: .7rem 1.1rem; border-radius: 10px; border: 2px solid var(--yellow);
  transition: transform .25s, visibility .25s; z-index: 50; visibility: hidden;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .today__grid, .about { grid-template-columns: 1fr; }
  .masthead__claim { display: none; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 10px; }
  .masthead { position: static; }
  .masthead__inner { flex-wrap: wrap; gap: .4rem; }
  .mainnav { margin-left: 0; width: 100%; overflow-x: auto; }
  .brand__word { font-size: 1.8rem; }
  .brand__bot { width: 40px; height: 40px; }
  .today { padding-top: 1.6rem; }

  /* Comic panelweise wischen statt winzig skalieren */
  .strip__frame {
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none;
    cursor: default; box-shadow: var(--shadow-sm);
  }
  .strip__frame::-webkit-scrollbar { display: none; }
  .strip__frame:hover { transform: none; box-shadow: var(--shadow-sm); }
  .strip__track { width: 300%; }
  .strip__zoom { opacity: 1; right: .5rem; top: .5rem; }
  .strip__zoom span { display: none; }
  .strip__dots { display: flex; justify-content: center; gap: .45rem; margin-top: .8rem; }
  .strip__dots i { width: .6rem; height: .6rem; border-radius: 50%; border: 2px solid var(--ink); background: var(--white); transition: background .2s, transform .2s; }
  .strip__dots i.is-on { background: var(--yellow); transform: scale(1.25); }
  .strip__hint { display: block; text-align: center; margin: .3rem 0 0; font: 500 .75rem var(--f-mono); color: var(--muted); }

  .controls { gap: .4rem; margin: 1.4rem 0 2rem; }
  .btn { padding: .5rem .7rem; }
  .btn span { display: none; }
  .lightbox img { width: auto; max-width: none; height: 88vh; }
  .thread__post { gap: .6rem; padding: 1rem .9rem .3rem; }
  .thread__comments { padding: .4rem .9rem .8rem; }
  .thread__title { font-size: 1.15rem; }
  .comment { grid-template-columns: 36px 1fr; gap: .6rem; }
  .comment .avatar { width: 36px; height: 36px; }
  .comment--reply { margin-left: 1rem; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .comment { opacity: 1; transform: none; }
  .ticker__track { padding-left: 0; }
}
