/* Hodnik ličnosti: the look of the original "Hodnik historije" (warm walls, gold frames) in the fonts of this site (EB Garamond, Inter), scoped to this page.
   The scene is drawn by hodnik.js; this file styles what lies over it: the title, the arrows, the hint, the Gallery / List switch, the list and the dialog. */

.hodnik-page {
  --wash: 238, 228, 211; --wall: #EEE4D3; --page: #FFF9EF; --ink: #3A3550; --ink-60: rgba(58, 53, 80, .6); --ink-35: rgba(58, 53, 80, .35);
  --h-serif: var(--serif); --h-mono: var(--sans); --h-cond: var(--serif);
  /* buttons in the dark ink of the rest of the site, not the page ink */
  --btn: #151a18; --btn-text: #f6f4ee;
  --u: min(calc(100vw / 1440), calc(100vh / 900)); --w: calc(100vw / 1440);
  height: 100%; overflow: hidden; background: var(--wall); color: var(--ink);
}
@media (max-width: 819px), (orientation: portrait) and (max-width: 1100px), (orientation: landscape) and (max-height: 500px) {
  .hodnik-page { --u: 1px; --w: 1px; }
}
html:has(.hodnik-page) { height: 100%; overflow: hidden; }
:where(.hodnik-page) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.hodnik-page [hidden] { display: none !important; }

#hod { position: fixed; inset: 0; background: var(--wall); color: var(--ink); }

/* the scene */
.gallery-host { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.gallery-host.grabbing { cursor: grabbing; }
.gallery-host.pointer { cursor: pointer; }
.canvas-mount { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s ease; }
.canvas-mount.ready { opacity: 1; }
.canvas-mount canvas { display: block; }
.veil { position: absolute; inset: 0; background: var(--wall); pointer-events: none; opacity: 1; transition: opacity 900ms ease-out; z-index: 2; }
.veil.faded { opacity: 0; }
.open-pill { position: fixed; z-index: 12; background: var(--btn); color: var(--btn-text); font-family: var(--h-mono); font-size: max(11px, calc(10 * var(--u))); letter-spacing: .14em; line-height: 1; text-transform: uppercase; padding: calc(7 * var(--u)) calc(13 * var(--u)); border-radius: 99px; white-space: nowrap; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; transition: opacity .12s ease; }
.open-pill.visible { opacity: 1; }

/* over the scene */
.gui { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: 1; visibility: visible; transition: opacity .3s ease, visibility .3s ease; }
.gui.hidden { opacity: 0; visibility: hidden; }
/* a soft wash over the floor, so the title and the plate read well over the boards */
/* on a wide screen only under the title (left) and the hint (right), so the labels on the walls in between stay clear */
.gui::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48%;
  background: linear-gradient(to top, rgba(var(--wash), .96), rgba(var(--wash), .86) 50%, rgba(var(--wash), 0));
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 60%, transparent 78%, transparent 84%, #000 96%);
  mask-image: linear-gradient(to right, #000 0, #000 60%, transparent 78%, transparent 84%, #000 96%);
  transition: opacity .35s ease;
}
/* in focus the camera looks at the wall, not the floor: the plate reads well without it, and the label under the portrait stays clear */
.gui.focused::before { opacity: 0; }
/* in focus, a low wash only behind the plate (bottom left), below the label under the portrait */
.gui::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(to top, rgba(var(--wash), .97), rgba(var(--wash), .9) 55%, rgba(var(--wash), 0));
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 30%, transparent 46%, transparent 80%, #000 94%);
  mask-image: linear-gradient(to right, #000 0, #000 30%, transparent 46%, transparent 80%, #000 94%);
  opacity: 0; transition: opacity .35s ease;
}
.gui.focused::after { opacity: 1; }
.gui > * { z-index: 1; }
.gui button { pointer-events: auto; }
.gui.hidden button { pointer-events: none; }
.mask { display: block; overflow: hidden; }
.rise { display: block; transform: translateY(105%); }
.gui.intro-done .rise { animation: maskRise 1000ms cubic-bezier(.2, .7, .2, 1) calc(250ms + var(--mi) * 60ms) both; }
@keyframes maskRise { from { transform: translateY(105%); } to { transform: translateY(0); } }

/* bottom right, above the hint: clear of the portraits on the near wall */
.arrows { position: absolute; right: calc(27 * var(--u)); bottom: calc(96 * var(--u)); display: flex; gap: calc(10 * var(--u)); }
.arrow-btn { width: max(24px, calc(50 * var(--u))); height: max(24px, calc(50 * var(--u))); border: 1.5px solid var(--btn); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--btn); background: transparent; transition: background .25s ease, color .25s ease; }
.arrow-btn:hover { background: var(--btn); color: var(--btn-text); }
.arrow-svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }

