@font-face {
  font-family: Geist;
  src: url("/assets/geist-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --paper: #101114;
  --surface: #17181d;
  --elevated: #1c1d24;
  --hover: #22232c;
  --line: #303139;
  --dim-line: #26272e;
  --ink: #f0f0f3;
  --muted: #a0a1af;
  --lavender: #b5bafa;
  --mono: "Geist Mono", ui-monospace, monospace;
  --gutter: clamp(1rem, 5vw, 4rem);
  --rail: min(calc(100% - var(--gutter) * 2), 73rem);
  background: var(--paper);
  color: var(--ink);
  font: 100%/1.55 Geist, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body, h1, p, form { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lavender); outline-offset: 3px; }
::selection { background: #49496d; color: white; }
[hidden] { display: none !important; }

.site-bar { border-bottom: 1px solid var(--dim-line); }
.bar-inner {
  width: var(--rail);
  min-height: 4.05rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.bar-inner > .bar-action, .bar-inner > form { margin-left: auto; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  font-family: var(--mono);
  font-weight: 580;
  font-size: 1.13rem;
  line-height: 1;
  letter-spacing: -0.08em;
  text-decoration: none;
}
.site-mark { position: relative; width: 1.4rem; height: 1.35rem; }
.site-mark::before, .site-mark::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 47%;
  height: 73%;
  border-radius: 1px;
}
.site-mark::before { left: 1px; background: #c8cbff; transform: skewY(22deg); }
.site-mark::after { right: 0; background: #858ac8; transform: skewY(-22deg); }
.breadcrumb, .bar-action { font-size: 0.87rem; color: var(--muted); }
.breadcrumb { display: inline-flex; align-items: center; gap: 1.05rem; }
.breadcrumb span { color: #5d5e69; font: 1.1rem var(--mono); }
.bar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.58rem;
  min-height: 2.3rem;
  padding: 0.35rem 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
}
.bar-action:hover { color: var(--ink); text-decoration: underline; }
.dashboard-symbol {
  width: 0.83rem; height: 0.83rem; border: 1px solid currentColor; border-radius: 2px;
  background: linear-gradient(to right, transparent 30%, currentColor 30% 40%, transparent 40%);
}
.icon { display: block; width: 1rem; height: 1rem; flex: none; }
h1 { overflow-wrap: anywhere; font-weight: 535; letter-spacing: -0.062em; line-height: 1.04; }

.landing {
  width: min(var(--rail), 64rem);
  margin: clamp(3.25rem, 13vh, 8rem) auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(1.75rem, 5vw, 5rem);
}
.cover-copy h1 { font-size: clamp(3rem, 5.7vw, 5rem); }
.cover-copy h1 span { display: block; }
.cover-copy p {
  max-width: 25em;
  margin-top: 1.15rem;
  font-size: clamp(1rem, 1.45vw, 1.1rem);
  line-height: 1.55;
  text-wrap: balance;
  color: var(--muted);
}
.cover-art { display: block; justify-self: end; width: min(100%, 26rem); height: auto; }

/* Full note and preview share the same source document and type hierarchy. */
.note { width: min(calc(100% - var(--gutter) * 2), 42rem); margin: clamp(3.8rem, 11vh, 7.8rem) auto; }
.note h1 { font-size: clamp(2.8rem, 6.6vw, 4.8rem); }
.article-head { padding-bottom: 1.7rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.4rem; font-size: 0.94rem; }
.byline time { padding-left: 0.95rem; border-left: 1px solid #44444e; color: var(--muted); font: 0.8rem/1.3 var(--mono); }
.note article { overflow-wrap: anywhere; }
.note article :is(p, li, blockquote) { color: #d4d4df; font: 1.15rem/1.78 Geist, system-ui, sans-serif; }
.note article p + p { margin-top: 1.1em; }
.note article :is(h2, h3) { margin: 1.65em 0 0.55em; letter-spacing: -0.035em; line-height: 1.2; }
.note article a { color: var(--lavender); }
.note article blockquote { margin: 1.5em 0; padding-left: 1.2rem; border-left: 2px solid #5b5e88; }
.note article :is(code, pre) { font-family: var(--mono); font-size: 0.9em; }
.note article code { color: #cdcff5; }
.note article pre { max-width: 100%; overflow-x: auto; padding: 1rem; border: 1px solid var(--line); background: var(--surface); border-radius: 0.45rem; }
.note article img { max-width: 100%; height: auto; }

.sign-in {
  width: min(var(--rail), 22rem);
  margin: clamp(4rem, 16vh, 10rem) auto;
}
.sign-in h1 { font-size: clamp(2rem, 4vw, 2.65rem); }
.login-form { display: grid; gap: 0.55rem; margin-top: 2rem; }
.login-form label { font-size: 0.87rem; color: #d2d2dc; }
.login-form input {
  width: 100%; min-height: 2.8rem; padding: 0.55rem 0.7rem;
  background: var(--paper); border: 1px solid #51525e; border-radius: 0.35rem;
}
.primary-button {
  justify-self: start;
  min-height: 2.7rem; padding: 0.55rem 1.1rem; margin-top: 0.35rem;
  background: #c2c5f5; color: #1b1b28; border: 1px solid #d2d4ff; border-radius: 0.35rem;
  font-size: 0.92rem; font-weight: 615;
}
.primary-button:hover { background: #d5d7ff; }
.form-message { color: #ffb3aa; font-size: 0.87rem; }

.dashboard { width: var(--rail); margin: clamp(3rem, 8vh, 5rem) auto 5rem; }
.index-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 1.15rem 2rem; margin-bottom: 1.6rem;
}
.index-heading { display: flex; align-items: baseline; gap: 1rem; }
.index-heading h1 { font-size: clamp(2.4rem, 4.2vw, 3.4rem); }
.note-count, .notes-table thead th { font: 0.8rem/1.5 var(--mono); color: var(--muted); }
.search-box {
  display: flex; align-items: center; gap: 0.55rem; width: min(100%, 15rem); min-width: 0;
  padding: 0.36rem 0.55rem; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 0.4rem;
}
.search-box:focus-within { outline: 2px solid var(--lavender); outline-offset: 2px; }
.search-box .icon { width: 0.9rem; height: 0.9rem; }
.search-box input { min-width: 0; width: 100%; appearance: none; padding: 0; border: 0; outline: 0; background: transparent; font-size: 0.9rem; }
.search-box input::placeholder { color: #a5a5b2; opacity: 1; }
.search-box kbd { min-width: 1.1rem; border: 1px solid #43434e; border-radius: 3px; text-align: center; font: 0.72rem/1.2rem var(--mono); }
.notes-table {
  width: 100%; table-layout: fixed; border-spacing: 0; text-align: left;
  border-block: 1px solid var(--line);
}
.notes-table :is(td, th) { vertical-align: middle; }
.notes-table thead th { padding-block: 0.56rem; border-bottom: 1px solid var(--line); font-weight: 400; }
.notes-table tbody :is(th, td) { padding-block: 0.65rem; }
.notes-table tbody tr + tr :is(th, td) { border-top: 1px solid var(--dim-line); }
.notes-table th:first-child { padding-inline: 1.05rem 0.55rem; }
.source-cell { width: 25%; padding-inline: 0.6rem; }
.source-cell code { color: var(--muted); font: 0.8rem/1.5 var(--mono); overflow-wrap: anywhere; }
.notes-table .preview-cell { width: 5.8rem; text-align: center; }
.notes-table .copy-cell { width: 8.5rem; text-align: right; padding-inline: 0.4rem 1.05rem; }
.notes-table tbody tr:focus-within, .notes-table tbody tr:has([aria-expanded="true"]) { background: #1a1b23; }
@media (hover: hover) { .notes-table tbody tr:hover { background: #1a1b23; } }
.note-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; max-width: 100%; gap: 0.75rem;
  border-radius: 0.25rem; font-size: 0.99rem; font-weight: 550; text-decoration: none;
}
.note-link span:last-child { overflow-wrap: anywhere; }
.note-link:hover { color: #d9daff; text-decoration: underline; }
.file-icon {
  display: grid; place-items: center; width: 1.85rem; height: 2rem; flex: none;
  color: var(--lavender);
}
.file-icon .icon { width: 1.04rem; height: 1.04rem; }
.icon-button, .copy-button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 2.4rem;
  border: 1px solid transparent; background: transparent; border-radius: 0.38rem; color: var(--muted);
}
.icon-button { width: 2.4rem; padding: 0; }
.icon-button:hover, .icon-button[aria-expanded="true"] { color: #d5d7ff; background: #30303e; }
.copy-button { gap: 0.4rem; padding-inline: 0.6rem; color: #dddde5; font-size: 0.83rem; font-weight: 480; border-color: var(--line); white-space: nowrap; }
.copy-button:hover { border-color: #565662; background: var(--hover); }
.copy-button .icon { width: 0.88rem; height: 0.88rem; }
.copy-button .icon-check, .copy-button[data-copied] .icon-copy { display: none; }
.copy-button[data-copied] .icon-check { display: block; }
.copy-button[data-copied] { color: var(--lavender); }
.copy-fallback { width: 100%; min-width: 0; margin-top: 0.35rem; }
.empty-message { margin-block: 1.5rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.dashboard-interactive) :is(.preview-cell, .copy-cell, .search-box) { display: none; }

.preview-panel {
  position: fixed; inset: auto; z-index: 10; display: flex; flex-direction: column; margin: 0; padding: 0;
  width: min(27rem, calc(100vw - 2rem)); height: auto; max-height: min(20rem, 64vh); max-height: min(20rem, 64dvh);
  overflow: hidden; border: 1px solid #545561; border-radius: 0.55rem;
  background: var(--elevated); color: var(--ink); box-shadow: 0 12px 34px #0008, inset 0 1px #ffffff0d;
}
.preview-heading {
  display: flex; justify-content: space-between; align-items: center; flex: none; gap: 0.6rem;
  padding: 0.14rem 0.26rem 0.14rem 0.95rem; border-bottom: 1px solid var(--line);
}
.preview-name { display: flex; align-items: center; min-width: 0; gap: 0.5rem; color: var(--muted); font: 0.79rem/1.5 var(--mono); }
.preview-panel iframe { width: 100%; height: min(var(--preview-body-height, 14rem), 20rem); min-height: 0; flex: 0 1 auto; border: 0; background: var(--elevated); }
html[data-note-preview] { overscroll-behavior: contain; background: var(--elevated); }
[data-note-preview] body { display: flow-root; }
[data-note-preview] :is(.site-bar, .byline), [data-note-preview] .note > a:first-child { display: none; }
[data-note-preview] .note { width: auto; margin: 1.25rem; }
[data-note-preview] .article-head { border: 0; padding: 0; margin-bottom: 0.7rem; }
[data-note-preview] .note h1 { font-size: 1.5rem; letter-spacing: -0.045em; }
[data-note-preview] .note p { font-size: 1rem; line-height: 1.6; }

@media (max-width: 44rem) {
  .landing { grid-template-columns: 1fr; gap: 1.6rem; margin-block: 3.6rem; }
  .cover-copy h1 { font-size: clamp(3rem, 9vw, 4.5rem); }
  .cover-art { justify-self: center; width: min(70%, 19rem); }
  .notes-table .source-cell { display: none; }
}
@media (max-width: 36rem) {
  .bar-inner { min-height: 3.65rem; gap: 0.7rem; }
  .breadcrumb { gap: 0.65rem; }
  .bar-action { min-height: 2.75rem; }
  .dashboard { margin-block: 2.3rem 3rem; }
  .index-head { align-items: stretch; flex-direction: column; margin-bottom: 1rem; }
  .search-box { width: 100%; }
  .search-box input { font-size: 1rem; }
  .search-box kbd { display: none; }
  .notes-table th:first-child { padding-inline: 0.5rem; }
  .notes-table .preview-cell { width: 3.6rem; }
  .notes-table .copy-cell { width: 6.3rem; padding-inline: 0.2rem 0.45rem; }
  .file-icon { width: 1.35rem; height: 1.6rem; }
  .file-icon .icon { width: 0.9rem; height: 0.9rem; }
  .note-link { gap: 0.4rem; }
  .icon-button, .copy-button { min-height: 2.75rem; }
  .icon-button { width: 2.75rem; }
  .copy-button { padding-inline: 0.4rem; }
}

@media (max-width: 24rem) {
  .notes-table .copy-cell { width: 3.55rem; text-align: center; padding-inline: 0.18rem; }
  .copy-button { width: 2.75rem; }
  .copy-button [data-copy-label] { display: none; }
}
