/* The project's section inside the window (appWindow/projectPages.js): the project's page and the page drawn
   in answer, as wireframes in the project's own grey, and what is the app's on them: the region and its number, the
   note, the wait, the strip that leads back, the grip. Each is shown by the state its stage carries. */

.cam {
  --over: rgba(0, 0, 0, .1);
  --strong: color-mix(in srgb, var(--own-ink) 62%, var(--own-paper)); --mid: color-mix(in srgb, var(--own-ink) 24%, var(--own-paper)); --soft: color-mix(in srgb, var(--own-ink) 11%, var(--own-paper));
}
@media (prefers-color-scheme: dark) { .cam { --over: rgba(0, 0, 0, .4); } }

.proj { display: none; position: absolute; inset: 0; padding: 36px 96px 0; background: var(--own-paper); color: var(--own-ink); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
:is([data-state="project-1"], [data-state="project-2"], [data-state="project-sent"]) .proj.today,
:is([data-state="project-3"], [data-state="project-carried"], [data-state="project-moved"]) .proj.answer { display: block; }
.proj .ttl { font-size: 30px; line-height: 36px; font-weight: 650; }
.proj .lede { margin-top: 6px; line-height: 25px; color: var(--own-soft); }
.proj .cap { font-size: 15px; line-height: 1; font-weight: 600; color: var(--own-soft); }
.proj .num { font-size: 14px; line-height: 1; font-weight: 500; color: var(--own-soft); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.proj .bar { display: block; height: 10px; border-radius: 5px; background: var(--soft); }

/* ---- the figures ---- */
.charts { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.plot { margin-top: 14px; display: grid; grid-template-columns: 28px 1fr; column-gap: 9px; }
.plot .axis { height: 112px; margin-top: -7px; display: flex; flex-direction: column; justify-content: space-between; text-align: right; }
.plot .columns { height: 100px; display: flex; align-items: flex-end; justify-content: space-around; border-bottom: 1.5px solid var(--mid); background: linear-gradient(var(--soft) 1px, transparent 1px) 0 0 / 100% 33.2px; }
.plot .columns i { position: relative; width: 32px; border-radius: 5px 5px 0 0; background: var(--soft); }
.plot .columns i.on, .funnel i.on { background: var(--mid); }
.plot .columns .num { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); padding: 0 3px; background: var(--own-paper); font-weight: 650; font-style: normal; color: var(--own-ink); }
.plot .days { grid-column: 2; margin-top: 8px; display: flex; justify-content: space-around; }
.plot .days .num { width: 32px; text-align: center; }
.funnel { display: grid; gap: 14px; align-content: start; }
.funnel .cap { margin-bottom: 2px; }
.funnel > div { display: flex; align-items: center; gap: 11px; }
.funnel i { height: 24px; width: calc((100% - 54px) * var(--share)); border-radius: 5px; background: var(--soft); }

/* ---- the parts ---- */
.tiles { display: flex; align-items: center; margin-top: 32px; }
.tiles .link { flex: none; width: 36px; height: 1.5px; background: var(--mid); }
.tile { position: relative; box-sizing: border-box; flex: 1; height: 118px; padding: 15px; display: flex; flex-direction: column; gap: 11px; border: 1.5px solid var(--mid); border-radius: 11px; background: var(--own-paper); }
.tile .name { font-size: 17px; line-height: 1; font-weight: 600; }
.tile .sum { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.tile .blk { width: 66px; height: 19px; border-radius: 6px; background: var(--mid); }
.tile .head { display: flex; align-items: baseline; justify-content: space-between; }
.tail { margin-top: 36px; display: grid; gap: 13px; }

/* ---- the page's further sections, fainter, down to the window's edge ---- */
.more { margin-top: 36px; opacity: .58; }
.more section { border-top: 1px solid var(--own-line); padding: 24px 0 32px; display: grid; gap: 14px; }
.more .bar.title { background: var(--mid); margin-bottom: 4px; }
.more .two { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.more svg { display: block; width: 100%; height: 92px; fill: none; stroke: var(--strong); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.more svg path { vector-effect: non-scaling-stroke; }
.more .base { stroke: var(--mid); }
.more .ends { margin-top: 8px; display: flex; justify-content: space-between; }
.more .rows { display: grid; gap: 14px; align-content: start; }
.more .rows > div { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--soft); }
.more .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.more .stats > div { display: grid; gap: 13px; padding: 17px 18px; border: 1.5px solid var(--mid); border-radius: 11px; }
.more .stats b { font-size: 26px; line-height: 1; font-weight: 650; color: var(--strong); font-variant-numeric: tabular-nums lining-nums; }
.more .stats .tall { height: 150px; }

/* ---- the app's mark: a region, dashed, with the number on its top right corner ---- */
.region { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); overflow: visible; pointer-events: none; visibility: hidden; }
.region rect { width: 100%; height: 100%; fill: none; stroke: var(--mark); stroke-width: 1.5; stroke-dasharray: 4 3; }
.disc { position: absolute; right: -14px; top: -14px; box-sizing: border-box; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--mark); color: var(--under); font: 600 11px/1 var(--face-sans); letter-spacing: 0; visibility: hidden; }
.proj { --mark: var(--own-ink); --under: var(--own-paper); }
:is([data-state="project-2"], [data-state="project-sent"]) :is(.region, .disc) { visibility: visible; }

/* ---- the writer's hand: where it is on the page it wears the whisper ---- */
.cam .hand { position: absolute; left: 0; top: 0; z-index: 6; width: 26px; height: 26px; margin: -3px 0 0 -5px; fill: var(--whisper); stroke: var(--paper); stroke-width: 1; stroke-linejoin: round; visibility: hidden; }
:is([data-state="project-start"][data-moving=""], [data-state="project-1"]) .win > .hand { visibility: visible; }
.band { position: absolute; left: 0; top: 0; z-index: 5; box-sizing: border-box; border: 1px dashed var(--own-ink); visibility: hidden; }
[data-state="project-1"][data-moving="point"] .band { visibility: visible; }

/* ---- the note, beside its mark ---- */
.note { display: none; position: absolute; left: calc(100% + 13px); top: -5px; z-index: 4; width: 310px; padding: 4px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 8px 24px var(--over); font: 14px/1.5 var(--face-sans); color: var(--ink); }
[data-state="project-2"] .note { display: block; }
.note .on { padding: 0 4px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.note .field { margin-top: 6px; display: flex; align-items: flex-end; gap: 6px; }
.note .field p { flex: 1; padding: 4px; }
.note .done { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 6px; color: var(--muted); }
.note .caret { position: relative; width: 0; height: 13px; margin: 0; background: none; vertical-align: baseline; }
.note .caret::before { content: ""; position: absolute; left: 0; bottom: -2px; width: 1px; height: 15px; background: var(--ink); }
.note .hint { display: none; position: absolute; color: var(--faint); }
.note .written:empty + .hint { display: inline; }

/* ---- the wait: a dot and its words. It stands at the window's foot, where the app has it after the page's last part ---- */
.waitline { display: none; position: absolute; left: 0; right: 0; top: calc(var(--foot, 900px) - 120px); z-index: 4; height: 68px; padding: 16px 96px 0; align-items: baseline; gap: 8px; background: var(--own-paper); border-top: 1px solid var(--own-line); font: 500 15px/1.5 var(--face-sans); color: var(--own-soft); }
.waitline b { font-weight: 400; color: var(--own-ink); }
.waitline span { display: none; }
[data-state="project-sent"] .waitline, [data-state="project-3"][data-moving="arrive"] .waitline, [data-state="project-carried"][data-moving=""] .waitline { display: flex; }
[data-state="project-sent"] [data-wait="marks"], [data-state="project-3"] [data-wait="next"], [data-state="project-carried"] [data-wait="move"] { display: inline; }

/* ---- the page drawn in answer: the app's strip leads back, and the page is a part at a time in arriving ---- */
.proj.answer { padding-top: 0; }
.arrives { transition: opacity var(--duration) linear; }
.strip { display: flex; align-items: baseline; gap: 4px; padding: 16px 0 8px; border-bottom: 1px solid var(--hairline); font: 12px/18px var(--face-sans); color: var(--muted); }
.strip b { margin-left: 8px; font-weight: 500; color: var(--ink); }
.answer .ttl { margin-top: 34px; }
.answer .say { margin-top: 10px; font: 20px/1.5 var(--face-serif); color: var(--own-soft); }
.time { position: relative; margin-top: 62px; height: 252px; --part: calc((100% - 108px) / 4); --next: calc(100% + 36px); }
.passes::before { content: ""; position: absolute; left: 0; right: 0; top: 30px; height: 1.5px; background: var(--mid); }
.point { position: absolute; top: 0; width: var(--part); height: 100%; }
.point::before { content: ""; position: absolute; left: 0; top: 25px; width: 11px; height: 11px; border-radius: 50%; background: var(--strong); }
.point.p2, .time .shown.p2 { left: calc(var(--part) + 36px); }
.point.p3 { left: calc(var(--part) * 2 + 72px); }
.point.p4 { left: calc(var(--part) * 3 + 108px); }
.point .when { position: absolute; left: 0; top: 0; font-size: 15px; line-height: 1; font-weight: 600; color: var(--own-soft); white-space: nowrap; }
.time .tile { position: absolute; top: 95px; left: 0; width: 100%; }
.time .tile.shown { width: var(--part); }
.tile.none { flex-direction: row; align-items: baseline; justify-content: space-between; border-style: dashed; }
.tile.none .name { font-weight: 500; color: var(--own-soft); }
.time .said { position: absolute; top: 228px; left: calc(var(--part) * 2 + 72px); font: 18px/1.5 var(--face-serif); color: var(--own-soft); white-space: nowrap; visibility: hidden; }
[data-state="project-moved"] .said { visibility: visible; }
/* A part that takes a move says so at rest with a dotted line along its surface's edge, stronger once the hand is on it. */
.passes::after { content: ""; position: absolute; left: -9px; top: 95px; height: 118px; border-left: 1px dotted currentColor; opacity: .24; }
[data-moving="carry"] .passes::after { opacity: .5; }

/* ---- the move: the part goes where the hand takes it, by the grip above it ---- */
.carried { z-index: 2; transform: translateX(calc(var(--carry, 0) * var(--next))); }
[data-moving="carry"] .carried { will-change: transform; }
.carried[data-held="true"] { border-color: var(--strong); box-shadow: 0 12px 26px -8px var(--deep); }
.grip { position: absolute; left: -1.5px; top: -27.5px; box-sizing: border-box; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--hairline); border-radius: 5px; background: var(--own-paper); color: var(--own-soft); visibility: hidden; }
[data-moving="carry"] :is(.grip, .carried .hand) { visibility: visible; }
.carried .hand { left: 11px; top: -16px; }

@media (prefers-reduced-motion: reduce) { .arrives { transition: none; } }
