/* type is the interface */
:root {
  --bg: #000;
  --ink: #F3F0EA;
  --ink-2: rgba(243, 240, 234, .58);
  --ink-3: rgba(243, 240, 234, .34);
  --hair: rgba(243, 240, 234, .12);
  --track: rgba(243, 240, 234, .10);
  --box: #141414;
  --ui: "Instrument Sans", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --c: #F3F0EA;
  --f: var(--ui);
  --pad: 18px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { position: fixed; inset: 0; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; }
button { cursor: pointer; }
input, textarea, select { width: 100%; }
::selection { background: var(--c); color: #000; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* ---------- screens ---------- */
#app { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(var(--sat) + 14px) var(--pad) calc(var(--sab) + 12px);
  transform: translate3d(100%, 0, 0); transition: transform .42s cubic-bezier(.2, .8, .2, 1), opacity .3s; will-change: transform; opacity: 0; pointer-events: none; }
.screen.current { transform: none; opacity: 1; pointer-events: auto; }
.screen.left { transform: translate3d(-28%, 0, 0); opacity: 0; }
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
@media (prefers-reduced-motion: reduce) { .screen, .name-row { transition: none; animation: none; } }

/* ---------- top line ---------- */
.top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); min-height: 20px; }
.top .back { color: var(--ink-2); padding: 6px 10px 6px 0; margin-left: -2px; }
.top .back::before { content: "‹"; font-size: 22px; line-height: 0; position: relative; top: 2px; margin-right: 6px; }

/* ---------- bars: bright = done, dim = where today's date says you should be ---------- */
.bar { position: relative; height: 10px; background: var(--track); border-radius: 5px; overflow: hidden; }
.bar s { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); opacity: .22; border-radius: 5px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); border-radius: 5px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.ev s, .bar.ev i { background: var(--ink); }
.bar.thin { height: 6px; border-radius: 3px; }

/* ---------- home ---------- */
#home { display: grid; grid-template-rows: auto auto auto 1fr; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.everyone { text-align: left; width: 100%; padding: 12px 0 14px; border-bottom: 1px solid var(--hair); display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 10px; }
.everyone .title { font-size: clamp(30px, 8.2vw, 44px); font-weight: 600; letter-spacing: -.035em; line-height: 1; align-self: end; }
.everyone .pct { font-size: clamp(30px, 8.2vw, 44px); font-weight: 500; letter-spacing: -.04em; line-height: 1; align-self: end; }
.everyone .pct small, .name-row .pc small, .hero .big small { font-size: .5em; font-weight: 500; color: var(--ink-2); margin-left: 2px; letter-spacing: 0; }
.everyone .bar { grid-column: 1 / -1; }
.cats { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 2px; }
.cat { font-size: 12px; color: var(--ink-2); }
.cat b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; margin-bottom: 5px; }
.cat b span { color: var(--ink-2); font-weight: 400; font-size: 11.5px; margin-left: 3px; }

.names { display: flex; flex-direction: column; min-height: 0; padding-top: 2px; }
.name-row { flex: 1 1 0; min-height: 78px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; align-items: end; column-gap: 12px; padding: 12px 0 9px;
  border-bottom: 1px solid var(--hair); color: var(--c); text-align: left; width: 100%; animation: slide .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 45ms); }
.name-row:last-child { border-bottom: 0; }
.name-row .nm { font-family: var(--f); font-size: clamp(26px, 5.2vh, 48px); line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; margin-left: -1px; padding-top: 4px; }
.name-row.caps .nm { text-transform: uppercase; letter-spacing: .01em; }
.name-row.italic .nm { font-style: italic; }
.name-row .pc { font-family: var(--ui); font-size: clamp(22px, 4.4vh, 36px); font-weight: 500; letter-spacing: -.04em; line-height: 1; color: var(--ink); padding-bottom: 2px; }
.name-row .bar { grid-column: 1 / -1; margin-top: 9px; }
.name-row.you .nm::after { content: "you"; font-family: var(--ui); font-size: 11px; letter-spacing: 0; text-transform: none; font-style: normal; color: var(--ink-3); vertical-align: top; margin-left: 8px; position: relative; top: 10px; }
@keyframes slide { from { transform: translate3d(-22px, 0, 0); opacity: 0; } to { transform: none; opacity: 1; } }
.no-anim .name-row { animation: none; }

