.sg {
  --sg-creme: #ebe8dd;
  --sg-papier: #f6f4ee;
  --sg-anthrazit: #252525;
  --sg-text: #3a3a3a;
  --sg-gedaempft: #6b675e;
  --sg-weiss: #ffffff;
  --sg-radius: 10px;
  --sg-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) 16px clamp(56px, 9vw, 120px);
  color: var(--sg-text);
  font-family: Jost, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.sg *,
.sg *::before,
.sg *::after {
  box-sizing: inherit;
}

.sg--dunkel {
  width: 100%;
  padding-top: 0;
}

.sg--dunkel .sg-kopf {
  max-width: none;
  margin: 0 0 clamp(40px, 6vw, 80px);
  padding: clamp(150px, 16vw, 210px) 0 clamp(56px, 8vw, 104px);
  background: var(--sg-anthrazit);
  box-shadow: 0 0 0 100vmax var(--sg-anthrazit);
  clip-path: inset(0 -100vmax);
  color: var(--sg-creme);
}

.sg--dunkel .sg-dachzeile {
  color: rgba(235, 232, 221, 0.72);
}

.sg--dunkel .sg-titel,
.sg--dunkel .sg-einleitung {
  color: var(--sg-creme);
}

.sg--dunkel .sg-einleitung {
  max-width: 30em;
}

.sg-kopf {
  max-width: 760px;
  margin: 0 auto clamp(36px, 6vw, 72px);
  text-align: center;
}

.sg-dachzeile {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sg-gedaempft);
}

.sg-titel {
  margin: 0 0 18px;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(48px, 8.5vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--sg-anthrazit);
}

.sg-einleitung {
  max-width: 30em;
  margin: 0 auto;
  font-size: clamp(17px, 2vw, 20px);
}

.sg-stern {
  color: inherit;
  text-decoration: none;
}

.sg-raster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 36px) clamp(12px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 1000px) {
  .sg-raster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.sg-kachel {
  margin: 0;
  padding: 0;
}

.sg-kachel::before,
.sg-kachel::marker {
  content: none;
}

.sg-knopf {
  appearance: none;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--sg-radius);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sg-bild {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--sg-radius);
  background: var(--sg-papier);
  isolation: isolate;
}

.sg-bild::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(37, 37, 37, 0) 50%, rgba(37, 37, 37, 0.42) 100%);
  pointer-events: none;
}

.sg .sg-foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 1.1s var(--sg-ease);
}

.sg-schild {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 1.8vw, 18px);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(80%, 210px);
  height: clamp(62px, 7.5vw, 92px);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--sg-weiss);
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  transition: transform 0.6s var(--sg-ease), box-shadow 0.6s var(--sg-ease);
}

.sg .sg-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sg-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 2px 0;
}

.sg-name {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1.12;
  color: var(--sg-anthrazit);
}

.sg-aktion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sg-gedaempft);
  transition: color 0.3s ease;
}

.sg-pfeil {
  display: inline-block;
  transition: transform 0.45s var(--sg-ease);
}

.sg-hinweis,
.sg-unsichtbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (hover: hover) {
  .sg-knopf:hover .sg-foto {
    transform: scale(1.06);
  }

  .sg-knopf:hover .sg-schild {
    transform: translateX(-50%) translateY(-6px);
    box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.5);
  }

  .sg-knopf:hover .sg-aktion {
    color: var(--sg-anthrazit);
  }

  .sg-knopf:hover .sg-pfeil {
    transform: translateX(5px);
  }

  .sg-knopf[data-sg-extern]:hover .sg-pfeil {
    transform: translate(3px, -3px);
  }
}

.sg-knopf:focus-visible {
  outline: 2px solid var(--sg-anthrazit);
  outline-offset: 6px;
}

.sg-fussnote {
  margin: clamp(32px, 4vw, 48px) 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--sg-gedaempft);
}

