/* Wikinger oder Preuße? — minimalist layout */
:root {
  --bg: #0c1118;
  --bg-elevated: #141c28;
  --surface: #1a2433;
  --text: #e8edf4;
  --text-muted: #94a3b8;
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.15);
  --preussen: #5b8fb9;
  --preussen-soft: rgba(91, 143, 185, 0.18);
  --island: #c45c3e;
  --island-soft: rgba(196, 92, 62, 0.18);
  --border: rgba(232, 237, 244, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: "Outfit", system-ui, sans-serif;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.lang-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(20, 28, 40, 0.88);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.lang-switcher__btn {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform 0.2s ease;
}

.lang-switcher__btn:hover {
  background: var(--surface);
  border-color: var(--border);
}

.lang-switcher__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-switcher__btn--active,
.lang-switcher__btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: rgba(201, 162, 39, 0.45);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("../assets/paper-bg.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 17, 24, 0.72) 0%, rgba(12, 17, 24, 0.92) 100%);
  pointer-events: none;
  z-index: 0;
}

#main {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#main.main--result {
  max-width: 1120px;
  justify-content: flex-start;
  padding-top: 2rem;
}

.view {
  display: none;
  animation: viewEnter 0.45s var(--transition) both;
}

.view--active {
  display: block;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Landing */
.landing {
  text-align: center;
  padding: 2rem 0;
}

.landing__title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.landing .btn--primary {
  margin-top: 0.5rem;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow var(--transition), background var(--transition),
    border-color var(--transition), color var(--transition);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn--primary {
  background: linear-gradient(145deg, #d4af37 0%, #a67c1a 100%);
  color: #0c1118;
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201, 162, 39, 0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(232, 237, 244, 0.2);
  background: var(--surface);
}

/* Quiz */
.quiz-shell {
  padding-top: 0.5rem;
}

.quiz-progress {
  margin-bottom: 2rem;
}

.quiz-progress__track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.quiz-progress__fill {
  height: 100%;
  width: 11.11%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--preussen), var(--island));
  transition: width 0.45s var(--transition);
}

.quiz-progress__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-questions {
  min-height: 240px;
}

.quiz-panel {
  display: none;
  animation: panelIn 0.35s var(--transition) both;
}

.quiz-panel--active {
  display: block;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.quiz-panel__scenario,
.quiz-panel__lead {
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.quiz-panel__scenario {
  margin: 0 0 1rem;
}

.quiz-panel__lead {
  margin: 0 0 1.5rem;
}

/* Trade-off scale */
.tradeoff-scale {
  margin-top: 0.25rem;
}

.tradeoff-scale__poles {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tradeoff-scale__pole {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tradeoff-scale__pole-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.tradeoff-scale__pole-hint {
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-muted);
}

.tradeoff-scale__pole--left {
  text-align: left;
  align-items: flex-start;
}

.tradeoff-scale__pole--right {
  text-align: right;
  align-items: flex-end;
}

.tradeoff-slider {
  position: relative;
  padding: 0.5rem 0 0.15rem;
}

.tradeoff-slider__input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 0.45rem;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--preussen-soft), var(--island-soft));
  cursor: pointer;
}

.tradeoff-slider__input:focus {
  outline: none;
}

.tradeoff-slider__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.tradeoff-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background var(--transition);
}

.tradeoff-slider__input::-moz-range-thumb {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background var(--transition);
}

.tradeoff-slider__input:active::-webkit-slider-thumb {
  transform: scale(1.1);
  background: var(--accent);
}

.tradeoff-slider__input:active::-moz-range-thumb {
  transform: scale(1.1);
  background: var(--accent);
}

/* Legacy likert (unused) */
.likert-scale__options {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.likert-option {
  position: relative;
  flex: 1;
  min-width: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.likert-option:hover {
  border-color: rgba(232, 237, 244, 0.18);
  background: var(--surface);
}

.likert-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.likert-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.likert-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.likert-option__dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  transition: border-color var(--transition), background var(--transition);
}

.likert-option:has(input:checked) .likert-option__dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg-elevated);
}

.likert-option__label {
  font-size: 0.65rem;
  line-height: 1.3;
  text-align: center;
  color: var(--text-muted);
}

