/* Atlas of Human Capacities: interactive map component for the Essence of Humanity site.
   Everything is scoped to .eoh-atlas. Colours and fonts come from the site's Webflow variables. */

.eoh-atlas {
  --atlas-serif: Kudryashev, "Palatino Linotype", Georgia, serif;
  --atlas-sans: Mulish, Arial, sans-serif;
  --atlas-ink: var(--color-black, #272221);
  --atlas-muted: var(--color-black-faded, #7e7c78);
  --atlas-paper: var(--color-cream, #f2eee7);
  --atlas-paper-2: var(--color-cream-darker, #f1e5d9);
  --atlas-panel: #fbfaf7;       /* off-white, so the panel stands apart from the cream page */
  --atlas-accent: var(--color-green-dark, #4b532b);
  --atlas-line: rgba(39, 34, 33, .14);
  --atlas-sea: #bad6f1;
  --atlas-ease: cubic-bezier(.65, 0, .25, 1);
  --atlas-panel-w: min(400px, 38%);
  position: relative;
  font-family: var(--atlas-sans);
  color: var(--atlas-ink);
}
.eoh-atlas *, .eoh-atlas *::before, .eoh-atlas *::after { box-sizing: border-box; }
.eoh-atlas :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.eoh-atlas :focus-visible { outline: 2px solid var(--atlas-accent); outline-offset: 2px; }

/* The CMS source lists and static texts are data only. */
.eoh-atlas [data-atlas-source] { display: none !important; }

/* ---------- depth filter (above the map) ---------- */
.eoh-atlas__depths { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 0 0 16px; }
.eoh-atlas__depths-title {
  flex: 1 0 100%; display: flex; align-items: center; gap: 20px; margin: 0 0 4px;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--atlas-muted);
}
.eoh-atlas__depths-title::after { content: ""; flex: 1; height: 1px; background: var(--atlas-line); }
.eoh-atlas__depth {
  flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline;
  text-align: left; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--atlas-line); background: var(--atlas-paper);
  transition: border-color .2s, background-color .2s, opacity .2s;
}
.eoh-atlas__depth:hover { border-color: rgba(39, 34, 33, .35); }
.eoh-atlas__depth[aria-pressed="true"] { border-color: var(--atlas-ink); background: #fff; }
.eoh-atlas.is-filtering .eoh-atlas__depth[aria-pressed="false"] { opacity: .55; }
.eoh-atlas__depth-dot { grid-row: 1 / 3; width: 12px; height: 12px; border-radius: 3px; background: var(--depth); align-self: start; margin-top: 5px; }
.eoh-atlas__depth-name { font-weight: 600; font-size: .95rem; }
.eoh-atlas__depth-name small { font-weight: 400; color: var(--atlas-muted); margin-left: 6px; }
.eoh-atlas__depth-desc { grid-column: 2; font-size: .8rem; line-height: 1.4; color: var(--atlas-muted); }
.eoh-atlas__depth-desc b { font-weight: 600; color: var(--atlas-ink); }

/* ---------- map frame ---------- */
.eoh-atlas__frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100svh - var(--atlas-offset-top, 0px));
  overflow: hidden; border-radius: 6px; background: var(--atlas-sea); touch-action: pan-y; user-select: none; -webkit-user-select: none;
  cursor: grab; isolation: isolate;
}
.eoh-atlas__frame.is-dragging { cursor: grabbing; }
.eoh-atlas__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The artwork and the spotlight are drawn on the canvas; the stage above it only holds live text and hit areas. */
.eoh-atlas__stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* illustrator credit, under the map */
.eoh-atlas__credit { margin: 10px 0 0; font-size: .78rem; line-height: 1.4; color: var(--atlas-muted); }
.eoh-atlas__credit a { color: var(--atlas-ink); text-decoration: underline; text-underline-offset: 2px; }
.eoh-atlas__credit a:hover { color: var(--atlas-accent); }

/* continent hit areas */
.eoh-atlas__region { position: absolute; border-radius: 12%; }

/* painted-map texts, rendered live */
.eoh-atlas__title, .eoh-atlas__name {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-family: var(--atlas-serif); font-weight: 400;
  color: var(--atlas-ink); line-height: 1; text-align: center;
}
.eoh-atlas__title { font-size: 118px; pointer-events: none; }
.eoh-atlas__name {
  font-size: 150px; padding: .05em .25em; border-radius: .2em;
  text-shadow: 0 0 .12em #fff, 0 0 .3em rgba(255, 255, 255, .9), 0 0 .6em rgba(255, 255, 255, .7);
  transition: opacity .4s; z-index: 2;
}
.eoh-atlas__name.is-compass { font-size: 120px; }
.eoh-atlas.has-focus .eoh-atlas__name:not(.is-current) { opacity: 0; pointer-events: none; }

/* capacity labels: same size as the painted labels, counter-scaled so they stay legible at the start view */
.eoh-atlas__chip {
  position: absolute; transform: translate(-50%, -50%) scale(var(--atlas-chip-scale, 1));
  font-family: var(--atlas-sans); font-weight: 600; font-size: 44px; line-height: 1.15; text-align: center;
  max-width: 8.6em; padding: .3em .55em .32em; border-radius: .3em; text-wrap: balance;
  background: var(--depth); color: var(--atlas-ink); box-shadow: 0 .06em .18em rgba(0, 0, 0, .18);
  transition: background-color .3s, box-shadow .3s, color .3s, opacity .4s;
}
.eoh-atlas__chip:hover, .eoh-atlas__chip.is-hover { box-shadow: 0 0 0 .08em #fff, 0 .1em .4em rgba(0, 0, 0, .35); }
.eoh-atlas__chip.is-active { box-shadow: 0 0 0 .1em #fff, 0 0 0 .18em var(--atlas-ink), 0 .1em .4em rgba(0, 0, 0, .35); }
.eoh-atlas.is-filtering .eoh-atlas__chip.is-dimmed { opacity: .35; }
.eoh-atlas.is-filtering .eoh-atlas__chip:not(.is-dimmed) { box-shadow: 0 0 0 .1em #fff, 0 .1em .4em rgba(0, 0, 0, .3); }


/* overlay notes at the start view (rivers, tagline) */
.eoh-atlas__note {
  position: absolute; max-width: 30em; font-size: 46px; line-height: 1.35; padding: .5em .7em; border-radius: .3em;
  background: rgba(255, 255, 255, .88); transition: opacity .4s; pointer-events: none;
}
.eoh-atlas__note b { display: block; font-family: var(--atlas-serif); font-weight: 400; font-size: 1.25em; margin-bottom: .15em; }
.eoh-atlas__note--being b::before, .eoh-atlas__note--doing b::before {
  content: ""; display: inline-block; width: 1.4em; height: .7em; margin-right: .4em; border-radius: .15em; vertical-align: .05em;
}
.eoh-atlas__note--being b::before { background: #6d8fbf; }
.eoh-atlas__note--doing b::before { background: #d9eef6; box-shadow: inset 0 0 0 .06em #9fc3d6; }
.eoh-atlas__note--tagline { background: none; text-align: center; font-family: var(--atlas-serif); font-size: 52px; transform: translateX(-50%); max-width: none; white-space: nowrap; }
.eoh-atlas.is-open .eoh-atlas__note, .eoh-atlas.is-zoomed .eoh-atlas__note { opacity: 0; }

/* ---------- chrome: breadcrumb, tools, hints ---------- */
.eoh-atlas__bar, .eoh-atlas__tools {
  position: absolute; top: 14px; z-index: 5; display: flex; align-items: center; gap: 2px;
  background: rgba(242, 238, 231, .94); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); padding: 4px;
}
.eoh-atlas__bar { left: 14px; max-width: calc(100% - 220px); }
.eoh-atlas__tools { right: 14px; transition: right .5s var(--atlas-ease); }
.eoh-atlas.is-open:not(.is-compact) .eoh-atlas__tools { right: calc(var(--atlas-panel-w) + 14px); }
.eoh-atlas__crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; font-size: .9rem; white-space: nowrap; overflow: hidden; }
.eoh-atlas__crumbs button { font-family: var(--atlas-serif); font-size: 1rem; }
.eoh-atlas__crumbs button:hover { text-decoration: underline; text-underline-offset: 3px; }
.eoh-atlas__crumbs span { color: var(--atlas-muted); }
.eoh-atlas__crumbs .is-leaf { font-family: var(--atlas-serif); font-size: 1rem; color: var(--atlas-ink); overflow: hidden; text-overflow: ellipsis; }
.eoh-atlas__tool { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; }
.eoh-atlas__tool:hover { background: rgba(39, 34, 33, .08); }
.eoh-atlas__tool svg { width: 18px; height: 18px; }
.eoh-atlas__tool--exit { display: none; }
.eoh-atlas.is-immersive .eoh-atlas__tool--fs { display: none; }
.eoh-atlas.is-immersive .eoh-atlas__tool--exit { display: grid; }

.eoh-atlas__hint, .eoh-atlas__tip {
  position: absolute; z-index: 6; pointer-events: none; font-size: .85rem; color: #fff; background: rgba(39, 34, 33, .86);
  border-radius: 999px; padding: 7px 14px; opacity: 0; transition: opacity .25s; white-space: nowrap;
}
.eoh-atlas__hint { left: 50%; bottom: 18px; transform: translateX(-50%); }
.eoh-atlas__hint.is-on { opacity: 1; }
.eoh-atlas__tip { transform: translate(14px, 14px); border-radius: 6px; }
.eoh-atlas__tip.is-on { opacity: 1; }
.eoh-atlas__tip b { font-family: var(--atlas-serif); font-weight: 400; font-size: 1rem; display: block; }
.eoh-atlas__tip span { opacity: .8; font-size: .78rem; }

/* ---------- panel ---------- */
.eoh-atlas__panel {
  position: absolute; z-index: 7; top: 0; right: 0; bottom: 0; width: var(--atlas-panel-w);
  background: var(--atlas-panel); box-shadow: -8px 0 30px rgba(0, 0, 0, .12);
  transform: translateX(105%); transition: transform .5s var(--atlas-ease); display: flex; flex-direction: column;
}
.eoh-atlas.is-open .eoh-atlas__panel { transform: none; }
.eoh-atlas__panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 0 22px; flex: none; }
.eoh-atlas__back { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--atlas-muted); }
.eoh-atlas__back:hover { color: var(--atlas-ink); }
.eoh-atlas__back svg { width: 14px; height: 14px; }
.eoh-atlas__grip { display: none; }
.eoh-atlas__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 26px 28px; }
.eoh-atlas__body.is-entering > * { animation: eoh-atlas-in .45s var(--atlas-ease) both; }
.eoh-atlas__body.is-entering > *:nth-child(2) { animation-delay: .04s; }
.eoh-atlas__body.is-entering > *:nth-child(3) { animation-delay: .08s; }
.eoh-atlas__body.is-entering > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes eoh-atlas-in { from { opacity: 0; transform: translateY(8px); } }

.eoh-atlas__eyebrow { margin: 6px 0 6px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--atlas-muted); }
.eoh-atlas__h { margin: 0; font-family: var(--atlas-serif); font-weight: 400; font-size: 2.2rem; line-height: 1.05; }
.eoh-atlas__q { margin: 10px 0 0; font-family: var(--atlas-serif); font-style: italic; font-size: 1.15rem; line-height: 1.35; color: var(--atlas-muted); }
.eoh-atlas__text { margin-top: 16px; font-size: .95rem; line-height: 1.6; }
.eoh-atlas__text p { margin: 0 0 .8em; }
.eoh-atlas__tag { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.eoh-atlas__tag i { width: 12px; height: 12px; border-radius: 3px; background: var(--depth); }
.eoh-atlas__tagnote { margin: 6px 0 14px; font-size: .82rem; line-height: 1.45; color: var(--atlas-muted); }
.eoh-atlas__tagnote b { color: var(--atlas-ink); font-weight: 600; }

.eoh-atlas__axis { display: flex; justify-content: space-between; margin: 22px 0 6px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--atlas-muted); }
.eoh-atlas__axisbar { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--d1), var(--d2), var(--d3)); }
.eoh-atlas__list { list-style: none; margin: 8px 0 0; padding: 0; }
.eoh-atlas__list li { border-bottom: 1px solid var(--atlas-line); }
.eoh-atlas__list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 2px; text-align: left;
  font-family: var(--atlas-serif); font-size: 1.1rem; transition: opacity .2s, padding .2s;
}
.eoh-atlas__list button:hover { padding-left: 6px; }
.eoh-atlas__list button i { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--depth); }
.eoh-atlas__list button span { flex: 1; }
.eoh-atlas__list button svg { width: 16px; height: 16px; opacity: .45; }
.eoh-atlas.is-filtering .eoh-atlas__list button.is-dimmed { opacity: .35; }
.eoh-atlas__list small { display: block; font-family: var(--atlas-sans); font-size: .78rem; color: var(--atlas-muted); }

