:root {
  --bg-left: #12151b;
  --bg-right: #0d1015;
  --surface: #3c464d;
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #d9d9d2;
  --number: #646f79;
  --line: rgba(255, 255, 255, 0.06);
  --brand: #8dc3d5;
  --accent: #7fb3c3;
  --muted: #94a0ab;
  --ok: #7fd7a3;
  --error: #f09a9a;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  background: #121212;
  overflow: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.22;
}

.shell {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
}

.editor-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  animation: fade-in 0.7s ease;
}

.toolbar {
  position: absolute;
  top: 10px;
  right: 0;
  z-index: 2;
  width: min(332px, calc(100% - 10px));
  background: var(--surface);
  border-left: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slide-in 0.5s ease;
}

.brand {
  margin: 0;
  text-align: right;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 47px;
  line-height: 0.95;
  color: var(--brand);
  letter-spacing: 0.015em;
  font-style: italic;
  font-weight: 600;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 0;
  text-transform: lowercase;
  opacity: 0.92;
}

.tool-btn:hover {
  color: #9ed1e0;
}

.status {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  min-height: 16px;
  text-align: right;
}

.status[data-tone='ok'] {
  color: var(--ok);
}

.status[data-tone='error'] {
  color: var(--error);
}

.editor-surface {
  position: relative;
  width: 100%;
  height: 100%;
}

.line-numbers {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  margin: 0;
  width: 48px;
  padding: 14px 10px 14px 0;
  border-right: 1px solid var(--line);
  color: var(--number);
  text-align: right;
  font-size: 13px;
  line-height: 1.58;
  white-space: pre;
  overflow: hidden;
  user-select: none;
}

#note {
  width: 100%;
  height: 100%;
  border: 0;
  resize: none;
  outline: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.58;
  padding: 14px 18px 14px 56px;
  tab-size: 2;
}

#note::placeholder {
  color: rgba(217, 217, 210, 0.35);
}

@keyframes slide-in {
  from {
    transform: translateX(-14px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .editor-wrap {
    min-height: 100dvh;
  }

  .toolbar {
    top: 0;
    right: 0;
    width: 100%;
    border-left: 0;
    padding: 8px 10px 6px;
  }

  .brand {
    font-size: 30px;
  }

  .line-numbers {
    width: 42px;
    font-size: 12px;
    padding-top: 12px;
    padding-right: 8px;
  }

  #note {
    min-height: 100dvh;
    padding-top: 12px;
    padding-left: 50px;
    font-size: 13px;
  }
}