.likert-option:has(input:checked) .likert-option__label {
  color: var(--text);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.quiz-actions .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Result — flip cards */
.result-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.flip-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  perspective: 1200px;
  min-height: 500px;
}

.flip-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: calc(var(--radius) + 4px);
}

.flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  transform-style: preserve-3d;
  transition: transform 0.65s var(--transition);
}

.flip-card.is-flipped .flip-card__inner {
  transform: rotateY(180deg);
}

.flip-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card__face--back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  overflow: hidden;
  padding: 1.15rem 1rem;
}

.flip-card__face--result {
  gap: 0.65rem;
  height: 100%;
}

.flip-card__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.flip-card__hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.flip-card__back-label {
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.flip-card__back-theme {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  line-height: 1.3;
}

.flip-card__back-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.48;
  color: var(--text);
}

.flip-card__face--contact {
  gap: 1rem;
  align-items: stretch;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.contact-list__item {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.contact-list__item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.contact-list__person {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.contact-list__avatar {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--surface);
}

.contact-list__details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.contact-list__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.contact-list__role {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-list__website {
  display: block;
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
  text-decoration: none;
}

.contact-list__website:hover {
  text-decoration: underline;
}

.contact-list__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.contact-list__link:hover {
  text-decoration: underline;
}

.result-card__summary {
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.48;
  margin: 0;
  text-align: left;
  flex-shrink: 0;
}

.result-card__comparison {
  margin: 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.result-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  align-content: end;
}

.result-figures--compact .result-figure__frame {
  aspect-ratio: 1 / 1.05;
  max-height: 100%;
}

.result-figure__percent {
  position: absolute;
  left: 50%;
  bottom: 0.5rem;
  top: auto;
  transform: translateX(-50%);
  z-index: 3;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.result-figure--island .result-figure__percent {
  color: var(--island);
}

.result-figure--preussen .result-figure__percent {
  color: var(--preussen);
}

.result-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}

.result-figure__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  --visible-percent: 50%;
  --faded-opacity: 0.25;
  --fade-soft: 14%;
}

.result-figure--island .result-figure__frame {
  border-color: rgba(196, 92, 62, 0.4);
}

.result-figure--preussen .result-figure__frame {
  border-color: rgba(91, 143, 185, 0.4);
}

.result-figure__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 calc(var(--visible-percent) - var(--fade-soft)),
    rgba(0, 0, 0, var(--faded-opacity)) calc(var(--visible-percent) + var(--fade-soft)),
    rgba(0, 0, 0, var(--faded-opacity)) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 calc(var(--visible-percent) - var(--fade-soft)),
    rgba(0, 0, 0, var(--faded-opacity)) calc(var(--visible-percent) + var(--fade-soft)),
    rgba(0, 0, 0, var(--faded-opacity)) 100%
  );
  transition: -webkit-mask-image 0.6s var(--transition), mask-image 0.6s var(--transition);
}

.result-figure__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent calc(var(--visible-percent) - var(--fade-soft)),
    rgba(12, 17, 24, 0.25) calc(var(--visible-percent) + var(--fade-soft)),
    rgba(12, 17, 24, 0.25) 100%
  );
  transition: background 0.6s var(--transition);
}

.result-figure__caption {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}

.result-figure--island .result-figure__caption {
  color: var(--island);
}

.result-figure--preussen .result-figure__caption {
  color: var(--preussen);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  justify-content: center;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.site-footer em {
  font-style: italic;
}

@media (max-width: 900px) {
  #main.main--result {
    max-width: 640px;
  }

  .result-deck {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }

  .flip-card,
  .flip-card__inner {
    min-height: 480px;
  }
}

@media (max-width: 480px) {
  .lang-switcher {
    top: 0.75rem;
    right: 0.75rem;
  }

  .tradeoff-scale__pole-title {
    font-size: 0.78rem;
  }

  .tradeoff-scale__pole-hint {
    font-size: 0.72rem;
  }

  .result-figures {
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view,
  .quiz-panel,
  .flip-card__inner,
  .result-figure__fade {
    animation: none !important;
    transition: none !important;
  }

  .btn--primary:hover {
    transform: none;
  }
}