.hint { position: absolute; right: calc(27 * var(--u)); bottom: calc(38 * var(--u)); text-align: right; font-family: var(--h-mono); font-size: max(11px, calc(10 * var(--u))); letter-spacing: .12em; line-height: 1.65; text-transform: uppercase; }

/* the title (while walking) and the plate of the person in focus share the bottom left corner and take turns */
.caption, .plate { position: absolute; left: calc(25 * var(--u)); right: calc(360 * var(--u)); bottom: calc(34 * var(--u)); transition: opacity .35s ease, transform .45s cubic-bezier(.2, .7, .2, 1), visibility .35s; }
.kicker-mask { width: max-content; margin: 0 0 calc(10 * var(--u)) calc(3 * var(--u)); }
.kicker { font-family: var(--h-mono); font-size: max(11px, calc(11.5 * var(--u))); letter-spacing: .14em; text-transform: uppercase; }
.headline { margin: 0; font-family: var(--h-cond); font-weight: 500; font-size: calc(104 * var(--u)); line-height: .92; letter-spacing: -.015em; text-wrap: balance; }
/* room above the capitals for the accent of Ć and below for g, j, which the mask would otherwise cut off */
.headline .mask { padding: .22em 0 .2em; margin: -.22em 0 -.2em; }
.intro-mask { margin: calc(16 * var(--u)) 0 0 calc(3 * var(--u)); }
.intro { max-width: 34em; font-size: max(14px, calc(16 * var(--u))); line-height: 1.5; color: var(--ink-60); }

.plate { opacity: 0; visibility: hidden; transform: translateY(14px); pointer-events: none; }
.gui.focused .caption { opacity: 0; visibility: hidden; transform: translateY(-10px); }
.gui.focused .plate { opacity: 1; visibility: visible; transform: none; }
.gui.focused .plate button { pointer-events: auto; }
.plate p { margin: 0; }
.plate-meta { display: flex; flex-wrap: wrap; gap: 0 1.1em; font-family: var(--h-mono); font-size: max(11px, calc(11.5 * var(--u))); letter-spacing: .14em; text-transform: uppercase; color: rgba(58, 53, 80, .78); }
.plate-n { font-variant-numeric: tabular-nums; }
.plate-name { margin-top: calc(10 * var(--u)) !important; font-family: var(--h-cond); font-weight: 500; font-size: max(34px, calc(72 * var(--u))); line-height: .98; letter-spacing: -.01em; }
.plate-role { margin-top: calc(8 * var(--u)) !important; max-width: 30em; font-family: var(--h-serif); font-style: italic; font-size: max(17px, calc(23 * var(--u))); line-height: 1.3; }
.plate-open { display: inline-flex; align-items: center; gap: .6em; min-height: 44px; margin-top: calc(18 * var(--u)); padding: 0 20px; border-radius: 99px; background: var(--btn) !important; color: var(--btn-text) !important; font-family: var(--h-mono); font-size: max(11px, calc(11 * var(--u))); letter-spacing: .14em; text-transform: uppercase; transition: background .2s ease; }
.plate-open:hover { background: var(--frame) !important; color: var(--btn) !important; }

