/* ============ DESK. by DRE. — same grid paper as the portfolio, but everything in code type ============ */
:root {
  --paper: #f2f1ed;
  --sheet: #faf9f6;
  --ink: #0e0e0e;
  --mute: #8b8a85;
  --faint: rgba(14, 14, 14, .18);
  --line: rgba(14, 14, 14, .06);
  --line-major: rgba(14, 14, 14, .12);
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --sans: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Libre Baskerville', Georgia, serif;
  --kraft: #d9c8a4;                              /* the folder */
  --kraft-light: #e4d5b5;
  --ease: cubic-bezier(.7, 0, .2, 1);
  --c: var(--ink);                               /* the current desk's colour */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono); font-size: 12px; line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { all: unset; cursor: pointer; }
button:focus-visible { outline: 1px dashed var(--ink); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--paper); }

.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-major) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}
.mono  { font-size: 10.5px; line-height: 12px; text-transform: uppercase; letter-spacing: .04em; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }
.sw { display: inline-block; width: 10px; height: 10px; background: var(--c); flex: none; }

/* ================= WORDMARK ================= */
.mark {
  display: inline-flex; align-items: baseline; white-space: nowrap;
  font-family: var(--mono); font-weight: 500; line-height: .8; letter-spacing: -.07em;
}
.mark .caret {
  display: inline-block; width: .52em; height: .085em; margin-left: .1em;
  background: currentColor; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.by { display: flex; align-items: center; gap: .45em; }
.by img { display: block; width: auto; }

/* ================= CORNERS ================= */
.chrome {
  position: fixed; z-index: 70;
  color: #fff; mix-blend-mode: difference;
  transition: opacity .7s ease .8s;
}
.chrome.tl { top: 24px; left: 24px; }
.chrome.bl { bottom: 24px; left: 24px; }
.chrome .mark { font-size: 32px; cursor: pointer; }
.chrome .by { margin-top: 10px; font-size: 11px; }
.chrome .by img { height: 12px; }
body.intro .chrome { opacity: 0; pointer-events: none; transition: none; }

/* ================= OPENING ================= */
#home {
  position: fixed; inset: 0; z-index: 100;
  background: #0b0b0b; cursor: pointer; transform-origin: 50% 50%;
}
.slide { position: absolute; inset: 0; background: center / cover no-repeat; visibility: hidden; filter: grayscale(1) contrast(1.05); }
.slide.on { visibility: visible; }
.slide::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .38); }
#big {
  position: absolute; left: 50%; top: 50%; z-index: 3; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, -50%) scale(.12); opacity: 0; pointer-events: none;
}
#big.land {
  transform: translate(-50%, -50%) scale(1); opacity: 1;
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(.16, 1, .3, 1), ease-out;
}
#big .mark { font-size: min(24vw, 216px); filter: drop-shadow(0 2px 18px rgba(0,0,0,.35)); }
#big .by { margin-top: 36px; font-size: 20px; transition: opacity .4s ease; }
#big .by img { height: 19px; }
#hint {
  position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; color: #fff;
  opacity: 0; transition: opacity .8s ease;
}
#home.ready #hint { opacity: .7; }
#home.zoom {
  transform: scale(5); opacity: 0; pointer-events: none;
  transition: transform 1.3s cubic-bezier(.7, 0, .25, 1), opacity .9s ease-in .35s;
}
#home.zoom #big .by, #home.zoom #hint { opacity: 0; }
.flying { position: fixed !important; z-index: 200; transform-origin: 0 0; color: #fff; }

/* ================= STAGE: one page per desk ================= */
#stage {
  position: fixed; inset: 0;
  opacity: 0; transform: scale(.92); transform-origin: 50% 40%;
  transition: opacity .5s ease, transform 1.3s var(--ease);
}
body:not(.intro) #stage { opacity: 1; transform: none; transition: opacity .8s ease .45s, transform 1.3s var(--ease); }

.layer {
  position: absolute; inset: 0;
  overflow: hidden; visibility: hidden; cursor: grab; touch-action: none;
  transform: translateX(100vw);
  transition: transform 1s var(--ease), visibility 0s linear 1s;
}
.layer.left { transform: translateX(-100vw); }
.layer.cur  { transform: none; visibility: visible; transition: transform 1s var(--ease); }
.layer.instant { transition: none !important; }
.layer.panning { cursor: grabbing; }
.layer.scroll { overflow: hidden auto; overscroll-behavior: contain; background-attachment: local; cursor: auto; touch-action: auto; }

