/* Miragon corporate design tokens, values from the CI (corporate-design skill, tokens.json).
   The token definitions are the one place where raw hex belongs, hence the lint exception. */
:root {
  /* brand-lint-disable */
  --cd-blau: #335DE5;
  --cd-gruen: #00E676;
  --cd-grau: #F9F7F7;
  --cd-schwarz: #1D1D1D;
  --cd-weiss: #FFFFFF;
  --cd-linie: #E6E2E2;
  --cd-text-leise: #6B6666;
  --cd-shadow-2: 0 4px 12px rgba(29, 29, 29, 0.10);
  /* brand-lint-enable */
  --cd-space-1: 4px;
  --cd-space-2: 8px;
  --cd-space-3: 16px;
  --cd-space-4: 24px;
  --cd-space-5: 32px;
  --cd-space-6: 48px;
  --cd-space-7: 64px;
  --cd-radius-lg: 16px;
  --cd-radius-pill: 999px;
  --cd-motion-fast: 150ms;
  --cd-ease-out: cubic-bezier(0, 0, 0.2, 1);
}

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

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

[hidden] {
  display: none !important;
}

html {
  background: var(--cd-grau);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: var(--cd-space-3);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--cd-schwarz);
}

p,
h1,
h2 {
  margin: 0;
}

.icon {
  flex: none;
  width: 24px;
  height: 24px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cd-blau);
  outline-offset: 2px;
}

/* The card clips the overlay while it slides in */
.card {
  position: relative;
  width: 100%;
  max-width: 30rem;
  overflow: hidden;
  padding: var(--cd-space-6) var(--cd-space-4) var(--cd-space-5);
  border-radius: var(--cd-radius-lg);
  background: var(--cd-weiss);
  box-shadow: var(--cd-shadow-2);
}

/* Share and QR buttons, revealed by the script */
#topActions {
  position: absolute;
  top: var(--cd-space-2);
  right: var(--cd-space-2);
  display: flex;
  gap: var(--cd-space-1);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: var(--cd-radius-pill);
  background: transparent;
  color: var(--cd-schwarz);
  cursor: pointer;
}

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

.app-icon {
  display: block;
  width: 96px;
  height: 96px;
}

/* Wordmark clear space: at least the height of the "M" on every side */
h1 {
  margin-top: var(--cd-space-5);
  line-height: 0;
}

h1 img {
  width: 200px;
  height: auto;
}

.subtitle {
  margin-top: var(--cd-space-5);
}

.address {
  margin-top: var(--cd-space-1);
  font-size: 13px;
  line-height: 1.5;
  color: var(--cd-text-leise);
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: var(--cd-space-3);
  width: 100%;
  margin-top: var(--cd-space-5);
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--cd-space-2);
  width: 100%;
  padding: var(--cd-space-3) var(--cd-space-4);
  border: 1px solid transparent;
  border-radius: var(--cd-radius-pill);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--cd-motion-fast) var(--cd-ease-out),
    border-color var(--cd-motion-fast) var(--cd-ease-out),
    color var(--cd-motion-fast) var(--cd-ease-out);
}

.button-primary {
  background: var(--cd-blau);
  color: var(--cd-weiss);
}

.button-secondary {
  border-color: var(--cd-linie);
  background: var(--cd-weiss);
  color: var(--cd-schwarz);
}

.button-secondary .icon {
  color: var(--cd-blau);
}

.social {
  display: flex;
  justify-content: center;
  gap: var(--cd-space-5);
  margin: var(--cd-space-6) 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--cd-space-2);
  border-radius: var(--cd-radius-lg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--cd-schwarz);
  text-decoration: none;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--cd-linie);
  border-radius: var(--cd-radius-pill);
  background: var(--cd-weiss);
  transition: border-color var(--cd-motion-fast) var(--cd-ease-out);
}

@media (hover: hover) {
  .icon-button:hover {
    background: var(--cd-grau);
  }

  .button-primary:hover {
    background: var(--cd-gruen);
    color: var(--cd-schwarz);
  }

  .button-secondary:hover,
  .social a:hover .social-icon {
    border-color: var(--cd-blau);
  }
}

/* Share and QR overlay inside the card; the script toggles top, opacity and visibility */
#modal {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--cd-space-6) var(--cd-space-4);
  overflow-y: auto;
  background: var(--cd-weiss);
  transition: top var(--cd-motion-fast) var(--cd-ease-out),
    opacity var(--cd-motion-fast) var(--cd-ease-out);
}

/* Same spot as the share and QR buttons */
#close {
  position: absolute;
  top: var(--cd-space-2);
  right: var(--cd-space-2);
}

#copyView,
#qrView {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-block: auto;
  text-align: center;
}

#copyView p {
  margin-bottom: var(--cd-space-5);
  text-wrap: balance;
}

#qr {
  width: 100%;
  max-width: 256px;
}

#qr svg {
  display: block;
  width: 100%;
  height: auto;
}

#qrView h2 {
  margin-top: var(--cd-space-4);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

/* Keep the subtitle on one line on 320px screens */
@media (max-width: 359px) {
  body {
    padding: var(--cd-space-2);
  }

  .card {
    padding-right: var(--cd-space-3);
    padding-left: var(--cd-space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  #modal,
  .button,
  .social-icon {
    transition: none;
  }
}