.eoh-atlas__cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; padding: 12px 18px; border-radius: 999px;
  background: var(--atlas-ink); color: #fff; font-size: .9rem; text-decoration: none;
}
.eoh-atlas__cta:hover { background: var(--atlas-accent); }
.eoh-atlas__cta svg { width: 16px; height: 16px; }
.eoh-atlas__voiced { margin-top: 18px; font-size: .82rem; color: var(--atlas-muted); }
.eoh-atlas__pn { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 10px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--atlas-line); }
.eoh-atlas__pn button { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--atlas-muted); }
.eoh-atlas__pn button + button { text-align: right; }
.eoh-atlas__pn strong { display: block; margin-top: 4px; font-family: var(--atlas-serif); font-weight: 400; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--atlas-ink); }

/* ---------- compact preview (phones, in the page) ---------- */
.eoh-atlas__launch {
  display: none; position: absolute; inset: 0; z-index: 8; align-items: flex-end; justify-content: center; padding: 16px;
  background: linear-gradient(to top, rgba(39, 34, 33, .45), rgba(39, 34, 33, 0) 55%);
}
.eoh-atlas__launch span { padding: 11px 20px; border-radius: 999px; background: var(--atlas-paper); color: var(--atlas-ink); font-size: .95rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.eoh-atlas.is-compact:not(.is-immersive) .eoh-atlas__launch { display: flex; }
.eoh-atlas.is-compact:not(.is-immersive) .eoh-atlas__stage { pointer-events: none; }
.eoh-atlas.is-compact:not(.is-immersive) .eoh-atlas__chip,
.eoh-atlas.is-compact:not(.is-immersive) .eoh-atlas__note,
.eoh-atlas.is-compact:not(.is-immersive) .eoh-atlas__panel,
.eoh-atlas.is-compact:not(.is-immersive) .eoh-atlas__bar,
.eoh-atlas.is-compact:not(.is-immersive) .eoh-atlas__tools { display: none; }
.eoh-atlas.is-compact .eoh-atlas__depths { gap: 8px; }
.eoh-atlas.is-compact .eoh-atlas__depth { flex: 1 1 100%; padding: 10px 12px; }

/* ---------- immersive (full screen) ---------- */
html.eoh-atlas-lock, html.eoh-atlas-lock body { overflow: hidden !important; }
.eoh-atlas.is-immersive .eoh-atlas__frame {
  position: fixed; inset: 0; z-index: 2147483000; width: auto; max-height: none; aspect-ratio: auto; touch-action: none;
  border-radius: 0;
}
.eoh-atlas.is-immersive .eoh-atlas__depths-title, .eoh-atlas.is-immersive .eoh-atlas__credit { display: none; }
.eoh-atlas.is-immersive .eoh-atlas__depths {
  position: fixed; z-index: 2147483001; left: 14px; right: 14px; top: 62px; margin: 0; flex-wrap: nowrap; overflow-x: auto; gap: 6px;
  scrollbar-width: none;
}
.eoh-atlas.is-immersive .eoh-atlas__depths::-webkit-scrollbar { display: none; }
.eoh-atlas.is-immersive .eoh-atlas__depth-desc { display: none; }
.eoh-atlas.is-immersive .eoh-atlas__depth { flex: none; padding: 6px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); }
.eoh-atlas.is-immersive .eoh-atlas__depth-dot { grid-row: auto; margin-top: 3px; }

