
/* Layout: three columns on one sheet. A scarlet label band on the left carries the title bottom-to-top; the metro map fills the middle; a reading panel sits on the right. The map's structure comes from streams.json. */
:root{
  --scarlet:#a8211b; --scarlet-deep:#8e1e18;
  --paper:#fbfaf6; --paper-2:#f4f2ec; --rule:#e2dfd6;
  --ink:#2b2b2b; --ink-soft:#6e6e6a; --faint:#dedbd2;
  --c-philosophy:#7f97b1; --c-heritage:#9aaec4; --c-economics:#6c87a6; --c-technology:#b0c0d1;
  --c-writing:#8c8b86; --c-books:#76756f; --c-services:#a2a19b; --c-institute:#b8b7b1;
  --display:'Shippori Mincho','Hiragino Mincho ProN','Yu Mincho',Georgia,serif;
  --cjk:'Zen Antique',var(--display);
  --brush:'Yuji Syuku','Zen Antique',var(--display);
  --script:'Have Heart One','Nanum Brush Script',var(--display);
  --body:'Zen Kaku Gothic New','Hiragino Sans','Helvetica Neue',Arial,sans-serif;
  --band:76px; --panel:340px;
  color-scheme:light;
}
html,body{height:100%}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--body);overflow:hidden}
.sheet{position:fixed;inset:0;display:grid;grid-template-columns:var(--band) minmax(0,1fr) var(--panel);box-sizing:border-box;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
/* the label band */
.band{background:var(--scarlet);color:#fff;display:grid;grid-template-rows:auto 1fr auto;justify-items:center;align-items:center;padding:18px 0 14px;min-height:0;overflow:hidden;box-shadow:inset -1px 0 0 rgba(0,0,0,.12)}
.band .cjk{font-family:var(--cjk);font-size:24px;line-height:1.1;letter-spacing:.2em;writing-mode:vertical-rl;text-orientation:upright;margin-bottom:.2em}
.band .spine{writing-mode:vertical-rl;transform:rotate(180deg);display:flex;align-items:center;gap:14px;min-height:0}
.band .spine .t{font-family:var(--script);font-size:40px;line-height:1;white-space:nowrap;letter-spacing:.01em}
.band .spine .c{font-family:var(--display);font-size:12px;letter-spacing:.3em;text-transform:uppercase;opacity:.9;white-space:nowrap}
.band .mark{width:44px;height:44px}
.band .mark svg{display:block;width:44px;height:44px}
/* the map */
.map{min-width:0;min-height:0;position:relative;background:var(--paper) radial-gradient(ellipse 60% 45% at 10% 0%,rgba(43,74,111,.06),transparent 70%) no-repeat}
svg#metro{display:block;width:100%;height:100%}
.line{cursor:pointer;transition:opacity .3s}
.line .track{fill:none;stroke-linecap:round;stroke-linejoin:round;filter:url(#wash);opacity:.88;transition:stroke .3s}
.line .bleed{fill:none;stroke-linecap:round;stroke-linejoin:round;opacity:.13;filter:url(#bleed);transition:stroke .3s,opacity .3s}
.line .bar{filter:url(#wash);opacity:.9;transition:fill .3s}
.line text{font-family:var(--body)}
.line .name{font-size:17px;font-weight:500;fill:var(--ink);letter-spacing:.02em;transition:fill .3s}
.line .gloss{font-size:12px;fill:var(--ink-soft)}
.line .station-label{font-size:11.5px;fill:var(--ink-soft)}
.line circle.station{fill:var(--paper);stroke-width:2.2;transition:stroke .2s}
.line .cjk-title{font-family:var(--cjk);font-size:34px;fill:var(--c-line);transition:fill .3s}
.line.active .track,.line.active .bleed{stroke:var(--scarlet)}
.line.active .bleed{opacity:.2}
.line.active .bar,.line.active .cjk-title,.line.active .name{fill:var(--scarlet)}
.line.active circle.station{stroke:var(--scarlet)}
.line.active circle.station.hot{fill:var(--scarlet)}
svg.has-active .line:not(.active){opacity:.45}
.line:focus{outline:none} .line:focus-visible .track{stroke:var(--scarlet)}
.seal-g{cursor:pointer} .seal-g:focus{outline:none} .seal-g:focus-visible .face{stroke:var(--ink);stroke-width:2}
.seal-g .face{fill:var(--scarlet)} .seal-g:hover .face{fill:var(--scarlet-deep)}
.seal-glyph{font-family:var(--cjk);font-size:118px;fill:#fff;text-anchor:middle;dominant-baseline:central;pointer-events:none;display:none}
svg.seal-glyph .seal-glyph{display:block}
.hand-set{display:none} svg.seal-hand .hand-set{display:block}
svg:not(.seal-geo) .stroke-set,svg:not(.seal-geo) .lk-overlay{display:none}
.stroke-set path{stroke:#fff;stroke-width:13;stroke-linecap:round;fill:none}
.lk-overlay{opacity:0;transition:opacity .35s;pointer-events:none}
.lk-overlay path{fill:none;stroke-linecap:round}
.lk-overlay text{font-family:var(--display);font-size:20px;font-weight:600}
svg.lk-on .lk-overlay{opacity:1}
.epigraph{font-family:var(--brush);fill:var(--ink-soft);opacity:.85}
.motif{pointer-events:none}
#world{transition:transform 1.1s cubic-bezier(.65,0,.25,1)}
.line.faded{opacity:.05 !important;pointer-events:none}
.line.opened .bar,.line.opened .cjk-title{opacity:0}
.ext{fill:none;stroke:var(--scarlet);stroke-linecap:round;filter:url(#wash)}
.cross{fill:none;stroke:#9aaec4;stroke-linecap:round;filter:url(#wash)}
.junction{opacity:0;transition:opacity .4s}
.junction circle{fill:var(--paper);stroke:var(--scarlet);stroke-width:4}
.junction text{font-family:var(--cjk);font-size:30px;fill:var(--scarlet)}
.junction.show{opacity:1}
.sub{opacity:0;transition:opacity .5s;cursor:pointer}
.sub.show{opacity:1}
.sub circle{fill:var(--paper);stroke:#6c87a6;stroke-width:3.5;transition:stroke .2s,fill .2s}
.sub:hover circle,.sub.hot circle,.sub:focus-visible circle{stroke:var(--scarlet)}
.sub .t{font:500 18px var(--body);fill:var(--ink)}
.sub.hot .t{fill:var(--scarlet)}
.sub .s{font:13px var(--body);fill:var(--ink-soft)}
.sub:focus{outline:none}
.land{opacity:0;transition:opacity 1.4s;pointer-events:none}
.land.show{opacity:1}
.epigraph{transition:opacity .8s} svg.travelling .epigraph{opacity:.12}
.line .station{cursor:pointer}
.line circle.station.hot{fill:var(--scarlet);stroke:var(--scarlet)}
.callout .leader{stroke:var(--scarlet);stroke-width:1.2}
.callout .npaper{fill:rgba(251,250,246,.96);stroke:var(--scarlet);stroke-width:1.4}
.note{font-family:var(--display);color:var(--ink);padding:12px 30px 11px 14px;box-sizing:border-box;width:100%}
.note .nn{font-family:var(--body);font-weight:500;font-size:15px;line-height:1.3;margin-bottom:4px}
.note .nd{font-size:13.5px;line-height:1.5;color:var(--ink-soft)}
.note .nu{display:inline-block;margin-top:6px;font-family:var(--body);font-size:12.5px;color:var(--scarlet);text-decoration:none;border-bottom:1px solid rgba(168,33,27,.35)}
.nclose{cursor:pointer} .nclose circle{fill:var(--paper);stroke:var(--faint);stroke-width:1} .nclose path{stroke:var(--ink-soft);stroke-width:1.4;fill:none}
.nclose:hover circle{stroke:var(--scarlet)} .nclose:focus{outline:none} .nclose:focus-visible circle{stroke:var(--scarlet)}
.panel ol li{cursor:pointer}
.panel ol li.picked > .n{color:var(--scarlet)}
.panel ol li.picked::before{background:var(--scarlet);border-color:var(--scarlet)}
/* the reading panel */
.panel{background:var(--paper-2);border-left:1px solid var(--rule);min-height:0;overflow:auto;padding:26px 26px 30px;box-sizing:border-box;font-family:var(--display)}
.panel .eyebrow{font-family:var(--body);font-size:11px;letter-spacing:.2em;text-transform:uppercase;color:var(--scarlet);margin:0 0 8px}
.panel h2{font-weight:500;font-size:23px;line-height:1.25;margin:0 0 10px}
.panel h2 .glyph{font-family:var(--cjk);color:var(--scarlet);margin-right:.35em}
.panel p{margin:0 0 10px;font-size:15.5px;line-height:1.6}
.panel p.muted{color:var(--ink-soft);font-size:14px}
.panel .gloss{font-style:italic;color:var(--ink-soft);margin:-4px 0 12px}
.panel h3{font-family:var(--body);font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--ink-soft);margin:18px 0 8px;font-weight:700}
.panel ol{list-style:none;margin:0;padding:0;border-left:3px solid var(--lc,var(--faint));margin-left:6px}
.panel ol li{position:relative;padding:4px 0 6px 18px}
.panel ol li::before{content:"";position:absolute;left:-8px;top:12px;width:9px;height:9px;border-radius:50%;background:var(--paper);border:2.2px solid var(--lc,var(--faint));box-sizing:border-box}
.panel ol li.hot::before{background:var(--scarlet);border-color:var(--scarlet)}
.panel ol li .n{font-family:var(--body);font-weight:500;font-size:15px}
.panel ol li .n a{color:var(--scarlet);text-decoration:none;border-bottom:1px solid rgba(168,33,27,.35)}
.panel ol li .n a:hover{border-bottom-color:var(--scarlet)}
.panel ol li .d{font-size:14px;line-height:1.5;color:var(--ink-soft);margin-top:2px}
.panel ol ol{margin:6px 0 0 2px;border-left-color:var(--faint)}
.panel ol ol li{padding:3px 0 4px 16px}
.panel ol ol li::before{width:7px;height:7px;top:11px;left:-7px}
.panel .links{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:14px;font-family:var(--body);font-size:13.5px}
.panel .links a{color:var(--scarlet);text-decoration:none;border-bottom:1px solid rgba(168,33,27,.35)}
.panel .legend{margin-top:22px;padding-top:14px;border-top:1px solid var(--rule)}
.panel .legend .sw{display:inline-block;width:22px;height:5px;border-radius:3px;vertical-align:middle;margin-right:8px}
.panel .foot{font-family:var(--body);font-size:11.5px;color:var(--ink-soft);margin-top:26px;letter-spacing:.04em}
.panel .foot code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:11px;background:var(--paper);border:1px solid var(--rule);padding:1px 5px;border-radius:3px}
.panel .pin{display:inline-block;font-family:var(--body);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--paper);background:var(--scarlet);padding:2px 8px;border-radius:999px;margin-left:8px;vertical-align:middle}
@media (prefers-reduced-motion:reduce){.line,.line *,.lk-overlay,#world,.land,.sub,.junction{transition:none}}
/* narrow screens: the band turns into a top bar and the panel lists every line */
@media (max-width:900px){
  body{overflow:auto}
  .sheet{position:static;display:block;height:auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  .band{display:flex;flex-direction:row;align-items:center;gap:14px;padding:12px 16px;margin:12px 0 0;border-radius:3px}
  .band .cjk{writing-mode:horizontal-tb;font-size:18px;margin:0}
  .band .spine{writing-mode:horizontal-tb;transform:none;flex-direction:column;align-items:flex-start;gap:2px;flex:1;min-width:0}
  .band .spine .t{font-size:28px;white-space:normal}
  .band .mark{width:36px;height:36px} .band .mark svg{width:36px;height:36px}
  .map{display:none}
  .panel{border-left:0;padding:18px 0 40px;background:transparent}
  .panel .all .card{border:1px solid var(--rule);border-left:5px solid var(--lc);border-radius:3px;background:#fff;padding:12px 14px;margin:0 0 12px}
  .panel .all h2{font-size:19px;margin-bottom:4px}
}


/* on wide screens the home list in the panel is hidden; it is the phone fallback */
@media (min-width:901px){ .panel .all{display:none} }