/* the title stays put while the paper moves underneath it */
.d-head { position: absolute; left: 24px; top: 120px; right: 24px; pointer-events: none; }
.d-head .d-title, .d-head button { pointer-events: auto; }
.d-meta { display: flex; align-items: center; gap: 12px; color: var(--mute); }
.d-title {
  margin-top: 12px; font-weight: 500; font-size: 44px; line-height: 48px; letter-spacing: -.06em;
  text-transform: lowercase; width: max-content; max-width: 100%;
  color: var(--c); transition: color .4s ease;
}
.d-title[contenteditable="true"] { outline: 1px dashed var(--ink); outline-offset: 4px; }
.d-title.edit { cursor: text; }
.d-sub { margin-top: 12px; color: var(--mute); }
.d-sub b { color: var(--ink); font-weight: 400; }
.d-sub button:hover { color: var(--ink); }
/* the paper everything is stuck to: moved and scaled by the pan & zoom */
.canvas { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; pointer-events: none; }
.canvas.flat { right: 0; width: auto; min-height: 100%; transform: none !important; }
/* to-dos, timers, calendars and one-things stay put in the window while the paper moves */
.pinned { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.layer.lift .canvas { z-index: 2; }                 /* while dragging something on the paper, it goes over everything */
.win-ctl .stk.on { opacity: 1; }                   /* ● stuck to the paper / ○ floating */

#zoomer {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  display: flex; align-items: center; gap: 12px; height: 24px; padding: 0 12px;
  background: var(--sheet); box-shadow: inset 0 0 0 1px var(--ink);
  transition: opacity .7s ease 1s;
}
#zoomer button { opacity: .6; } #zoomer button:hover { opacity: 1; }
#zpct { min-width: 36px; text-align: center; }
#zoomer.off, body.intro #zoomer { opacity: 0; pointer-events: none; transition: opacity .3s; }

/* ================= WINDOWS (everything you place on a desk) ================= */
.win {
  position: absolute; pointer-events: auto;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 0 rgba(14,14,14,0);
  transition: box-shadow .2s ease;
}
.win.drag { box-shadow: inset 0 0 0 1px var(--ink), 12px 12px 0 0 rgba(14,14,14,.1); cursor: grabbing; }
.win.settle { transition: left .28s var(--ease), top .28s var(--ease), width .2s ease, box-shadow .2s ease; }
.win.new { animation: drop .7s var(--ease) both; }
@keyframes drop { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.win.gone { animation: lift .35s ease both; }
@keyframes lift { to { opacity: 0; transform: translateY(-12px); } }

.win-h {
  height: 24px; padding: 0 8px 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(var(--ink), var(--ink)) bottom / 100% 1px no-repeat;
  cursor: grab; touch-action: none; user-select: none; white-space: nowrap;
  font-size: 10.5px; line-height: 12px; text-transform: uppercase; letter-spacing: .04em;
}
.win:focus-within .win-h, .win.drag .win-h { background: var(--c); color: #fff; }
.win-name { overflow: hidden; text-overflow: ellipsis; }
.win-name::before { content: "~/"; opacity: .45; }
.win-ctl { display: flex; align-items: center; gap: 10px; }
.win-ctl .cnt { opacity: .55; }
.win-ctl button { min-width: 12px; text-align: center; opacity: .55; }
.win-ctl button:hover { opacity: 1; }
.win-b { padding: 12px; }
.grip {
  position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--ink) 50%);
  opacity: 0; transition: opacity .2s;
}
.win:hover .grip { opacity: .5; }
.win.min .win-b, .win.min .grip { display: none; }

[contenteditable] { outline: none; cursor: text; }
[contenteditable]:empty::before { content: attr(data-ph); color: var(--faint); }
input, textarea {
  all: unset; box-sizing: border-box; width: 100%; font: inherit; color: inherit; cursor: text;
}
input::placeholder, textarea::placeholder { color: var(--faint); }

