@font-face {
  font-family: "Tiempos";
  src: url("../fonts/tiempos-headline-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sohne";
  src: url("../fonts/soehne-buch.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sohne";
  src: url("../fonts/soehne-halbfett.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #080a0d;
  --bone: #f3efe7;
  --paper: #d9d3c6;
  --muted: #9a958a;
  --line: rgba(243, 239, 231, 0.15);
  --glass: rgba(8, 10, 13, 0.7);
  --red: #ff5a4d;
  --cyan: #00b7a8;
  --gold: #e7c84b;
  --blue: #7db4ff;
  --green: #9cc76c;
  --memory-1: #ff5a4d;
  --memory-2: #7db4ff;
  --memory-3: #e7c84b;
  --memory-4: #00b7a8;
  --font-display: "Tiempos", Georgia, "Times New Roman", serif;
  --font-body: "Sohne", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  color: inherit;
}

#memoryStage,
.grain {
  position: fixed;
  inset: 0;
}

#memoryStage {
  z-index: 0;
  filter: saturate(1.34) contrast(1.08);
}

.grain {
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

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

.topbar,
.room {
  position: relative;
  z-index: 2;
}

.topbar {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  gap: 14px;
  align-items: start;
  padding: 22px 24px;
}

.backlink {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 10, 13, 0.34);
  color: var(--paper);
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 82px);
  font-weight: 400;
  line-height: 0.94;
  text-align: center;
  text-wrap: balance;
}

.room {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  padding: 12px 24px 24px;
}

.docent,
.columns article,
.labels,
.accession {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--memory-1) 11%, transparent), transparent 36%),
    linear-gradient(315deg, color-mix(in srgb, var(--memory-2) 11%, transparent), transparent 44%),
    var(--glass);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.34),
    0 0 36px color-mix(in srgb, var(--memory-1) 16%, transparent);
  backdrop-filter: blur(22px);
}

.docent {
  min-height: 520px;
  padding: 18px;
}

.docent-head,
.section-head,
.input-row,
.score-actions,
.memory-mode,
.docent-tools,
.sound-switch,
.sound-glyph {
  display: flex;
  align-items: center;
}

.docent-head,
.section-head {
  justify-content: space-between;
  gap: 14px;
}

.docent-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.memory-mode {
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.memory-mode button,
.score-actions button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
}

.memory-mode button[aria-selected="true"],
.score-actions button:hover {
  background: linear-gradient(90deg, var(--memory-1), var(--memory-2));
  color: var(--ink);
}

.sound-switch {
  position: relative;
  gap: 9px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 239, 231, 0.07);
  color: var(--paper);
  padding: 8px 10px;
  cursor: pointer;
}

.sound-switch[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--memory-3) 62%, rgba(243, 239, 231, 0.16));
  background: color-mix(in srgb, var(--memory-3) 18%, rgba(243, 239, 231, 0.06));
}

.sound-glyph {
  gap: 2px;
  height: 16px;
}

.sound-glyph span {
  width: 3px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
}

.sound-glyph span:nth-child(2) {
  height: 11px;
}

.sound-glyph span:nth-child(3) {
  height: 15px;
}

.sound-switch[aria-checked="true"] .sound-glyph span {
  background: var(--memory-3);
  box-shadow: 0 0 12px color-mix(in srgb, var(--memory-3) 78%, transparent);
  animation: soundBars 900ms ease-in-out infinite alternate;
}

.sound-switch[aria-checked="true"] .sound-glyph span:nth-child(2) {
  animation-delay: 120ms;
}

.sound-switch[aria-checked="true"] .sound-glyph span:nth-child(3) {
  animation-delay: 240ms;
}

.docent h2 {
  max-width: 760px;
  margin: 40px 0 18px;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: clamp(40px, 6.4vw, 88px);
  font-weight: 400;
  line-height: 0.92;
  text-wrap: balance;
}

.docent-line {
  max-width: 620px;
  color: var(--paper);
  font-size: 19px;
}

.docent-form {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.input-row {
  gap: 8px;
}

input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--bone);
  padding: 0 12px;
  outline: none;
}

input::placeholder {
  color: var(--muted);
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 239, 231, 0.07);
  cursor: pointer;
}

.icon-button.primary {
  border-color: color-mix(in srgb, var(--memory-1) 72%, rgba(243, 239, 231, 0.2));
  background: color-mix(in srgb, var(--memory-1) 26%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--memory-1) 30%, transparent);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 10, 13, 0.9);
  color: var(--bone);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.score-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.score-actions button {
  border: 1px solid var(--line);
  background: rgba(243, 239, 231, 0.06);
}

.counter-memory-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.memory-lane {
  min-height: 138px;
  padding: 12px;
  border: 1px solid rgba(243, 239, 231, 0.12);
  border-radius: 8px;
  background: rgba(243, 239, 231, 0.055);
}

.memory-lane .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.true-lane .eyebrow {
  color: var(--memory-2);
}

.counter-lane .eyebrow {
  color: var(--memory-1);
}

.memory-lane p {
  margin: 0;
  min-height: 48px;
  color: var(--paper);
  font-size: 14px;
  font-style: italic;
}

.counter-lane p {
  color: var(--bone);
  font-style: normal;
  opacity: 0.74;
  transition: opacity 640ms var(--ease), filter 640ms var(--ease);
}

.counter-lane p.waiting {
  opacity: 0.3;
  filter: blur(0.3px);
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.columns article {
  min-height: 320px;
  padding: 14px;
}

.columns h2,
.labels h2 {
  margin-bottom: 12px;
  color: var(--bone);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  padding: 10px 0;
  border-top: 1px solid rgba(243, 239, 231, 0.11);
  color: var(--paper);
  font-size: 14px;
}

.labels {
  padding: 16px;
}

#conditionReadout {
  color: var(--memory-3);
  font-size: 12px;
  font-weight: 600;
}

#artworkList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#artworkList li {
  min-height: 112px;
  padding: 12px;
  border: 1px solid rgba(243, 239, 231, 0.12);
  border-radius: 8px;
  background: rgba(243, 239, 231, 0.06);
}

#artworkList strong {
  display: block;
  margin-bottom: 6px;
  color: var(--bone);
}

.accession {
  grid-column: 1 / -1;
  padding: 16px;
}

.room-traces {
  grid-column: 1 / -1;
}

.accession p:last-child {
  margin-bottom: 0;
  color: var(--paper);
  font-size: 16px;
}

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

@keyframes soundBars {
  from {
    transform: scaleY(0.58);
    opacity: 0.62;
  }

  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (max-width: 1040px) {
  .room,
  .columns,
  .counter-memory-container {
    grid-template-columns: 1fr;
  }

  #artworkList {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  h1 {
    text-align: left;
  }

  .room {
    padding: 10px 18px 18px;
  }

  .docent-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .docent-tools {
    justify-content: flex-start;
  }
}
