/* look and timings taken from the app's prototype (tag prototype-23) */
:root {
  --bg: #f2f1ee; --ink: #1c1c1e; --muted: #5b5b60; --panel: #fff; --ring: #1c1c1e;
  --chrome: rgba(255,255,255,.74); --chrome-border: rgba(0,0,0,.07);
  --shadow-far: 0 1px 2px rgba(0,0,0,.05);
  --shadow-near: 0 2px 6px rgba(0,0,0,.07), 0 8px 24px rgba(0,0,0,.06);
  --shadow-focus: 0 6px 18px rgba(0,0,0,.14), 0 18px 48px rgba(0,0,0,.12);
  --dur: .45s; --ease: cubic-bezier(.22,.8,.24,1);
  --l0: .80; --l1: .89; --l2: .94; --c0: .09; --c1: .06; --c2: .035;
  --edge: oklch(.8 .03 var(--h) / .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101012; --ink: #f5f5f7; --muted: #9a9aa0; --panel: #19191c; --ring: #fff;
    --chrome: rgba(30,30,32,.74); --chrome-border: rgba(255,255,255,.08);
    --shadow-far: 0 1px 2px rgba(0,0,0,.5);
    --shadow-near: 0 2px 8px rgba(0,0,0,.45), 0 10px 28px rgba(0,0,0,.35);
    --shadow-focus: 0 8px 24px rgba(0,0,0,.55), 0 20px 56px rgba(0,0,0,.45);
    --l0: .40; --l1: .32; --l2: .26; --c0: .07; --c1: .05; --c2: .035;
    --edge: transparent;
  }
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 0s !important; } .node.zoomed .page { animation: none !important; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap;
  max-width: 1400px; margin: 0 auto; padding: 56px 24px 32px; }
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 64px); letter-spacing: -.03em; line-height: 1; font-weight: 750; }
.claim { margin: 0; max-width: 380px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.claim b { color: var(--ink); font-weight: 600; }
.claim p { margin: 0; }

main { max-width: 1400px; margin: 0 auto; padding: 32px 24px 120px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#stage { position: relative; outline: none; transition: height var(--dur) var(--ease); overflow: hidden; }
#links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
#links path { fill: none; stroke-width: 2.4; stroke-linecap: round; opacity: .16; transition: opacity .25s; }
#links path.hl { opacity: 1; stroke-width: 3.2; }

.node { position: absolute; left: 0; top: 0; border-radius: 16px; overflow: hidden; cursor: pointer;
  background: oklch(var(--l) var(--c) var(--h)); color: var(--ink);
  box-shadow: var(--shadow-far); user-select: none; -webkit-user-select: none;
  transition: transform var(--dur) var(--ease), width var(--dur) var(--ease), height var(--dur) var(--ease),
    opacity var(--dur) var(--ease), box-shadow .2s, border-radius var(--dur) var(--ease); }
.node.d0 { --l: var(--l0); --c: var(--c0); box-shadow: var(--shadow-near); }
.node.d1 { --l: var(--l1); --c: var(--c1); }
.node.d2 { --l: var(--l2); --c: var(--c2); }
.node.d1, .node.d2 { box-shadow: var(--shadow-far), inset 0 0 0 1px var(--edge); }   /* the hairline a pale box needs */
.node:hover { filter: brightness(1.04); }
.node.path { box-shadow: var(--shadow-near); }
.node.cursor { box-shadow: inset 0 0 0 2.5px var(--ring), var(--shadow-focus); z-index: 1; }
.node.off { opacity: 0 !important; pointer-events: none; }
.node.faded { opacity: .28; }   /* the titles around an opened page stay legible */
.node .in { padding: 12px 16px; }
.node .title { font-weight: 600; }
.node.parent .in, .node.zoomed .in { position: absolute; left: 0; right: 0; top: 0; }   /* placed by placeLabels: in the part of the box that is in view */   /* placed by placeLabels: in the part of the box that is in view */
.node.r .in { text-align: right; }
.node .page, .node .zclose { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* closed: read by screen readers and search, not shown */
.node.zoomed .zclose { position: absolute; width: 32px; height: 32px; clip-path: none; top: 14px; right: 14px; z-index: 1; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.18); color: #fff; font: 600 18px/1 system-ui; cursor: pointer; }
.node.zoomed .zclose:hover { background: rgba(0,0,0,.3); }
.node.zoomed .title { margin-right: 40px; }

/* the Focus view in place: the item itself becomes the page */
@keyframes zin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.node.zoomed { cursor: default; border-radius: 22px; user-select: text; -webkit-user-select: text; z-index: 2; }
.node.zoomed:hover { filter: none; }
.node.zoomed .in { padding: 18px 22px 22px; text-align: left; }
.node.zoomed .title { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.node.zoomed .page { position: static; width: auto; height: auto; overflow: visible; clip-path: none; animation: zin .42s .12s both; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 8px; margin: 14px 0 0; }
.strip dt { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: color-mix(in srgb, currentColor 72%, transparent); }
.strip dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.body { margin-top: 14px; font-size: 15px; line-height: 1.55; max-width: 62ch; }
.body p { margin: 0 0 10px; }
.body a { font-weight: 600; }
#measure { position: absolute; visibility: hidden; left: -9999px; top: 0; }

/* the hint line: one bubble at the bottom, as in the app */
.chrome { position: fixed; background: var(--chrome); border: 1px solid var(--chrome-border); border-radius: 999px;
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); box-shadow: var(--shadow-near); }
#hint { z-index: 11; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: 14px; padding: 7px 10px 7px 16px;
  font-size: 12px; color: var(--muted); max-width: 94vw; text-align: center; line-height: 1.6; border-radius: 18px; }
#hint.bare { padding: 7px 10px; }
#hint .hk { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
#hint .hk:hover { color: var(--ink); }
#hint kbd { font: inherit; font-weight: 600; color: var(--ink); }
#bHelp { font: inherit; font-weight: 700; background: var(--chrome-border); border: 0; color: var(--ink); cursor: pointer;
  height: 20px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; margin-left: 10px; vertical-align: -1px; }
#hint.bare #bHelp { margin-left: 0; }
#modechip { top: 14px; left: 50%; transform: translateX(-50%); z-index: 12; padding: 5px 12px; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
#modechip[hidden] { display: none; }
#modechip kbd { font: inherit; color: var(--muted); font-weight: 500; margin-left: 6px; }
#modechip { cursor: pointer; }
@media (pointer: coarse) { #hint .hk, #bHelp { padding: 10px 6px; } #bHelp { height: auto; } }

.hero .lead { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.hero .lead b { color: var(--ink); font-weight: 600; }
noscript { display: block; max-width: 760px; margin: 0 auto; padding: 0 24px 40px; line-height: 1.5; }

/* nothing has happened yet: the hint line lights up, twice, so the keys are seen */
@keyframes nudge { 0%, 100% { transform: scale(1); box-shadow: var(--shadow-near); }
  35% { transform: scale(1.07); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 22%, transparent), var(--shadow-focus); } }
#hint.nudge { animation: nudge 1.3s var(--ease) 2; }
#hint.nudge kbd { text-decoration: underline 2px; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { #hint.nudge { animation: none; box-shadow: 0 0 0 3px var(--ring); } }

/* the track inside a box taller than the screen: where in the box you are */
.track { position: absolute; right: 7px; width: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 14%, transparent); pointer-events: none; }
.node.r .track { right: auto; left: 7px; }
.track[hidden] { display: none; }
.track i { position: absolute; left: 0; right: 0; border-radius: 2px; background: color-mix(in srgb, currentColor 55%, transparent); }

/* a connection's name: a soft fill from the colour of the left mind map to the right one's, the theme's writing on it (as in the app) */
#pills { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.lpill { pointer-events: auto; cursor: pointer; }
.lpill { position: absolute; translate: -50% -50%; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; color: var(--ink); white-space: nowrap;
  background: linear-gradient(90deg, color-mix(in srgb, var(--vl) 24%, var(--panel)), color-mix(in srgb, var(--vr) 24%, var(--panel)));
  border: 1.5px solid color-mix(in srgb, var(--ink) 38%, transparent); }
.lpill.sel { border-color: var(--ring); box-shadow: var(--shadow-near); }
#links path.sel { opacity: 1; stroke-width: 4; }
/* standing on a connection: the item and the ends of its connections stay whole, the chosen end is lit */
.node.dim { opacity: .3; }
.node.lit { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ring) 55%, transparent), var(--shadow-focus); filter: brightness(1.12); }

