/* The explorer: a dark body against an orange to yellow sky, with ink in one dark red-brown.
   Type: Doto for the numerals of the wheel only. Geist for the text that you read. Geist Mono for small labels and values.
   Sections are cards (a light tint on the sky). Inside a card, a chip (a dark tint) holds an icon. There are no rules between sections.
   Layout modes (set by explorer.js on <body data-mode>):
   wide  = text left, model, ruler, cards right     mid = text left, model, ruler     phone = model above the text */
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Doto"; src: url("fonts/doto.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --t1: #2c0a02; --t2: #63240a;                          /* ink, and ink for the second level */
  --rgb-text: 44, 10, 2; --rgb-line: 84, 26, 6;          /* the same as numbers, for rgba() and for the ruler */
  --card: rgba(255, 244, 216, .36); --chip: rgba(116, 30, 4, .13);
  --mark: #fffbe2;                                       /* the index of the wheel, and text on ink */
  --disc: rgba(122, 30, 4, .2); --panel: #ffbf69; --tile: rgba(255, 249, 232, .55); --veil: rgba(96, 26, 4, .5);
  --f-text: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-num: "Doto", "Geist Mono", ui-monospace, monospace;
  --pad: max(28px, 5.4vw);
  --wheel-h: 212px;          /* explorer.js sets these, and --copy-bottom and --side-bottom: each column ends a little above the rim of the wheel */
  --copy-top: 50vh;
  --head: 27px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: linear-gradient(to top right, #fe411f 0%, #fd8a2f 30%, #fea53d 58%, #fecc62 100%); color: var(--t1); font: 400 15px/1.5 var(--f-text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--t1); outline-offset: 3px; }
::selection { background: rgba(255, 251, 226, .7); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#c { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; cursor: grab; touch-action: none; }
#c:active { cursor: grabbing; }
#ruler { position: fixed; left: 0; top: 0; pointer-events: none; }

/* top bar: the name on the left, the menu on the right */
#top { position: fixed; left: var(--pad); right: var(--pad); top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; pointer-events: none; }
#brand { display: flex; align-items: center; gap: 14px; pointer-events: auto; }
/* the logo file is white: it is the mask of a block of ink */
#logo { display: block; width: 96px; height: 26px; background: var(--t1); -webkit-mask: url("datalabs-logo-white.svg") center / contain no-repeat; mask: url("datalabs-logo-white.svg") center / contain no-repeat; }
#top h1 { font: 500 13px/1.2 var(--f-label); padding: 5px 0 5px 14px; border-left: 1px solid rgba(var(--rgb-line), .3); }
#menu { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); pointer-events: auto; font: 500 12.5px/1 var(--f-label); }
#menu button { height: 32px; padding: 0 14px; border-radius: 999px; white-space: nowrap; transition: background-color .15s; }
#menu button:hover { background: var(--chip); }
#menu .short, #menu .tiny { display: none; }
#spin { width: 32px; padding: 0 !important; display: grid; place-items: center; }
#spin svg { width: 20px; height: 20px; stroke-width: 1.7; opacity: .55; }
#spin[aria-pressed="true"], #spin[aria-pressed="true"]:hover { background: var(--t1); color: var(--mark); }
#spin[aria-pressed="true"] svg { opacity: 1; }

/* cards */
.card { background: var(--card); border-radius: 18px; }
.card > h3 { font: 500 12px/1.3 var(--f-label); color: var(--t2); }

/* text of the week */
#copy { position: fixed; z-index: 1; left: var(--pad); top: clamp(76px, 11.5vh, 132px); bottom: var(--copy-bottom, calc(var(--wheel-h) + 6px)); width: clamp(290px, 27vw, 392px); display: flex; flex-direction: column; pointer-events: none; }
#copy > * { pointer-events: auto; }
#wk { display: flex; flex-direction: column; gap: 2px; }
#wk-n { font: 600 15px/1.3 var(--f-label); }
#wk-u { font: 400 11.5px/1.4 var(--f-label); color: var(--t2); }
#head { font: 500 var(--head)/1.17 var(--f-text); letter-spacing: -.022em; margin-top: .7em; text-wrap: pretty; }
#facts { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; font: 400 13px/1.4 var(--f-label); }
#size { font-weight: 500; white-space: pre-line; }          /* a size with two values (length, weight) has one line for each */
#tags { color: var(--t2); }
#copy.tighter #wk-u { display: none; }          /* no room for the line below the week */
#copy.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 44px), transparent); mask-image: linear-gradient(#000 calc(100% - 44px), transparent); }      /* the text scrolls, and there is more below */
/* the first text of a visit decodes from left to right. The part to come is in its place from the start, so the lines do not move. */
.fx-rest { opacity: 0; }
.fx-live { opacity: .5; }

/* the size in real life: one photo of an object that is about as long as the body. Each photo has the same box, on the tint of the card. */
#scale { --pw: 64px; --ph: 50px; margin-top: 16px; padding: 12px 22px 12px 16px; display: flex; align-items: center; gap: 16px; align-self: flex-start; max-width: 100%; }
#scale[hidden] { display: none; }
#scale .pic { flex: none; width: var(--pw); height: var(--ph); }
#scale img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(60, 16, 0, .3)); }
#scale figcaption { display: flex; flex-direction: column; min-width: 0; }
#scale .q { font: 400 12px/1.3 var(--f-label); color: var(--t2); }
#scale b { font: 600 17px/1.2 var(--f-text); letter-spacing: -.012em; margin-top: 4px; }
#copy.tightest #scale { --pw: 46px; --ph: 36px; padding: 9px 18px 9px 12px; gap: 12px; }
#side #scale { margin: 0; align-self: stretch; flex: none; }      /* in the right column: as wide as the cards above it */

#more-b { display: none; align-self: flex-start; margin-top: 14px; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--t1); color: var(--mark); font: 500 12.5px/1 var(--f-label); }

/* cards on the right: also at this age (one icon for each topic), this stage */
#side { position: fixed; z-index: 1; right: var(--pad); top: clamp(76px, 11.5vh, 132px); bottom: var(--side-bottom, calc(var(--wheel-h) + 10px)); width: clamp(300px, 24vw, 350px); display: flex; flex-direction: column; gap: 10px; }
#also-card[hidden] { display: none; }
#also-card { min-height: 0; display: flex; flex-direction: column; padding: 16px 16px 0; }
#also-card > h3 { margin-bottom: 14px; }
#also { overflow: hidden auto; scrollbar-width: none; min-height: 0; padding-bottom: 16px; outline: none; }
#also::-webkit-scrollbar { display: none; }
#also.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 56px), transparent); mask-image: linear-gradient(#000 calc(100% - 56px), transparent); }
.rows { display: flex; flex-direction: column; gap: 13px; }
.row { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.row .chip { width: 32px; height: 32px; border-radius: 10px; background: var(--chip); display: grid; place-items: center; }
.row svg { width: 20px; height: 20px; stroke-width: 1.6; }
.row b { display: block; font: 600 13.5px/1.3 var(--f-text); }
.row p { font-size: 13.5px; line-height: 1.4; }
#stage-card, .card.stage-card { flex: none; padding: 16px; }
#stage-card > h3, .card.stage-card > h3 { margin-bottom: 10px; }
.stage b { display: block; font: 600 16px/1.25 var(--f-text); letter-spacing: -.01em; }
.stage span { display: block; font: 400 12px/1.4 var(--f-label); color: var(--t2); margin-top: 1px; }
.stage p { font-size: 13.5px; line-height: 1.42; margin-top: 8px; }

/* the wheel */
#wheel { position: fixed; left: 0; right: 0; bottom: 0; height: var(--wheel-h); overflow: hidden; touch-action: none; cursor: ew-resize; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%); }
#dial { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#dial .disc { fill: var(--disc); stroke: rgba(var(--rgb-line), .42); stroke-width: 1; }
#dial .day { stroke: rgba(var(--rgb-line), .3); stroke-width: 1; }
#dial .week { stroke: rgba(var(--rgb-line), .6); stroke-width: 1; }
#dial .stop { stroke: var(--t1); stroke-width: 1.5; }
#dial .band { stroke: rgba(var(--rgb-line), .34); stroke-width: 1; }
#dial .index { fill: var(--mark); stroke: none; }
#dial .needle { stroke: var(--mark); stroke-width: 1.5; }
#nums > *, #bands > * { position: absolute; left: 0; top: 0; white-space: nowrap; line-height: 1; }
#nums > * { font-family: var(--f-num); font-weight: 900; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--t2); }
#nums button { color: var(--t1); cursor: pointer; padding: 6px 8px; margin: -6px -8px; }
#nums span { opacity: .34; }
#bands > * { font: 400 12px/1 var(--f-label); color: var(--t2); opacity: .75; transition: color .2s, opacity .2s; }
#bands > .on { color: var(--t1); opacity: 1; font-weight: 500; }

#load { position: fixed; transform: translate(-50%, -50%); font: 400 12.5px/1.3 var(--f-label); color: var(--t1); pointer-events: none; opacity: 0; transition: opacity .3s; }
#load.on { opacity: 1; }

/* loading screen: the sky with one large number. The explorer opens when all models and the steps between them are here. */
#boot { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: 96px var(--pad) 48px; pointer-events: none; transition: opacity .6s ease; }
#boot[hidden] { display: none; }
#boot .in { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 500px; }
#boot-n { font: 900 clamp(84px, 17vw, 148px)/.82 var(--f-num); letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--t1); }
#boot-n::after { content: "%"; font: 600 15px/1 var(--f-label); letter-spacing: 0; margin-left: 6px; color: var(--t2); vertical-align: top; position: relative; top: 14px; }
#boot-bar { width: min(300px, 64vw); height: 3px; border-radius: 2px; background: rgba(var(--rgb-line), .2); overflow: hidden; margin-top: 6px; }
#boot-bar::before { content: ""; display: block; height: 100%; background: var(--t1); transform-origin: left; transform: scaleX(var(--f, 0)); transition: transform .25s linear; }
#boot-cap { font: 500 12.5px/1.4 var(--f-label); color: var(--t1); min-height: 1.4em; }
#boot-weeks { max-width: min(500px, 100%); text-wrap: balance; }                                  /* one line on a wide screen, two lines of the same length on a phone */
#boot-weeks span { display: inline-block; margin: 2px 5.5px; font: 900 15px/1.2 var(--f-num); font-variant-numeric: tabular-nums; color: rgba(var(--rgb-text), .26); transition: color .3s; }
#boot-weeks span.on { color: var(--t1); }
#boot-note { font: 400 13px/1.45 var(--f-text); color: var(--t2); max-width: 30ch; }
#boot-again { pointer-events: auto; font: 500 12.5px/1 var(--f-label); height: 36px; padding: 0 18px; border-radius: 999px; background: var(--t1); color: var(--mark); }
#boot-again[hidden] { display: none; }
#boot.fail #boot-n, #boot.fail #boot-note { opacity: .45; }
body[data-boot="load"] :is(#copy, #side, #wheel, #ruler, #load) { opacity: 0; pointer-events: none; }
body[data-boot="open"] :is(#copy, #side, #wheel, #ruler) { transition: opacity .8s ease .2s; }
body[data-boot="open"] #boot { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #boot, #boot-bar::before, #boot-weeks span, body[data-boot="open"] :is(#copy, #side, #wheel, #ruler) { transition: none; } }

/* dialogs: a solid panel */
dialog { background: var(--panel); color: var(--t1); border: 0; border-radius: 24px; padding: 34px 38px 36px; width: min(700px, 92vw); max-height: 86vh; box-shadow: 0 30px 80px rgba(70, 16, 0, .34); }
dialog::backdrop { background: var(--veil); }
dialog h2 { font: 500 30px/1.12 var(--f-text); letter-spacing: -.025em; margin: 0 40px 16px 0; outline: none; }
dialog .x { position: sticky; top: -18px; z-index: 1; height: 0; display: flex; justify-content: flex-end; margin: 0 -20px 0 0; }
dialog .x button { width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; background: var(--tile); display: grid; place-items: center; transition: background-color .15s; }
dialog .x button:hover { background: var(--mark); }
dialog .x svg { width: 18px; height: 18px; }
.doc h3 { font: 500 12px/1.3 var(--f-label); color: var(--t2); margin: 30px 0 12px; }
.doc p, .doc li { font-size: 14.5px; line-height: 1.55; }
.doc ol, .doc ul { padding-left: 20px; } .doc li { margin: 4px 0; }
.doc .refs li { font-size: 13px; color: var(--t2); }

/* why we built this: one statement, the people it is for, and what to keep in mind */
#why h2 { font: 500 12px/1.3 var(--f-label); letter-spacing: 0; color: var(--t2); margin-bottom: 22px; }
#why .lead { font: 500 clamp(26px, 4.6vw, 38px)/1.08 var(--f-text); letter-spacing: -.032em; max-width: 13em; text-wrap: balance; }
#why .sub { font-size: 16px; line-height: 1.45; margin-top: 14px; max-width: 30em; }
.doc .tiles, .doc .notes { list-style: none; padding: 0; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.doc .tiles li { margin: 0; background: var(--tile); border-radius: 16px; padding: 16px 16px 18px; display: flex; flex-direction: column; }
.tiles svg { width: 28px; height: 28px; margin-bottom: 18px; }
.tiles b { font: 600 14.5px/1.25 var(--f-text); letter-spacing: -.005em; }
.tiles span { font-size: 13.5px; line-height: 1.4; margin-top: 4px; }
.notes { display: grid; gap: 12px; }
.doc .notes li { margin: 0; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; min-height: 32px; font-size: 13.5px; line-height: 1.42; }
.notes svg { width: 32px; height: 32px; padding: 6.5px; border-radius: 10px; background: var(--chip); }
.notes span { align-self: center; }
.doc .status { font: 400 12px/1.45 var(--f-label); color: var(--t2); margin-top: 22px; }

/* the sheet with the cards, for a window with no room for the cards on the right */
#more { margin: auto 0 0; width: 100%; max-width: none; max-height: 84vh; border-radius: 24px 24px 0 0; padding: 26px 16px calc(18px + env(safe-area-inset-bottom)); }
#more h2 { font-size: 20px; letter-spacing: -.015em; margin: 0 48px 18px 6px; }
#more .x { margin-right: -2px; top: -12px; } #more .x button { margin-top: -14px; }
#more-body { display: grid; gap: 10px; }
#more .card { background: var(--tile); padding: 16px; }
#more .card > h3 { margin-bottom: 14px; }

/* mid: no cards on the right. They open with the "More" button. */
body:not([data-mode="wide"]) #side { display: none; }
body:not([data-mode="wide"]) #more-b { display: block; }

/* phone: the model is above the text */
body[data-mode="phone"] { --pad: 16px; }
body[data-mode="phone"] #top { top: 12px; gap: 10px; }
body[data-mode="phone"] #top h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; }
body[data-mode="phone"] #logo { width: 78px; height: 21px; }
body[data-mode="phone"] #menu { font-size: clamp(10.5px, 3vw, 12px); padding: 3px; }          /* the menu and the logo share one line down to a width of 320 px */
body[data-mode="phone"] #menu button { height: 30px; padding: 0 clamp(6px, 2vw, 10px); }
body[data-mode="phone"] #spin { width: 30px; }
body[data-mode="phone"] #menu .long { display: none; } body[data-mode="phone"] #menu .short { display: inline; }
body[data-mode="phone"] #copy { left: var(--pad); right: var(--pad); width: auto; top: var(--copy-top); bottom: var(--wheel-h); overflow: hidden auto; scrollbar-width: none; }
body[data-mode="phone"] #copy::-webkit-scrollbar { display: none; }
body[data-mode="phone"] #wk-n { padding: 6px 150px 6px 0; }
body[data-mode="phone"] #head { margin-top: .5em; }
body[data-mode="phone"] #facts { margin-top: 10px; font-size: 12.5px; }
body[data-mode="phone"] #scale { --pw: 52px; --ph: 40px; margin: 12px 0 10px; padding: 10px 20px 10px 14px; gap: 14px; }
body[data-mode="phone"] #scale b { font-size: 15.5px; margin-top: 3px; }
body[data-mode="phone"] #more-b { position: absolute; right: 0; top: 0; margin: 0; height: 32px; padding: 0 13px; font-size: 12px; }
body[data-mode="phone"] #wheel { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%); }
body[data-mode="phone"] #bands > * { font-size: 11px; }
body[data-mode="phone"] dialog.doc { padding: 26px 22px 28px; border-radius: 22px; }
body[data-mode="phone"] dialog.doc .x { margin-right: -8px; }
body[data-mode="phone"] .tiles { grid-template-columns: 1fr; gap: 8px; }
body[data-mode="phone"] .doc .tiles li { display: grid; grid-template-columns: 28px 1fr; column-gap: 14px; padding: 14px 16px; align-items: start; }
body[data-mode="phone"] .tiles svg { grid-row: span 2; margin: 2px 0 0; }
body[data-mode="phone"] .tiles span { margin-top: 2px; }

@media (max-width: 389px) { body[data-mode="phone"] #logo { width: 72px; height: 19.5px; } }
@media (max-width: 345px) { body[data-mode="phone"] #why-b .full { display: none; } body[data-mode="phone"] #why-b .tiny { display: inline; } }

/* a low window, for example a phone on its side */
body[data-short] #wk-u, body[data-short] #tags { display: none; }
body[data-short] #copy { top: 68px; width: 42vw; overflow: hidden auto; scrollbar-width: none; }
body[data-short] #head { margin-top: .5em; }
body[data-short] #facts, body[data-short] #more-b { margin-top: 10px; }
body[data-short] #scale { display: none; }          /* no room for the photo of the object */

/* a narrow tablet: the logo stays, the name of the page is for screen readers only, so that the menu has room */
@media (min-width: 720px) and (max-width: 900px) { #top h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* phones: short text under a bigger model (review 17 Nov). The week, its headline in three lines at most, and the
   size card; "counted from…" and the length and stage lines are left out here (the More sheet has the week's details). */
body[data-mode="phone"] #wk-u, body[data-mode="phone"] #facts { display: none; }
body[data-mode="phone"] #head { margin-top: .35em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
body[data-mode="phone"] #scale { margin: 10px 0 8px; padding: 8px 16px 8px 12px; }
