/* ---------------------------------------------------------
   Junge Liberale Ebersberg-Erding — Baustellenseite
   --------------------------------------------------------- */

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

:root {
  --magenta: #e5017d;
  --magenta-deep: #b90062;
  --yellow: #ffed00;
  --font-display: "Allo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Allo", "Helvetica Neue", Arial, sans-serif;

  /* One design pixel. The 1440x1024 artwork scales to cover the viewport,
     so the band and the content always keep their proportions. */
  --u: max(0.069444vw, 0.097656vh);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: var(--magenta);
  color: var(--magenta);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: "ROND" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.modal-open,
html.modal-open body {
  overflow: hidden;
}

body ::selection {
  background: var(--magenta);
  color: var(--yellow);
}

/* The whole key visual is a fixed 1440x1024 stage, scaled to cover the
   viewport. That keeps the diagonal and every element in the same place. */
.scene {
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(1440 * var(--u));
  height: calc(1024 * var(--u));
  transform: translate(-50%, -50%);
  background: var(--magenta);
}

/* Exact ribbon geometry from the reference artwork. */
.stripe {
  position: absolute;
  inset: 0;
  background: var(--yellow);
  clip-path: polygon(
    0 7.91%,
    100% 45.61%,
    100% 94.82%,
    0 57.23%
  );
  pointer-events: none;
}

.page {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(1024 * var(--u));
  padding: calc(302 * var(--u)) 24px 0;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.brand {
  margin: 0 0 calc(128 * var(--u));
  line-height: 0;
}

.brand__logo {
  display: block;
  width: calc(216 * var(--u));
  height: auto;
}

.headline {
  margin: 0 0 calc(42 * var(--u));
  color: var(--magenta);
  font-family: var(--font-display);
  font-size: calc(66 * var(--u));
  font-variation-settings: "ROND" 0;
  font-weight: 900;
  letter-spacing: 0.011em;
  line-height: calc(77 / 66);
  text-wrap: balance;
}

.headline-break {
  display: inline;
}

.headline__line-two {
  position: relative;
  left: calc(-1 * var(--u));
  letter-spacing: 0.022em;
}

.downloads-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(12 * var(--u));
  width: calc(282 * var(--u));
  height: calc(52 * var(--u));
  margin: 0;
  padding: calc(4 * var(--u)) 0 0 calc(4 * var(--u));
  border: 0;
  background: var(--magenta);
  box-shadow:
    calc(-10 * var(--u)) calc(17 * var(--u)) 0 0 var(--yellow);
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: calc(40 * var(--u));
  font-variation-settings: "ROND" 0;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: none;
  cursor: pointer;
  transform: translateX(calc(13 * var(--u))) rotate(3.7deg);
  transform-origin: center;
  transition:
    transform 180ms ease,
    background-color 180ms ease;
}

.downloads-button:hover {
  background: var(--magenta-deep);
  transform: translateX(calc(13 * var(--u))) rotate(3.7deg) translateY(-3px) scale(1.015);
}

.downloads-button:active {
  transform: translateX(calc(13 * var(--u))) rotate(3.7deg) translateY(0) scale(0.99);
}

.downloads-button__arrow {
  display: inline-block;
  transition: transform 180ms ease;
}

.downloads-button:hover .downloads-button__arrow {
  transform: translateX(0.16em);
}

.downloads-button:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 5px;
}

/* ---------------------------------------------------------
   Downloads dialog
   --------------------------------------------------------- */

.downloads-dialog {
  width: min(92vw, 470px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--yellow);
  overflow: visible;
}

.downloads-dialog::backdrop {
  background: rgba(81, 0, 45, 0.76);
  backdrop-filter: blur(2px);
}

.downloads-dialog[open]::backdrop {
  animation: backdrop-in 220ms ease-out both;
}

.dialog__panel {
  position: relative;
  width: 100%;
  max-height: 88vh;
  max-height: 88svh;
  padding: clamp(60px, 6vw, 66px) clamp(18px, 3.4vw, 26px) clamp(18px, 3.2vw, 24px);
  border: 2px solid var(--yellow);
  background: var(--magenta);
  box-shadow: 9px 9px 0 var(--yellow);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: rotate(-0.8deg);
}

