/* Zeppelab – Physik mit Auftrieb
   Himmelblau, Sonnengelb und eine eigene Farbe pro Thema.
   Schriften liegen lokal in fonts/ (Bricolage Grotesque, Instrument Sans; SIL OFL). */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-700.woff') format('woff');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-400.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/instrument-400.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/instrument-700.woff') format('woff');
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --font-head: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --content: 76rem;

  --sky: #bfe3ff;
  --air: #f3f9ff;
  --white: #ffffff;
  --ink: #14215a;
  --ink-soft: #4a5788;
  --sun: #ffd23f;
  --sun-deep: #f2b705;
  --line: #d6e4f5;
  --focus: #ff7a1a;
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--air);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}
h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.container {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 700px) {
  .container {
    padding: 0 2rem;
  }
}

/* ------------------------------------------------------------ Kopfzeile */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
body[data-page='index'] .site-header {
  background: var(--sky);
  border-bottom: 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.brand svg {
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
}
.brand-name {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.brand-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 3px;
}
.nav a {
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* ------------------------------------------------------------ Himmel (Startbereich) */

.sky {
  position: relative;
  overflow: hidden;
  background: var(--sky);
  padding: 1rem 0 6rem;
}
.sky .container {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .sky .container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 2.5rem;
  }
}
.sky h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 11ch;
}
.sky .lead {
  margin: 1.1rem 0 0;
  max-width: 34rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
}
.search {
  position: relative;
  display: block;
  margin-top: 1.8rem;
  max-width: 34rem;
}
.search svg {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  width: 1.3rem;
  height: 1.3rem;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 3.6rem;
  padding: 0 1.2rem 0 3.1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font-size: 1.05rem;
  box-shadow: 0 4px 0 var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder {
  color: #7d88b3;
}
.search input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 4px 0 var(--focus);
}
.count-line {
  margin: 1rem 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.count-line strong {
  color: var(--ink);
}

.airship {
  margin: 0;
  justify-self: center;
  width: 100%;
  max-width: 34rem;
}
.airship svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.airship .drift {
  animation: driften 9s ease-in-out infinite;
}
@keyframes driften {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(8px, -9px);
  }
}
.airship figcaption {
  margin-top: 0.2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
@media (max-width: 899px) {
  .airship {
    max-width: 22rem;
    order: -1;
  }
  .airship figcaption {
    display: none;
  }
}

.clouds {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.clouds svg {
  position: absolute;
  fill: #ffffff;
}
.cloud-a {
  width: 190px;
  left: -3%;
  top: 80%;
  opacity: 0.8;
}
.cloud-b {
  width: 140px;
  right: 5%;
  top: 6%;
  opacity: 0.9;
}
.cloud-c {
  width: 90px;
  left: 44%;
  top: 4%;
  opacity: 0.65;
}
.sky-edge {
  position: absolute;
  left: 0;
  bottom: -1px;
  z-index: 1;
  width: 100%;
  height: 64px;
  fill: var(--air);
}
@media (prefers-reduced-motion: reduce) {
  .airship .drift {
    animation: none;
  }
}

/* ------------------------------------------------------------ Filter */

.filters {
  position: relative;
  z-index: 3;
  margin-top: -1.25rem;
}
.filter-label {
  display: block;
  margin: 0 0 0.7rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
}
.grades {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.grade {
  border: 2px solid var(--ink);
  background: var(--white);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.grade:hover {
  background: #fff6cf;
}
.grade[aria-pressed='true'] {
  background: var(--sun);
  box-shadow: 0 3px 0 var(--ink);
}

.topics-block {
  margin-top: 1.9rem;
}
.topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.7rem;
}
.topic {
  --c: #e2e8f0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 6.2rem;
  padding: 0.8rem 0.9rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--c);
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s;
}
.topic:hover {
  transform: translateY(-2px);
}
.topic svg {
  width: 1.9rem;
  height: 1.9rem;
}
.topic .t-name {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
}
.topic .t-count {
  position: absolute;
  top: 0.6rem;
  right: 0.65rem;
  min-width: 1.7rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}
.topic[aria-pressed='true'] {
  border-color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.topic.none {
  opacity: 0.45;
}
.topic.all {
  --c: var(--white);
  border-color: var(--line);
}
.topic.all[aria-pressed='true'] {
  border-color: var(--ink);
}

.subtopics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--white);
  border: 2px solid var(--line);
}
.subtopics > span {
  font-weight: 600;
  font-size: 0.92rem;
  margin-right: 0.2rem;
}
.sub {
  border: 2px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.sub:hover {
  border-color: var(--ink);
}
.sub[aria-pressed='true'] {
  background: var(--c);
  border-color: var(--ink);
}
.sub .n {
  margin-left: 0.35rem;
  color: var(--ink-soft);
  font-weight: 400;
}

/* ------------------------------------------------------------ Ergebnisse */

.results {
  margin-top: 2.6rem;
}
.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
}
.results-head h2 {
  font-size: 1.7rem;
}
.results-head p {
  margin: 0;
  color: var(--ink-soft);
}
.reset {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.group + .group {
  margin-top: 2.8rem;
}
.group-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.group-head .dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 12px;
  background: var(--c);
}
.group-head .dot svg {
  width: 1.65rem;
  height: 1.65rem;
}
.group-head h2 {
  font-size: 1.7rem;
}
.group-head .n {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
}
.results-head + .grid {
  margin-top: 1.3rem;
}

.card {
  --c: #e2e8f0;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition:
    transform 0.12s,
    border-color 0.12s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
}
.card .frame {
  position: relative;
  padding: 0.65rem 0.65rem 0;
  background: var(--c);
}
.card .shot {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: var(--white);
}
.card .shot > * {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}
.card .tag {
  position: absolute;
  left: 1.1rem;
  bottom: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 2.2rem);
  padding: 0.15rem 0.7rem 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--c);
  border: 2px solid var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .tag svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}