/* the number of an item's connections, at its inner edge: a click stands on them (the mouse's way into a hop) */
.lkb { position: absolute; top: 50%; translate: 0 -50%; right: 10px; z-index: 1; border: 0; border-radius: 999px; padding: 2px 8px;
  font: inherit; font-weight: 600; font-size: 11.5px; line-height: 1.4; color: inherit; background: color-mix(in srgb, currentColor 14%, transparent); cursor: pointer; opacity: .75; }
.node.r .lkb { right: auto; left: 10px; }
.lkb:hover { opacity: 1; background: color-mix(in srgb, currentColor 24%, transparent); }
.lkb { display: none; }                                        /* only on the box you stand on, or under the mouse: no clutter on every line */
.node.cursor:not(.zoomed) .lkb, body:not(.kbd) .node:not(.zoomed):hover .lkb { display: block; }
.node.cursor:has(.lkb):not(.zoomed) .in, .node:has(.lkb):not(.zoomed):hover .in { padding-right: 150px; }
.node.r.cursor:has(.lkb):not(.zoomed) .in, .node.r:has(.lkb):not(.zoomed):hover .in { padding-right: 16px; padding-left: 150px; }

/* the welcome speaks of keys to keyboards and of taps to touch screens */
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: inline; } .keys-only { display: none; } }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* the app's icon in the welcome */
.body img.logo { float: left; margin: 2px 16px 6px 0; border-radius: 16px; }

