/* ============================================================
   Design tokens — Apple dark-mode system palette. Colors are
   used sparingly and functionally: one blue for actions, one
   small identity color per source, everything else grayscale.
   ============================================================ */
:root {
  --bg: #000000;
  --card: #1c1c1e;
  --card-hover: #242426;
  --card-inset: #2c2c2e;
  --sep: rgba(255, 255, 255, 0.09);
  --sep-strong: rgba(255, 255, 255, 0.16);

  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --blue: #2997ff;

  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Inter.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
::selection {
  background: rgba(41, 151, 255, 0.32);
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.5rem 7rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
}

/* ================= Hero ================= */
.hero {
  text-align: center;
  padding: 7rem 0 3rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.hero p {
  font-size: clamp(1.125rem, 2.6vw, 1.375rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--text-2);
  margin: 0 auto;
  max-width: 30rem;
  text-wrap: balance;
}
.hero .count {
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  color: var(--text-3);
  letter-spacing: 0;
  min-height: 1.3em;
}

/* ================= Toolbar ================= */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.9rem 0 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sep);
}

.searchrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 0.6rem;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.searchwrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.searchwrap svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  fill: var(--text-3);
  pointer-events: none;
}
.search {
  width: 100%;
  font-family: inherit;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  appearance: none;
}
.search::placeholder {
  color: var(--text-3);
}
.search::-webkit-search-cancel-button {
  filter: invert(1) opacity(0.4);
}
.search:hover {
  background: var(--card-hover);
}
.search:focus {
  outline: none;
  background: var(--card-hover);
  border-color: var(--blue);
}

.iconbtn {
  flex: none;
  width: 2.625rem;
  height: 2.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.iconbtn svg {
  width: 18px;
  height: 18px;
}
.iconbtn:hover {
  background: var(--card-hover);
  color: var(--text);
}
.iconbtn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.iconbtn[aria-pressed="true"],
.iconbtn[aria-expanded="true"] {
  background: var(--card-inset);
  color: var(--blue);
}

.monthnav {
  position: relative;
}
.monthpop {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  min-width: 11rem;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--card-hover);
  border: 1px solid var(--sep-strong);
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.monthitem {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.monthitem:hover {
  background: var(--card-inset);
}
.monthitem:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.monthpop .empty {
  margin: 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.875rem;
  color: var(--text-3);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.pill {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.pill:hover {
  background: var(--card-hover);
  color: var(--text);
}
.pill:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  flex: none;
  transition: opacity 0.2s ease;
}
.pill[aria-pressed="true"] {
  color: var(--text);
  background: var(--card-inset);
}
.pill[aria-pressed="true"] .dot {
  opacity: 1;
}

/* ================= Liste ================= */
.daygroup {
  margin-top: 2.75rem;
  scroll-margin-top: 8.5rem;
}
.daygroup h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-2);
  margin: 0 0 0.85rem;
  padding-left: 0.25rem;
}

.card {
  background: var(--card);
  border-radius: 18px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: background-color 0.22s ease;
}
.card:hover {
  background: var(--card-hover);
}
.card.open {
  background: var(--card-hover);
}

.cardtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 0.9rem 0 1.4rem;
}

.meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  min-width: 0;
  flex-wrap: wrap;
}
.meta .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.meta .src {
  color: var(--accent);
}
.meta .sep {
  color: var(--text-3);
  opacity: 0.6;
}
.meta .time,
.meta .readtime {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.star {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.18s ease;
}
.star svg {
  width: 18px;
  height: 18px;
}
.star:hover {
  color: var(--text);
}
.star:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 999px;
}
.star.active {
  color: #ff9f0a;
}
.star.active svg {
  fill: currentColor;
}

