/* Översetter website. Tokens live in tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--c-ground);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Soft coloured light behind the glass. Fixed, so cards refract it as the
   page scrolls; pure gradients, no image. The ground colour sits on <html>:
   a body background would paint over this negative-z layer. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48rem 34rem at 8% -4%, var(--glow-1), transparent 68%),
    radial-gradient(40rem 32rem at 100% 34%, var(--glow-2), transparent 70%),
    radial-gradient(44rem 32rem at 34% 106%, var(--glow-3), transparent 70%);
}

[hidden] { display: none !important; }

main { flex: 1 0 auto; }
main:focus { outline: none; }

a { color: var(--c-petrol); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--c-ink);
  color: var(--c-ground);
  border-radius: 999px;
}
.skip-link:focus { top: 12px; color: var(--c-ground); }

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- glass */
/* One recipe for every raised surface: translucent fill, blur of what lies
   behind, a bright hairline edge and a soft shadow. */

.glass,
.translator,
.ad,
.page-card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-highlight), var(--shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .translator, .ad, .page-card { background: var(--c-surface); }
  .pane--out { background: var(--c-surface-out) !important; }
}

/* --------------------------------------------------------------- header */

.site-header { padding: clamp(32px, 7vw, 64px) 0 0; }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
}

.logo {
  display: inline-flex;
  flex-direction: column;
  color: var(--c-ink);
  text-decoration: none;
  font-weight: 700;
  font-stretch: 108%;
  font-size: 2.75rem;
  line-height: 0.86;
  letter-spacing: -0.035em;
}
.logo:hover { color: var(--c-ink); }
.logo__row { display: flex; align-items: flex-start; gap: 0.09em; }
.logo__mark {
  width: 0.62em;
  height: 0.69em;
  margin-top: -0.02em;
  color: var(--c-petrol);
}
.page-sub .logo { font-size: 1.9rem; }
.page-sub .site-header { padding-top: clamp(24px, 5vw, 40px); }

.brand { min-width: 0; }

.intro {
  margin: 16px 0 0;
  color: var(--c-ink-soft);
  font-size: var(--fs-lead);
}

/* ------------------------------------------------------- store badges */
/* Official artwork only, unmodified, App Store first (Apple's marketing
   guidelines), the Google Play badge at least as large as Apple's, and a
   quarter of the badge height as clear space between them. */

.stores { flex: none; }
.stores__label { margin: 0 0 10px; color: var(--c-ink-soft); font-size: var(--fs-small); }
.stores ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.badge { display: block; border-radius: 9px; }
.badge img { display: block; height: 44px; width: auto; }
/* The Google PNG carries transparent padding (29 of 250 px top and bottom);
   scaled so its visible badge matches Apple's 44 px, the padding cropped. */
.badge--play img { height: 57px; margin: -6.6px 0; }

/* ----------------------------------------------------------- translator */

.translator {
  margin-top: clamp(28px, 5vw, 40px);
  border-radius: var(--radius);
  overflow: hidden;
}

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-line);
}
.bar__lang { padding: 0 24px; font-weight: 600; font-size: 0.98rem; }

.swap {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  background: var(--glass);
  box-shadow: var(--glass-highlight), 0 2px 8px -2px rgba(16, 40, 48, 0.18);
  color: var(--c-ink);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.swap:hover:not([disabled]) { background: var(--c-hover); }
.swap svg { width: 20px; height: 20px; }
.swap.is-turned { transform: rotate(180deg); }

.panes { display: grid; grid-template-columns: 1fr 1fr; }

.pane { display: flex; flex-direction: column; min-width: 0; }
.pane--out { background: var(--glass-out); border-left: 1px solid var(--c-line); }

.pane__text {
  flex: 1 0 auto;
  width: 100%;
  min-height: 12rem;
  margin: 0;
  padding: 20px 24px 8px;
  border: 0;
  background: transparent;
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--fs-text);
  line-height: 1.4;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
textarea.pane__text { resize: none; }
textarea.pane__text:focus { outline: none; }
textarea.pane__text::placeholder { color: var(--c-ink-muted); opacity: 1; }
/* Focus in the text field: the pane brightens a little; the caret shows the
   rest. No hard frame — it cut across the rounded card. */
.pane--in { transition: background-color 0.2s ease; }
.pane--in:focus-within { background: var(--c-focus-fill); }

.pane__text .placeholder { color: var(--c-ink-muted); }
.pane__text.is-stale { color: var(--c-ink-soft); }

.pane__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 6px 12px 12px 24px;
}
.pane__foot .spacer { flex: 1; }

