/* Layout: a white page; two-column header; clusters are soft green heat-glows of ink dots along a snail-shell spiral, biggest at the heart, newest themes at the growing tip. Theme names are flat chips. Dot shape = kind of resource. Deliberately light-only. */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --card: #ffffff;
  --ink: #26221d;
  --muted: #6f665b;
  --rule: rgba(96, 118, 170, 0.20);   /* notebook lines */
  --brick: #9b3428;                    /* the handwritten red */
  --trail: rgba(38, 34, 29, 0.28);
  /* One ink per theme (dots + label). The heat underneath is always the same green. */
  --c0: #b23a2b;  /* brick */
  --c1: #2b6f8a;  /* deep teal */
  --c2: #c4881a;  /* ochre */
  --c3: #6e4c9e;  /* plum */
  --c4: #d0602f;  /* terracotta */
  --c5: #2f3f78;  /* navy */
  --c6: #b8417a;  /* rose */
  --c7: #7a5634;  /* bark */
  --c-growing: #4f8a2c;  /* young green */
  --heat: rgb(196, 226, 160);  /* the map's glow green, also the lens when it's on */
  --hover: #e6f0d9;            /* hover/selected fill: a pale version of the glow, visible on white */

  /* Type A: Mono (the old postgrowthsg.wordpress.com body face, used everywhere). Switchable in the prototype bar. */
  --f-head: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-head-weight: 500;
  --f-body: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --chip-char: 8.1;
}
/* Type B: old site — DM Mono body, geometric headings (Didact Gothic stands in for TeX Gyre Adventor) */

/* Type C: plain HTML — the browser's own serif */

* { box-sizing: border-box; }
html, body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  color: var(--ink);
  background-color: var(--paper);
  font-family: var(--f-body); font-size: 16px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 56px;
  min-height: 100%;
}
.wrap { max-width: 1160px; margin: 0 auto; display: grid; gap: 36px; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px dashed var(--brick); outline-offset: 3px; }

