:root {
  color-scheme: dark;
  --deck-background: rgba(39, 39, 42, 0.92);
  --deck-border: rgba(255, 255, 255, 0.09);
  --page-background: #171719;
  --stage-background: #0d0e10;
  --label: #f1f1f3;
  --secondary-label: #aaaab0;
  --faint-label: #77777e;
  --hover: rgba(255, 255, 255, 0.075);
  --transition-duration: 600ms;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page-background);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--label);
  background:
    radial-gradient(circle at 50% -20%, rgba(126, 126, 142, 0.15), transparent 36rem),
    var(--page-background);
}

a {
  color: inherit;
}

.control-deck {
  position: sticky;
  z-index: 10;
  top: 0;
  padding: 10px max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--deck-border);
  background: var(--deck-background);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
}

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

.look-matrix {
  display: grid;
  gap: 6px;
}

.look-row {
  display: grid;
  grid-template-columns: 46px repeat(9, minmax(72px, 1fr));
  align-items: stretch;
  gap: 5px;
  min-width: 880px;
}

.look-row-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
}

.look-row-wrapper::-webkit-scrollbar {
  display: none;
}

.canvas-label {
  display: grid;
  align-items: center;
  color: var(--faint-label);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.look-button {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 30px minmax(0, 1fr) 13px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 7px;
  color: var(--secondary-label);
  background: transparent;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.look-button:hover {
  color: var(--label);
  background: var(--hover);
}

.look-button:focus-visible {
  outline: 2px solid rgba(122, 179, 255, 0.9);
  outline-offset: 1px;
}

.look-button[aria-pressed="true"] {
  color: var(--label);
}

.look-button[aria-pressed="true"]::after {
  content: "✓";
  color: #73adff;
  font-size: 12px;
  font-weight: 700;
}

.look-swatch {
  width: 30px;
  height: 18px;
  overflow: hidden;
  border-radius: 6px;
  background: transparent;
}

.look-swatch img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.look-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.home {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

body.home main {
  display: grid;
  flex: 1;
}

.document-stage {
  display: grid;
  justify-items: center;
  margin: 0;
  align-content: start;
  padding: clamp(22px, 4vw, 56px) 16px clamp(22px, 4vw, 56px);
  background: var(--stage-background);
  transition: background-color var(--transition-duration) linear;
}

body[data-canvas="light"] .document-stage {
  --stage-background: #d6d3ca;
}

.document-stack {
  position: relative;
  width: min(100%, 756px);
  aspect-ratio: 1192 / 2592;
  overflow: hidden;
  background: #08090b;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 70px rgba(0, 0, 0, 0.34);
}

.document-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: contain;
  transition: opacity var(--transition-duration) linear;
}

.document-image.is-visible {
  opacity: 1;
}

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

footer {
  display: flex;
  width: 100%;
  max-width: 1180px;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 14px 18px 16px;
  color: var(--faint-label);
  font-size: 11px;
}

footer a {
  text-decoration-color: rgba(255, 255, 255, 0.24);
  text-underline-offset: 3px;
}

.noscript-message {
  margin: 0;
  padding: 12px;
  color: var(--secondary-label);
  text-align: center;
}

@media (max-width: 760px) {
  .control-deck {
    padding-inline: 10px;
  }

  .document-stage {
    padding-inline: 0;
    padding-top: 14px;
  }

  .document-stack {
    width: 100%;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-duration: 0ms;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Text pages: privacy, support, impressum */
.text-page {
  min-height: 100vh;
}

.page-header {
  padding: 18px max(16px, calc((100vw - 760px) / 2));
  border-bottom: 1px solid var(--deck-border);
}

.page-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.text-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 16px 56px;
  line-height: 1.6;
  color: var(--label);
}

.text-article h1 {
  margin: 0.2em 0 0.4em;
  font-size: 2rem;
  line-height: 1.2;
}

.text-article h2 {
  margin: 1.8em 0 0.5em;
  font-size: 1.15rem;
}

.text-article .lead {
  color: var(--secondary-label);
  font-size: 1.1rem;
}

.text-article ul,
.text-article ol {
  padding-left: 1.3em;
}

.text-article li {
  margin: 0.4em 0;
}

.text-article a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-article code,
.text-article kbd {
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: var(--hover);
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace;
}

.text-article hr {
  margin: 3em 0 2em;
  border: 0;
  border-top: 1px solid var(--deck-border);
}

.text-article em {
  color: var(--secondary-label);
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 36px;
  border-top: 1px solid var(--deck-border);
  color: var(--faint-label);
  font-size: 0.9rem;
}

/* Language: blocks marked .i18n exist once per language; lang.js sets data-ui. */
html:not([data-ui="de"]) .i18n[lang="de"],
html[data-ui="de"] .i18n[lang="en"] {
  display: none;
}

.lang-switch button {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.24);
  text-underline-offset: 3px;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  color: var(--label);
  text-decoration: none;
  font-weight: 600;
}