.count, .status { color: var(--c-ink-muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.status.is-error { color: var(--c-error); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 0.95rem/1 var(--f-sans);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn:active:not([disabled]) { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { cursor: default; opacity: 0.4; }

.btn--primary {
  background: var(--c-button);
  color: var(--c-on-button);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px -8px rgba(16, 40, 48, 0.5);
}
.btn--primary:hover:not([disabled]) { background: var(--c-button-hover); color: var(--c-on-button); }

.btn--quiet { background: transparent; color: var(--c-ink); padding: 0 12px; }
.btn--quiet:hover:not([disabled]) { background: var(--c-hover); }

.btn--icon { width: 44px; padding: 0; }

.loading-dots { display: inline-flex; gap: 4px; margin-right: 6px; vertical-align: middle; }
.loading-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: dot 1s infinite ease-in-out;
}
.loading-dots i:nth-child(2) { animation-delay: 0.15s; }
.loading-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.noscript {
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--c-line);
  color: var(--c-ink-soft);
  font-size: var(--fs-small);
}

.more {
  margin: 16px 4px 0;
  color: var(--c-ink-soft);
  font-size: var(--fs-small);
}

/* ------------------------------------------------------------- ad slots */
/* Placeholders by design: two reserved slots below the translator. They must
   read clearly as "advertise here" — a heading, one line, a real button —
   inside a dashed frame that marks the space an ad would fill. A booked slot
   shows a self-hosted image, labelled "Anzeige". */

.ads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.ad {
  padding: 10px;
  border-radius: var(--radius-small);
}
.ad p { margin: 0; }

.ad__frame {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  height: 100%;
  min-height: 190px;
  padding: 20px 22px;
  border: 1.5px dashed var(--c-line-dashed);
  border-radius: calc(var(--radius-small) - 6px);
}
.ad__label {
  color: var(--c-ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.ad__title {
  font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.ad__body { color: var(--c-ink-soft); font-size: 0.95rem; }
.ad__cta { margin-top: auto; }
.ad .btn { margin-top: 14px; }

.ad--booked { padding: 10px; }
.ad--booked .ad__label { padding: 0 6px 8px; }
.ad--booked img { display: block; width: 100%; height: auto; border-radius: 12px; }

/* ---------------------------------------------------------- sub pages */

.page { padding-top: clamp(24px, 5vw, 40px); }
.page-sub .wrap { max-width: calc(44rem + 2 * var(--gutter)); }

.page-card {
  padding: clamp(24px, 5vw, 44px);
  border-radius: var(--radius);
}

.page h1 {
  margin: 0 0 18px;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.page h2 {
  margin: 36px 0 8px;
  font-size: var(--fs-h2);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.page h3 { margin: 26px 0 6px; font-size: 1.05rem; font-weight: 600; }
.page p, .page ul, .page ol, .page address { margin: 0 0 14px; }
.page ul, .page ol { padding-left: 1.3em; }
.page li { margin-bottom: 6px; }
.page address { font-style: normal; }
.page .lead { color: var(--c-ink-soft); font-size: var(--fs-lead); }
.page-card > :last-child { margin-bottom: 0; }

.faq { border-top: 1px solid var(--c-line); }
.faq details { border-bottom: 1px solid var(--c-line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 9px; height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--c-ink-soft);
  border-bottom: 2px solid var(--c-ink-soft);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq details > div { padding: 0 0 16px; color: var(--c-ink-soft); }

.draft {
  margin: 0 0 28px;
  padding: 14px 18px;
  border-left: 4px solid var(--c-error);
  border-radius: 0 10px 10px 0;
  background: var(--c-draft);
  font-size: var(--fs-small);
}
.draft p { margin: 0; }

.after-faq { margin-top: 28px; }

/* --------------------------------------------------------------- footer */

.site-footer {
  flex: none;
  margin-top: 48px;
  padding: 0 0 36px;
  color: var(--c-ink-soft);
  font-size: var(--fs-small);
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--c-ink-soft); text-decoration: none; display: inline-block; padding: 8px 0; }
.site-footer a:hover, .site-footer a[aria-current="page"] { color: var(--c-ink); text-decoration: underline; }

/* ----------------------------------------------------------- responsive */

@media (max-width: 720px) {
  .site-header { padding-top: 24px; }
  .site-header .wrap { gap: 14px; }
  .logo { font-size: 2.2rem; }
  .intro { margin-top: 12px; font-size: 1rem; }
  .stores__label { margin-bottom: 8px; }
  .translator { margin-top: 22px; border-radius: 22px; }
  .panes { grid-template-columns: 1fr; }
  .pane--out { border-left: 0; border-top: 1px solid var(--c-line); }
  .pane__text { min-height: 7.5rem; padding: 16px 18px 6px; }
  .pane__foot { padding-left: 18px; min-height: 56px; }
  .bar__lang { padding: 0 18px; font-size: 0.94rem; }
}

@media (max-width: 560px) {
  .ads { grid-template-columns: 1fr; }
  .ad__frame { min-height: 0; }
}

@media (max-width: 380px) {
  .bar__lang { padding: 0 10px 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .glass, .translator, .ad, .page-card, .swap {
    background: var(--c-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .pane--out { background: var(--c-surface-out); }
}

@media (forced-colors: active) {
  .translator, .swap, .btn, .ad, .page-card { border: 1px solid CanvasText; }
}

@media print {
  body::before, .stores, .translator, .more, .ads { display: none; }
  .page-card { box-shadow: none; border: 0; padding: 0; }
}
