:root {
  --page: #e9e8e3;
  --win: #ffffff;
  --bar: #f5f4f1;
  --side: #f5f4f1;
  --line: #e4e3df;
  --ink: #2b2b2a;
  --muted: #6f6e69;
  --faint: #9a9994;
  --accent: #6fb51f;
  --accent-ink: #4f8a12;
  --hover: rgba(0, 0, 0, .055);
  --label: #55544f;
  --label-bg: rgba(255, 255, 255, .86);
  --label-hover: rgba(236, 235, 231, .95);
  --float: 0 24px 60px -18px rgba(30, 28, 20, .32);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0c0d0d; --win: #19191a; --bar: #202021; --side: #202021; --line: #2c2c2e;
    --ink: #ecebe7; --muted: #a8a7a2; --faint: #7d7c78; --accent: #a6e33a; --accent-ink: #a6e33a;
    --hover: rgba(255, 255, 255, .07); --label: #d6d5d0; --label-bg: rgba(25, 25, 26, .84);
    --label-hover: rgba(48, 48, 50, .95); --float: 0 24px 60px -18px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0c0d0d; --win: #19191a; --bar: #202021; --side: #202021; --line: #2c2c2e;
  --ink: #ecebe7; --muted: #a8a7a2; --faint: #7d7c78; --accent: #a6e33a; --accent-ink: #a6e33a;
  --hover: rgba(255, 255, 255, .07); --label: #d6d5d0; --label-bg: rgba(25, 25, 26, .84);
  --label-hover: rgba(48, 48, 50, .95); --float: 0 24px 60px -18px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  display: grid;
  place-items: center;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* the window: surfaces are told apart by tone, not lines */
.window {
  position: relative;
  width: min(1240px, calc(100vw - 48px));
  height: min(800px, calc(100svh - 48px));
  background: var(--win);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 268px 1fr;
  grid-template-rows: 48px auto 1fr 30px;
  overflow: hidden;
}
.sidebar { grid-column: 1; grid-row: 1 / -1; }
.titlebar { grid-column: 2; grid-row: 1; }
.find { grid-column: 2; grid-row: 2; }
.stage { grid-column: 2; grid-row: 3; position: relative; }
.statusbar { grid-column: 2; grid-row: 4; }

/* sidebar */
.sidebar {
  display: flex; flex-direction: column;
  padding: 18px 14px 16px;
  background: var(--side);
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.me { padding: 30px 10px 20px; }
.me-name {
  margin: 0;
  font: 400 48px/0.95 "Instrument Serif", Georgia, serif;
  letter-spacing: -.015em;
}
.me-bio { margin: 14px 0 0; color: var(--ink); font-size: 18px; line-height: 1.5; text-wrap: pretty; }
.me-bio b { font-weight: 600; }
.me-cta {
  margin-top: 18px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; background: var(--ink); color: var(--win);
  font-weight: 600; font-size: 15px;
  transition: transform .2s ease, background .2s ease;
}
.me-cta:hover { background: var(--accent-ink); color: #fff; }
.me-cta:active { transform: scale(.97); }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-h { margin: 18px 10px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.side-nav button, .side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 10px; border-radius: 8px;
  font-size: 15px; font-weight: 500; text-decoration: none; text-align: left;
  color: var(--ink);
}
.side-nav button:hover, .side-nav a:hover { background: var(--hover); }
.side-nav [aria-current="true"] { background: var(--hover); }
.side-nav svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--accent-ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.side-nav img { width: 17px; height: 17px; border-radius: 4px; flex: none; }
.side-foot { margin: auto 10px 0; padding-top: 20px; font-size: 13px; line-height: 1.7; color: var(--muted); }
@media (max-height: 900px) {
  .me { padding-top: 18px; }
  .side-foot { display: none; }
}
@media (max-height: 820px) and (min-width: 861px) {
  .me { padding: 8px 10px 12px; }
  .me-name { font-size: 40px; }
  .me-bio { font-size: 16px; margin-top: 10px; }
  .me-cta { margin-top: 12px; min-height: 40px; }
  .side-h { margin: 12px 10px 4px; }
  .side-nav button, .side-nav a { padding: 5px 10px; font-size: 14px; }
}

/* title bar */
.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px;
  user-select: none;
}
.tools { display: flex; gap: 4px; }
.tools.end { justify-self: end; }
.tools:first-child { justify-self: start; }
.lights { display: flex; gap: 8px; padding-left: 4px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.crumbs { display: flex; align-items: center; gap: 2px; font-weight: 600; font-size: 14px; min-width: 0; }
.crumbs button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 6px; white-space: nowrap; }
.crumbs button:hover { background: var(--hover); }
.crumbs button[aria-current="true"] { cursor: default; }
.crumbs button[aria-current="true"]:hover { background: none; }
.crumbs .sep { color: var(--faint); font-weight: 400; }
.crumbs svg { width: 16px; height: 16px; flex: none; }
.tool { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.tool:hover { background: var(--hover); color: var(--ink); }
.tool:disabled { opacity: .35; cursor: default; background: none; }
.tool svg { width: 16px; height: 16px; }

/* find */
.find { position: relative; padding: 4px 14px 10px; }
.find input {
  width: 100%; font: inherit; color: var(--ink); background: var(--bar);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; outline: none;
}
.find input:focus { border-color: var(--accent); }
.find ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 200px; overflow: auto; }
.find li { padding: 6px 12px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.find li span { color: var(--muted); font-size: 13px; }
.find li[aria-selected="true"] { background: var(--hover); }

/* stage */
.stage { overflow: hidden; cursor: default; touch-action: pan-y; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.items { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.item {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap; pointer-events: auto;
  font-size: 15px; font-weight: 500; letter-spacing: -.005em;
  color: var(--label);
  opacity: 0; transition: opacity .35s ease, color .2s ease;
  will-change: transform;
  padding: 2px 4px; border-radius: 6px;
}
.item.on { opacity: 1; }
.item.on.dim { opacity: .28; }
.item.on.dim:hover, .item.on.dim:focus-visible { opacity: 1; }
.item:not(.on) { pointer-events: none; }
.item span {
  padding: 1px 6px; margin-left: -3px; border-radius: 5px;
  background: var(--label-bg);
  transition: background .2s ease, color .2s ease;
}
.item.dim span { background: none; }
.item:hover, .item.open { color: var(--ink); }
.item:hover span { background: var(--label-hover); }
.item.dir.open span { font-weight: 600; }
.item svg { width: 24px; height: 24px; flex: none; overflow: visible; margin-left: -16px; color: var(--label); }
.item .ic-fill { fill: var(--win); }
.item.open .ic-closed, .item:not(.open) .ic-open { display: none; }
.item.open svg, .item:hover svg { color: var(--ink); }
.item.file svg { opacity: .85; }
.stage.bird-hover { cursor: pointer; }

/* the falcon's speech bubble */
.say { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; visibility: hidden; }
.say.on { visibility: visible; }
.say span {
  position: absolute; left: 0; bottom: 0; translate: -50% 0;
  display: block; padding: 7px 12px; border-radius: 12px;
  background: var(--ink); color: var(--win);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transform-origin: 50% 100%;
}
.say span::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink);
}
.hint {
  position: absolute; right: 24px; top: 14px; margin: 0; z-index: 3;
  color: var(--muted); font-size: 13px; transition: opacity .6s ease; pointer-events: none;
}
.hint.gone { opacity: 0; }

/* the big words, and the folder's picture opposite them */
.headline {
  position: absolute; z-index: 3; left: 32px; bottom: 28px;
  width: min(640px, calc(100% - 64px)); pointer-events: none;
}
.has-cover .headline { width: min(620px, calc(100% - 64px - clamp(220px, 24vw, 320px) - 40px)); }
/* a neutral scrim, so the words never sit on bark */
.headline::before {
  content: ""; position: absolute; z-index: -1;
  left: -32px; right: -100vw; top: -48px; bottom: -28px;
  background: linear-gradient(to bottom, transparent, var(--win) 40%); /* taste-skill-ignore: neutral scrim over the pixel art */
}
.headline > * { transition: opacity .45s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.headline.swap > * { opacity: 0; transform: translateY(10px); }
.hl-title {
  margin: 0; font: 400 clamp(36px, 4.6vw, 66px)/1 "Instrument Serif", Georgia, serif;
  letter-spacing: -.02em; text-wrap: balance;
}
.hl-title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.hl-title .w > span { display: inline-block; transform-origin: 0 100%; }
.hl-sub { margin: 16px 0 0; max-width: 48ch; color: var(--ink); font-size: 17px; line-height: 1.5; text-wrap: pretty; }
.me-name .ch { display: inline-block; }

.cover {
  position: absolute; z-index: 3; right: 32px; bottom: 28px; margin: 0;
  width: clamp(220px, 24vw, 320px);
}
.cover[hidden] { display: none; }
.cover-media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--bar); }
.cover-media > * { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* status */
.statusbar {
  display: flex; justify-content: center; align-items: center; position: relative;
  background: var(--bar);
  font-size: 13px; color: var(--muted); user-select: none;
}
.falcon-note { position: absolute; right: 16px; }

/* quick look: a solid sheet that really floats */
.ql {
  position: absolute; z-index: 5;
  right: 18px; top: 64px; bottom: 46px;
  width: min(460px, calc(100% - 36px));
  background: var(--win);
  border-radius: 12px;
  box-shadow: var(--float); /* taste-skill-ignore: the preview sheet floats */
  display: flex; flex-direction: column;
  animation: ql-in .28s cubic-bezier(.2,.8,.2,1);
}
.ql[hidden] { display: none; }
@keyframes ql-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.has-motion .ql, .has-motion .leave[open] { animation: none; }
.ql-bar { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 14px 16px 12px; background: var(--bar); border-radius: 12px 12px 0 0; }
.ql-close { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--hover); align-self: center; }
.ql-close:hover { color: var(--ink); }
.ql-close svg { width: 12px; height: 12px; }
.ql h2 { margin: 0; font-size: 15px; font-weight: 600; }
.ql-path { font-size: 13px; color: var(--muted); }
.ql-body { padding: 20px 22px 24px; overflow: auto; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.ql-body p { margin: 0 0 14px; }
.ql-body ul { margin: 0 0 14px; padding-left: 18px; }
.ql-body li { margin-bottom: 8px; }
.ql-big { font: 400 32px/1.06 "Instrument Serif", Georgia, serif; letter-spacing: -.015em; text-wrap: balance; }
.ql-list { margin: 0; padding-left: 22px; }
.ql-list li { margin-bottom: 14px; padding-left: 4px; }
.ql-list li::marker { font: 400 20px "Instrument Serif", Georgia, serif; color: var(--accent-ink); }
.ql-meta { color: var(--muted); font-size: 13px; }
.ql-icon { display: block; border-radius: 12px; margin-bottom: 14px; }
.ql-shot { display: block; width: 100%; height: auto; border-radius: 6px; margin-bottom: 14px; background: var(--bar); }
.ql-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--ink); color: var(--win); text-decoration: none; font-weight: 600; }
.ql-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; align-items: baseline; }
.ql-dl dt { font-weight: 600; white-space: nowrap; }
.ql-dl dd { margin: 0; }
.ql-keys { font-size: 22px; margin: 6px 0 18px; }
kbd { font: 600 14px/1 Inter, system-ui, sans-serif; padding: 5px 9px; border-radius: 6px; background: var(--bar); }
.ql-keys kbd { font-size: 17px; padding: 8px 12px; }