/* to-do */
.w-title { font-weight: 600; font-size: 13px; line-height: 24px; letter-spacing: -.02em; }
.tasks { list-style: none; }
.tasks li, .t-add {
  display: grid; grid-template-columns: 24px 30px minmax(0, 1fr) 14px; align-items: start;
  font-size: 13px; line-height: 24px;
}
.ln { color: var(--faint); font-size: 10.5px; user-select: none; }
.cb { white-space: pre; user-select: none; }
.cb:hover { background: var(--c); color: #fff; }
.tx { overflow-wrap: anywhere; letter-spacing: -.02em; }
.tasks li.done .tx { text-decoration: line-through; color: var(--mute); }
.tasks li.done .cb { color: var(--mute); }
.del { opacity: 0; color: var(--mute); text-align: right; }
.tasks li:hover .del { opacity: 1; }
.del:hover { color: var(--ink); }
.t-add input { grid-column: 3 / 5; letter-spacing: -.02em; }
.t-add .ln { grid-column: 1; }

/* note (older desks) */
.t-note .win-b { padding: 0 12px; }
.t-note textarea { display: block; height: 100%; font-size: 13px; line-height: 24px; letter-spacing: -.02em; resize: none; overflow: auto; }

/* sticky notes */
.win.t-sticky {
  cursor: grab;
  background: var(--bg, #f4e8a6);
  box-shadow: 0 1px 0 rgba(14,14,14,.1), 4px 5px 0 rgba(14,14,14,.06);
}
.win.t-sticky.drag { box-shadow: 0 1px 0 rgba(14,14,14,.1), 14px 16px 0 rgba(14,14,14,.1); }
.t-sticky .win-h, .t-sticky:focus-within .win-h, .t-sticky.drag .win-h {
  background: none; color: var(--ink); opacity: 0; transition: opacity .2s;
}
.t-sticky:hover .win-h, .t-sticky:focus-within .win-h, .t-sticky.drag .win-h { opacity: 1; }
.st-tools { display: flex; gap: 7px; }
.t-sticky .win-ctl, .t-title .win-ctl { gap: 7px; }
.t-sticky .win-h { padding: 0 8px 0 10px; gap: 8px; }
.st-tools button { opacity: .5; text-transform: none; }
.st-tools button:hover { opacity: 1; }
.t-sticky .win-b { padding: 0 14px 14px; overflow: auto; }
.st-tx { min-height: 100%; line-height: 1.5; letter-spacing: -.01em; overflow-wrap: anywhere; user-select: none; cursor: inherit; }
.st-tx:empty::before { content: attr(data-ph); color: rgba(14,14,14,.3); }
.t-sticky.editing { cursor: auto; }
.t-sticky.editing .st-tx { user-select: text; cursor: text; }
.t-sticky.editing .win-b { box-shadow: inset 0 0 0 1px rgba(14,14,14,.25); }
.st-tx ul { padding-left: 1.1em; }
.chk { cursor: pointer; font-family: var(--mono); font-size: .9em; white-space: pre; user-select: none; }
.chk:hover { background: var(--ink); color: var(--paper); }
.st-tx s.ck { text-decoration: line-through; text-decoration-thickness: 1px; opacity: .5; }
.t-sticky .grip { background: linear-gradient(135deg, transparent 50%, rgba(14,14,14,.35) 50%); }

/* titles: big words on the paper, with an optional backing */
.win.t-title {
  cursor: grab; background: var(--bg, transparent);
  box-shadow: 0 1px 0 rgba(14,14,14,.1), 4px 5px 0 rgba(14,14,14,.06);
}
.win.t-title.bare { box-shadow: none; }
.win.t-title.bare:hover { box-shadow: inset 0 0 0 1px rgba(14,14,14,.15); }
.win.t-title.dark { color: var(--paper); }
.t-title .win-h {                                 /* its tools float just above it */
  position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 4px;
  background: none !important; color: var(--ink) !important; opacity: 0; transition: opacity .2s;
}
.t-title:hover .win-h, .t-title:focus-within .win-h { opacity: 1; }
.t-title .win-b { padding: 14px 22px; }
.t-title .st-tx { line-height: 1.12; font-weight: 500; letter-spacing: -.02em; min-height: 0; }
.t-title.editing .win-b { box-shadow: inset 0 0 0 1px rgba(14,14,14,.25); }
.t-title .grip { background: linear-gradient(135deg, transparent 50%, rgba(14,14,14,.35) 50%); }

/* one thing */
.o-k { color: var(--mute); padding-top: 6px; padding-bottom: 6px; }
.o-tx { font-weight: 500; font-size: 18px; line-height: 24px; letter-spacing: -.04em; margin-bottom: 12px; min-height: 24px; }
.o-done { font-size: 12px; }
.o-done:hover { text-decoration: underline; text-underline-offset: 3px; }
.t-one.done .o-tx { text-decoration: line-through; color: var(--mute); }

/* timer */
.tm-l { font-size: 13px; line-height: 24px; letter-spacing: -.02em; }
.tm-d { font-weight: 500; font-size: 48px; line-height: 48px; letter-spacing: -.07em; margin: 12px 0; font-variant-numeric: tabular-nums; }
.tm-row { display: flex; justify-content: space-between; }
.tm-row button { opacity: .45; }
.tm-row button:hover, .tm-row button.on { opacity: 1; }
.tm-row button.on::before { content: "["; } .tm-row button.on::after { content: "]"; }
.tm-go { font-weight: 600; }
.t-timer.ring { animation: ring .5s steps(1) 6; }
@keyframes ring { 50% { background: var(--c); color: #fff; } }

/* mini calendar */
.mc-h { display: flex; justify-content: space-between; font-weight: 600; letter-spacing: -.02em; }
.mc-h button { width: 24px; text-align: center; }
.mc-g { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-top: 6px; }
.mc-g .dow { color: var(--mute); font-size: 10.5px; }
.mc-g button { height: 24px; line-height: 22px; position: relative; font-size: 12px; }
.mc-g button:hover { background: var(--line-major); }
.mc-g button.out { color: var(--faint); }
.mc-g button.today { background: var(--ink); color: var(--paper); }
.mc-g button.sel { box-shadow: inset 0 0 0 1px var(--c); }
.mc-g .dots { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 2px; }
.dots i, .sq { display: block; width: 4px; height: 4px; background: var(--c); }
.mc-add { display: grid; grid-template-columns: 56px 1fr; margin-top: 6px; font-size: 12px; box-shadow: inset 0 -1px 0 var(--ink); }
.mc-add span { color: var(--mute); }
.mc-add.pick { grid-template-columns: 56px 1fr auto; }
.mc-desk { display: flex; align-items: center; gap: 6px; font-size: 11px; padding-left: 8px; opacity: .7; }
.mc-desk:hover { opacity: 1; }
.mc-up { list-style: none; margin-top: 12px; padding-top: 6px; box-shadow: inset 0 1px 0 var(--line-major); }
.mc-up li { display: grid; grid-template-columns: 14px 56px minmax(0, 1fr); align-items: center; font-size: 12px; }
.mc-up li .sq { width: 6px; height: 6px; }
.mc-up li span:first-of-type { color: var(--mute); }
.mc-up .tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-up .none { display: block; color: var(--mute); }

/* overview snippets */
.snip .win-name::before { content: none; }
.snip .win-name { display: flex; align-items: center; gap: 8px; }
.snip .open { opacity: .55; }
.snip .open:hover { opacity: 1; }
.snip .s-one { font-weight: 600; letter-spacing: -.02em; font-size: 13px; }
.snip .s-one span { font-weight: 400; color: var(--c); }
.snip .s-note { color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snip .s-ev { font-size: 12px; display: flex; gap: 8px; align-items: center; }
.snip .s-ev .sq { width: 6px; height: 6px; }
.snip .s-more, .snip .s-empty { color: var(--mute); font-size: 12px; }
.snip .s-foot {
  display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px;
  background: linear-gradient(var(--line-major), var(--line-major)) top / 100% 1px no-repeat;
}
.bar { letter-spacing: .08em; font-size: 10px; color: var(--c); }
.bar i { font-style: normal; color: var(--faint); }

/* ================= CALENDAR PAGE ================= */
.legend { position: absolute; left: 24px; top: 240px; right: 24px; display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; pointer-events: auto; }
.legend .lg-k { color: var(--mute); }
.chip { display: inline-flex; align-items: center; gap: 6px; opacity: .5; }
.chip:hover, .chip.on { opacity: 1; }
.chip.on .nm::before { content: "["; } .chip.on .nm::after { content: "]"; }
.cal {
  position: absolute; left: 23px; top: 287px; display: grid; pointer-events: auto;
  border-left: 1px solid var(--ink); border-top: 1px solid var(--ink);
}
.cal .dow { height: 24px; padding: 0 8px; display: flex; align-items: center; color: var(--mute); box-shadow: inset -1px -1px 0 var(--ink); background: var(--paper); }
.cal .cell {
  height: 120px; padding: 0 6px; overflow: hidden; cursor: cell;
  background: rgba(250, 249, 246, .7);
  box-shadow: inset -1px -1px 0 var(--ink);
}
.cal .cell.out { background: transparent; }
.cal .cell.out .dn { color: var(--faint); }
.cal .dn { font-size: 10.5px; line-height: 24px; padding-left: 2px; }
.cal .today .dn span { background: var(--ink); color: var(--paper); padding: 2px 5px; }
/* the calendar shows the actual sticky notes, small: same paper, font and shadow as on the desk,
   with a little square of the desk's colour in the corner */
.ev {
  display: block; position: relative; width: calc(100% - 6px); margin: 0 3px 5px; padding: 5px 18px 5px 7px;
  box-sizing: border-box; text-align: left; cursor: grab; touch-action: none;
  background: var(--bg, #f4e8a6);
  box-shadow: 0 1px 0 rgba(14,14,14,.1), 3px 3px 0 rgba(14,14,14,.06);
  color: var(--ink); font-size: 11px; line-height: 14px; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: box-shadow .15s ease;
}
.ev::after { content: ""; position: absolute; right: 6px; top: 50%; margin-top: -3px; width: 6px; height: 6px; background: var(--c); }
.ev:hover { box-shadow: 0 1px 0 rgba(14,14,14,.1), 5px 6px 0 rgba(14,14,14,.1); }
.ev-ghost { position: fixed; z-index: 95; pointer-events: none; margin: 0; transform: rotate(-3deg); box-shadow: 8px 10px 0 rgba(14,14,14,.12); }
.cal .cell.over { background: var(--sheet); box-shadow: inset 0 0 0 2px var(--ink); }

/* the date tag on a sticky that's on the calendar */
.st-date {
  position: absolute; left: 10px; bottom: 7px; z-index: 2; display: none;
  height: 16px; line-height: 16px; padding: 0 6px; font-size: 10px;
  background: rgba(14,14,14,.08); color: rgba(14,14,14,.7);
}
.st-date.on { display: block; }
.st-date:hover { background: var(--ink); color: var(--paper); }
.t-sticky .mn { display: none; }                   /* folding doesn't make sense for a sticky */

.pop-ta { height: auto; min-height: 54px; line-height: 18px; padding: 3px 0; white-space: pre-wrap; resize: none; }
.pop-date { font-size: 12px; }
.pop-quick { display: flex; gap: 14px; margin: 6px 0; color: rgba(14,14,14,.6); }
.pop-quick button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pop-go { display: block; margin-top: 6px; font-size: 12px; }
.pop-go:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal .more { font-size: 10.5px; color: var(--mute); }
.cal .cell input { font-size: 11px; height: 20px; box-shadow: inset 0 -1px 0 var(--ink); }

/* ================= FLOATING TOOLBAR ================= */
#dock {
  position: fixed; z-index: 60; width: 216px;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--ink), 8px 8px 0 rgba(14,14,14,.07);
  transition: opacity .7s ease 1s, transform 1s var(--ease) .7s;
}
body.intro #dock { opacity: 0; transform: translateY(24px); pointer-events: none; transition: none; }
#dock .win-h, #dock:focus-within .win-h, #dock.drag .win-h { background: var(--ink); color: var(--paper); }
#dock.drag { box-shadow: inset 0 0 0 1px var(--ink), 14px 14px 0 rgba(14,14,14,.1); }
#dock .win-b { padding: 12px 12px 6px; }
.p-h { display: flex; justify-content: space-between; color: var(--mute); padding: 6px 0; }
#tools { margin-top: 12px; }
.p-sub { margin-top: 12px; }
.p-list { list-style: none; }
.p-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: 6px; align-items: center;
  width: 100%; height: 24px; font-size: 13px; letter-spacing: -.02em; cursor: pointer;
}
.p-row .ic { font-size: 12px; color: var(--mute); text-align: left; }
.p-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-row .ct { font-size: 10.5px; color: var(--mute); }
.p-row:hover .nm { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.p-row.on { font-weight: 600; }
.p-row.on .nm::before { content: "> "; }
.p-row .ed { color: var(--mute); opacity: 0; width: 12px; text-align: center; }
.p-row:hover .ed { opacity: 1; }
.p-row .ed:hover { color: var(--ink); }
.p-row.add { color: var(--mute); }
.p-row.add:hover { color: var(--ink); }
.p-row input { font-size: 13px; letter-spacing: -.02em; }
.kbd { font-size: 10px; color: var(--mute); border: 1px solid var(--faint); line-height: 14px; padding: 0 4px; }
#tools.off .p-row { opacity: .3; pointer-events: none; }
#toolsNote { color: var(--mute); font-size: 12px; display: none; line-height: 18px; margin-top: 6px; }
#tools.off #toolsNote { display: block; }
.p-foot { margin-top: 12px; padding-top: 6px; display: flex; justify-content: space-between; color: var(--mute); box-shadow: inset 0 1px 0 var(--line-major); }
#dock.min .win-b { display: none; }

/* ================= POP-OVER (rename / colour / events) ================= */
#pop {
  position: fixed; z-index: 90; width: 216px; padding: 12px;
  background: var(--sheet); box-shadow: inset 0 0 0 1px var(--ink), 8px 8px 0 rgba(14,14,14,.08);
  display: none;
}
#pop.on { display: block; }
.pop-k { color: var(--mute); padding: 6px 0; }
.pop-in { font-size: 13px; height: 24px; letter-spacing: -.02em; box-shadow: inset 0 -1px 0 var(--ink); margin-bottom: 6px; }
.sws { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 6px; }
.sws button { height: 20px; background: var(--c); }
.sws button.on { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 3px var(--ink); }
.pop-desks { display: flex; flex-direction: column; margin-bottom: 6px; }
.pop-desks button { display: flex; align-items: center; gap: 8px; height: 24px; font-size: 12px; opacity: .55; }
.pop-desks button.on, .pop-desks button:hover { opacity: 1; }
.pop-desks button.on span::before { content: "> "; }
.pop-del { display: block; margin-top: 6px; font-size: 12px; color: var(--mute); }
.pop-del:hover { color: #b5482f; }

/* ================= THE FOLDER ================= */
#folder {
  position: fixed; left: 50%; bottom: 0; z-index: 55;
  width: min(760px, calc(100vw - 48px)); height: min(72vh, 640px);
  transform: translate(-50%, calc(100% - 84px));
  transition: transform .6s var(--ease);
  perspective: 1600px; cursor: pointer;
}
#folder:hover, #folder.peek { transform: translate(-50%, calc(100% - 112px)); }
#folder.open { transform: translate(-50%, 0); cursor: auto; }
#folder.off, body.intro #folder { transform: translate(-50%, 110%); pointer-events: none; }
#folder.gulp { animation: gulp .45s ease; }
@keyframes gulp { 40% { margin-bottom: -10px; } 70% { margin-bottom: 4px; } }

.f-back {
  position: absolute; inset: 22px 0 0 0;
  background: var(--kraft); box-shadow: inset 0 0 0 1px rgba(14,14,14,.4);
}
.f-tab {
  position: absolute; left: 24px; top: -22px; height: 23px; padding: 0 22px;
  display: flex; align-items: center; gap: 8px;
  background: var(--kraft);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%);
}
.f-tab::before {                                  /* hairline edge of the tab */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(14,14,14,.4), rgba(14,14,14,.4)) top / 100% 1px no-repeat;
}
.f-name { color: rgba(14,14,14,.7); }
/* papers peeking out of the top once something is filed */
.f-sheets { position: absolute; left: 20px; right: 20px; top: 10px; height: 40px; display: none; }
#folder.full .f-sheets { display: block; }
#folder.open .f-sheets { display: none; }
.f-sheets::before, .f-sheets::after {
  content: ""; position: absolute; inset: 0; background: var(--sheet); box-shadow: inset 0 0 0 1px rgba(14,14,14,.25);
}
.f-sheets::after { left: 24px; right: -8px; top: 6px; background: #f3efe6; transform: rotate(-.6deg); }

.f-front {
  position: absolute; left: 0; right: 0; top: 48px; bottom: 0;
  background: var(--kraft-light);
  box-shadow: inset 0 0 0 1px rgba(14,14,14,.4), 0 -3px 8px rgba(14,14,14,.06);
  transform-origin: 50% 100%;
  transition: transform .8s var(--ease), opacity .25s ease;
}
#folder.open .f-front { transform: rotateX(-86deg); opacity: 0; transition: transform .8s var(--ease), opacity .3s ease .4s; }
.f-label { position: absolute; left: 24px; right: 24px; top: 14px; display: flex; justify-content: space-between; color: rgba(14,14,14,.6); }

.f-inside {
  position: absolute; inset: 20px 24px 24px; overflow: auto;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
#folder.open .f-inside { opacity: 1; pointer-events: auto; transition: opacity .4s ease .35s; }
.f-bar { display: flex; justify-content: space-between; align-items: center; height: 24px; color: rgba(14,14,14,.6); }
.f-acts { display: flex; gap: 16px; }
.f-bar button:hover, .f-crumbs button:hover { color: var(--ink); }
.f-crumbs { display: flex; gap: 6px; align-items: center; }
.f-crumbs button { color: rgba(14,14,14,.6); }
.f-crumbs b { color: var(--ink); font-weight: 500; }
.f-crumbs .over { color: var(--ink); text-decoration: underline; }

.f-subs { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 12px 0 18px; }
.f-subs:empty { display: none; }
.sub { position: relative; width: 104px; text-align: left; cursor: pointer; }
.sub .ico {                                       /* a tiny folder */
  position: relative; height: 64px; margin-top: 8px;
  background: #cdb88f; box-shadow: inset 0 0 0 1px rgba(14,14,14,.4);
  transition: transform .25s var(--ease);
}
.sub .ico::before {
  content: ""; position: absolute; left: 8px; top: -8px; width: 36px; height: 9px;
  background: #cdb88f; clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 100%, 0 100%);
}
.sub .ico::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background: var(--kraft-light); box-shadow: inset 0 0 0 1px rgba(14,14,14,.4);
}
.sub:hover .ico, .sub.over .ico { transform: translateY(-4px); }
.sub.over .ico::after { background: var(--sheet); }
.sub .ct { position: absolute; left: 8px; bottom: 6px; z-index: 1; font-size: 10px; color: rgba(14,14,14,.5); }
/* long folder names wrap onto the next line instead of being cut off */
.sub .nm { display: block; margin-top: 6px; font-size: 12px; line-height: 16px; letter-spacing: -.02em; white-space: normal; overflow-wrap: anywhere; }
.sub .nm[contenteditable="true"] { outline: 1px dashed var(--ink); }
.sub .x { position: absolute; right: 0; top: 0; z-index: 2; opacity: 0; font-size: 12px; }
.sub:hover .x { opacity: .6; }

.f-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.f-empty { grid-column: 1 / -1; color: rgba(14,14,14,.55); font-size: 12px; padding: 24px 0; }
.file {
  position: relative; height: 132px; padding: 8px 10px; overflow: hidden; cursor: grab;
  background: var(--bg, var(--sheet)); box-shadow: inset 0 0 0 1px rgba(14,14,14,.55), 2px 2px 0 rgba(14,14,14,.06);
  touch-action: none; user-select: none;
}
.file:hover { box-shadow: inset 0 0 0 1px var(--ink), 4px 4px 0 rgba(14,14,14,.08); }
.file .fk { display: flex; justify-content: space-between; color: var(--mute); margin-bottom: 6px; }
.file .fb { font-size: 12px; line-height: 18px; letter-spacing: -.01em; }
.file .fb s { color: var(--mute); }
.file .fa {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between;
  padding: 0 10px; height: 24px; align-items: center; background: var(--ink); color: var(--paper);
  font-size: 11px; transform: translateY(100%); transition: transform .2s ease;
}
.file:hover .fa { transform: none; }
.file.dragging { opacity: .3; }
.file-ghost { position: fixed; z-index: 95; pointer-events: none; width: 168px; transform: rotate(-3deg); opacity: .9; }

/* a note on its way into the folder (sits just under the folder so it slides inside) */
.to-folder { position: fixed !important; z-index: 54 !important; pointer-events: none; transform-origin: 0 0; margin: 0; }
/* moving something to another desk: it shrinks into that desk in the toolbar */
.to-desk { position: fixed !important; z-index: 61 !important; pointer-events: none; transform-origin: 0 0; margin: 0; }
body.carrying #deskList .p-row[data-desk] { box-shadow: inset 0 0 0 1px var(--faint); }
body.carrying #deskList .p-row[data-desk].on { box-shadow: none; opacity: .4; }
#deskList .p-row.drop { background: var(--ink); color: var(--paper); box-shadow: none; }
#deskList .p-row.drop .ic, #deskList .p-row.drop .ct { color: var(--paper); }
#deskList .p-row.got { animation: got .7s ease; }
@keyframes got { 30% { background: var(--line-major); } }

/* ================= ACCOUNT (bottom of the toolbar) ================= */
.p-acct {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 6px;
  font-size: 11px; line-height: 18px; color: var(--mute); box-shadow: inset 0 1px 0 var(--line-major);
}
.p-acct:empty { display: none; }
.p-acct .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-acct button { color: var(--ink); white-space: nowrap; }
.p-acct button:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ================= SIGN IN ================= */
#auth {
  position: fixed; inset: 0; z-index: 85;
  display: grid; place-items: center; padding: 96px 24px 48px; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s;
}
#auth.on { opacity: 1; visibility: visible; transition: opacity .7s ease .5s; }
#auth.over { z-index: 150; }                          /* coming back from a password-reset email */
body.authing #dock, body.authing #zoomer, body.authing #folder { opacity: 0; pointer-events: none; }
body.authing .chrome.bl { opacity: 0; }
body.authing .chrome.tl { z-index: 90; }            /* keep the DESK logo in the corner */

.a-wrap { position: relative; width: min(384px, 100%); }
#auth .a-card { position: relative; width: 100%; box-shadow: inset 0 0 0 1px var(--ink), 12px 12px 0 rgba(14,14,14,.07); }
#auth .a-card .win-h { background: var(--ink); color: var(--paper); cursor: default; }
#auth .a-card .win-name::before { content: "~/"; }
#auth .a-card .win-b { padding: 24px 24px 20px; }
#auth .a-card .win-ctl { opacity: .5; }
#auth.on .a-card { animation: drop .8s var(--ease) .55s both; }

.a-title { font-weight: 500; font-size: 32px; line-height: 36px; letter-spacing: -.06em; text-transform: lowercase; }
.a-sub { color: var(--mute); margin-top: 8px; }
.a-note-top { margin-top: 16px; font-size: 13px; line-height: 20px; letter-spacing: -.01em; }
#authForm { margin-top: 24px; }
.a-f { display: block; margin-bottom: 16px; }
.a-f[hidden] { display: none; }
.a-f > span { display: block; color: var(--mute); margin-bottom: 4px; }
.a-f input {
  display: block; width: 100%; height: 36px; font-size: 14px; letter-spacing: -.01em;
  box-shadow: inset 0 -1px 0 var(--ink); transition: box-shadow .2s ease;
}
.a-f input:focus { box-shadow: inset 0 -2px 0 var(--ink); }
.a-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--mute); }
.a-hint:empty { display: none; }
.a-go {
  display: block; width: 100%; height: 44px; margin-top: 8px; box-sizing: border-box;
  background: var(--ink); color: var(--paper); text-align: center; font-size: 13px; letter-spacing: .01em;
  transition: background .2s ease, color .2s ease;
}
.a-go:hover { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.a-go[hidden] { display: none; }
#auth.busy .a-go { opacity: .5; cursor: wait; }
.a-msg { min-height: 0; margin-top: 10px; font-size: 12px; line-height: 18px; }
.a-msg:empty { margin: 0; }
.a-msg.err { color: #b5482f; }
.a-msg.ok { color: #2f7a78; }
.a-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.a-links:empty { display: none; }
.a-links button { color: var(--mute); text-transform: uppercase; }
.a-links button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.a-else[hidden] { display: none; }
.a-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--mute); }
.a-or::before, .a-or::after { content: ""; flex: 1; height: 1px; background: var(--line-major); }
.a-guest {
  display: block; width: 100%; height: 40px; box-sizing: border-box; text-align: center;
  box-shadow: inset 0 0 0 1px var(--ink); font-size: 12px;
}
.a-guest:hover { background: var(--ink); color: var(--paper); }
.a-note { margin-top: 8px; text-align: center; font-size: 11px; color: var(--mute); }

/* a sticky note stuck to the corner of the card */
.a-sticky {
  position: absolute; left: calc(100% - 36px); top: -52px; width: 184px; min-height: 150px; padding: 18px 16px;
  background: #f4e8a6; box-shadow: 0 1px 0 rgba(14,14,14,.1), 4px 5px 0 rgba(14,14,14,.06);
  font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.5; letter-spacing: .01em;
  transform: rotate(3deg); z-index: 2; pointer-events: none;
}
#auth.on .a-sticky { animation: drop .7s var(--ease) .95s both; }
@media (max-width: 859px) { .a-sticky { display: none; } #auth { padding-top: 120px; } }

/* ================= THE TOUR ================= */
#tour { position: fixed; inset: 0; z-index: 96; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; }
#tour.on { opacity: 1; visibility: visible; transition: opacity .4s ease; }
.t-ring {                                             /* a frame around the thing, with the rest of the page softly faded */
  position: fixed; box-shadow: 0 0 0 1px var(--ink), 0 0 0 9999px rgba(242,241,237,.78);
  transition: left .5s var(--ease), top .5s var(--ease), width .5s var(--ease), height .5s var(--ease);
}
.t-ring.none { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px rgba(242,241,237,.78); }
.t-card {                                             /* the explanation is a sticky note */
  position: fixed; width: 300px; padding: 18px 18px 14px; pointer-events: auto;
  background: #f4e8a6; box-shadow: 0 1px 0 rgba(14,14,14,.1), 6px 7px 0 rgba(14,14,14,.08);
  transform: rotate(-1deg);
  transition: left .5s var(--ease), top .5s var(--ease), opacity .3s ease;
}
.t-n { color: rgba(14,14,14,.5); }
.t-t { margin-top: 8px; font-weight: 500; font-size: 22px; line-height: 26px; letter-spacing: -.05em; }
.t-x { margin-top: 8px; font-size: 13px; line-height: 20px; letter-spacing: -.01em; }
.t-b { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.t-skip { color: rgba(14,14,14,.55); }
.t-skip:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.t-next { height: 30px; line-height: 30px; padding: 0 14px; background: var(--ink); color: var(--paper); font-size: 12px; }
.t-next:hover { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ================= TOAST ================= */
#toast {
  position: fixed; left: 24px; bottom: 72px; z-index: 80;
  background: var(--ink); color: var(--paper); padding: 0 12px; height: 24px;
  display: flex; align-items: center; gap: 12px; font-size: 12px;
  transform: translateY(12px); opacity: 0; pointer-events: none; transition: .3s ease;
}
#toast.on { transform: none; opacity: 1; pointer-events: auto; }
#toast button { text-decoration: underline; text-underline-offset: 3px; }

/* ================= PHONES ================= */
@media (max-width: 859px) {
  .chrome.bl { display: none; }
  .d-head { top: 120px; }
  .d-title { font-size: 34px; line-height: 48px; }
  .cal .cell { height: 96px; padding: 0 2px; }
  .ev { font-size: 9px; padding: 4px 3px 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01s !important; animation-duration: .01s !important; }
}
