/* Strandline: the public pages (public page v1, 30 Nov; built 1 Dec). Phone first, night first.
   Colours, type and spacing are the design thread's tokens.css. IBM Plex is self-hosted. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400 600; font-display: swap; src: url("fonts/plex-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/plex-mono-500-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/plex-serif-italic-latin.woff2") format("woff2"); }

:root {
  /* ground and surfaces */
  --sl-bg: #10131c;
  --sl-surface: #191d29;
  --sl-surface-line: #262b3b;
  --sl-rule: #232838;
  --sl-track: #2a3042;
  /* text */
  --sl-text: #ebe6da;
  --sl-text-his: #f1ecdf;
  --sl-text-soft: #d4d0c5;
  --sl-text-muted: #a9abb6;
  --sl-text-faint: #8b8e9b;
  /* accents */
  --sl-mustard: #d6ae52;
  --sl-mustard-hover: #e8c674;
  --sl-cat-red: #c4513b;
  --sl-live: #7fc79a;
  --sl-habit: #6f7690;
  --sl-carried: #3b4156;
  /* type */
  --sl-sans: "IBM Plex Sans", system-ui, sans-serif;
  --sl-mono: "IBM Plex Mono", ui-monospace, monospace;
  --sl-serif: "IBM Plex Serif", Georgia, serif;
  --sl-size-status: 22px;
  --sl-size-thought: 18px;
  --sl-size-body: 15px;
  --sl-size-small: 13px;
  /* shape and space */
  --sl-radius-card: 12px;
  --sl-radius-button: 12px;
  --sl-gutter: 16px;
  --sl-touch: 44px;
  --sl-max-width: 1200px;
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { background: var(--sl-bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sl-bg); color: var(--sl-text); font: 400 var(--sl-size-body)/1.5 var(--sl-sans);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
a { color: var(--sl-mustard); }
a:hover { color: var(--sl-mustard-hover); }
h1 { margin: 6px 0 0; font-size: 28px; line-height: 1.2; font-weight: 600; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
p { margin: 12px 0 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
.wrap { padding-left: var(--sl-gutter); padding-right: var(--sl-gutter); max-width: var(--sl-max-width); margin-left: auto; margin-right: auto; }
.narrow { max-width: 720px; }
.label { font: 500 11px/1.3 var(--sl-mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--sl-mustard); margin: 0; }
.mono { font-family: var(--sl-mono); }
.gold { color: var(--sl-mustard); }
.muted { color: var(--sl-text-muted); }
.soft { color: var(--sl-text-soft); }
.small { font-size: var(--sl-size-small); }
.his { font-family: var(--sl-serif); font-style: italic; color: var(--sl-text-his); }
.card { background: var(--sl-surface); border: 1px solid var(--sl-surface-line); border-radius: var(--sl-radius-card); padding: 16px; }
.rule { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sl-rule); }
.rule-top { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--sl-rule); }
.head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
ul.plain { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.4; }
.credit { font-size: 12px; line-height: 1.5; color: var(--sl-text-faint); }
.credit a { color: var(--sl-text-muted); }
.dot, .pill i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sl-live); margin-right: 6px; vertical-align: middle; }