/* leaving dialog */
.leave {
  width: min(420px, calc(100vw - 32px)); padding: 26px 26px 22px;
  border: 0; border-radius: 14px;
  background: var(--win); color: var(--ink);
  box-shadow: var(--float); /* taste-skill-ignore: a real dialog */
}
.leave[open] { animation: ql-in .25s cubic-bezier(.2,.8,.2,1); }
.leave::backdrop { background: rgba(10, 10, 10, .45); }
.leave h2 { margin: 0; font: 400 34px/1.05 "Instrument Serif", Georgia, serif; letter-spacing: -.015em; text-wrap: balance; }
.leave h2 span { overflow-wrap: anywhere; }
.leave-sub { margin: 12px 0 22px; font-size: 16px; }
.leave-actions { display: flex; gap: 8px; justify-content: flex-end; }
.leave-actions > * { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .15s ease; }
.leave-actions > *:active { transform: scale(.97); }
.leave-stay { background: var(--hover); }
.leave-go { background: var(--ink); color: var(--win); }

.plain { position: fixed; inset: 0; padding: 40px; background: var(--page); }

/* ---------- the pixel cursor ---------- */
html.has-cursor:not(.native-cursor), html.has-cursor:not(.native-cursor) * { cursor: none !important; }
html.has-cursor input, html.has-cursor textarea { cursor: text !important; }
.cursor { position: fixed; left: 0; top: 0; z-index: 2147483647; pointer-events: none; opacity: 0; }
.cursor.on { opacity: 1; }
html.native-cursor .cursor { opacity: 0; }
.cursor span { position: absolute; left: 0; top: 0; transform-origin: 0 0; transition: transform .12s ease, opacity .08s ease; }
.cursor .c-hand { left: -6px; opacity: 0; }
.cursor.hand .c-hand { opacity: 1; }
.cursor.hand .c-arrow { opacity: 0; }
.cursor.down span { transform: scale(.8); }
.cursor .o { fill: var(--ink); }
.cursor .f { fill: var(--win); }
.cursor.hand .c-hand .f { fill: var(--accent); }
.spark {
  position: fixed; z-index: 2147483646; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  background: var(--accent); pointer-events: none;
  animation: spark .42s steps(4) forwards;
}
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