.proto {
  margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px;
  font-size: 13px; color: var(--muted); border: 1.5px dashed rgba(38,34,29,.25); border-radius: 10px; padding: 8px 14px;
  background: rgba(251, 247, 239, 0.6);
}
.proto strong { color: var(--ink); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.proto label { display: inline-flex; align-items: center; gap: 8px; }
.proto input[type=range] { width: 100px; accent-color: var(--brick); }
.proto output { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 2ch; }
.proto input[type=checkbox] { accent-color: var(--brick); }
.proto select { border: 1px solid rgba(38,34,29,.25); border-radius: 6px; background: var(--card); padding: 2px 6px; }

header.head { display: grid; gap: 18px 56px; padding-top: 18px; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
.head .left { display: grid; gap: 28px; justify-items: start; min-width: 0; }
.head .about { display: grid; gap: 10px; min-width: 0; align-content: start; }
.head .about h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { header.head { grid-template-columns: 1fr; } }
.logo { width: 72px; height: auto; display: block; }
.shape { display: inline-block; flex: none; overflow: visible; vertical-align: middle; }
h1 {
  font-family: var(--f-head); font-weight: var(--f-head-weight);
  font-size: clamp(28px, 4.6vw, 46px); line-height: 1.08; margin: 0; letter-spacing: -0.02em; text-wrap: balance; max-width: none;
}
.lede { max-width: 58ch; margin: 2px 0 0; color: var(--muted); }

.start { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.start .lbl { font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; border: 1.5px solid var(--ink); background: var(--card);
  border-radius: 999px; padding: 6px 14px 6px 11px; font-size: 14px; cursor: pointer; max-width: 100%;
}
.chip:hover { background: var(--hover); }
.chip i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bar { display: grid; gap: 20px; justify-items: start; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .ring { width: 13px; height: 13px; border: 1.5px solid var(--ink); background: transparent; }
.crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; min-height: 30px; }
.back { background: none; border: 0; padding: 10px 8px 10px 0; color: var(--muted); cursor: pointer; font-family: var(--f-body); font-size: 15px; font-weight: 500; line-height: 1; }
.back:hover { text-decoration: underline; }
.crumb h2 { font-family: var(--f-head); font-weight: var(--f-head-weight); font-size: clamp(26px, 4vw, 36px); margin: 0; line-height: 1; }
.crumb .counts { color: var(--muted); font-size: 14px; }

.map { position: relative; }
.map svg { display: block; width: 100%; height: auto; overflow: visible; }
.hit { fill: transparent; cursor: pointer; }
.clabel { cursor: pointer; }
.clabel .pill { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.clabel.static { cursor: default; }
.deep { opacity: 0; transition: opacity .7s ease; pointer-events: none; }
.deep.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .deep { transition: none; } }
.clabel .name { font-family: var(--f-body); font-size: 13px; fill: var(--ink); }
.clabel .meta { font-family: var(--f-body); font-size: 13.5px; fill: var(--muted); }
.clabel .more { fill: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }   /* a real link: ink and underlined, not an error-red */
.clabel:hover .pill, .clabel:focus-visible .pill, .clabel.hot .pill { fill: var(--hover); }
.clabel:focus { outline: none; }
/* Keyboard focus on a theme chip: the site's dashed brick ring, drawn on the chip itself (SVG has no outline) */
.clabel:focus-visible .pill { stroke: var(--brick); stroke-width: 2.2; stroke-dasharray: 4 3; }
.trail { fill: none; stroke: var(--trail); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 0.1 9; }
.link { stroke: var(--ink); stroke-opacity: .32; stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.node { cursor: pointer; }
.node .dot { stroke: var(--card); stroke-width: 1.2; }
.node .dot.two { stroke-width: 2.6; }
.node circle.pin { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.node circle.bridge { fill: none; stroke: var(--ink); stroke-opacity: .5; stroke-width: 1; stroke-dasharray: 2 2; }
.node:hover .dot, .node:focus-visible .dot, .node.sel .dot { filter: drop-shadow(0 0 2px rgba(38,34,29,.55)); }
.node:focus { outline: none; }
.node:focus-visible .dot { stroke: var(--brick); stroke-width: 2.6; }
.fade { animation: fadein .5s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.tip {
  position: absolute; pointer-events: none; background: var(--card); border: 1.5px solid var(--ink);
  border-radius: 8px; padding: 7px 11px; font-size: 13.5px; max-width: 260px;
}
.tip b { font-weight: 500; display: block; line-height: 1.3; margin-bottom: 3px; }
.tip small { color: var(--muted); font-size: 13.5px; }

.list { display: grid; gap: 56px 88px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.list section { min-width: 0; }
.list h3 { font-family: var(--f-body); font-weight: 600; font-size: 13.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; display: flex; gap: 9px; align-items: center; line-height: 1.2; }
.list h3 i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.list ul { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--rule); }
.list li button {
  background: none; border: 0; padding: 13px 0 12px; text-align: left; cursor: pointer; width: 100%;
  display: flex; gap: 10px; justify-content: space-between; align-items: baseline;
}
.list li button:hover .t { color: var(--brick); }
.list .t { min-width: 0; }
.list .d { font-size: 14px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%); z-index: 20;
  background: var(--card);
  border-left: 1.5px solid var(--ink);
  padding: calc(30px + env(safe-area-inset-top, 0px)) calc(30px + env(safe-area-inset-right, 0px)) calc(30px + env(safe-area-inset-bottom, 0px)) 30px;
  overflow-y: auto; transform: translateX(105%); transition: transform .3s ease;
  display: grid; gap: 20px; align-content: start;
}
.panel.open { transform: none; }
.panel .x { justify-self: end; background: var(--card); border: 1.5px solid var(--ink); border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 15px; line-height: 1; }
.panel .type { font-family: var(--f-body); font-size: 13.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1; display: inline-flex; gap: 9px; align-items: center; }
.panel .type i { width: 10px; height: 10px; border-radius: 50%; }
.panel h3 { font-family: var(--f-head); font-weight: var(--f-head-weight); font-size: 26px; line-height: 1.08; margin: 0; text-wrap: balance; }
.panel .meta { font-size: 14px; color: var(--muted); }
.panel .meta .todo { color: var(--brick); }
.panel p { margin: 0; }
.panel .tags { display: flex; flex-wrap: wrap; gap: 10px; }
.panel .tags button { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.panel .tags button:hover { background: var(--ink); color: var(--card); }
.panel .tags .loose { border-style: dashed; }
.panel .tags .extra { border: 1px dashed var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: var(--muted); }
.panel .archived { font-size: 14px; color: var(--muted); justify-self: start; }
.panel .open-link { display: inline-block; background: var(--ink); color: var(--card); text-decoration: none; border-radius: 999px; padding: 9px 18px; font-weight: 600; justify-self: start; }
.panel .open-link:hover { background: var(--brick); }
.panel .ex { color: var(--brick); font-size: 14px; }
.panel h4 { margin: 8px 0 0; font-family: var(--f-body); font-size: 13.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1; }
.panel .near { display: grid; }
.panel .near button { background: none; border: 0; padding: 11px 0; text-align: left; cursor: pointer; display: flex; gap: 9px; align-items: baseline; }
.panel .near button i { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.panel .near button:hover { color: var(--brick); }
.note { font-size: 14px; color: var(--muted); max-width: 70ch; margin: 0; }
.note b { font-weight: 500; color: var(--ink); }

@media (max-width: 640px) {
  .panel { top: auto; width: 100%; max-height: 80%; border-left: 0; border-top: 1.5px solid var(--ink); border-radius: 16px 16px 0 0; transform: translateY(105%); padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
  .logo { width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .panel, .chip { transition: none; }
  .fade { animation: none; }
}

/* Top-right link to the About page, and the About page itself */
.head .nav { justify-self: end; display: flex; gap: 18px; padding-top: 6px; }
.head .nav a { display: inline-block; padding: 8px 4px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.head .nav a:hover { color: var(--ink); }
.about-page { max-width: 62ch; display: grid; gap: 22px; padding-block: 8px 48px; }
.about-page h2 { margin: 36px 0 0; font-size: 14.5px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .08em; }
.about-page p { margin: 0; line-height: 1.7; }
.about-page a { color: var(--ink); }
@media (max-width: 760px) { .head .nav { justify-self: start; padding-top: 0; } }

/* Footer snail on every page (snail.js): crawls at roughly real snail speed, leaving a dotted trail */
.snail-foot { margin-top: 56px; display: grid; gap: 8px; }
.snail-track { position: relative; height: 58px; border-bottom: 1px solid var(--rule); overflow: hidden; }
.snail-slime { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background-image: radial-gradient(circle, var(--trail) 1.2px, transparent 1.6px); background-size: 9px 5px; background-repeat: repeat-x; }
.snail { position: absolute; left: 0; bottom: 1px; width: 50px; height: 52px; background: url(logo.png) no-repeat 0 0 / 101px 52px; will-change: transform; }
.snail-read { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .legend { font-size: 14px; gap: 6px 14px; }
  .wrap { gap: 26px; }
}

/* About page extras (v2): type list with shape icons, small notes, text still to write */
.about-page .aside-note { font-size: 14px; color: var(--muted); }
.about-page em { font-style: normal; font-weight: 500; }
.about-page .todo { color: var(--brick); }
.about-page svg.shape { fill: var(--ink); align-self: start; margin-top: calc((1.55em - 18px) / 2 - 1px); }   /* centred on the first line of its label */
.about-page p.effort svg.shape { margin-top: calc((1.7em - 18px) / 2); }
.about-page ul.types { list-style: none; margin: 0; padding: 0; display: grid; }
.about-page ul.types li { display: grid; grid-template-columns: 22px 11.5rem minmax(0, 1fr); gap: 2px 14px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.about-page ul.types li:first-child { border-top: 1px solid var(--rule); }
.about-page ul.types .t { font-weight: 500; }
.about-page ul.types .e { color: var(--muted); font-size: 14px; }
.about-page p.effort { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; align-items: baseline; }
.about-page ul.links { margin: 0; padding-left: 1.2em; display: grid; gap: 12px; }
@media (max-width: 560px) {
  .about-page ul.types li { grid-template-columns: 22px minmax(0, 1fr); }
  .about-page ul.types .e { grid-column: 2; }
}

/* Search (v2): a pill box above the map, a dropdown list of matches, and the map fading to show them */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.find { display: block; }
.searchbox { position: relative; width: 100%; }
.searchbox input { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px; padding: 8px 40px 8px 16px; }
.searchbox input::placeholder { color: var(--muted); }
.qx { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; cursor: pointer; font-size: 13px; color: var(--muted); line-height: 1; }
.qx:hover { background: var(--hover); color: var(--ink); }
.results { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden; }
.rcount { font-size: 13.5px; color: var(--muted); padding: 11px 20px 9px; border-bottom: 1px solid var(--rule); min-height: 31px; }
.rlist { max-height: min(52vh, 416px); overflow-y: auto; }
.res { display: flex; gap: 14px; align-items: baseline; padding: 14px 20px; cursor: pointer; border-bottom: 1px solid var(--rule); }
.res:last-child { border-bottom: 0; }
.res.hi { background: var(--hover); }
.res svg.shape { flex: none; transform: translateY(2px); }
.rt { display: grid; min-width: 0; }
.rname { font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.rsub { font-size: 13.5px; color: var(--muted); }
.rnone { padding: 16px 20px; font-size: 14px; color: var(--muted); display: grid; gap: 10px; }
.rnone p { margin: 0; }
.rnone p:first-child { color: var(--ink); }
.rnone button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rnone a { color: var(--ink); text-underline-offset: 3px; }
.rnone button:hover, .rnone a:hover { color: var(--brick); }
.clabel.zero { opacity: .5; }
.clabel.zero .pill { stroke: var(--muted); }
.list li.miss { opacity: .35; }

/* Header, right-hand column (v2): About at the top, the questions, then the search just above the type icons */
.head .right { display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; gap: 30px; min-width: 0; }
.head .right .nav { align-self: flex-end; }
.head .side { display: grid; gap: 22px; min-width: 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 0 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 15px; letter-spacing: 0; }
.faq[open] summary::after { content: '–'; }
.faq ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.faq a { display: inline-block; padding: 6px 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.faq a:hover { color: var(--ink); }
.about-page [id] { scroll-margin-top: 16px; }
@media (max-width: 760px) { .head .right { align-self: auto; } .head .right .nav { align-self: flex-start; } }

/* Efforts (v2): the Resources | Efforts switch, and card notes inside a theme */
.head-home .left { align-self: stretch; grid-template-rows: auto auto 1fr; }
.head-page .left { gap: 56px; }   /* the About page: more room between the logo and its heading */
.views { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; align-self: end; }
.modes { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.modes button { font: inherit; font-size: 14px; background: var(--card); color: var(--ink); border: 0; padding: 9px 18px; cursor: pointer; }
.modes button + button { border-left: 1.5px solid var(--ink); }
.modes button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.modes button:hover:not([aria-pressed="true"]) { background: var(--hover); }
/* The Singapore & Asia lens: a separate on/off pill; when on it takes the glow green */
.lens { display: inline-flex; align-items: center; gap: 9px; font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px; padding: 9px 16px 9px 12px; cursor: pointer; }
.lens-mark { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); flex: none; }
.lens:hover { background: var(--hover); }
.lens[aria-pressed="true"] { background: var(--heat); }
.lens[aria-pressed="true"] .lens-mark { background: var(--ink); }
.modes button:focus-visible { outline-offset: -5px; }
.cardnote { margin: 0 0 18px; font-size: 14px; color: var(--muted); max-width: 52ch; }

/* v2: a laptop note under the heading (small screens only) and example searches under the search box */
.hint { display: none; margin: -12px 0 0; font-size: 14px; color: var(--muted); max-width: 38ch; }
@media (max-width: 760px) { .hint { display: block; } }
.try { margin: 10px 0 0 6px; font-size: 14px; color: var(--muted); }
.try button { display: inline-block; background: none; border: 0; padding: 8px 3px; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.try button:hover { color: var(--ink); }
.find.typing .try { display: none; }

/* v2: a Collage card with no efforts yet is a muted chip with a dashed outline */
.clabel.empty .pill { stroke: var(--muted); stroke-dasharray: 4 3; }
.clabel.empty .name { fill: var(--muted); }

/* v3: skip link (first thing the Tab key reaches; hidden until focused) */
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--ink); color: var(--card); padding: 9px 16px; border-radius: 999px; font-size: 14px; text-decoration: none; }
.skip:focus { top: 12px; }

/* v3: no one-word last lines in running text */
p, li, .note, .cardnote { text-wrap: pretty; }

/* The first screen (critique, 18 Nov): Questions start folded at every width, and on phones the order is
   logo + heading, switch, Questions, then the legend and counts, then the search directly above the map.
   (The header's wrappers dissolve so the pieces can be ordered; About moves to the top right, as on a laptop.) */
@media (max-width: 760px) {
  .wrap { position: relative; }
  header.head-home, .head-home .right, .head-home .side { display: contents; }
  .head-home .left { order: -5; }
  .head-home .nav { order: -4; position: absolute; top: 24px; right: 0; padding-top: 0; }
  .head-home .faq { order: -3; }
  .bar { order: -2; }
  .head-home .find { order: -1; }
}

/* Tap targets (critique, 18 Nov): about 32-40px on a laptop, at least 44px on phones and touch screens */
@media (max-width: 760px), (pointer: coarse) {
  .faq ul { gap: 0; }
  .faq a { padding: 13px 0; }
  .faq summary { padding: 14px 0; }
  .try { margin-top: 0; }
  .try button { padding: 15px 6px; }
  .head .nav a { padding: 13px 8px; }
  .modes button { padding: 13px 20px; }
  .lens { padding: 13px 18px 13px 14px; }
  .qx { width: 40px; height: 40px; right: 2px; }
  .panel .x { width: 44px; height: 44px; }
  .panel .tags button { padding: 11px 16px; }
  .panel .tags .extra { padding: 8px 14px; }
  .panel .near button { padding: 14px 0; }
  .back { padding: 14px 12px 14px 0; }
}
@media (max-width: 760px) { .head-home .nav { top: 10px; right: -8px; } }