.downloads-dialog[open] .dialog__panel {
  animation: panel-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dialog__close {
  position: absolute;
  top: clamp(12px, 2vw, 16px);
  right: clamp(12px, 2vw, 16px);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.dialog__close:hover {
  background: var(--yellow);
  color: var(--magenta);
}

.dialog__close:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.downloads-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.downloads-list__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.downloads-list__link:hover {
  background: var(--yellow);
  color: var(--magenta);
  transform: translateX(4px);
}

.downloads-list__link:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.downloads-list__link:hover:focus-visible {
  outline-color: var(--magenta);
}

.downloads-list__icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.downloads-list__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.downloads-list__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.downloads-list__name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.downloads-list__meta {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.015em;
  line-height: 1.4;
  opacity: 0.8;
}

.downloads-list__arrow {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.downloads-list__link:hover .downloads-list__arrow {
  transform: translateY(4px);
}

/* ---------------------------------------------------------
   Responsive adjustments
   --------------------------------------------------------- */

/* Phones: leave the cover-scaled artboard and use a stacked layout. */
@media (max-width: 700px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .scene {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    min-height: 100svh;
    min-height: 100dvh;
    transform: none;
  }

  .stripe {
    position: fixed;
  }

  /* Center the whole hero in the visible viewport, with a slight downward
     bias so it sits comfortably inside the yellow band on tall phones. */
  .page {
    position: relative;
    justify-content: center;
    min-height: 100svh;
    min-height: 100dvh;
    padding:
      max(calc(env(safe-area-inset-top) + 10vh), 72px)
      max(20px, env(safe-area-inset-right))
      max(calc(env(safe-area-inset-bottom) + 2vh), 24px)
      max(20px, env(safe-area-inset-left));
  }

  .brand {
    margin-bottom: clamp(44px, 7vh, 60px);
  }

  .brand__logo {
    width: clamp(154px, 41vw, 216px);
  }

  .headline {
    margin-bottom: 30px;
    font-size: clamp(1.8rem, 7.6vw, 3rem);
    letter-spacing: 0.004em;
    line-height: 1.14;
  }

  .headline__line-two {
    letter-spacing: inherit;
  }

  .downloads-button {
    gap: 10px;
    width: auto;
    min-width: 190px;
    height: 46px;
    padding: 0 18px;
    font-size: clamp(1.25rem, 5.4vw, 1.5rem);
    transform: rotate(3.4deg);
  }

  .downloads-button:hover {
    transform: rotate(3.4deg) translateY(-3px) scale(1.015);
  }

  .downloads-button:active {
    transform: rotate(3.4deg) translateY(0) scale(0.99);
  }

  .downloads-dialog {
    width: calc(100vw - 32px);
  }

  .dialog__panel {
    padding: 58px 16px 18px;
    box-shadow: 7px 7px 0 var(--yellow);
    transform: rotate(-0.5deg);
  }

  .downloads-dialog[open] .dialog__panel {
    animation-name: panel-in-mobile;
  }

  .dialog__close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 1.55rem;
  }

  .downloads-list__link {
    gap: 11px;
    padding: 12px;
  }

  .downloads-list__name {
    font-size: 1.06rem;
  }

  .downloads-list__icon {
    width: 22px;
    height: 22px;
  }
}

/* Compact phones and short portrait screens. */
@media (max-width: 700px) and (max-height: 620px) {
  .page {
    padding-top: max(calc(env(safe-area-inset-top) + 7vh), 56px);
    padding-bottom: max(calc(env(safe-area-inset-bottom) + 2vh), 20px);
  }

  .brand {
    margin-bottom: 32px;
  }

  .brand__logo {
    width: clamp(132px, 36vw, 160px);
  }

  .headline {
    margin-bottom: 22px;
    font-size: clamp(1.55rem, 7vw, 2rem);
    line-height: 1.12;
  }

  .downloads-button {
    min-width: 174px;
    height: 42px;
    font-size: 1.12rem;
  }
}

/* Compact landscape phones. */
@media (max-width: 700px) and (max-height: 520px) and (orientation: landscape) {
  .page {
    padding:
      max(env(safe-area-inset-top), 12px)
      max(20px, env(safe-area-inset-right))
      max(env(safe-area-inset-bottom), 12px)
      max(20px, env(safe-area-inset-left));
  }

  .brand {
    margin-bottom: 16px;
  }

  .brand__logo {
    width: clamp(108px, 18vw, 140px);
  }

  .headline {
    margin-bottom: 16px;
    font-size: clamp(1.35rem, 4.4vw, 1.9rem);
    line-height: 1.08;
  }

  .downloads-button {
    min-width: 160px;
    height: 40px;
    padding: 0 14px;
    font-size: 1.1rem;
  }
}

@media (max-width: 380px) {
  .headline {
    font-size: clamp(1.65rem, 7.2vw, 1.9rem);
  }

  .downloads-button {
    min-width: 174px;
    padding: 0 14px;
    font-size: 1.18rem;
  }

  .downloads-list__name {
    font-size: 0.98rem;
  }

  .downloads-list__meta {
    font-size: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .downloads-dialog[open] .dialog__panel,
  .downloads-dialog[open]::backdrop {
    animation: none;
  }

  .downloads-button,
  .downloads-button__arrow,
  .downloads-list__link,
  .downloads-list__arrow,
  .dialog__close {
    transition: none;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(1deg) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-0.8deg) scale(1);
  }
}

@keyframes panel-in-mobile {
  from {
    opacity: 0;
    transform: translateY(16px) rotate(0.8deg) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-0.5deg) scale(1);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