@media (max-width: 1000px) {
  .cover { display: none !important; }
  .has-cover .headline { width: min(640px, calc(100% - 64px)); }
}
@media (max-width: 860px) {
  .window { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 44px auto 1fr 30px; }
  .sidebar {
    min-width: 0; grid-column: 1; grid-row: 1; padding: 14px 0 12px; overflow: visible;
    background: var(--side);
  }
  .titlebar { grid-column: 1; grid-row: 2; background: transparent; }
  .find { grid-column: 1; grid-row: 3; }
  .stage { grid-column: 1; grid-row: 4; }
  .statusbar { grid-column: 1; grid-row: 5; }
  .has-cover .headline, .headline { left: 18px; bottom: 16px; width: calc(100% - 36px); }
  .sidebar .lights { display: none; }
  .me { padding: 4px 16px 12px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .me-name { font-size: 36px; }
  .me-bio { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; font-size: 18px; line-height: 1.4; }
  .me-cta { grid-column: 2; grid-row: 1; margin: 0; min-height: 40px; padding: 0 16px; font-size: 14px; }
  .side-nav { flex-direction: row; gap: 6px; overflow-x: auto; padding: 0 16px 2px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-h, .side-foot { display: none; }
  .side-nav button, .side-nav a { flex: none; padding: 7px 13px; background: var(--hover); border-radius: 999px; font-size: 14px; }
  .hl-title { font-size: clamp(28px, 7.6vw, 44px); }
  .hl-sub { font-size: 16px; margin-top: 10px; }
  .hint { display: none; }
}
@media (max-width: 640px) {
  .window { width: calc(100vw - 16px); height: calc(100svh - 16px); border-radius: 12px; }
  .crumbs { justify-content: center; overflow: hidden; }
  .item { font-size: 14px; gap: 5px; }
  .item svg { width: 20px; height: 20px; margin-left: -14px; }
  .ql { left: 10px; right: 10px; top: 56px; bottom: 36px; width: auto; }
  .falcon-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .item, .hint { transition: none; }
  .ql, .leave[open] { animation: none; }
}