/* buttons: real buttons and links, 44 px targets */
.icon-btn { width: var(--sl-touch); height: var(--sl-touch); display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--sl-text); border-radius: 8px; cursor: pointer; padding: 0; }
.icon-btn.glass { width: 40px; height: 40px; background: rgba(16,19,28,.78); }
.btn { min-height: 40px; padding: 0 14px; border-radius: 8px; font: 500 12px/1 var(--sl-mono); letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.outline { border: 1px solid var(--sl-mustard); background: rgba(16,19,28,.82); color: var(--sl-mustard); }
.btn.fill { border: 0; background: var(--sl-mustard); color: var(--sl-bg); }
.btn.fill:hover { background: var(--sl-mustard-hover); color: var(--sl-bg); }
.big-btn { display: flex; height: 50px; margin-top: 24px; border-radius: var(--sl-radius-button); font: 600 16px/1 var(--sl-sans);
  letter-spacing: 0; text-transform: none; }

/* header */
.top { height: 52px; padding: 0 var(--sl-gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--sl-rule); position: sticky; top: 0; z-index: 20; background: var(--sl-bg);
  padding-top: env(safe-area-inset-top, 0px); height: calc(52px + env(safe-area-inset-top, 0px)); }
.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark { font-size: 18px; font-weight: 600; letter-spacing: .2px; color: var(--sl-text); text-decoration: none; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; text-decoration: none; min-height: var(--sl-touch); white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 12px; }
.clock { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--sl-mono); color: #b4b6c0; white-space: nowrap; }
.clock svg { color: var(--sl-mustard); }
.clock .sun, .clock.day .moon { display: none; }
.clock.day .sun { display: inline; }
.menu-btn { margin-right: -10px; }
.top-nav { display: none; }
.page-about .clock, .page-how .clock, .page-list .clock, .page-works .clock, .page-work .clock { display: none; }

/* the menu: full screen on phones */
.menu { position: fixed; inset: 0; z-index: 50; background: var(--sl-bg); overflow-y: auto; padding-bottom: 32px; }
.menu .top { position: static; }
.menu-list { padding: 8px var(--sl-gutter) 0; max-width: 720px; }
.menu-list .label { margin-top: 18px; }
.menu-list a { display: flex; align-items: center; min-height: 52px; padding: 6px 0; border-bottom: 1px solid #1f2433; color: var(--sl-text); text-decoration: none; }
.menu-list b { display: block; font-size: 17px; font-weight: 400; }
.menu-list small { display: block; font-size: 12px; color: var(--sl-text-faint); }

/* front page */
.oneliner { margin: 0; padding-top: 12px; padding-bottom: 12px; font-size: 14px; line-height: 1.45; color: #c9c6bd; }
.oneliner a { white-space: nowrap; font-weight: 500; }
.oneliner a.first-visit { background: rgba(214,174,82,.16); border-radius: 6px; padding: 2px 6px; }
.stage { position: relative; border-radius: var(--sl-radius-card); overflow: hidden; aspect-ratio: 604 / 421; background: #1a1e2a; }
.view3d, .map { position: absolute; inset: 0; width: 100%; height: 100%; }
#view3d.view3d { --falu: var(--sl-cat-red); }   /* his tag's colour, from the page (the 3D css stays the 3D thread's) */
.pill { position: absolute; top: 10px; left: 10px; z-index: 3; display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 99px;
  background: rgba(16,19,28,.78); font: 500 11px var(--sl-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--sl-text); }
.stage-tools { position: absolute; top: 6px; right: 6px; z-index: 4; display: flex; gap: 2px; }
.popover { position: absolute; top: 50px; right: 6px; z-index: 6; background: var(--sl-surface); border: 1px solid var(--sl-surface-line);
  border-radius: 10px; padding: 6px 12px; display: flex; flex-direction: column; font-size: 14px; }
.popover label { display: flex; align-items: center; gap: 10px; min-height: var(--sl-touch); cursor: pointer; }
.popover input { width: 18px; height: 18px; accent-color: var(--sl-mustard); }
.fps { position: absolute; top: 44px; left: 10px; z-index: 3; font: 12px var(--sl-mono); background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 4px; }
.stage-buttons { position: absolute; right: 10px; bottom: 10px; z-index: 4; display: flex; gap: 8px; }
.here { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 4; }
.card3d { position: absolute; left: 10px; top: 52px; z-index: 5; max-width: min(300px, calc(100% - 20px)); background: rgba(25,29,41,.94);
  border: 1px solid var(--sl-surface-line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.card3d h3 { margin: 0 34px 4px 0; font-size: 15px; }
.card3d p { margin: 3px 0; color: var(--sl-text-soft); font-size: 13px; }
.card3d .open { display: inline-block; margin-top: 6px; }
#card3d-close { position: absolute; top: 0; right: 0; font-size: 20px; }
.map { background: #151a26; }
.map .place rect { fill: #262b3b; stroke: #3b4156; stroke-width: .3; }
.map .place text { fill: var(--sl-text); font-size: 2.4px; text-anchor: middle; font-family: var(--sl-sans); }
.map .place.closed rect { fill: #1b1f2b; }
.map .place.closed text { fill: var(--sl-text-faint); }
.map .place { cursor: pointer; }
.map .him { fill: var(--sl-cat-red); stroke: #fff4d6; stroke-width: .35; transition: cx 1.5s, cy 1.5s; }
.map .him-tag { fill: #fff; font-size: 2.2px; font-weight: 600; text-anchor: middle; font-family: var(--sl-sans); }
.map .him-tag-bg { fill: var(--sl-cat-red); }
.map .neighbour { fill: var(--sl-habit); }
.map .neighbour-name { fill: var(--sl-text-muted); font-size: 1.8px; font-family: var(--sl-sans); }
.note3d { margin: 6px 0 0; font-size: 13px; color: var(--sl-text-muted); }
.now { padding-top: 14px; }
.status { margin-top: 4px; font-size: var(--sl-size-status); font-weight: 500; line-height: 1.25; }
.why { margin-top: 4px; font-size: 14px; line-height: 1.4; color: var(--sl-text-muted); }
.conditions { margin-top: 6px; font: 12px var(--sl-mono); color: var(--sl-text-faint); }
.thought .label span { margin-left: .4em; }
.thought .his { margin: 8px 0 0; font-size: var(--sl-size-thought); line-height: 1.42; }
.goal { margin-top: 14px; padding: 12px 14px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; font-weight: 500; }
.goal-head .mono { font-size: 13px; white-space: nowrap; }
.progress { margin-top: 10px; height: 10px; border-radius: 99px; background: var(--sl-track); overflow: hidden; }
.progress div { height: 100%; border-radius: 99px; background: var(--sl-mustard); width: 0; transition: width .6s; }
.goal .muted { margin-top: 8px; }
.how-sentence { margin-top: 6px; font-size: 18px; line-height: 1.35; }
.scales { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.scale .top-row { display: flex; justify-content: space-between; font-size: 13px; }
.scale .top-row span:last-child { color: var(--sl-text-muted); }
.scale .track { margin-top: 6px; position: relative; height: 6px; border-radius: 99px; background: var(--sl-track); }
.scale .track i { position: absolute; top: -3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--sl-mustard); transition: left .6s; }
.scale .ends { margin-top: 3px; display: flex; justify-content: space-between; font-size: 11px; color: var(--sl-text-faint); }
.outings { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.outings li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; }
.outings .when { font: 12px var(--sl-mono); color: var(--sl-text-faint); padding-top: 2px; }
.outings b { display: block; font-size: 15px; font-weight: 500; }
.outings p { margin: 0; font-size: 14px; line-height: 1.45; color: #c9c6bd; }
.letter { margin-top: 24px; }
.foot { margin-top: 28px; padding-top: 18px; padding-bottom: 32px; border-top: 1px solid var(--sl-rule); display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.foot .credit { margin-top: 6px; }

/* full screen: the real API where there is one, the stage over the whole page on iPhones */
.stage.full { position: fixed; inset: 0; z-index: 40; border-radius: 0; aspect-ratio: auto; }
body.has-full { overflow: hidden; }

/* clean recording mode (?clean=1): only the island, his tag, and a small mark */
.clean-mark, .clean-caption { display: none; }
body.clean { overflow: hidden; }
body.clean .top, body.clean .oneliner, body.clean .side-col, body.clean .front-below, body.clean .foot, body.clean .note3d,
body.clean .pill, body.clean .stage-tools, body.clean .stage-buttons, body.clean .card3d, body.clean .here, body.clean .popover, body.clean .fps { display: none !important; }
body.clean .front-top { padding: 0; max-width: none; }
body.clean .stage { position: fixed; inset: 0; border-radius: 0; aspect-ratio: auto; }
body.clean .view3d { pointer-events: none; }
body.clean .clean-mark { display: block; position: absolute; top: calc(18px + env(safe-area-inset-top, 0px)); left: 18px; z-index: 3;
  font-size: 15px; color: rgba(235,230,218,.9); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
body.clean .clean-mark b { font-weight: 600; letter-spacing: .3px; margin-right: 10px; }
body.clean .clean-mark span { font: 12px var(--sl-mono); }
body.clean.no-mark .clean-mark { display: none; }
body.clean.caption .clean-caption { display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 48px 24px 0; height: 32%; background: linear-gradient(to top, rgba(10,12,18,.85) 55%, rgba(10,12,18,0));
  font-size: 22px; font-weight: 500; line-height: 1.3; color: var(--sl-text); }
/* kept clear of the bottom 15%, where Instagram and TikTok put their buttons */
body.clean.caption .clean-caption::after { content: ""; display: block; height: 15vh; }

/* intro, how, works, lists */
.picture { margin-top: 16px; aspect-ratio: 604 / 421; border-radius: var(--sl-radius-card); background: #1a1e2a center / cover no-repeat; }
.intro { padding-top: 20px; }
.intro p { font-size: 16px; line-height: 1.55; color: var(--sl-text-soft); }
.narrow > section { margin-top: 26px; }
.narrow > section.intro { margin-top: 0; }
.narrow section > p { font-size: 15px; line-height: 1.55; color: var(--sl-text-soft); }
.points { display: flex; flex-direction: column; gap: 14px; }
.point { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.point svg { color: var(--sl-mustard); }
.point b { font-size: 15px; font-weight: 500; }
.point p { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--sl-text-muted); }
.card h2 { font-size: 17px; }
.card ul { margin: 10px 0 0; padding-left: 18px; font-size: 15px; line-height: 1.6; color: var(--sl-text-soft); }
.steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.steps .num { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--sl-mustard); color: var(--sl-mustard);
  font: 13px var(--sl-mono); display: flex; align-items: center; justify-content: center; }
.steps b { font-size: 15px; font-weight: 500; }
.steps .tag { font: 10px var(--sl-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--sl-text-faint); margin-left: 4px; }
.steps p { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--sl-text-muted); }
.moves { margin-top: 8px; display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--sl-track); }
.moves div { width: 0; transition: width .6s; }
.m-mind { background: var(--sl-mustard); }
.m-habit { background: var(--sl-habit); }
.m-carried { background: var(--sl-carried); }
.legend { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend div { display: flex; justify-content: space-between; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; }
.legend .m-carried { border: 1px solid var(--sl-habit); }
.models { margin: 10px 0 0; }
.models .row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1f2433; font-size: 14px; }
.models dt { color: var(--sl-text-soft); }
.models dd { margin: 0; font: 12px var(--sl-mono); text-align: right; }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 12px; }
.work-tile { display: block; text-decoration: none; color: var(--sl-text); }
.work-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--sl-surface); }
.work-tile.tune .art { aspect-ratio: 4 / 3; border-radius: 8px; background: var(--sl-surface); border: 1px solid var(--sl-surface-line);
  display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--sl-mustard); }
.work-tile b { display: block; margin-top: 6px; font-size: 14px; font-weight: 500; }
.work-tile small { color: var(--sl-text-faint); font-size: 12px; }
#works > .label { margin-top: 26px; }
.work-page .work-media { margin-top: 12px; }
.work-img { display: block; width: 100%; border-radius: var(--sl-radius-card); }
.play.big { min-height: 56px; padding: 0 24px; border-radius: var(--sl-radius-button); border: 0; background: var(--sl-mustard); color: var(--sl-bg);
  font: 600 17px/1 var(--sl-sans); cursor: pointer; }
.work-page .his { font-size: 18px; }
.work-page .label { margin-top: 20px; }
.work-page .soft { margin-top: 4px; }
.item { padding: 14px 0; border-bottom: 1px solid var(--sl-rule); }
.item .meta { font-size: 12px; color: var(--sl-text-faint); font-family: var(--sl-mono); }
.item p { margin: 6px 0 0; }
.diary p { font-family: var(--sl-serif); font-style: italic; color: var(--sl-text-his); font-size: 17px; line-height: 1.55; white-space: pre-line; }
.list-label { margin-top: 24px !important; }
.spark { width: 100%; height: 26px; margin-top: 6px; display: block; }
.note { font-size: 14px; color: var(--sl-text-soft); }
.note s { color: var(--sl-text-faint); }
.more { margin-top: 8px; min-height: 40px; background: transparent; border: 1px solid var(--sl-surface-line); border-radius: 8px; padding: 0 12px; color: var(--sl-mustard); cursor: pointer; }
.line b { color: var(--sl-text); font-weight: 500; }
.wordless { color: var(--sl-text-muted); font-style: italic; }
.err { color: #e09a8a; }

/* desktop: the same order with more room (public page v1, J) */
@media (min-width: 900px) {
  :root { --sl-gutter: 32px; --sl-size-status: 24px; --sl-size-thought: 19px; }
  .wordmark { font-size: 20px; }
  .top-nav { display: flex; gap: 18px; font-size: 14px; }
  .top-nav a { color: var(--sl-text-soft); text-decoration: none; }
  .top-nav a:hover { color: var(--sl-mustard); }
  .menu-btn { display: none; }
  .page-about .clock, .page-how .clock, .page-list .clock, .page-works .clock, .page-work .clock { display: inline-flex; }
  .front-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 32px; align-items: start; }
  .now { padding-top: 0; }
  .front-below { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 32px; align-items: start; }
  .front-below .letter { margin-top: 24px; }
}
@media (max-width: 899px) {
  #view-btn { display: none; }   /* phones reach the map from the menu */
}
@media (max-width: 420px) {
  .page-front .clock { font-size: 11px; }
}
@media (max-width: 899px) {
  .stage.is-map #view-btn { display: inline-flex; }   /* on the map, the way back to 3D */
}
.stage.is-map #find3d, .stage.is-map #walk-btn, .stage.is-map #flyup3d, .stage.is-map .stage-tools { display: none; }
