/* noahlampert.com/map, on top of site.css. */
.map-page [hidden] { display: none !important; } /* the card and search set display, which would beat [hidden] */
/* With script on, the map, its search and its key keep their place (invisible) until map.js
   shows them, so the list below doesn't jump down after the first paint. */
html.js:not(.map-off) .map-page #map[hidden] { display: block !important; visibility: hidden; }
html.js:not(.map-off) .map-page #map-foot[hidden], html.js:not(.map-off) .map-page .map-find[hidden] { display: grid !important; visibility: hidden; }
/* Intro and search beside the map on wide screens, above it on narrow ones. */
.map-hero { display: grid; gap: clamp(8px, 2vw, 28px); padding-top: clamp(32px, 6vw, 72px); align-items: start; } /* the h1 sits where every page's does (privacy, press, start) */
@media (min-width: 1100px) { .map-hero { grid-template-columns: minmax(280px, 0.42fr) 1fr; } }
/* Narrow: the keyboard help and key go under the map, so the map comes sooner. */
@media (max-width: 1099px) { .map-hero .map-head { display: contents; } .map-foot { order: 1; } }
.map-head { display: grid; gap: 12px; align-content: start; }
.map-head h1 { font-size: min(var(--fs-h1), 4.75rem); max-width: 12ch; } /* beside the map, the page h1 fits its column */
.map-head .lede { max-width: 40em; color: var(--soft); font-size: clamp(1.0625rem, 1.5vw, 1.25rem); }

/* Search */
.map-find { position: relative; max-width: 34rem; margin-top: 10px; display: grid; gap: 6px; }
.map-find label { font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: 0.1em; text-transform: uppercase; color: var(--butter); }
.map-find input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: rgba(31, 13, 24, 0.85);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 11px 18px; -webkit-appearance: none; appearance: none;
}
.map-find input::placeholder { color: var(--dim); }
.map-find input:focus { outline: 2px solid var(--butter); outline-offset: 2px; }
.map-count { font-size: 0.875rem; color: var(--soft); min-height: 1.2em; padding-left: 18px; }
.map-count:empty { display: none; }
.map-results { display: grid; gap: 2px; }
.map-results button {
  width: 100%; text-align: left; font: inherit; font-size: 0.9375rem; color: var(--text); background: rgba(31, 13, 24, 0.85);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 16px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px;
}
.map-results button span { color: var(--dim); font-family: var(--mono); font-size: 0.75rem; align-self: center; }
.map-deep { max-width: 34rem; margin-top: 6px; padding-left: 18px; }
.map-deep button { font: inherit; font-size: 0.9375rem; text-align: left; color: var(--butter); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); } /* the site's inline-link underline */
.map-deep button:hover { text-decoration-color: currentColor; }
.map-deep button:focus-visible { outline: 2px solid var(--butter); outline-offset: 2px; border-radius: 4px; }
.map-results button:hover { border-color: var(--line-2); background: var(--card-2); }

/* The map: a square that fills the width, up to the window's height. */
.map-stage { position: relative; justify-self: center; width: min(100%, 86vh); width: min(100%, 86svh); aspect-ratio: 1; touch-action: manipulation; }
@media (max-width: 700px) { .map-stage { width: auto; justify-self: stretch; margin-inline: calc(4px - var(--gutter)); } } /* phones: nearly edge to edge */
#map-canvas { position: absolute; inset: 0; display: block; }
.map-nodes { position: absolute; inset: 0; pointer-events: none; }
.map-node {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer;
  font: inherit; color: var(--soft); background: none; border: 0; padding: 4px 6px; min-height: 24px; border-radius: 8px; white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.map-node span { display: block; }
.map-page [data-acc="cream"] { --acc: var(--text); }
.map-theme { --acc: var(--text); font-family: var(--mono); font-size: clamp(0.625rem, 1.1vw, 0.75rem); letter-spacing: 0.06em; text-transform: uppercase; color: var(--acc); } /* map.js sets --acc to the theme's colour */
/* Apps, games, tools and readings: the themes' mono type, smaller and quieter. */
.map-item { font-family: var(--mono); font-size: clamp(0.5625rem, 0.95vw, 0.6875rem); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); opacity: 0.85; }
.map-item.hot, .map-item:hover, .map-item:focus-visible { opacity: 1; }
.map-node:hover, .map-node.hot { color: var(--butter); background: rgba(18, 6, 13, 0.7); }
.map-theme:hover, .map-theme.hot { color: var(--acc); background: rgba(18, 6, 13, 0.85); box-shadow: inset 0 -2px 0 var(--acc); }
.map-node:focus-visible { outline: 2px solid var(--butter); outline-offset: 0; color: var(--butter); background: rgba(18, 6, 13, 0.85); }
/* On a phone the app, game, tool and reading buttons only show when lit: their stars sit 18 px
   apart, too close for 24 px tap targets, so a tap on the canvas picks the nearest star instead,
   and the list below the map has every one as a link. */
@media (max-width: 700px) {
  .map-theme { letter-spacing: 0.01em; } /* tighter on phones: the ring has no room to spare */
  .map-item:not(.hot) { visibility: hidden; }
}

