@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text-color: #1d1d1f;
  --bg: #ffffff;
  --cursor-color: #00b5ff;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Top bar */
.topbar {
  width: 100%;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  z-index: 10;
  opacity: 0.35;
  transition: opacity 0.5s ease;
}
.topbar:hover { opacity: 1; }
.topbar.always-visible { opacity: 1; }

.topbar-inner {
  width: 100%;
  max-width: 680px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-name {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
  color: #1d1d1f;
}

.topbar-btn {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: #86868b;
  background: none;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}
.topbar-btn:hover {
  color: #1d1d1f;
  border-color: #1d1d1f;
}
.topbar-btn:active {
  transform: scale(0.96);
}
.topbar-btn.saved {
  color: #34c759;
  border-color: #34c759;
}
.topbar-btn.primary {
  background: #1d1d1f;
  color: #ffffff;
  border-color: #1d1d1f;
}
.topbar-btn.primary:hover {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.word-count {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #86868b;
  font-variant-numeric: tabular-nums;
}

/* Editor */
.editor-container {
  width: 100%;
  max-width: 680px;
  height: 100%;
  padding: 100px 32px 120px;
  overflow-y: auto;
  scrollbar-width: none;
}
.editor-container::-webkit-scrollbar { display: none; }

.editor {
  position: relative;
  min-height: 60vh;
  outline: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  line-height: 1.75;
  font-weight: 400;
  color: transparent;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  white-space: pre-wrap;
  caret-color: transparent;
  width: 100%;
}

.editor:empty::before {
  content: "";
}

/* Placeholder */
.quote-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  line-height: 1.75;
  font-weight: 400;
  color: #d2d2d7;
  z-index: 0;
}
.quote-placeholder.hidden {
  display: none;
}

/* Blurred overlay layer */
.blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  white-space: pre-wrap;
  color: transparent;
  z-index: 1;
}

.blur-overlay .blurred {
  color: var(--text-color);
  filter: blur(1.5px);
  opacity: 0.55;
}

.blur-overlay .clear {
  color: var(--text-color);
}

.editor-wrapper {
  position: relative;
}

/* Custom cursor */
.custom-cursor {
  position: absolute;
  width: 4px;
  height: 40px;
  background: var(--cursor-color);
  border-radius: 2px;
  pointer-events: none;
  z-index: 2;
  animation: cursorBreathe 1.2s ease-in-out infinite;
}

@keyframes cursorBreathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Bottom fade */
.bottom-fade {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}

/* ---- Notes list screen ---- */
.notes-container {
  width: 100%;
  max-width: 680px;
  height: 100%;
  padding: 100px 32px 120px;
  overflow-y: auto;
  scrollbar-width: none;
}
.notes-container::-webkit-scrollbar { display: none; }

.archives-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.archive-item:hover {
  background: #f5f5f7;
}

.archive-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.archive-item-title {
  font-size: 14px;
  font-weight: 400;
  color: #1d1d1f;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-item-preview {
  font-size: 12px;
  font-weight: 300;
  color: #aeaeb2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}
.archive-item:hover .archive-item-actions {
  opacity: 1;
}

.archive-action-btn {
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 400;
  color: #86868b;
  background: none;
  border: 1px solid #e5e5ea;
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}
.archive-action-btn:hover {
  color: #1d1d1f;
  border-color: #c7c7cc;
}
.archive-action-btn.delete:hover {
  color: #ff3b30;
  border-color: #ff3b30;
}

.notes-empty {
  font-size: 15px;
  font-weight: 300;
  color: #d2d2d7;
  padding: 40px 0;
  text-align: center;
}

/* Bottom toolbar */
.bottom-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 24px 0;
  z-index: 6;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.bottom-toolbar:hover {
  opacity: 1;
}
.screen.active:hover .bottom-toolbar {
  opacity: 0.35;
}
.bottom-toolbar:hover {
  opacity: 1 !important;
}

/* View mode (reading a saved note) */
.view-topbar-title {
  font-size: 13px;
  font-weight: 300;
  color: #86868b;
  letter-spacing: -0.01em;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Screens */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; }

