/* goingin design frames. Static pictures of the design for sign-off (D19): no timer code.
   Built against the wisdom-design register, stamp WD113-ed3c40d7, from docs/design/DIRECTION.md.
   Colour: the house palette, quiet mode, as written in register/palette-quiet.css, plus goingin's
   own tokens, each with its reason beside it (WD-004). */

@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "Azeret Mono"; src: url("/fonts/azeret-mono.woff2") format("woff2"); font-weight: 100 900; font-display: block; }

:root {
  /* grounds and neutral inks (WD-111) */
  --white: oklch(1 0 0);
  --paper: oklch(0.958 0.007 85);
  --panel-2: oklch(0.975 0.005 85);       /* the ground of a text field, nothing else */
  --hair: oklch(0.885 0.008 85);          /* row dividers */
  --hair-strong: oklch(0.78 0.01 85);     /* control outlines */
  --ink: oklch(0.24 0.012 80);            /* numbers, text */
  --ink-2: oklch(0.45 0.012 80);          /* event labels, the line, steppers */
  --ink-3: oklch(0.57 0.012 80);          /* a switched-off event; large labels and marks only */
  /* hues, quiet (WD-108, WD-109), each with its one job here (WD-110) */
  --blue: oklch(0.52 0.075 225);          /* action: IN, links */
  --coral-peach: oklch(0.80 0.07 55);     /* the seal */
  --purple: oklch(0.34 0.085 301);        /* aside: the note beside the seal on the first visit */
  --green: oklch(0.52 0.085 150);         /* approval (not used on a frame yet) */
  --label-ink: oklch(0.24 0.012 80);      /* the light theme's --ink, fixed: the label on a fill */
  --ground: var(--white);                 /* Ma sits on white (WD-032) */

  /* goingin's own tokens: the same in both themes */
  --sit-ground: oklch(0.10 0.004 80);     /* #040302. The sitting screen: the darkest off-black that is not
                                             pure black (WD-051). About 0.10% of a white screen's light. */
  --sit-ink: oklch(0.48 0.02 75);         /* #645c51. The number and OUT in the sit: 3.13:1 on --sit-ground,
                                             the floor for large type and no brighter; a hair warm. */
  --sit-ink-dimmer: oklch(0.40 0.02 75);  /* the dimmer step offered beside it: 2.2:1 */
  --sit-ink-awake: oklch(0.60 0.02 75);   /* the paused state only: eyes are open and a choice is wanted,
                                             so its words pass 4.5:1 on --sit-ground */
  --photo-ink-light: oklch(0.945 0.006 85); /* the time sat over a darker zone: the dark theme's --ink */
  --photo-ink-dark: oklch(0.24 0.012 80);   /* the time sat over a pale zone: the light theme's --ink */
  --seal: oklch(0.84 0.07 55);            /* the seal's coral peach, the dark-theme value, fixed on a photo */

  --font-sans: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Azeret Mono", ui-monospace, monospace;
  --t-label: 0.75rem;
  --t-small: 0.875rem;
  --t-body: 1.0625rem;
  --t-lede: 1.375rem;
  --t-door: 1.75rem;
  --t-title: 2.5rem;
  --t-length: 4.5rem;
  --t-sit: clamp(5.5rem, 27cqw, 6.5rem);

  --gutter: 24px;
  --tap: 48px;
  --radius: 2px;

  --ease-leave: cubic-bezier(0.4, 0, 1, 1);
  --ease-arrive: cubic-bezier(0, 0, 0.2, 1);
  --ease-pass: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-dawn: cubic-bezier(0.8, 0, 0.5, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: oklch(0.205 0.006 80);
  --panel-2: oklch(0.232 0.006 80);
  --hair: oklch(0.34 0.008 80);
  --hair-strong: oklch(0.46 0.01 80);
  --ink: oklch(0.945 0.006 85);
  --ink-2: oklch(0.76 0.008 82);
  --ink-3: oklch(0.60 0.008 82);
  --blue: oklch(0.72 0.10 225);
  --coral-peach: oklch(0.84 0.07 55);
  --purple: oklch(0.74 0.085 301);
  --green: oklch(0.75 0.085 150);
  --ground: var(--paper);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body { margin: 0; min-height: 100%; background: var(--ground); color: var(--ink);
  font-family: var(--font-sans); font-weight: 300; font-size: var(--t-body); line-height: 1.6;
  font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; }
body.dark-room { background: var(--sit-ground); }
body.true-black { background: #000; } /* outside the current rule (WD-051): shown for comparison only */
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.32em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ---- the screen: one phone, edge to edge. Everything inside hangs on the axis. ---- */
.screen { position: relative; width: min(100vw, 440px); height: 100dvh; margin: 0 auto; overflow: hidden;
  container-type: size; background: var(--ground); }
.stage { position: absolute; inset: 0;
  --axis: calc(12px + 33.333cqw);          /* the left edge of column 3 of 6: 142px at 390 */
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --top: max(16px, var(--st)); --bot: max(16px, var(--sb)); }

/* ---- the way back: shows for four seconds, then clears. The corner stays tappable. ---- */
.tag { position: fixed; z-index: 90; left: max(0px, calc(50vw - 220px)); top: env(safe-area-inset-top, 0px);
  padding: 16px 14px 18px; font: 400 0.6875rem/1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--tag-ink, var(--ink-2)); text-decoration: none; white-space: nowrap;
  animation: tag-clear 1ms 4s steps(1) forwards; }
.tag.stays { animation: none; }
@keyframes tag-clear { to { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) { .tag { animation: tag-clear 600ms 4s linear forwards; } .tag.stays { animation: none; } }

/* ================= setup ================= */
.setup { position: absolute; inset: var(--top) 0 var(--bot) 0; display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 48px 88px minmax(200px, 400px) 56px 48px 48px; }
.setup > * { position: relative; min-height: 0; }
.chrome .theme { position: absolute; right: 14px; top: 0; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }

.door { position: absolute; left: var(--axis); top: 0; height: 48px; display: flex; align-items: center;
  font: 400 var(--t-door)/1 var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.door.in { color: var(--blue); margin-left: -3px; padding: 0 40px 0 0; cursor: pointer; } /* the line grows out of the I */
.door.out { color: var(--ink-2); margin-left: -2px; }

.x-label { position: absolute; right: calc(100cqw - var(--axis) + 14px); top: 50%; transform: translateY(-50%);
  font: 400 var(--t-label)/1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.x-num { position: absolute; left: calc(var(--axis) + 14px); top: 50%; transform: translateY(-50%);
  font: 300 var(--t-door)/1 var(--font-sans); color: var(--ink); white-space: nowrap; }
.x-num.big { font-size: var(--t-length); letter-spacing: -0.02em; margin-left: -0.03em; }
.x-ctl { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); display: flex; color: var(--ink-2); }
.step { width: 48px; height: 48px; display: grid; place-items: center; }
.step.spent { color: var(--ink-3); opacity: 0.45; }
.sw { min-width: 48px; height: 48px; padding-right: 15px; display: grid; place-items: center end;
  font: 400 var(--t-label)/1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.6em; }
.tick { position: absolute; left: calc(var(--axis) - 4px); width: 9px; height: 0; border-top: 1px solid var(--ink-2); }

.prelude .tick.a { top: 0; }
.rail .line { position: absolute; left: var(--axis); top: 0; bottom: 0; width: 0; border-left: 1px solid var(--ink-2); }
.ev { position: absolute; left: 0; right: 0; height: 48px; }
.ev .tick { top: 50%; }
.ev.e-sit { top: -24px; }
.ev.e-half { top: calc(50% - 24px); }
.ev.e-final { bottom: 36px; }   /* a fixed 60px above END: tied to END, not to the line's scale */
.ev.e-end { bottom: -24px; }
.ev.off .x-label { color: var(--ink-3); }
.ev.off .tick, .ev.off .x-num { display: none; }
.ev.off .sw { color: var(--ink-3); text-decoration: none; }
/* In the light theme --ink-3 reads 4.45:1 on white, which WD-111 keeps for large marks only, so the off label
   and its word stay --ink-2 there; the missing number and tick and the word OFF carry the state. */
:root:not([data-theme="dark"]) .ev.off .x-label, :root:not([data-theme="dark"]) .ev.off .sw { color: var(--ink-2); }
.foot .to-log { position: absolute; right: 24px; top: 0; height: 48px; display: flex; align-items: center; font-weight: 400; }

/* ================= the sit ================= */
.sit { position: absolute; inset: 0; background: var(--sit-ground); color: var(--sit-ink); }
.sit.dimmer { color: var(--sit-ink-dimmer); }
.sit.true-black { background: #000; } /* outside the current rule (WD-051) */
.count { position: absolute; left: var(--axis); top: calc(30cqh - 0.8485em); margin-left: -0.03em;
  font: 300 var(--t-sit)/1 var(--font-sans); letter-spacing: -0.02em; white-space: nowrap; }
.count small { font-size: var(--t-title); letter-spacing: -0.01em; }
.out-word { position: absolute; left: var(--axis); bottom: calc(var(--bot) + 48px); height: 48px; display: flex; align-items: center; margin-left: -2px;
  font: 400 var(--t-door)/1 var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
/* paused: the number holds; the words wake up */
.sit .state { position: absolute; right: calc(100cqw - var(--axis) + 14px); top: calc(30cqh - 0.78rem);
  font: 400 var(--t-label)/1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--sit-ink-awake); }
.sit.paused .out-word, .sit .resume { color: var(--sit-ink-awake); }
.sit .resume { position: absolute; left: var(--axis); bottom: calc(var(--bot) + 48px + 104px); height: 48px; display: flex; align-items: center; margin-left: -2px;
  font: 400 var(--t-door)/1 var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase; }
/* the comparison: left half as specified, right half true black */
.split-half { position: absolute; top: 0; bottom: 0; right: 0; width: 50%; background: #000; }

/* ================= OUT ================= */
.photo { position: absolute; inset: 0; background: var(--sit-ground); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.ink-light .count { color: var(--photo-ink-light); text-shadow: 0 0 24px oklch(0.10 0.004 80 / 0.30); }
.photo.ink-dark .count { color: var(--photo-ink-dark); text-shadow: 0 0 24px oklch(1 0 0 / 0.30); }
.seal { position: absolute; right: calc(100cqw - var(--axis) + 14px); top: calc(30cqh - 36px); width: 36px; height: 36px;
  border-radius: var(--radius); background: var(--seal); color: var(--label-ink); display: grid; place-items: center;
  font: 400 1.25rem/1 var(--font-sans); letter-spacing: 0; padding-bottom: 3px; }

/* ================= the log ================= */
.logpage { position: absolute; inset: 0; overflow: auto; padding: calc(var(--top) + 44px) 0 calc(var(--bot) + 72px); }
.logpage h1 { margin: 9cqh 0 0 var(--axis); font: 300 var(--t-title)/1.05 var(--font-sans); letter-spacing: -0.02em; }
.logpage .about { margin: 12px var(--gutter) 0 var(--axis); color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.logpage .rows { margin-top: 40px; }
.logpage .row { position: relative; height: 48px; }
.logpage .x-num small { font-size: var(--t-body); }
.logpage .empty { margin: 40px var(--gutter) 0 var(--axis); color: var(--ink-2); max-width: 15rem; }
.logfoot { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--bot) + 48px); background: var(--ground); border-top: 1px solid var(--hair); }
.logfoot a { position: absolute; top: 0; height: 48px; display: flex; align-items: center; font-weight: 400; }
.logfoot .export { left: var(--axis); }
.logfoot .back { right: 24px; }

/* ================= the first visit ================= */
.first { position: absolute; inset: var(--top) 0 var(--bot) 0; display: grid; grid-template-rows: minmax(0, 1.5fr) auto minmax(0, 1fr) auto; }
.first .title { margin-left: var(--axis); margin-right: var(--gutter); }
.first h1 { margin: 0 0 12px -0.04em; font: 300 var(--t-title)/1 var(--font-sans); letter-spacing: -0.02em; }
.first .lede { margin: 0 0 24px; font: 400 var(--t-lede)/1.35 var(--font-sans); }
.first p { margin: 0 0 12px; text-wrap: pretty; }
.first .how { color: var(--ink-2); }
.first .how .nb { white-space: nowrap; }
.first .how svg { display: inline-block; vertical-align: -0.22em; margin: 0 0.1em; }
.first .onward { display: inline-flex; align-items: center; min-height: 48px; font-weight: 400; }
.first .sealed { grid-row: 4; display: flex; align-items: flex-end; gap: 14px; margin: 0 var(--gutter) 24px; justify-content: flex-start; padding-left: calc(var(--axis) - var(--gutter) - 56px - 14px); }
.first .sealed .seal { position: static; width: 56px; height: 56px; font-size: 2rem; background: var(--coral-peach); padding-bottom: 5px; flex: none; }
.first .aside { margin: 0; color: var(--purple); font-size: var(--t-small); font-weight: 400; line-height: 1.45; }

/* ================= the index and the icon page: tool pages, Ma dialled down ================= */
.idx { width: min(100vw, 440px); margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) var(--gutter) max(40px, env(safe-area-inset-bottom)); }
.idx { position: relative; }
/* at the top of the page, scrolling away with it: fixed, it would cover text on a phone (as the Ma model page found) */
.idx .theme { position: absolute; z-index: 10; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.idx h1 { margin: 56px 0 8px; font: 300 var(--t-title)/1.05 var(--font-sans); letter-spacing: -0.02em; }
.idx .lede { margin: 0 0 8px; font: 400 var(--t-lede)/1.35 var(--font-sans); }
.idx p { margin: 0 0 12px; text-wrap: pretty; max-width: 26rem; }
.idx .quiet { color: var(--ink-2); }
.idx h2 { margin: 56px 0 6px; font: 400 var(--t-lede)/1.3 var(--font-sans); }
.idx h2 + p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; margin-bottom: 14px; }
.idx .rows { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--hair); }
.idx .rows a { display: block; padding: 13px 0 14px; min-height: 56px; border-top: 1px solid var(--hair); color: var(--ink); text-decoration: none; }
.idx .rows b { display: block; font-weight: 400; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.32em; }
.idx .rows span { display: block; margin-top: 3px; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.idx .note { margin-top: 40px; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }

/* the icon page: a home screen drawn at real size, other icons as plain shapes */
.home { margin: 24px calc(-1 * var(--gutter)) 0; padding: 28px 27px 12px; display: grid; grid-template-columns: repeat(4, 60px); justify-content: space-between; row-gap: 26px; }
.home.dark { background: oklch(0.34 0.008 80); color: oklch(0.945 0.006 85); }  /* a stand-in wallpaper: the house dark hairline grey, so icon B's dark ground can be told from it */
.home.light { background: oklch(0.958 0.007 85); color: oklch(0.24 0.012 80); }
.home figure { margin: 0; width: 60px; }
.home .ico { display: block; width: 60px; height: 60px; border-radius: 13.5px; background: oklch(0.60 0.008 82 / 0.45); }
.home img.ico { background: none; }
.home figcaption { margin: 6px -10px 0; text-align: center; font: 400 0.6875rem/1.2 var(--font-sans); white-space: nowrap; min-height: 14px; }
.big-icons { display: grid; grid-template-columns: 96px 1fr; gap: 20px 16px; align-items: center; margin: 24px 0 0; }
.big-icons img { width: 96px; height: 96px; border-radius: 21.6px; display: block; }
.big-icons p { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.big-icons p b { display: block; color: var(--ink); font-weight: 400; font-size: var(--t-body); }

/* ================= the motion study ================= */
.study { cursor: pointer; }
.study, .study * { -webkit-tap-highlight-color: transparent; }  /* or iOS flashes the whole screen grey on a tap */
.study .layer { position: absolute; inset: 0; }
.study .setup-wrap { transform-origin: calc(12px + 33.333cqw) 16%; }   /* in through IN */
.study .photo-wrap { transform-origin: calc(12px + 33.333cqw) 26%; background: var(--sit-ground); }  /* the world settles round the number */
.study .setup-soft { filter: blur(18px); opacity: 0; pointer-events: none; }  /* a still blur; it is never animated (WD-060) */
.study .veil { background: var(--sit-ground); opacity: 0; pointer-events: none; }
.study .photo-wrap, .study .photo-sharp, .study .sit-el, .study .photo-el { opacity: 0; }
.study .photo-wrap, .study .photo-el { pointer-events: none; }
.study .photo-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.study .sit-el { color: var(--sit-ink); pointer-events: none; }
.study .count.photo-el { color: var(--photo-ink-light); text-shadow: 0 0 24px oklch(0.10 0.004 80 / 0.30); }
.study.ink-dark .count.photo-el { color: var(--photo-ink-dark); text-shadow: 0 0 24px oklch(1 0 0 / 0.30); }
.study .foot .rm { position: absolute; left: var(--gutter); top: 0; height: 48px; display: flex; align-items: center; cursor: pointer;
  font: 400 var(--t-label)/1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-2); }
.study .foot .rm b { font-weight: 400; color: var(--ink); margin-left: 0.6em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.6em; }

/* resting states */
.study[data-state="sit"] .setup-sharp, .study[data-state="out"] .setup-sharp { opacity: 0; }
.study[data-state="sit"] .veil, .study[data-state="sit"] .sit-el, .study[data-state="sit"] .photo-wrap { opacity: 1; }
.study[data-state="photo"] .photo-wrap, .study[data-state="photo"] .photo-sharp, .study[data-state="photo"] .photo-el { opacity: 1; }
.study[data-state="out"] .photo-wrap { opacity: 1; }

/* IN, 3000ms */
.study[data-state="in"] .setup-wrap { animation: scale-in 1800ms var(--ease-leave) forwards; }
.study[data-state="in"] .setup-sharp { animation: fade-out 700ms var(--ease-leave) forwards; }
.study[data-state="in"] .setup-soft { animation: soft 1800ms linear forwards; }
.study[data-state="in"] .veil { animation: fade-in 1500ms 300ms var(--ease-pass) forwards; }
.study[data-state="in"] .sit-el { animation: fade-in 1200ms 1800ms var(--ease-arrive) forwards; }
/* OUT, 3600ms */
.study[data-state="out"] .out-word.sit-el { opacity: 1; animation: fade-out 600ms var(--ease-leave) forwards; }
.study[data-state="out"] .veil { opacity: 1; animation: fade-out 2400ms var(--ease-dawn) forwards; }
.study[data-state="out"] .photo-sharp { animation: fade-in 2400ms 1200ms var(--ease-pass) forwards; }
.study[data-state="out"] .photo-wrap { animation: scale-out 3600ms var(--ease-arrive) forwards; }
.study[data-state="out"] .count.sit-el { opacity: 1; animation: fade-out 1400ms 1200ms var(--ease-pass) forwards; }
.study[data-state="out"] .count.photo-el { animation: fade-in 1400ms 1200ms var(--ease-pass) forwards; }
.study[data-state="out"] .seal.photo-el { animation: fade-in 400ms 3200ms var(--ease-arrive) forwards; }
/* back to the setup screen: 800ms, opacity only */
.study[data-state="back"] .photo-wrap, .study[data-state="back"] .photo-el { opacity: 1; animation: fade-out 800ms var(--ease-pass) forwards; }
.study[data-state="back"] .photo-sharp { opacity: 1; }

/* reduced motion: one 500ms linear cross-fade each way; no scale, no soft layer, no stagger */
.study.reduced[data-state="in"] .setup-wrap, .study.reduced[data-state="in"] .setup-sharp, .study.reduced[data-state="in"] .setup-soft { animation: none; }
.study.reduced[data-state="in"] .veil, .study.reduced[data-state="in"] .sit-el { animation: fade-in 500ms linear forwards; }
.study.reduced[data-state="out"] .photo-wrap { animation: none; }
.study.reduced[data-state="out"] .photo-sharp { opacity: 1; animation: none; }
.study.reduced[data-state="out"] .veil, .study.reduced[data-state="out"] .out-word.sit-el, .study.reduced[data-state="out"] .count.sit-el { animation: fade-out 500ms linear forwards; }
.study.reduced[data-state="out"] .count.photo-el, .study.reduced[data-state="out"] .seal.photo-el { animation: fade-in 500ms linear forwards; }
.study.reduced[data-state="back"] .photo-wrap, .study.reduced[data-state="back"] .photo-el { animation: fade-out 500ms linear forwards; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes scale-in { from { transform: scale(1); } to { transform: scale(1.05); } }
@keyframes scale-out { from { transform: scale(1.05); } to { transform: scale(1); } }
/* the soft copy: up over the first 500ms, down over the next 1300ms */
@keyframes soft { 0% { opacity: 0; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); } 27.78% { opacity: 1; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); } 100% { opacity: 0; } }