/* the list */
.list-section { position: fixed; inset: 0; z-index: 14; background: var(--page); overflow-y: auto; overflow-x: hidden; padding: calc(110 * var(--w)) calc(48 * var(--w)) calc(80 * var(--w)); opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; }
.list-section.open { opacity: 1; pointer-events: auto; visibility: visible; }
.list-header { margin-bottom: calc(36 * var(--w)); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.list-heading { margin: 0; font-family: var(--h-cond); font-weight: 500; font-size: calc(44 * var(--w)); line-height: 1; }
.list-cat + .list-cat { margin-top: calc(64 * var(--w)); }
.list-cat-h { margin: 0 0 calc(24 * var(--w)); padding-top: calc(14 * var(--w)); border-top: 1px solid var(--ink-35); font-family: var(--h-serif); font-weight: 500; font-size: max(22px, calc(30 * var(--w))); line-height: 1.1; }
.list-cat-h span { margin-left: .5em; font-family: var(--h-mono); font-size: max(11px, calc(11 * var(--w))); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-60); vertical-align: middle; }
.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(190 * var(--w)), 1fr)); column-gap: calc(48 * var(--w)); row-gap: calc(46 * var(--w)); }
.list-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
/* a 4:5 room for each portrait; the portrait is shrunk to fit, never enlarged */
/* the same gold frame as on the walls, as large as the portrait itself; the portraits stand on one line, so the names below line up */
.hodnik-page { --frame: #D3AA72; --frame-w: 5px; --frame-shadow: 0 14px 28px rgba(120, 90, 50, .24); }
.list-img-wrap { display: flex; align-items: flex-end; justify-content: center; width: 100%; aspect-ratio: 4 / 5; margin-bottom: calc(16 * var(--w)); transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.list-card:hover .list-img-wrap { transform: translateY(calc(-4 * var(--w))); }
.list-img { display: block; max-width: calc(100% - 2 * var(--frame-w)); max-height: calc(100% - 2 * var(--frame-w)); width: auto; height: auto; border: var(--frame-w) solid var(--frame); box-shadow: var(--frame-shadow); }
.mono { display: flex; align-items: center; justify-content: center; font-family: var(--h-serif); font-weight: 500; color: rgba(58, 53, 80, .72); }
.list-img.mono { box-sizing: border-box; max-width: 100%; max-height: 100%; height: 100%; aspect-ratio: 3 / 4; background: #F6EAD8; font-size: max(40px, calc(64 * var(--w))); }
.list-title { font-family: var(--h-serif); font-weight: 500; font-size: max(15px, calc(17 * var(--w))); line-height: 1.2; }
.list-artist { font-family: var(--h-serif); font-style: italic; font-size: max(13px, calc(14.5 * var(--w))); color: var(--ink-60); margin-top: calc(2 * var(--w)); }

/* the closing note under the list */
.lic-note { max-width: 40rem; margin-top: calc(80 * var(--w)); padding-top: calc(28 * var(--w)); border-top: 1px solid var(--ink-35); }
.lic-note h2 { margin: 0; font-family: var(--h-serif); font-weight: 500; font-size: max(26px, calc(36 * var(--w))); line-height: 1.1; }
.lic-note p { margin: .7rem 0 0; color: var(--ink-60); }
.lic-mail { display: inline-flex; align-items: center; min-height: 46px; margin-top: 1.2rem; padding: 0 22px; border-radius: 99px; background: var(--btn); color: var(--btn-text); font-family: var(--h-mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }

/* one photograph, opened */
#lb { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 72px calc(48 * var(--w)) 48px; border: 0; background: var(--page); color: var(--ink); overflow: hidden; }
#lb::backdrop { background: rgba(58, 53, 80, .35); }
#lb[open] { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.lb-ph { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
/* the photograph in the carved frame of the corridor: hodnik.js sizes the picture (never above its natural size) and draws the frame
   and the mount on the canvas round it; the padding is the room the frame takes */
.lb-art { position: relative; flex: none; }
.lb-art img { display: block; position: relative; z-index: 0; }
.lb-art .lb-mono { display: flex; position: relative; z-index: 0; }
.lb-ph img { max-width: none; max-height: none; }
.lb-frame { position: absolute; inset: 0; z-index: 1; pointer-events: none; filter: drop-shadow(0 16px 26px rgba(90, 70, 40, .28)) drop-shadow(0 2px 3px rgba(60, 45, 25, .25)); }
.lb-txt { max-height: 100%; overflow-y: auto; }
.lb-mono { background: #F6EAD8; font-size: clamp(5rem, 10vw, 9rem); }
.lb-cat { margin: 0 0 14px; font-family: var(--h-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-60); }
#lb h2 { margin: 0; font-family: var(--h-cond); font-weight: 500; font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: .98; }
.lb-role { margin: 12px 0 0; font-family: var(--h-serif); font-style: italic; font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.3; }
.lb-tag { display: inline-block; margin: 16px 0 0; padding: .3rem .8rem; border: 1px solid var(--ink); border-radius: 99px; font-family: var(--h-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; }
.lb-tag.origin, .lb-tag.linked { border-color: var(--ink-35); color: var(--ink-60); }
.lb-text { margin: 22px 0 0; font-size: 1.02rem; line-height: 1.7; max-width: 34em; }
.lb-src { display: inline-block; margin-top: 18px; font-size: .8rem; color: var(--ink-60); text-underline-offset: 3px; }
.lb-src:visited { color: var(--ink-60); }
.lb-src:hover { color: var(--ink); }
.lb-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ink-35); }
.lb-nav button { min-height: 44px; padding: 0 16px; border: 1px solid var(--ink-35); border-radius: 99px; font-family: var(--h-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; transition: border-color .2s ease, background .2s ease; }
.lb-nav button:hover { border-color: var(--ink); }
.lb-x { position: absolute; top: 18px; right: calc(48 * var(--w)); min-height: 44px; padding: 0 14px; border-radius: 99px; font-family: var(--h-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
.lb-x:hover { text-decoration: underline; }
#lb :focus-visible, .hodnik-page :focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }

@media (max-width: 819px), (orientation: portrait) and (max-width: 1100px), (orientation: landscape) and (max-height: 500px) {
  .hint { top: 76px; left: 16px; right: 16px; bottom: auto; text-align: left; font-size: 11px; }
  .caption, .plate { left: 16px; right: 16px; bottom: 88px; }
  /* on a phone the title and the plate span the width, over the floor: a full-width wash, lower in focus so the label above stays clear */
  .gui::before { -webkit-mask-image: none; mask-image: none; }
  .gui.focused::before { opacity: 1; height: 40%; }
  .gui::after { display: none; }
  .kicker-mask { margin: 0 0 8px 0; }
  .kicker { font-size: 11px; }
  .headline { font-size: min(12.5vw, 11vh); line-height: .92; }
  .intro-mask { margin: 12px 0 0; }
  .intro { font-size: 14px; }
  .plate-name { font-size: min(10vw, 40px); }
  .plate-role { font-size: 17px; }
  .plate-open { margin-top: 14px; }
  .arrows { left: 16px; right: auto; bottom: 24px; gap: 8px; }
  .arrow-btn { width: 44px; height: 44px; }
  .arrow-svg { width: 18px; height: 18px; }
  .list-section { padding: 84px 16px 60px; }
  .list-header { margin-bottom: 24px; }
  .list-heading { font-size: 28px; }
  .list-cards { grid-template-columns: repeat(2, 1fr); column-gap: 16px; row-gap: 28px; }
  .list-cat + .list-cat { margin-top: 44px; }
  .list-cat-h { margin-bottom: 18px; padding-top: 12px; }
  .hodnik-page { --frame-w: 4px; }
  .list-img-wrap { margin-bottom: 12px; }
  .list-title { font-size: 15px; }
  .list-artist { font-size: 13px; }
  .lic-note { margin-top: 56px; padding-top: 24px; }
  #lb[open] { display: block; overflow-y: auto; padding: 64px 20px 40px; }
  .lb-ph { height: auto; }

  .lb-txt { overflow: visible; }

  .lb-cat { margin: 22px 0 10px; }
  .lb-x { right: 12px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hint { display: none; }
  .caption, .plate { bottom: 18px; right: 132px; }
  .headline { font-size: min(8vw, 17vh); }
  .intro-mask, .plate-role { display: none; }
  .plate-name { font-size: min(7vw, 15vh); }
  .plate-open { margin-top: 8px; }
  .arrows { left: auto; right: 16px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { transform: none; }
  .gui.intro-done .rise { animation: none; }
  .veil, .canvas-mount, .gui, .caption, .plate { transition: none; }
}
