/* blog.eighteenhq — personal notes */
:root {
  --ink: #1a1f1c;
  --ink-soft: #3d463f;
  --mute: #6b746c;
  --line: #c9cfc8;
  --paper: #f3f5f1;
  --paper-deep: #e6ebe4;
  --accent: #0f6b4c;
  --accent-soft: #d4ebe1;
  --danger: #8b2e2e;
  --save: #2a6b45;
  --radius: 2px;
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --max: 40rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #dfe8e0 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8ebe3 0%, transparent 50%),
    var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  padding-block: 2.5rem 4rem;
}

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.75rem;
  animation: rise 0.55s ease both;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4vw, 2.05rem);
  font-weight: 500;
  font-variation-settings: "opsz" 72, "SOFT" 40;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand span {
  color: var(--mute);
  font-weight: 400;
  font-size: 0.72em;
  letter-spacing: 0;
  margin-left: 0.35rem;
}

.nav-link {
  font-size: 0.85rem;
  color: var(--mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--ink);
  border-bottom-color: var(--line);
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.note-list li {
  border-top: 1px solid var(--line);
  animation: rise 0.5s ease both;
}

.note-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.note-list a {
  display: block;
  padding: 1.15rem 0.15rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s, padding-left 0.2s;
}

.note-list a:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  padding-left: 0.5rem;
}

.note-list h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.note-list .meta {
  font-size: 0.78rem;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.note-list .preview {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty {
  padding: 3rem 0;
  color: var(--mute);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  animation: rise 0.5s ease both;
}

/* Note view */
.note-view .meta {
  color: var(--mute);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1.5rem;
  animation: rise 0.45s ease both;
}

.note-view h1 {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  animation: rise 0.55s 0.05s ease both;
}

.note-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink);
  animation: rise 0.6s 0.1s ease both;
}

/* Write / login */
.write-shell {
  width: min(100%, 44rem);
  margin-inline: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.9rem 1.25rem;
}

.write-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.15rem 0.75rem;
  flex-shrink: 0;
}

.write-bar .left,
.write-bar .right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--mute);
  min-height: 1.1em;
}

.status.saved {
  color: var(--save);
}

.status.error {
  color: var(--danger);
}

.status.saving {
  color: var(--ink-soft);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.btn:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.editor textarea {
  flex: 1;
  width: 100%;
  min-height: 70dvh;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.4vw, 1.35rem);
  line-height: 1.65;
  letter-spacing: -0.015em;
  padding: 0.25rem 0.15rem;
  caret-color: var(--accent);
}

.editor textarea::placeholder {
  color: color-mix(in srgb, var(--mute) 70%, transparent);
  font-style: italic;
}

/* Login gate */
.gate {
  flex: 1;
  display: grid;
  place-content: center;
  padding: 2rem 0.5rem 4rem;
  animation: rise 0.5s ease both;
}

.gate-card {
  width: min(100%, 20rem);
  text-align: center;
}

.gate h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.gate p {
  margin: 0 0 1.5rem;
  color: var(--mute);
  font-size: 0.95rem;
}

.gate form {
  display: grid;
  gap: 0.75rem;
}

.gate input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  letter-spacing: 0.28em;
  text-align: center;
  color: var(--ink);
  outline: none;
}

.gate input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gate .error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 0;
}

.gate .btn.primary {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