.map-card {
  position: absolute; z-index: 2; pointer-events: auto; /* it sits inside .map-nodes, which passes clicks through */ width: min(300px, 80%); padding: 14px 16px; border-radius: 14px;
  background: rgba(31, 13, 24, 0.94); border: 1px solid var(--line-2); box-shadow: 0 18px 40px -18px #000;
  display: grid; gap: 4px;
}
.map-card.docked { left: 8px; right: 8px; bottom: -8px; top: auto; width: auto; transform: translateY(100%); }
.map-card-title { font-family: var(--display); font-size: 1.25rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.map-card-meta { font-size: 0.875rem; color: var(--soft); }
.map-card-go { margin-top: 6px; font-size: 0.9375rem; color: var(--butter); text-underline-offset: 3px; }
.map-stage:has(.map-card.docked:not([hidden])) { margin-bottom: 150px; }

.map-foot { display: grid; gap: 8px; margin-top: 10px; font-size: 0.875rem; color: var(--dim); }
.map-key { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.map-key span { display: inline-flex; align-items: center; gap: 8px; }
.map-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.map-how { max-width: 40em; }
.map-how summary { cursor: pointer; color: var(--soft); font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: 0.06em; text-transform: uppercase; padding-block: 6px; }
.map-how summary::marker { color: var(--butter); }
.map-how p { margin-top: 6px; }
.k-theme { background: var(--text); box-shadow: 0 0 8px var(--text); }
.k-item { background: var(--butter); transform: rotate(45deg) scale(0.8); border-radius: 1px !important; }
.k-ep { background: var(--text); width: 4px !important; height: 4px !important; opacity: 0.8; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The list */
.map-list { display: grid; gap: 10px; padding-bottom: clamp(48px, 8vw, 96px); }
.map-list details { border: 1px solid var(--line); border-radius: 16px; background: rgba(31, 13, 24, 0.6); box-shadow: inset 3px 0 0 var(--acc); } /* each theme's own colour */
.map-list details[open] { border-color: var(--line-2); }
.map-list summary { cursor: pointer; padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.map-list summary::marker { color: var(--acc); }
.map-t { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.map-n, .map-eps span, .map-items span { font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: 0.03em; color: var(--dim); }
.map-items, .map-eps { padding: 0 18px 12px 36px; display: grid; gap: 4px; }
.map-eps { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 4px 28px; }
.map-items a { color: var(--butter); }
.map-eps li, .map-items li { font-size: 0.9375rem; line-height: 1.4; }
.map-eps a { text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.map-eps a:hover { text-decoration-color: var(--text); }
.map-kw { padding: 0 18px 14px 36px; font-size: 0.8125rem; color: var(--dim); }
:target { scroll-margin-top: calc(var(--top-h) + 20px); }

/* Theme pages, /map/<theme>/ */
.map-page-link { padding: 0 18px 8px 36px; font-size: 0.875rem; }
.map-page-link a, .theme-head .label a { color: var(--butter); text-underline-offset: 3px; }
/* The hero: name and lede beside the theme's own corner of the sky (map.mjs, constellation). */
.theme-hero { display: grid; gap: clamp(20px, 3vw, 40px); align-items: center; padding-top: clamp(20px, 4vw, 48px); }
.theme-head { display: grid; gap: 12px; align-content: center; }
.theme-head h1.long { font-size: min(var(--fs-h1), clamp(2.5rem, 5vw, 5rem)); } /* "Consciousness", "Synchronicity" */
.theme-sub { font-family: var(--display); font-style: italic; font-size: var(--fs-h3); line-height: 1.2; color: var(--soft); }
.theme-head .lede { margin-top: 4px; text-wrap: pretty; }
.theme-top span { white-space: nowrap; }
.theme-top { font-family: var(--mono); font-size: var(--fs-meta); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.theme-head .actions { margin-top: 8px; }
.theme-sky { display: block; container-type: inline-size; aspect-ratio: 1000 / 760; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 45%, rgba(251, 241, 208, 0.05), transparent 70%), rgba(18, 6, 13, 0.55); transition: border-color 0.25s ease; }
.theme-sky:hover { border-color: var(--line-2); }
.sky-crop { display: block; width: 100%; height: 100%; }
.sc-far circle { fill: #fbf1d0; opacity: 0.22; }
.sc-themes circle { fill: #fbf1d0; opacity: 0.55; }
/* Sizes are in the SVG's 1000-unit viewBox: 20 units is 12 px or more once the sky is 600 px wide (--fs-meta floor). */
.sc-themes text, .sc-items text { font-family: var(--mono); font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase; text-anchor: middle; fill: var(--dim); }
.sc-items circle { fill: var(--butter); }
.sc-items text { fill: var(--text); }
@container (max-width: 599px) { .sky-crop text { display: none; } } /* under 600 px wide, 20 units is under 12 px; the cards and chips below name them */
.sc-eps circle { fill: #fbf1d0; opacity: 0.9; }
.sc-me { fill: var(--butter); }
@media (min-width: 900px) {
  .theme-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.theme-sec .sec-head { margin-bottom: clamp(16px, 2.4vw, 24px); }
.theme-sec .eps { margin-top: 0; }
@media (min-width: 1100px) {
  .theme-sec .eps { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(32px, 4vw, 64px); }
}
.theme-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.theme-cards a { display: grid; gap: 8px; grid-template-rows: auto auto 1fr auto; height: 100%; padding: clamp(18px, 2.4vw, 26px); }
.theme-cards a:hover .game-go .go { transform: translate(2px, -2px); }
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-chips a { display: inline-flex; gap: 8px; align-items: baseline; text-decoration: none; transition: border-color 0.2s ease, color 0.2s ease; }
.theme-chips a:hover { border-color: var(--butter); color: var(--butter); }
.theme-chips span { font-size: var(--fs-meta); color: var(--dim); }
.theme-sec .map-kw { padding: 18px 0 0; max-width: 70em; }
.theme-page main { padding-bottom: clamp(48px, 8vw, 96px); }
#t-other { --acc: var(--line-2); } /* no theme, no colour */