.card .body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.15rem 1.15rem;
}
.card h3 {
  font-size: 1.3rem;
  line-height: 1.15;
}
.card p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card p.by {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.card p.by + .grades-mini {
  margin-top: 0;
}
.grades-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.45rem;
}
.grades-mini span {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--air);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
}

.empty {
  padding: 3rem 1.5rem;
  border: 2px dashed var(--line);
  border-radius: 20px;
  background: var(--white);
  text-align: center;
}
.results-head + .empty {
  margin-top: 1.3rem;
}
.empty h2 {
  font-size: 1.5rem;
}
.empty p {
  margin: 0.5rem auto 0;
  max-width: 30rem;
  color: var(--ink-soft);
}
.empty .reset {
  margin-top: 1rem;
}

/* ------------------------------------------------------------ Simulationsseite */

.sim-page {
  padding: 0;
}
/* Kopfzeile der Simulationsseite: Titel, Schlagwörter und Knöpfe in einer Leiste */
body[data-page='simulation'] .site-header .container {
  max-width: none;
  gap: 1rem;
  height: auto;
  min-height: 4rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
body[data-page='simulation'] .brand-name {
  font-size: 1.15rem;
}
body[data-page='simulation'] .brand-sub {
  display: none;
}
body[data-page='simulation'] .brand svg {
  width: 2.1rem;
  height: 2.1rem;
}
.sim-bar {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}
.sim-bar:empty {
  display: none;
}
.sim-titel {
  flex: 1;
  min-width: 0;
}
.sim-titel h1 {
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  margin-top: 0.2rem;
}
.sim-meta .tag {
  --c: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.05rem 0.6rem 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--c);
  font-weight: 700;
  font-size: 0.78rem;
}
.sim-meta .tag svg {
  width: 0.95rem;
  height: 0.95rem;
}
.sim-meta .tag.grade-tag {
  background: var(--white);
  border: 1px solid var(--line);
  font-weight: 600;
  padding: 0.05rem 0.6rem;
}
.sim-meta .von {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-left: 0.2rem;
}
.zurueck {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.zurueck svg {
  width: 1.1rem;
  height: 1.1rem;
}
.btn.klein {
  height: 2.35rem;
  padding: 0 0.9rem;
  font-size: 0.92rem;
}
.btn.klein.primary {
  box-shadow: 0 2px 0 var(--ink);
}
@media (max-width: 1100px) {
  .btn.klein:not(.primary) span {
    display: none;
  }
  .btn.klein:not(.primary) {
    width: 2.35rem;
    padding: 0;
    justify-content: center;
  }
}
@media (max-width: 760px) {
  body[data-page='simulation'] .site-header .container {
    flex-wrap: wrap;
  }
  .sim-bar {
    order: 3;
    flex-basis: 100%;
    padding-left: 0;
    border-left: 0;
  }
  .zurueck span {
    display: none;
  }
  .sim-titel h1 {
    white-space: normal;
    font-size: 1.15rem;
  }
}
@media (max-width: 480px) {
  .btn.klein.primary span {
    display: none;
  }
  .btn.klein.primary {
    width: 2.35rem;
    padding: 0;
    justify-content: center;
  }
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.9rem;
  padding: 0 1.15rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: #fff6cf;
}
.btn.primary {
  background: var(--sun);
  box-shadow: 0 3px 0 var(--ink);
}
.btn.primary:hover {
  background: var(--sun-deep);
}
.btn svg {
  width: 1.1rem;
  height: 1.1rem;
}
.stage {
  margin-top: 0;
  overflow: hidden;
  background: var(--white);
}
.stage iframe {
  display: block;
  width: 100%;
  /* --kopf = Höhe der Kopfleiste, wird von app.js gesetzt */
  height: calc(100vh - var(--kopf, 4.1rem));
  height: calc(100dvh - var(--kopf, 4.1rem));
  min-height: 420px;
  border: 0;
  background: var(--white);
}
.stage:fullscreen {
  border: 0;
  border-radius: 0;
}
.stage:-webkit-full-screen {
  border: 0;
  border-radius: 0;
}
.stage:fullscreen iframe {
  height: 100vh;
}
.stage:-webkit-full-screen iframe {
  height: 100vh;
}

/* ------------------------------------------------------------ Fußzeile */

.site-footer {
  margin-top: 5rem;
  background: var(--ink);
  color: #dfe7ff;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.site-footer .brand-small {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
}
.site-footer .brand-small svg {
  width: 1.8rem;
  height: 1.8rem;
}
.site-footer p {
  margin: 0;
  font-size: 0.92rem;
}
.site-footer nav {
  display: flex;
  gap: 1.2rem;
}
.site-footer nav a {
  font-weight: 600;
  text-decoration: none;
}
.site-footer nav a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ Textseiten */

.prose {
  max-width: 44rem;
  padding-top: 2.5rem;
}
.prose h1 {
  font-size: 2.6rem;
  margin-bottom: 1.4rem;
}
.prose h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.4rem;
}
.prose p,
.prose li {
  color: #2b3770;
}
.prose .todo {
  background: #fff6cf;
  border: 2px solid var(--sun-deep);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
}
.prose mark {
  background: #ffe788;
  color: inherit;
  padding: 0 0.2em;
  border-radius: 0.2em;
}

/* ------------------------------------------------------------ Smartphone */

@media (max-width: 560px) {
  .brand-sub,
  .nav {
    display: none;
  }
  .topics {
    grid-template-columns: repeat(2, 1fr);
  }
  .topic {
    min-height: 5.4rem;
  }
}
