/* ── home ──
 * The empty state / home screen and its recent-note list.
 * Linked from index.html in cascade order — the order is load-bearing. */

/* ── Empty state ───────────────────────────────────── */
#empty-state {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--status-height);
  z-index: 50;
  overflow-y: auto;
  /* Own stacking context, so ::before/::after at negative z-index land above this
     element's own background instead of disappearing behind the page. */
  isolation: isolate;
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, color-mix(in srgb, var(--accent) 6%, transparent), transparent),
    var(--bg-page);
  opacity: 1;
  transition: opacity 0.35s var(--ease);
}
#empty-state.hidden { display: none; }
#empty-state.dissolving { opacity: 0; pointer-events: none; }

.empty-center {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 40px;
  text-align: center;
}
.wordmark {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: color-mix(in srgb, var(--fg) 92%, white);
}
.wordmark .bye { color: var(--fg-faint); font-weight: 300; }
.wordmark .cursor-blink {
  display: inline-block;
  width: 13px;
  height: 26px;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: -3px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.tagline {
  margin-top: 12px;
  color: var(--fg-dim);
  font-size: 13.5px;
}
.tagline b { color: var(--fg); font-weight: 500; }
.tagline a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-line);
}

.hint-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 38px;
  width: 100%;
  max-width: 720px;
}
.hint-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 15px 14px 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.hint-card:hover { border-color: var(--border); transform: translateY(-2px); }
.hint-card kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 2px 7px;
}
.hint-card .h { margin-top: 9px; font-size: 12.5px; color: var(--fg); font-weight: 500; }
.hint-card .d { margin-top: 2px; font-size: 11px; color: var(--fg-faint); line-height: 1.5; }

.recent {
  width: 100%;
  max-width: 720px;
  margin-top: 34px;
  text-align: left;
}
.recent.hidden { display: none; }
.rc-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rc-title::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.recent-item:hover { background: var(--bg-raised); border-color: var(--border-soft); }
/* Keyboard selection — a persistent form of the hover state. */
.recent-item.kb-active,
.recent-folder.kb-active { background: var(--bg-raised); border-color: var(--border-soft); }
.recent-item.kb-active .ri-del,
.recent-item.kb-active .ri-folder { opacity: 1; }
.recent-item .ri-ico { color: var(--fg-faint); font-size: 12px; }
.recent-item .ri-name {
  color: var(--fg);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-item .ri-langs { color: var(--fg-faint); font-size: 10.5px; white-space: nowrap; }
.recent-item .ri-langs b { color: var(--accent); font-weight: 400; }
.recent-item .ri-time { margin-left: auto; font-size: 10.5px; color: var(--fg-faint); white-space: nowrap; }
.recent-item .ri-del {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--fg-faint);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.recent-item:hover .ri-del { opacity: 1; }
.recent-item .ri-del:hover { color: var(--danger); border-color: var(--danger); }

.recent-item .ri-folder {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--fg-faint);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.recent-item:hover .ri-folder { opacity: 1; }
.recent-item .ri-folder:hover { color: var(--accent); border-color: var(--accent-line); }
.recent-item .ri-folder svg { width: 14px; height: 14px; display: block; }
@media (hover: none) { .recent-item .ri-del, .recent-item .ri-folder { opacity: 1; } }

/* Dark, palette-matched tooltip for the row's buttons (replaces the native title).
   Keyed on [data-tip] rather than on one button's class: it was written for the
   folder button, so the ✕ beside it kept falling back to the browser's grey
   system tooltip — two tooltips, two different looks, on one row. */
.recent-item [data-tip] { position: relative; }
.recent-item [data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-code);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 10.5px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.recent-item [data-tip]:hover::after,
.recent-item [data-tip]:focus-visible::after { opacity: 1; }

.recent-folder {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 12px 4px;
  cursor: pointer;
  user-select: none;
  font-size: 11.5px;
  color: var(--fg-dim);
}
.recent-folder:hover .rf-name { color: var(--fg); }
.recent-folder .rf-caret { color: var(--accent); font-size: 10px; }
.recent-folder .rf-name { letter-spacing: 0.03em; }
.recent-folder .rf-count { font-size: 10px; color: var(--fg-faint); }
.recent-item.in-folder { margin-left: 18px; }

.creator-credit {
  margin-top: 40px;
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}
.creator-credit a {
  color: var(--fg-dim);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
  transition: color 0.15s, border-color 0.15s;
}
.creator-credit a:hover { color: var(--accent); border-color: var(--accent-line); }
