:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  background: #000;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --line: rgba(255, 255, 255, 0.11);
  --muted: rgba(255, 255, 255, 0.47);
}
* { box-sizing: border-box; }
html, body, #root { width: 100%; min-height: 100%; margin: 0; background: #000; }
body { min-height: 100dvh; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
::selection { background: #fff; color: #000; }
.app { min-height: 100dvh; background: #000; color: #fff; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 22px; background: rgba(0,0,0,.88); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.brand { margin: 0; font-size: 15px; line-height: 1; font-weight: 650; letter-spacing: -.02em; }
.icon-button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line);
  border-radius: 10px; background: #050505; color: #fff; cursor: pointer; font-size: 20px; line-height: 1;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
.icon-button:hover { background: #0c0c0c; border-color: rgba(255,255,255,.2); }
.icon-button:active { transform: scale(.96); }
.icon-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.icon-button.danger { font-size: 15px; }
.home { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 64px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.filters { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #040404; }
.filter-button {
  min-width: 48px; height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; transition: color 120ms ease, background 120ms ease;
}
.filter-button:hover { color: #fff; }
.filter-button.active { background: #fff; color: #000; }
.filter-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.notes-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.note-card-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.note-card {
  position: relative; display: flex; flex-direction: column; min-height: 190px; padding: 21px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: #050505;
}
.note-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom,rgba(255,255,255,.025),transparent 42%); }
.note-card-title { position: relative; z-index: 1; margin: 0; color: #fff; font-size: 17px; line-height: 1.25; font-weight: 650; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-card-snippet { position: relative; z-index: 1; display: -webkit-box; margin: 12px 0 22px; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.note-card-date { position: relative; z-index: 1; margin-top: auto; color: rgba(255,255,255,.32); font-size: 11px; font-weight: 600; }
.empty { padding: 80px 0; color: var(--muted); font-size: 13px; text-align: center; }
.editor-shell { min-height: 100dvh; padding-bottom: 96px; }
.editor { width: min(820px, calc(100% - 38px)); margin: 0 auto; padding: 46px 0 120px; }
.title-wrap { position: relative; width: 100%; min-height: 58px; margin-bottom: 28px; }
.title-morph {
  position: absolute; inset: 0; display: flex; align-items: center; width: 100%; min-height: 58px; overflow: hidden;
  color: #fff; font-size: clamp(30px,5vw,44px); line-height: 1.15; font-weight: 700; letter-spacing: -.045em; white-space: nowrap; pointer-events: none;
}
.title-input {
  position: relative; z-index: 2; width: 100%; height: 58px; padding: 0; border: 0; outline: 0; background: transparent;
  color: transparent; caret-color: #fff; font-size: clamp(30px,5vw,44px); line-height: 1.15; font-weight: 700; letter-spacing: -.045em;
}
.title-input::selection { background: rgba(255,255,255,.32); color: transparent; }
.note-meta { margin-bottom: 26px; color: rgba(255,255,255,.33); font-size: 11px; font-weight: 600; }
.editor-body { min-height: 52vh; padding: 2px 0 80px; outline: 0; color: #f7f7f7; font-size: 17px; line-height: 1.72; word-break: break-word; }
.editor-body:empty::before { content: "Write"; color: rgba(255,255,255,.22); }
.editor-body p { margin: 0 0 1em; }
.editor-body ul { padding-left: 1.4em; list-style: disc; }
.editor-body li { margin: .2em 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 850px) { .notes-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) {
  .topbar { height: 54px; padding: 0 14px; }
  .home { width: min(100% - 24px,1180px); padding-top: 20px; }
  .home-head { align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .filters { flex: 1; }
  .filter-button { flex: 1; min-width: 0; padding-inline: 7px; }
  .notes-grid { grid-template-columns: 1fr; gap: 12px; }
  .note-card { min-height: 154px; padding: 18px; }
  .editor { width: min(100% - 28px,820px); padding-top: 32px; }
  .title-wrap, .title-input, .title-morph { min-height: 50px; height: 50px; }
  .editor-body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
