/* Fonts served with the site (SIL Open Font License, see /fonts): no request to a third party. */
@font-face { font-family: 'Italiana'; font-weight: 400; font-display: swap; src: url('/fonts/italiana-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 400; font-style: italic; font-display: swap; src: url('/fonts/dm-sans-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url('/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }

/* A dark grey room; the only colour comes from the artwork, which lights it. */
:root {
  --ground: #1a1a1c;
  --raised: #242427;
  --line: #3a3a3e;
  --ink: #ebe8e3;
  --soft: #a29f9a;
  --faint: #75736f;
  --serif: 'Italiana', 'Didot', Georgia, serif;
  --top: 64px; --bottom: 104px; --side: 88px; --pad: 28px;
  font-family: 'DM Sans', system-ui, sans-serif; color: var(--ink); background: var(--ground);
  font-synthesis: none; color-scheme: dark; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .35; cursor: default; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }

/* The room */
.room { position: fixed; inset: 0; display: grid; grid-template-rows: var(--top) minmax(0, 1fr) var(--bottom); grid-template-columns: minmax(0, 1fr); }
.ambient-glow, .ambient-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ambient-glow { z-index: 0; filter: saturate(1.15); }
.ambient-dust { z-index: 1; }
.stage { position: relative; z-index: 2; min-height: 0; display: grid; place-items: center; }
.art-mount { position: relative; line-height: 0; box-shadow: 0 12px 34px #00000059; }
.art-mount img { display: block; width: var(--fit-w, auto); height: var(--fit-h, auto); max-width: calc(100vw - 2 * var(--side)); max-height: calc(100dvh - var(--top) - var(--bottom) - 24px); user-select: none; -webkit-user-select: none; touch-action: none; }
.gaze-cursor { position: absolute; width: 18px; height: 18px; border: 1.5px solid #fff; border-radius: 50%; box-shadow: 0 0 0 6px #ffffff1f, 0 0 14px #0008; transform: translate(-50%, -50%); pointer-events: none; }
.art-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--soft); }
.art-error { position: absolute; inset: 0; display: grid; place-content: center; gap: 16px; text-align: center; font-size: 14px; color: var(--soft); }

/* Bars: quiet, and gone while one contemplates */
.bar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 var(--pad); transition: opacity .7s ease; }
body.idle .bar, body.idle .art-nav { opacity: 0; pointer-events: none; }
body.idle { cursor: none; }
.brand { font-family: var(--serif); font-size: 27px; letter-spacing: .01em; text-decoration: none; color: var(--ink); padding-bottom: 2px; }
.top-bar nav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.collection-button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: #1a1a1cb3; transition: border-color .2s, background .2s; max-width: 46vw; min-width: 0; }
.collection-button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-button:hover { border-color: var(--soft); background: var(--raised); }
.collection-icon { flex: none; width: 14px; height: 14px; background: linear-gradient(var(--ink) 0 0) 0 0 / 6px 6px no-repeat, linear-gradient(var(--ink) 0 0) 8px 0 / 6px 6px no-repeat, linear-gradient(var(--ink) 0 0) 0 8px / 6px 6px no-repeat, linear-gradient(var(--ink) 0 0) 8px 8px / 6px 6px no-repeat; opacity: .85; }
.round-button { flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: #1a1a1cb3; transition: border-color .2s, background .2s; }
.round-button:hover { border-color: var(--soft); background: var(--raised); }
.eye-icon { width: 18px; height: 11px; border: 1.5px solid var(--ink); border-radius: 50% / 50%; position: relative; }
.eye-icon::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--ink); }
body.gaze-on .eye-icon::after { background: #fff; box-shadow: 0 0 8px #fff; }
.frame-icon { width: 14px; height: 14px; background: linear-gradient(var(--ink) 0 0) 0 0 / 5px 1.5px no-repeat, linear-gradient(var(--ink) 0 0) 0 0 / 1.5px 5px no-repeat, linear-gradient(var(--ink) 0 0) 100% 0 / 5px 1.5px no-repeat, linear-gradient(var(--ink) 0 0) 100% 0 / 1.5px 5px no-repeat, linear-gradient(var(--ink) 0 0) 0 100% / 5px 1.5px no-repeat, linear-gradient(var(--ink) 0 0) 0 100% / 1.5px 5px no-repeat, linear-gradient(var(--ink) 0 0) 100% 100% / 5px 1.5px no-repeat, linear-gradient(var(--ink) 0 0) 100% 100% / 1.5px 5px no-repeat; }

/* The cartel: title, artist and date, and where we are */
.cartel { min-width: 0; }
.cartel h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-artist { font-size: 14px; color: var(--soft); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-collection { font-size: 12px; color: var(--faint); margin-top: 5px; padding: 2px 0; text-align: left; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.art-collection:hover { color: var(--ink); border-color: var(--faint); }
.desk { display: flex; align-items: center; gap: 22px; flex: none; }
.influence { display: grid; gap: 8px; width: 230px; font-size: 12px; color: var(--soft); }
.influence-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) var(--value, 75%), var(--line) 0); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 2px; background: var(--line); border-radius: 2px; }
input[type=range]::-moz-range-progress { height: 2px; background: var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 5px #ebe8e31a; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--ink); }
.play-button { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--soft); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.play-button:hover { background: var(--raised); border-color: var(--ink); }
.play-icon { width: 0; height: 0; border-left: 13px solid var(--ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
.play-button.playing .play-icon { width: 13px; height: 15px; border: 0; margin: 0; background: linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 9px, var(--ink) 9px); }

/* Previous / next, beside the artwork */
.art-nav { position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; background: #1a1a1c80; display: grid; place-items: center; transition: opacity .7s, background .2s; }
.art-nav:hover { background: var(--raised); }
.art-nav span { width: 11px; height: 11px; border-top: 1.5px solid var(--ink); border-left: 1.5px solid var(--ink); }
.previous { left: calc(var(--pad) - 6px); } .previous span { transform: translateX(2px) rotate(-45deg); }
.next { right: calc(var(--pad) - 6px); } .next span { transform: translateX(-2px) rotate(135deg); }
.gaze-status { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 12px; color: var(--ink); background: #1a1a1cd9; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; white-space: nowrap; }

/* Buttons */
.primary-button { display: block; width: 100%; padding: 16px 22px; border-radius: 999px; background: var(--ink); color: var(--ground); font-size: 15px; font-weight: 500; transition: background .2s; }
.primary-button:hover { background: #fff; }
.primary-button:focus-visible { outline: 1px solid var(--faint); outline-offset: 4px; }
.text-button { display: block; margin: 14px auto 0; padding: 8px 6px; font-size: 14px; color: var(--soft); transition: color .2s; }
.text-button:hover { color: var(--ink); }
.ghost-button { height: 44px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; white-space: nowrap; transition: border-color .2s, background .2s; }
.ghost-button:hover { border-color: var(--soft); background: #ffffff08; }

/* Dialogs */
dialog { background: var(--raised); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 0; max-height: calc(100dvh - 32px); box-shadow: 0 40px 120px #000000a6; }
dialog::backdrop { background: #0e0e10b3; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sheet-head h2 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1; }
.close-button { width: 40px; height: 40px; border-radius: 50%; position: relative; flex: none; }
.close-button::before, .close-button::after { content: ''; position: absolute; left: 12px; top: 19px; width: 16px; height: 1.5px; background: var(--ink); transform: rotate(45deg); }
.close-button::after { transform: rotate(-45deg); }
.close-button:hover { background: #ffffff0d; }

.welcome-dialog { width: min(440px, calc(100vw - 32px)); padding: 40px 36px 28px; text-align: center; }
.welcome-mark { font-family: var(--serif); font-size: 20px; color: var(--soft); }
.welcome-dialog h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.15; margin: 18px 0 14px; text-wrap: balance; }
.welcome-text { font-size: 14px; line-height: 1.6; color: var(--soft); margin-bottom: 28px; text-wrap: balance; }
.welcome-hint { font-size: 13px; line-height: 1.5; color: var(--soft); margin: 14px 0 0; }
.text-button.small-link { margin-top: 2px; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
dialog:focus { outline: none; }

.library-dialog { width: min(1120px, calc(100vw - 32px)); height: min(880px, calc(100dvh - 32px)); padding: 30px 32px 24px; }
.library-dialog[open] { display: flex; flex-direction: column; }
.collection-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 18px; }
.collection-chip { height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--soft); transition: color .2s, border-color .2s, background .2s; }
.collection-chip:hover { color: var(--ink); border-color: var(--soft); }
.collection-chip[aria-current=true] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; min-width: 0; height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--ground); font-size: 14px; }
.search-form input::placeholder { color: var(--faint); }
.library-status { font-size: 13px; color: var(--soft); margin: 16px 0 14px; min-height: 18px; }
.art-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 18px; align-content: start; padding: 2px 2px 8px; margin: 0 -2px; }
.art-card { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; }
.art-card img, .card-fallback { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: #19191b; border-radius: 6px; transition: transform .3s ease; }
.art-card:hover img { transform: translateY(-3px); }
.art-card.current img { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.card-fallback { display: grid; place-items: center; font-size: 12px; color: var(--faint); padding: 12px; text-align: center; }
.card-title { font-family: var(--serif); font-size: 19px; line-height: 1.15; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-artist { font-size: 12px; color: var(--soft); }
.card-source { font-size: 11px; color: var(--faint); text-decoration: none; margin-top: 2px; display: inline-block; }
.card-source:hover { color: var(--ink); }
.more-button { margin: 18px auto 0; display: block; }

.about-dialog { width: min(980px, calc(100vw - 32px)); padding: 30px 36px 32px; overflow-y: auto; }
.about-columns { display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px; margin-top: 22px; }
.about-dialog h3 { font-size: 14px; font-weight: 500; margin: 22px 0 10px; }
.about-dialog section > h3:first-child { margin-top: 0; }
.about-dialog p { font-size: 14px; line-height: 1.7; color: var(--soft); margin-bottom: 12px; max-width: 64ch; }
.about-dialog strong { color: var(--ink); font-weight: 500; }
.about-dialog a { text-underline-offset: 3px; text-decoration-color: var(--faint); }
.art-credit { font-size: 13px; }
.about-quote { margin: 26px 0 0; max-width: 34em; }
.about-quote blockquote { margin: 0; }
.about-dialog .about-quote p { font-family: var(--serif); font-size: 29px; line-height: 1.3; color: var(--ink); margin: 0; max-width: none; text-wrap: pretty; }
.about-quote figcaption { margin-top: 14px; font-size: 13px; color: var(--soft); }
.about-quote cite { font-style: italic; }
.about-intro { margin: 30px 0 38px; max-width: 64ch; }
.about-dialog .about-intro p { font-size: 16px; line-height: 1.7; color: var(--ink); margin: 0 0 12px; max-width: none; }
.about-signature { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.about-dialog .about-signature p { font-family: var(--serif); font-size: 24px; color: var(--ink); margin: 0; }
.about-links { display: flex; gap: 22px; font-size: 14px; }
.about-dialog .about-links a { color: var(--ink); text-decoration-color: var(--faint); }
.about-dialog .about-links a:hover { text-decoration-color: var(--ink); }

/* Calibration */
.calibration-overlay { position: fixed; inset: 0; z-index: 30; background: var(--ground); }
.cancel-calibration { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 18px; margin: 0; z-index: 5; }
.calibration-preparation { position: absolute; inset: 0; margin: auto; width: min(420px, calc(100% - 40px)); height: max-content; text-align: center; }
.calibration-preparation h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.15; }
.calibration-preparation p { font-size: 15px; line-height: 1.6; color: var(--soft); margin: 14px 0 30px; text-wrap: balance; }
.calibration-instructions { position: absolute; top: 33%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; width: min(520px, 80%); color: var(--faint); font-size: 13px; }
.calibration-instructions p { margin-top: 8px; color: var(--soft); min-height: 20px; }
.calibration-target { position: absolute; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ink) var(--fill, 0%), #ffffff24 0); box-shadow: 0 0 40px #ffffff26; pointer-events: none; }
.calibration-target:disabled { opacity: 1; }
.calibration-target span { width: 10px; height: 10px; border-radius: 50%; background: var(--ground); box-shadow: 0 0 0 4px var(--ground); }
.recal-ring { position: fixed; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; border: 2px solid var(--ink); box-shadow: 0 0 30px #ffffff55; z-index: 60; pointer-events: none; animation: breathe 1.2s ease-in-out infinite; }
.recal-ring::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; }
@keyframes breathe { 50% { transform: scale(.86); opacity: .8; } }
.tracking-video { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; opacity: .01; pointer-events: none; }

.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 12px); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--ground); padding: 12px 18px; max-width: calc(100% - 32px); width: max-content; border-radius: 12px; font-size: 14px; line-height: 1.5; box-shadow: 0 10px 40px #0009; }

/* Phones */
@media (max-width: 760px) {
  :root { --top: 60px; --bottom: 168px; --side: 14px; --pad: 16px; }
  .brand { font-size: 23px; }
  .top-bar nav { gap: 6px; }
  .collection-button { height: 38px; padding: 0 12px; font-size: 13px; max-width: 42vw; }
  .round-button { width: 38px; height: 38px; }
  #fullscreen-button { display: none; }
  .bottom-bar { flex-direction: column; align-items: stretch; justify-content: center; gap: 14px; }
  .cartel h1 { font-size: 25px; }
  .art-artist { font-size: 13px; }
  .desk { justify-content: space-between; }
  .influence { width: auto; flex: 1; }
  .play-button { width: 50px; height: 50px; }
  /* Below the artwork rather than over its edges */
  .art-nav { top: auto; bottom: 4px; width: 40px; height: 40px; margin-top: 0; background: #1a1a1cb3; }
  .previous { left: var(--pad); } .next { right: var(--pad); }
  .library-dialog, .about-dialog { padding: 22px 18px 18px; }
  .sheet-head h2 { font-size: 30px; }
  /* Every collection in view; the whole sheet scrolls down to the works */
  .library-dialog[open] { display: block; overflow-y: auto; }
  .collection-list { gap: 6px; margin: 18px 0 16px; }
  .collection-chip { height: 34px; padding: 0 12px; font-size: 13px; }
  .art-grid { overflow: visible; }
  .search-form { flex-wrap: wrap; }
  .art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .about-columns { grid-template-columns: 1fr; gap: 0; }
  .about-dialog .about-quote p { font-size: 23px; }
  .about-intro { margin: 24px 0 28px; }
  .about-dialog .about-intro p { font-size: 15px; }
  .welcome-dialog { padding: 32px 24px 22px; }
  .welcome-dialog h2 { font-size: 30px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --top: 52px; --bottom: 76px; --side: 64px; }
  .influence-ends, .art-collection { display: none; }
  .cartel h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