.sg-fenster {
  position: fixed;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(560px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--sg-weiss);
  color: var(--sg-text);
  font-family: Jost, system-ui, sans-serif;
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.45);
}

.sg-fenster:not([open]) {
  display: none;
}

.sg-fenster::backdrop {
  background: rgba(25, 25, 25, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.sg-fenster-kopf {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 20px;
  background: var(--sg-creme);
}

.sg-fenster-schild {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 56px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--sg-weiss);
}

.sg-fenster-schild img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sg-fenster-titel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.sg-fenster-dach {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sg-gedaempft);
}

.sg-fenster-name {
  overflow: hidden;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 26px;
  line-height: 1.1;
  color: var(--sg-anthrazit);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sg-schliessen {
  appearance: none;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sg-weiss);
  color: var(--sg-anthrazit);
  cursor: pointer;
  transition: transform 0.35s var(--sg-ease);
}

.sg-schliessen:hover {
  transform: rotate(90deg);
}

.sg-schliessen:focus-visible {
  outline: 2px solid var(--sg-anthrazit);
  outline-offset: 2px;
}

.sg-fenster-rumpf {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--sg-weiss);
}

.sg-fenster-rumpf iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.sg-fenster-rumpf iframe.sg-bereit {
  opacity: 1;
}

.sg-laden {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 24px;
}

.sg-laden[hidden] {
  display: none;
}

.sg-laden span {
  display: block;
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(90deg, #efece4 0%, #f8f6f1 50%, #efece4 100%);
  background-size: 200% 100%;
}

.sg-laden span:first-child {
  width: 40%;
  height: 26px;
  margin: 0 auto 10px;
}

.sg-fenster-fuss {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--sg-gedaempft);
  background: var(--sg-creme);
}

html.sg-offen {
  overflow: hidden;
}

@media (max-width: 719px) {
  .sg-aktion {
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .sg-knopf[data-sg-extern] .sg-aktion {
    white-space: normal;
  }

  .sg-fenster {
    inset: auto 0 0 0;
    width: 100vw;
    height: 94dvh;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.45);
  }

  .sg-fenster-kopf {
    padding-top: 22px;
  }

  .sg-fenster-kopf::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(37, 37, 37, 0.22);
    transform: translateX(-50%);
  }

  .sg-fenster-schild {
    width: 76px;
    height: 48px;
  }

  .sg-fenster-name {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sg-kopf > * {
    animation: sg-auf 0.9s var(--sg-ease) both;
  }

  .sg-kopf > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .sg-kopf > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .sg-laden span {
    animation: sg-schimmer 1.4s linear infinite;
  }

  .sg-fenster[open] {
    animation: sg-rein 0.55s var(--sg-ease);
  }

  .sg-fenster[open]::backdrop {
    animation: sg-blende 0.4s ease;
  }

  .sg-fenster.sg-zu {
    animation: sg-raus 0.32s var(--sg-ease) forwards;
  }

  .sg-fenster.sg-zu::backdrop {
    animation: sg-blende 0.32s ease reverse forwards;
  }

  @supports (animation-timeline: view()) {
    .sg-kachel {
      animation: sg-auf linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }

    .sg-kachel:nth-child(even) {
      animation-range: entry 10% entry 85%;
    }
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 719px) {
  .sg-fenster[open] {
    animation-name: sg-hoch;
  }

  .sg-fenster.sg-zu {
    animation-name: sg-runter;
  }
}

@keyframes sg-auf {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sg-schimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes sg-rein {
  from {
    transform: translateX(100%);
  }

  to {
    transform: none;
  }
}

@keyframes sg-raus {
  from {
    transform: none;
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes sg-hoch {
  from {
    transform: translateY(100%);
  }

  to {
    transform: none;
  }
}

@keyframes sg-runter {
  from {
    transform: none;
  }

  to {
    transform: translateY(100%);
  }
}

@keyframes sg-blende {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
