/* The map: a replica of the Kumu embed of "Miroslav Kostic's Official Portfolio",
   under the site header (nav.css). Measurements come from the live embed
   (October 2026); all text is Helvetica Neue. Mobile first: the base rules are
   for a phone, where the profile is a bottom sheet; from 768 px it is a panel
   on the right. */

:root {
  --bg: #fcfcfa;
  --ink: #333;
  --ink-strong: rgba(0, 0, 0, 0.8);
  --muted: #ccc;
  --accent: #428bca;
  --link: rgb(52, 179, 235);
  --outline: #b72a2a;
  --helvetica: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sidebar-w: 100vw;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 14px/20px var(--helvetica);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.map-page .site-header { position: fixed; top: 0; left: 0; right: 0; }

#app button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* The map fills the window between the header and the small footer. */
#app { position: fixed; top: var(--site-header-h); left: 0; right: 0; bottom: var(--mini-footer-h); overflow: hidden; }


#scene { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: default; }
#scene.grabbing { cursor: grabbing; }
#scene.pointer { cursor: pointer; }
/* Safari's faded map layers and the layer above them (app.js); the pointer reaches #scene. */
.scene-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-layer[hidden] { display: none; }

/* ---------- search ---------- */
.console {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  width: calc(100% - 64px);
  transition: box-shadow .2s;
}
.console.open { right: 0; width: auto; background: var(--bg); box-shadow: 0 0 100px 0 #ccc; }
.search { display: flex; align-items: center; height: 50px; padding: 9px 7px 7px; margin: 0; }
.search-icon { display: flex; align-items: center; justify-content: center; width: 37px; height: 34px; color: #555; flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 6px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 16px/20px var(--helvetica);   /* 16 px stops iPhone Safari zooming the page on focus */
}
.search input::placeholder { color: #999; opacity: 1; }
.results { list-style: none; margin: 0; padding: 0; max-height: min(461px, calc(100dvh - var(--site-header-h) - 60px)); overflow-y: auto; overscroll-behavior: contain; }
.results li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 20px; border-left: 3px solid transparent; font-size: 16px; cursor: pointer; }
.results li.active { background: #f5f5f5; border-left-color: var(--accent); }
.results .title { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.results .none { color: #999; font-weight: 400; cursor: default; }

/* ---------- toolbars ---------- */
.region.top-right {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: right .3s ease;
}
.toolbar { display: flex; flex-direction: column; width: 46px; padding: 3px 1px; border-radius: 5px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 10px 0 #eee; }
.toolbar[hidden] { display: none; }
.tb-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 40px; color: var(--ink); }
.tb-btn:hover { color: #000; }
.focus-toolbar .focus-step { display: none; }
.focus-toolbar.active .focus-step { display: flex; }
.focus-btn[aria-pressed="true"] { color: var(--accent); }

.tooltip { position: absolute; z-index: 50; padding: 3px 8px; border-radius: 4px; background: #000; color: #fff; font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; }
.tooltip::after { content: ""; position: absolute; top: 50%; right: -5px; margin-top: -5px; border: 5px solid transparent; border-right: 0; border-left-color: #000; }

/* ---------- profile: a bottom sheet on phones ---------- */
.sidebar {
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  background: rgba(255, 255, 255, 0.78);
  /* The map shows through, blurred (Mickey, 20 Oct 2026). */
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(100%);
  transition: transform .3s ease;
}
.sidebar.open { transform: none; }
.sidebar-content { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px calc(10px + env(safe-area-inset-bottom)); outline: 0; }

.sidebar .close, .sidebar .full-page {
  position: absolute;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-strong);
  cursor: pointer;
  transition: background-color .15s;
}
/* Proper icons in full ink, centred on the title's first line (Mickey, 20 Oct 2026):
   the title's line is 30 px tall and starts 16 px down on phones. */
.sidebar .close { top: 9px; right: 4px; }
.sidebar .full-page { top: 9px; right: 48px; }
.sidebar .close:hover, .sidebar .full-page:hover, .sidebar .close:focus-visible, .sidebar .full-page:focus-visible { background: rgba(0, 0, 0, 0.07); }
.sidebar .full-page[hidden] { display: none; }

.sidebar-toggle {
  position: absolute;
  bottom: 100%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 44px;
  margin-left: -32px;
  color: #999;
  visibility: hidden;
}
.sidebar:not(.open) .sidebar-toggle { bottom: calc(100% + env(safe-area-inset-bottom)); }
.sidebar.has-profile .sidebar-toggle { visibility: visible; }
.sidebar-toggle span, .sidebar-toggle span::before, .sidebar-toggle span::after { display: block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.sidebar-toggle span { position: relative; }
.sidebar-toggle span::before, .sidebar-toggle span::after { content: ""; position: absolute; top: 0; }
.sidebar-toggle span::before { left: -8px; }
.sidebar-toggle span::after { left: 8px; }

.selection-toolbar { position: absolute; right: 0; bottom: env(safe-area-inset-bottom); z-index: 2; }
.selection-toolbar .focus-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--accent); }

/* profile content */
.article { margin-top: 16px; }
.profile-header { margin: 16px 0 18px; }
.profile-header table { width: 100%; border-collapse: collapse; }
.profile-header td { padding: 0; vertical-align: top; }
.profile-header .img-cell { width: 58px; }
.profile-header .text-cell { padding-right: 80px; }   /* clear of the full-page and close buttons */
.profile-header .img-cell + .text-cell { padding-left: 2px; }
.profile-header .title { margin: 0 0 5px; color: var(--ink-strong); font: 700 26px/30px var(--helvetica); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.profile-header .subtitle { margin: 0; color: var(--muted); font: 300 14px/20px var(--helvetica); letter-spacing: -0.01em; text-transform: uppercase; }
.profile-image { display: block; width: 48px; height: 48px; object-fit: cover; }

.markdown { color: var(--ink-strong); font: 400 17px/26px var(--helvetica); overflow-wrap: break-word; }
.markdown p { margin: 0 0 18px; }
.markdown img { display: block; max-width: 100%; height: auto; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { color: var(--ink); font-family: var(--helvetica); }
.markdown h1 { margin: 30px 0 8px; font-size: 26px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; }
.markdown h2 { margin: 26px 0 4px; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
.markdown h3 { margin: 22px 0 2px; font-size: 20px; line-height: 26px; font-weight: 300; }
.markdown h4, .markdown h5, .markdown h6 { margin: 20px 0 2px; font-size: 18px; line-height: 24px; font-weight: 700; }
.markdown > :first-child { margin-top: 0; }
.markdown ul, .markdown ol { margin: 0 0 18px; padding-left: 24px; }
.markdown li { margin: 0 0 6px; }
.markdown a { color: inherit; text-decoration: underline; text-decoration-color: rgba(0, 0, 0, 0.25); text-underline-offset: 3px; }
.markdown a:hover { text-decoration-color: currentColor; }
.markdown blockquote { margin: 0 0 20px; padding-left: 16px; border-left: 3px solid #eee; }
.widget-container { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.widget-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.details { margin-bottom: 30px; }
.tags { margin: 28px 0; }
.tag { display: inline-block; margin: 0 6px 6px 0; padding: 11px 12px; border: 1px solid #eee; border-radius: 3px; color: #444; font-size: 14px; line-height: 20px; text-decoration: none; }
.attributes { display: flex; flex-direction: column; margin: 0 0 40px; }
.attribute { display: flex; margin: 0 0 10px; }
.attribute .name { flex: 0 0 33.333%; padding: 6px 15px 0 0; font-size: 11px; line-height: 11px; font-weight: 700; text-transform: uppercase; }
.attribute .values { flex: 1; min-width: 0; }
.attribute .values p { margin: 0 0 10px; }
.attribute a { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
.attribute a:hover { text-decoration: underline; }


/* lightbox */
.sidebar .markdown img, .sidebar .profile-image { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.94); } }
.lightbox { animation: fade-in .2s ease-out; }
.lightbox img { animation: zoom-in .26s cubic-bezier(.2, .7, .2, 1); }
/* The open panel, its title and its picture grow into the full page (see nav.css). */
.sidebar.open { view-transition-name: entry-panel; }
.sidebar.open .pn-banner .title { view-transition-name: entry-title; }
.sidebar.open .pn-banner .pn-icon { view-transition-name: entry-icon; }
@media (prefers-reduced-motion: reduce) { .lightbox, .lightbox img { animation: none; } }
.lightbox figure { position: relative; margin: 0; }
.lightbox img { display: block; max-width: 94vw; max-height: 90vh; max-height: 90dvh; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3); background: #fff; }
.lightbox-close { position: absolute; top: 0; right: 0; width: 44px; height: 44px; color: #fff; font-size: 26px; line-height: 44px; text-shadow: 0 0 4px rgba(0, 0, 0, 0.6); background: none; border: 0; cursor: pointer; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { position: fixed; inset: 40% 0 auto; text-align: center; }

/* ---------- 768 px and up: Kumu's side panel, on the right ---------- */
@media (min-width: 768px) {
  :root { --sidebar-w: clamp(440px, 45vw, 630px); }
  .console { width: 260px; }
  .search input { height: 34px; font-size: 14px; }
  .results li { min-height: 40px; height: 40px; padding: 6px 36px; }

  .toolbar { width: 40px; padding: 6px 1px 5px; }
  .tb-btn { width: 38px; height: 29px; }
  .focus-toolbar { padding: 5px 1px; }
  /* The zoom and focus toolbars move left with the panel so it never covers them. */
  #app.sidebar-open .region.top-right { right: calc(var(--sidebar-w) + 9px); }

  .sidebar {
    top: 0;
    left: auto;
    right: 0;
    width: var(--sidebar-w);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: -1px 0 0 rgba(0, 0, 0, 0.06);
    transform: translateX(100%);
  }
  .sidebar-content { padding: 0 40px 10px; }
  /* The title's 38 px line starts 20 px down: buttons 40 px tall at 19 px share its centre. */
  .sidebar .close, .sidebar .full-page { top: 19px; width: 40px; height: 40px; }
  .sidebar .close { right: 12px; }
  .sidebar .full-page { right: 56px; }

  .sidebar-toggle {
    top: 50%;
    bottom: auto;
    left: auto;
    right: 100%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0;
    padding-right: 8px;
  }
  .sidebar:not(.open) .sidebar-toggle { bottom: auto; }
  .sidebar-toggle span::before, .sidebar-toggle span::after { left: 0; }
  .sidebar-toggle span::before { top: -6px; }
  .sidebar-toggle span::after { top: 6px; }

  .selection-toolbar { bottom: 0; }
  .selection-toolbar .focus-btn { width: 37px; height: 35px; }

  .article { margin-top: 20px; }
  .profile-header { margin: 20px 0 18px; }
  .profile-header .img-cell { width: 70px; }
  .profile-image { width: 60px; height: 60px; }
  .profile-header .title { font-size: 36px; line-height: 38px; }
  .profile-header .subtitle { font-size: 16px; }

  .markdown { font-size: 18px; line-height: 28px; }
  .markdown p { margin-bottom: 20px; }
  .markdown h1 { margin: 36px 0 8px -2px; font-size: 36px; line-height: 38px; }
  .markdown h2 { margin: 30px 0 4px -1px; font-size: 30px; line-height: 36px; }
  .markdown h3 { margin: 24px 0 2px -1px; font-size: 24px; line-height: 28.8px; }
  .markdown ul, .markdown ol { padding-left: 30px; }
  .tag { padding: 4px 6px; margin-bottom: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .region.top-right { transition: none; }
}

/* ---------- the panel: a small version of the full page (his ruling, 20 Oct 2026) ---------- */
.panel-page { margin: 0 -20px; }
.pn-banner {
  position: relative; padding: 22px 20px 22px; color: #f9f9f9;
  background-color: #262626; background-size: cover; background-position: center;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
}
.pn-banner:not(.has-photo) { background-size: 40px 40px; }
.pn-banner.has-photo::before { content: ""; position: absolute; inset: 0; background: rgba(18, 18, 18, 0.6); }
.pn-banner > * { position: relative; }
.pn-banner { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 0, 0, 0.45); }   /* as on page headers (his note, 20 Oct 2026) */
.pn-title-row { display: flex; align-items: center; gap: 14px; padding-right: 96px; }   /* clear of the two buttons */
.pn-icon { flex: none; width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3); }
.pn-titles { min-width: 0; }
.pn-banner .title { margin: 0; color: #fff; font: 700 26px/1.15 var(--helvetica); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.pn-banner .subtitle { margin: 3px 0 0; color: rgba(255, 255, 255, 0.82); font: 300 15px/1.3 var(--helvetica); text-transform: none; letter-spacing: 0; }
.pn-summary { margin: 14px 0 0; color: rgba(255, 255, 255, 0.92); font: 300 15px/1.45 var(--helvetica); }
.pn-section { padding: 18px 20px 2px; }
.pn-section h2 { margin: 0 0 8px; color: var(--ink-strong); font: 700 20px/1.2 var(--helvetica); }
.pn-facts { margin: 0; border-top: 1px solid #e6e6e6; }
.pn-facts > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 9px 0; border-bottom: 1px solid #e6e6e6; }
.pn-facts dt { color: #6b6b6b; font: 400 13px/1.4 var(--helvetica); }
.pn-facts dd { margin: 0; font: 300 15px/1.45 var(--helvetica); }
.pn-facts dd a { text-underline-offset: 3px; text-decoration-color: #c4c4c4; }
.pn-facts .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pn-facts .chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid #cfcfcf; border-radius: 999px; background: #fff; color: #1c1c1c; font: 300 14px/1.2 var(--helvetica); text-decoration: none; }
.pn-facts .chip:hover { border-color: #1c1c1c; }
.pn-facts .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pn-actions { margin: 0; padding: 14px 20px 26px; }
.pn-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 4px; background: #1c1c1c; color: #fff; font: 300 16px/1.2 var(--helvetica); text-decoration: none; }
.pn-btn:hover { background: #000; }
/* The close and full-page buttons sit on a dark disc, legible over the header and the text. */
#app .sidebar .close, #app .sidebar .full-page { top: 26px; color: #fff; background: rgba(0, 0, 0, 0.32); }   /* #app: above the button reset */
#app .sidebar .close:hover, #app .sidebar .full-page:hover, #app .sidebar .close:focus-visible, #app .sidebar .full-page:focus-visible { background: rgba(0, 0, 0, 0.5); }
@media (min-width: 768px) {
  .panel-page { margin: 0 -40px; }
  .pn-banner { padding: 28px 40px 26px; }
  .pn-banner .title { font-size: 30px; }
  .pn-section { padding: 22px 40px 2px; }
  .pn-facts > div { grid-template-columns: 120px 1fr; gap: 16px; align-items: baseline; }
  .pn-facts dt { text-align: right; }
  .pn-facts dt.sr-only + dd { grid-column: 2; }
  .pn-facts .chip { min-height: 30px; }
  .pn-actions { padding: 14px 40px 32px; }
  #app .sidebar .close, #app .sidebar .full-page { top: 34px; }
}

/* Team cards in the panel, as on the pages (21 Oct 2026). */
.panel-page .team { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.panel-page .team-card { display: flex; align-items: center; gap: 10px; height: 100%; padding: 8px 12px 8px 8px; border-radius: 12px; background: #f4f4f2; color: inherit; text-align: left; text-decoration: none; box-sizing: border-box; }
.panel-page .team-face { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.panel-page .team-default { background: #e3e3e1; color: #9a9a97; }
.panel-page .team-glyph { width: 22px; height: 22px; }
.panel-page .team-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.panel-page .team-name { font-weight: 500; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.panel-page .team-role { color: #757575; font-size: 12.5px; line-height: 1.3; }
.panel-page .team-face-link { flex: none; display: block; border-radius: 50%; }
.panel-page .team-name, .panel-page .team-role { width: fit-content; max-width: 100%; }
.panel-page a.team-name, .panel-page a.team-role { color: inherit; text-decoration: underline; text-decoration-color: rgba(0, 0, 0, 0.2); text-underline-offset: 3px; }
.panel-page a.team-role { color: #757575; }
.panel-page a.team-name:hover, .panel-page a.team-role:hover { text-decoration-color: currentColor; }
.panel-page .team-solo { display: flex; align-items: flex-start; gap: 12px; margin-top: 10px; }
.panel-page .team-solo .team-text { gap: 8px; padding-top: 2px; }
.panel-page .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.panel-page .role-chips .chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 1px solid #cfcfcf; border-radius: 999px; background: #fff; color: #1c1c1c; font: 300 13.5px/1.2 var(--helvetica); text-decoration: none; }
.panel-page .role-chips a.chip:hover { border-color: #1c1c1c; }