/* compact + immersive: the panel becomes a bottom sheet */
.eoh-atlas.is-compact .eoh-atlas__panel {
  top: auto; left: 0; width: auto; height: 46%; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
  transform: translateY(105%); transition: transform .45s var(--atlas-ease), height .35s var(--atlas-ease);
}
.eoh-atlas.is-compact.is-open .eoh-atlas__panel { transform: none; }
.eoh-atlas.is-compact .eoh-atlas__panel.is-full { height: 88%; }
.eoh-atlas.is-compact .eoh-atlas__grip { display: block; width: 100%; height: 22px; flex: none; position: relative; }
.eoh-atlas.is-compact .eoh-atlas__grip::after { content: ""; position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(39, 34, 33, .25); }
.eoh-atlas.is-compact .eoh-atlas__panel-head { padding-top: 0; }
.eoh-atlas__panel.is-overview [data-act="close"] { visibility: hidden; }
.eoh-atlas.is-compact .eoh-atlas__body { padding: 6px 20px 24px; }
.eoh-atlas.is-compact .eoh-atlas__h { font-size: 1.8rem; }
.eoh-atlas.is-compact .eoh-atlas__bar { max-width: calc(100% - 150px); }
.eoh-atlas.is-compact .eoh-atlas__tool--zoom { display: none; }

/* ---------- edit mode (?atlas-edit) ---------- */
.eoh-atlas.is-editing .eoh-atlas__chip, .eoh-atlas.is-editing .eoh-atlas__name { cursor: move; outline: 2px dashed rgba(200, 0, 0, .7); }
.eoh-atlas.is-editing .eoh-atlas__region { outline: 3px dashed rgba(0, 140, 0, .6); }
.eoh-atlas__toast {
  position: absolute; z-index: 9; left: 14px; bottom: 14px; max-width: calc(100% - 28px); padding: 10px 14px; border-radius: 8px;
  background: #1f1b1a; color: #fff; font: 13px/1.4 ui-monospace, Menlo, monospace; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.eoh-atlas__toast.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .eoh-atlas__panel { transition: none; }
  .eoh-atlas__body.is-entering > * { animation: none; }
}