/* ---------- person ---------- */
.hero { padding: 8px 0 6px; }
.hero .nm { display: block; width: 100%; text-align: left; font-family: var(--f); color: var(--c); font-size: clamp(64px, 24vw, 120px); line-height: .9; letter-spacing: -.03em; white-space: nowrap; margin: 0 calc(-1 * var(--pad)) 0 -3px; width: calc(100% + var(--pad) + 3px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent); mask-image: linear-gradient(90deg, #000 84%, transparent); }
.hero.caps .nm { text-transform: uppercase; }
.hero.italic .nm { font-style: italic; }
.hero .stat { display: flex; align-items: flex-end; gap: 14px; margin-top: 10px; }
.hero .big { font-size: 46px; font-weight: 500; letter-spacing: -.045em; line-height: 1; }
.hero .sub { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; padding-bottom: 3px; }
.hero .sub b { color: var(--ink); font-weight: 500; }
.hero .bar { margin-top: 12px; }
.vision { display: block; width: 100%; text-align: left; margin: 14px 0 2px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.vision.empty { color: var(--ink-3); }

.cat-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 0; font-size: 13px; color: var(--c); }
.cat-head .n { color: var(--ink-2); }
.goal { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: end; padding: 13px 0 12px; border-bottom: 1px solid var(--hair); width: 100%; text-align: left; }
.goal .t { display: block; width: 100%; text-align: left; padding: 0; }
.goal .cnt { display: inline-flex; align-items: baseline; gap: 4px; }
.cell { width: 4.2ch; min-width: 48px; text-align: right; font: inherit; font-size: 22px; font-weight: 500; letter-spacing: -.04em; color: var(--ink); background: transparent; border: 1px solid transparent; border-bottom-color: var(--hair); border-radius: 6px 6px 0 0; padding: 4px 4px 3px; -moz-appearance: textfield; appearance: textfield; transition: background .15s, border-color .15s; }
.cell::-webkit-outer-spin-button, .cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cell:focus { outline: none; background: var(--box); border-color: var(--c); border-radius: 6px; }
.goal.editing .bar i { transition: none; }
.goal .t { font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
.goal .t small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.goal.done .t { color: var(--ink-2); }
.goal .cnt { font-size: 22px; font-weight: 500; letter-spacing: -.04em; line-height: 1; padding-left: 8px; text-align: right; white-space: nowrap; color: var(--ink); }
.goal .cnt small { font-size: 13px; color: var(--ink-2); font-weight: 400; letter-spacing: 0; }
.goal .bar { grid-column: 1 / -1; margin-top: 9px; }
.goal .t:active { opacity: .7; }
.add-row { display: block; width: 100%; text-align: left; padding: 16px 0; color: var(--ink-3); font-size: 15px; }
.add-row:active { color: var(--ink-2); }

.section { margin: 30px 0 4px; font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; }
.note { padding: 11px 0; border-bottom: 1px solid var(--hair); font-size: 14.5px; line-height: 1.4; }
.note .who { font-size: 12.5px; margin-bottom: 2px; }
.note .when { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }
.note-in { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 8px 0 6px; }
.note-in textarea { resize: none; min-height: 84px; max-height: 160px; line-height: 1.4; font-size: 15px; background: var(--box); border: 1px solid var(--hair); border-radius: 10px; padding: 12px; }
.note-in textarea:focus { outline: none; border-color: var(--c); }
.note-in button { color: #000; background: var(--c); font-size: 14px; font-weight: 600; padding: 13px 18px; border-radius: 999px; }

.years { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.years button { color: var(--ink-2); font-size: 16px; padding: 6px 0; }
.years button.on { color: var(--c); }
.arch .goal { padding: 10px 0 9px; }
.arch .goal .t { font-size: 14.5px; color: var(--ink-2); }
.arch .goal .cnt { font-size: 16px; }
.arch .bar { height: 6px; border-radius: 3px; }
.arch-score { font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
.arch .vision { margin: 6px 0 4px; }
.end { height: 48px; }

/* ---------- everyone ---------- */
.dash .hero .nm { font-family: var(--ui); font-weight: 600; color: var(--ink); font-size: clamp(54px, 18vw, 96px); letter-spacing: -.045em; }
.dot-row { margin: 22px 0 0; }
.dot-row .lbl { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.dot-row .lbl b { font-weight: 500; }
.dots { position: relative; height: 22px; }
.dots .base { position: absolute; left: 0; right: 0; top: 6px; height: 10px; border-radius: 5px; background: var(--track); }
.dots .exp { position: absolute; left: 0; top: 6px; height: 10px; border-radius: 5px; background: var(--ink); opacity: .14; }
.dots .avg { position: absolute; top: 6px; height: 10px; left: 0; border-radius: 5px; background: var(--ink); opacity: .5; }
.dots { height: 26px; }
.dots .d { position: absolute; top: 1px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; margin-left: -11px; border: 2px solid #000; color: #000; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; transition: left .6s cubic-bezier(.2, .8, .2, 1); }
.dots .base, .dots .exp, .dots .avg { top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.race { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.race .t { font-size: 15px; margin-bottom: 8px; }
.race .lane { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.race .lane .who { font-family: var(--rf); color: var(--rc); font-size: 18px; line-height: 1; white-space: nowrap; overflow: hidden; }
.race .lane .bar s, .race .lane .bar i { background: var(--rc); }
.feed .item { padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14px; line-height: 1.4; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.feed .item .when { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

/* ---------- sheets ---------- */
.veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .25s; z-index: 20; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.veil.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: #0b0b0b; border-top: 1px solid var(--hair); border-radius: 18px 18px 0 0; padding: 12px var(--pad) calc(var(--sab) + 18px);
  transform: translate3d(0, 100%, 0); transition: transform .38s cubic-bezier(.2, .8, .2, 1); max-height: 90vh; overflow-y: auto; }
.sheet.on { transform: none; }
.sheet h3 { font-size: 16px; font-weight: 500; margin: 0 0 4px; line-height: 1.3; }
.sheet .sub { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.sheet .grip { width: 34px; height: 4px; border-radius: 2px; background: var(--hair); margin: 0 auto 14px; }
.field { padding: 8px 0; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea, .field select { font-size: 16px; padding: 11px 12px; background: var(--box); border: 1px solid var(--hair); border-radius: 9px; -webkit-appearance: none; appearance: none; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--c); }
.field textarea { resize: none; min-height: 72px; line-height: 1.4; }
.field textarea.tall { min-height: 120px; }
.field select option { background: #111; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; }
.actions .primary { color: #000; background: var(--c); padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 15px; }
.actions .quiet { color: var(--ink-2); font-size: 15px; padding: 12px 0; }
.actions .danger { color: #f66; opacity: .8; font-size: 14px; padding: 12px 0; }
.bigin { display: flex; justify-content: center; align-items: baseline; gap: 6px; padding: 6px 0 0; }
.bigin input { width: 3.5ch; min-width: 110px; text-align: center; font: inherit; font-size: 56px; font-weight: 500; letter-spacing: -.04em; color: var(--ink); background: var(--box); border: 1px solid var(--hair); border-radius: 12px; padding: 4px 8px; -moz-appearance: textfield; appearance: textfield; }
.bigin input::-webkit-outer-spin-button, .bigin input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bigin input:focus { outline: none; border-color: var(--c); }
.bigin small { font-size: 20px; }
.stepper { display: flex; justify-content: center; gap: 20px; margin: 4px 0 8px; }
.stepper button { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--hair); font-size: 26px; color: var(--ink); }
.stepper button:active { background: var(--c); color: #000; border-color: var(--c); }
.pace-line { text-align: center; font-size: 13.5px; color: var(--ink-2); margin: 0 0 6px; }
.pace-line b { color: var(--c); font-weight: 500; }
.details-toggle { display: block; width: 100%; text-align: left; color: var(--ink-2); font-size: 14px; padding: 12px 0 4px; }
.details-toggle::after { content: " ▾"; color: var(--ink-3); }
.details-toggle.open::after { content: " ▴"; }
.hist { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.hist div { padding: 6px 0; border-bottom: 1px solid var(--hair); display: flex; justify-content: space-between; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 0; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; }
.swatches button.on { border-color: var(--ink); }
.faces { display: flex; flex-direction: column; padding: 4px 0; }
.faces button { text-align: left; font-size: 26px; padding: 8px 0; color: var(--ink-2); line-height: 1.1; }
.faces button.on { color: var(--c); }
.sheet .links { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; border-top: 1px solid var(--hair); padding-top: 6px; }
.sheet .links button { text-align: left; padding: 12px 0; font-size: 15px; color: var(--ink); border-bottom: 1px solid var(--hair); }
.sheet .links button.danger { color: #f66; }
.sheet p { font-size: 15px; line-height: 1.5; margin: 0 0 4px; color: var(--ink); }

/* ---------- who ---------- */
#who { position: fixed; inset: 0; background: #000; z-index: 30; display: flex; flex-direction: column; padding: calc(var(--sat) + 24px) var(--pad) calc(var(--sab) + 24px); }
#who h1 { font-size: 15px; font-weight: 500; color: var(--ink-2); margin: 0 0 8px; }
#who .list { flex: 1; display: flex; flex-direction: column; }
#who .list button { flex: 1; text-align: left; font-size: clamp(34px, 8.5vh, 64px); line-height: 1; letter-spacing: -.02em; border-bottom: 1px solid var(--hair); }
#who .list button.caps { text-transform: uppercase; }
#who .list button.italic { font-style: italic; }

.toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 26px); transform: translate(-50%, 20px); background: var(--ink); color: #000; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; opacity: 0; transition: .3s; z-index: 40; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.empty { color: var(--ink-3); font-size: 14px; padding: 12px 0; }
.hidden { display: none !important; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--box); border: 1px solid var(--hair); border-radius: 999px; padding: 8px 14px; font-size: 14px; color: var(--ink-2); text-align: left; }
.chip.on { background: var(--c); border-color: var(--c); color: #000; font-weight: 500; }
.chip-add { display: block; margin-top: 10px; font-size: 13px; color: var(--ink-3); padding: 4px 0; }
.chips.stack { flex-direction: column; gap: 10px; }
.chip-group { display: flex; flex-direction: column; gap: 8px; }
.chip.who { border-color: var(--pc); color: var(--pc); align-self: flex-start; }
.chip.who::after { content: " ▾"; opacity: .6; }
.chip-group.open .chip.who::after { content: " ▴"; }
.chip-goals { display: none; flex-wrap: wrap; gap: 8px; padding-left: 10px; }
.chip-group.open .chip-goals { display: flex; }

/* feed */
.feed-link { display: block; width: 100%; text-align: left; margin-top: 34px; padding: 14px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); color: var(--ink-2); font-size: 15px; }
.feed-day { margin: 22px 0 4px; font-size: 12.5px; color: var(--ink-3); }
.feed .item { grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: baseline; }
.feed .item .feed-who { font-size: 17px; line-height: 1; white-space: nowrap; }
.feed .item.comment span:nth-child(2) { color: var(--ink); }
.feed .item[data-go] { cursor: pointer; }
/* folds */
.fold { border-bottom: 1px solid var(--hair); }
.fold-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left; padding: 14px 0; font-size: 15px; }
.fold-h span:first-child { color: var(--ink-2); font-size: 12.5px; }
.fold-v { color: var(--ink); text-align: right; }
.fold-v::after { content: " ▾"; color: var(--ink-3); }
.fold.open .fold-v::after { content: " ▴"; }
.fold-b { display: none; padding: 0 0 14px; }
.fold.open .fold-b { display: block; }

/* top links */
.feedbar { display: flex; justify-content: flex-end; gap: 6px; align-items: center; width: 100%; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 15px; font-weight: 500; color: var(--ink); text-align: left; }
.feedbar .chev { font-size: 22px; line-height: 1; color: var(--ink-2); padding-right: 2px; }
.feedbar:active { opacity: .6; }
/* wrap cards */
.cards { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 10px calc(-1 * var(--pad)) 0; padding: 0 var(--pad); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.card { flex: 0 0 calc(100% - 20px); scroll-snap-align: start; border-radius: 22px; padding: 26px 22px 28px; color: #000; min-height: 70vh; display: flex; flex-direction: column; gap: 6px; }
.card.group { background: #111; color: var(--ink); border: 1px solid var(--hair); }
.card.group .c-name { font-size: clamp(44px, 15vw, 76px); }
.c-eyebrow { font-size: 13px; opacity: .7; margin-bottom: 8px; }
.c-name { font-size: clamp(56px, 20vw, 96px); line-height: .95; letter-spacing: -.03em; word-break: break-word; }
.c-name.caps { text-transform: uppercase; } .c-name.italic { font-style: italic; }
.c-big { font-size: 96px; font-weight: 500; letter-spacing: -.05em; line-height: 1; margin: 10px 0 14px; }
.c-big small { font-size: 36px; opacity: .7; margin-left: 2px; letter-spacing: 0; }
.c-line { font-size: 15px; line-height: 1.4; }
.c-kv { display: flex; flex-direction: column; margin: 8px 0; font-size: 15px; }
.c-kv span { font-size: 12px; opacity: .65; } .c-kv b { font-weight: 600; line-height: 1.3; } .c-kv i { font-style: normal; opacity: .75; font-size: 13px; }
.c-rank { display: flex; flex-direction: column; gap: 4px; margin-top: auto; font-size: 15px; }
.c-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.c-share { color: #000; background: var(--ink); padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.c-hint { font-size: 12.5px; }

/* gate */
#who h1.gate { margin-bottom: 14px; }
.gate-list { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; flex: 1; padding-top: 10px; }
.gate-chip { font-size: 16px; padding: 12px 16px; }
.gate-chip.on { background: var(--ink); border-color: var(--ink); color: #000; }
.gate-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; }
.gate-go { color: #000; background: var(--ink); padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15px; }
.gate-go:disabled { opacity: .5; }

.feed-link.poke { margin-top: 26px; }