.cardhead {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.6rem 1.4rem 1.25rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.cardhead:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-radius: 18px;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.25;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.unread {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 0.45rem;
  margin-bottom: 0.1em;
  vertical-align: middle;
}
.teaser {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card.open .teaser {
  display: none;
}

.chev {
  float: right;
  margin: 0.15rem 0 0 1rem;
  width: 20px;
  height: 20px;
  fill: var(--text-3);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  flex: none;
}
.card.open .chev {
  transform: rotate(180deg);
}

mark {
  background: rgba(41, 151, 255, 0.32);
  color: inherit;
  border-radius: 3px;
  padding: 0 0.1em;
}

/* ---- aufgeklappt ---- */
.panel {
  display: none;
  padding: 0 1.4rem 1.35rem;
}
.card.open .panel {
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .card.open .panel {
    animation: open 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }
}
@keyframes open {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.article {
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.011em;
  color: #dcdce0;
}
.article > * + * {
  margin-top: 1.05rem;
}
.article p {
  margin: 0;
}
.article .lead {
  font-size: 1.125rem;
  color: var(--text);
  letter-spacing: -0.015em;
}
.article .sec {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 1.9rem;
}
.article .lbl {
  font-weight: 600;
  color: var(--text);
}
.article ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.article li {
  position: relative;
  padding-left: 1.15rem;
  margin-top: 0.4rem;
}
.article li:first-child {
  margin-top: 0;
}
.article li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.68em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
}

.cardfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--sep);
  font-size: 0.875rem;
  color: var(--text-3);
}
.cardfoot .date {
  flex: 1 1 auto;
  min-width: 0;
}
.cardfoot .actions {
  display: flex;
  gap: 1rem;
  flex: none;
}
.copy {
  font: inherit;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--blue);
  background: transparent;
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
  transition: opacity 0.18s ease;
}
.copy:hover {
  opacity: 0.7;
}
.copy:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: rise 0.5s cubic-bezier(0.32, 0.72, 0, 1) backwards;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Ladeplatzhalter ---- */
.skel {
  background: var(--card);
  border-radius: 18px;
  margin-bottom: 0.75rem;
  padding: 1.25rem 1.4rem;
}
.skelbar {
  height: 11px;
  border-radius: 6px;
  background: var(--card-inset);
}
.skelbar + .skelbar {
  margin-top: 0.7rem;
}
@media (prefers-reduced-motion: no-preference) {
  .skelbar {
    animation: pulse 1.6s ease-in-out infinite;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.sentinel {
  height: 1px;
}

#load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}
#load-more-wrap[hidden] {
  display: none;
}
.loadmore {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.loadmore:hover {
  background: var(--card-hover);
  color: var(--text);
}
.loadmore:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ================= Hinweise ================= */
.note {
  margin-top: 2.5rem;
  background: var(--card);
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  text-align: center;
}
.note h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
}
.note p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-2);
  margin: 0 auto;
  max-width: 26rem;
}
.note p + p {
  margin-top: 0.6rem;
}
.note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  color: var(--text);
  background: var(--card-inset);
  padding: 0.14em 0.42em;
  border-radius: 5px;
}
.note .small {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}
.linklike {
  font: inherit;
  font-weight: 500;
  color: var(--blue);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.linklike:hover {
  opacity: 0.75;
}

/* ================= Glossar ================= */
.glossary-head {
  text-align: center;
  padding: 2.5rem 0 1rem;
}
.glossary-head .back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}
.glossary-head h2 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}
.glossary-head .sub {
  color: var(--text-3);
  font-size: 0.9375rem;
  margin: 0;
}

.gterm {
  background: var(--card);
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 0.75rem;
}
.gterm h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
}
.gterm p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #dcdce0;
}
.gterm .gsources {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}
.gterm .gsources a {
  color: var(--blue);
  text-decoration: none;
}
.gterm .gsources a:hover {
  text-decoration: underline;
}

@media (max-width: 36rem) {
  .wrap {
    padding: 0 1.15rem 5rem;
  }
  .hero {
    padding: 4.5rem 0 2.25rem;
  }
  .cardtop {
    padding: 0.8rem 0.6rem 0 1.15rem;
  }
  .cardhead {
    padding: 0.5rem 1.15rem 1.1rem;
  }
  .panel {
    padding: 0 1.15rem 1.15rem;
  }
  .card h3 {
    font-size: 1.1875rem;
  }
  .monthpop {
    right: -0.5rem;
  }
  /* Below ~460px the search field gets too cramped alongside three icon
     buttons on one line (placeholder text starts truncating) — give the
     field its own full-width row and let the icons wrap beneath it. */
  .searchwrap {
    flex-basis: 100%;
  }
}