/* a phone: the Focus view over the screen, as the app has it: the box in the middle, what borders it around it */
#fv { display: none; position: fixed; inset: 0; z-index: 10; background: var(--bg); padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  grid-template-columns: 30px minmax(0, 1fr) 30px; grid-template-rows: 44px minmax(0, auto) 44px; gap: 8px; align-content: center;
  grid-template-areas: ". up ." "par card right" ". down ."; touch-action: pan-y; }
body.phonefocus #fv { display: grid; }
body.phonefocus { overflow: hidden; }
#fv .peek { font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink); border: 0; padding: 0 14px; border-radius: 14px; cursor: pointer; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; background: oklch(var(--l2) var(--c2) var(--h)); box-shadow: var(--shadow-near); text-align: left; }
#fv .up { grid-area: up; } #fv .down { grid-area: down; } #fv .fleft { grid-area: par; }
#fv .peek.fleft, #fv .peek.fside { writing-mode: vertical-rl; padding: 10px 0; text-align: center; }
#fv .peek.fleft { transform: rotate(180deg); }
#fv .fright { grid-area: right; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
#fv .fright .peek { flex: 1 1 0; min-height: 0; }
#fv .fcard { grid-area: card; position: relative; min-height: 220px; max-height: calc(100dvh - 130px); overflow-y: auto; overscroll-behavior: contain; border-radius: 22px; padding: 16px 18px 20px;
  background: oklch(var(--l1) var(--c1) var(--h)); box-shadow: inset 0 0 0 2.5px var(--ring), var(--shadow-focus); }
#fv .fcard h2 { margin: 0 34px 0 0; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; overflow-wrap: break-word; }
#fv .crumb { margin: 0 34px 6px 0; font-size: 12.5px; opacity: .75; }
#fv .zclose { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; clip-path: none; z-index: 1; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.18); color: inherit; font: 600 18px/1 system-ui; cursor: pointer; }
@keyframes fv-u { from { opacity: 0; transform: translateY(40px); } } @keyframes fv-d { from { opacity: 0; transform: translateY(-40px); } }
@keyframes fv-r { from { opacity: 0; transform: translateX(40px); } } @keyframes fv-l { from { opacity: 0; transform: translateX(-40px); } }
.from-u { animation: fv-u .28s var(--ease); } .from-d { animation: fv-d .28s var(--ease); } .from-r { animation: fv-r .28s var(--ease); } .from-l { animation: fv-l .28s var(--ease); }
@media (prefers-reduced-motion: reduce) { .fcard { animation: none !important; } }

/* the Context view: where an item comes from and where it leads, built from the lines */
.ctx { margin-top: 16px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); font-size: 14px; }
.ctx h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.ctx .where { margin: 0 0 8px; opacity: .7; }
.ctx ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ctx ul.thru { margin: 4px 0 4px 18px; opacity: .85; }
.ctx button { font: inherit; color: inherit; background: color-mix(in srgb, currentColor 9%, transparent); border: 0; border-radius: 10px; padding: 4px 10px; cursor: pointer; text-align: left; }
.ctx button:hover { background: color-mix(in srgb, currentColor 18%, transparent); }
.ctx b { font-weight: 600; opacity: .75; margin-right: 4px; }
.ctx small { display: block; margin: 2px 0 0 10px; opacity: .6; font-size: 12px; }

/* a phone: the grid through a window of two columns and a quarter */
body.phone main { padding: 0 12px 24px; }
body.phone #stage { overflow: hidden; touch-action: pan-y; }
body.phone #pills, body.phone .node .lkb { display: none !important; }
body.phone .node { user-select: none; -webkit-user-select: none; }
body.phone .node:not(.parent) .in { height: 100%; display: flex; align-items: center; padding: 8px 12px !important; }
body.phone .node.parent .in { padding: 8px 12px; }
body.phone .node .title { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
body.phone .node.sliver { opacity: .7; border-radius: 12px; }
body.phone .node.sliver .title { white-space: nowrap; font-size: 12.5px; }
body.phone .node.sliver.thin .title { visibility: hidden; }
/* a strip: the parent, written upright, as in the app's Focus view */
body.phone .node.upright { border-radius: 12px; }
body.phone .node.upright .in { padding: 0 !important; display: flex; justify-content: center; align-items: center; }
body.phone .node.upright .title { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 100%; font-size: 12.5px; line-height: 1.2; }
body.phone .node.end { --l: var(--l1); --c: var(--c1); box-shadow: var(--shadow-near); }
body.phone .node.end .title::before { content: attr(data-kind); display: block; font-size: 11px; font-weight: 500; opacity: .75; margin-bottom: 2px; }
#pmap { padding: 14px 12px 6px; }
#pmap header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
#pmap header img { border-radius: 9px; flex: none; }
#pmap header b { display: block; font-size: 16px; }
#pmap header small { display: block; font-size: 12px; line-height: 1.3; color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; min-height: 24px; font-size: 13px; color: var(--muted); }
.crumbs button { font: inherit; color: inherit; background: none; border: 0; padding: 3px 4px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
