/* DevDash — warm dark notebook UI */
:root {
  --bg: #1a1613;
  --bg-raised: #221d19;
  --bg-sunken: #141110;
  --border: #322a25;
  --border-strong: #4a3e36;
  --text: #e9ddd0;
  --text-muted: #9a897a;
  --text-dim: #6b5d51;
  --accent: #f0a65c;
  --accent-warm: #d4823c;
  --accent-soft: rgba(240, 166, 92, 0.12);
  --danger: #e67c6f;
  --success: #8fb874;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --font-notebook: "Iowan Old Style", "Charter", Georgia, serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(240, 166, 92, 0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.page__header {
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(240, 166, 92, 0.6);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand__sep {
  color: var(--text-dim);
}

.brand__project {
  color: var(--text-muted);
  font-size: 14px;
}

.tagline {
  color: var(--text-muted);
  font-size: 13px;
  margin: 8px 0 0;
  font-style: italic;
}

/* Cards */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease;
}

.card:focus-within {
  border-color: var(--border-strong);
}

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card__hint {
  font-size: 11px;
  color: var(--text-dim);
}

.card__hint kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-sunken);
  color: var(--text-muted);
}

.card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Fields */
.field {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  resize: vertical;
  min-height: 64px;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.field:focus {
  border-color: var(--accent-warm);
  background: #0f0c0a;
}

.field::placeholder {
  color: var(--text-dim);
}

.field--notebook {
  font-family: var(--font-notebook);
  font-size: 16px;
}

.field--mono {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #1a1208;
}

.btn--primary:hover {
  background: #f5b471;
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1;
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* Voice recorder */
.card--voice {
  background: linear-gradient(180deg, var(--bg-raised), #1e1814);
}

.recorder {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 4px;
}

.record {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.record__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  transition: border-color 150ms ease, transform 200ms ease;
}

.record__core {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--accent-warm);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.record:hover .record__ring {
  border-color: var(--accent);
}

.record:hover .record__core {
  background: var(--accent);
}

.record[data-state="recording"] .record__ring {
  border-color: var(--danger);
  animation: pulse-ring 1.4s ease-out infinite;
}

.record[data-state="recording"] .record__core {
  inset: 22px;
  border-radius: 4px;
  background: var(--danger);
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(230, 124, 111, 0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(230, 124, 111, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 124, 111, 0); }
}

.recorder__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timer {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.02em;
}

.recorder__status {
  font-size: 13px;
  color: var(--text-muted);
}

/* Timeline */
.timeline {
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.timeline__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.feed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed__empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 13px;
  padding: 16px 4px;
}

.entry {
  display: grid;
  grid-template-columns: 72px auto 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  transition: background 100ms ease;
}

.entry:hover {
  background: rgba(255, 255, 255, 0.015);
}

.entry__time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.entry__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: var(--bg-sunken);
  white-space: nowrap;
}

.entry__badge[data-type="voice"]   { color: var(--accent);  border-color: rgba(240, 166, 92, 0.3); background: var(--accent-soft); }
.entry__badge[data-type="thought"] { color: #b8c4a8; border-color: rgba(143, 184, 116, 0.25); background: rgba(143, 184, 116, 0.08); }
.entry__badge[data-type="logs"]    { color: #a8b4c4; border-color: rgba(116, 148, 184, 0.25); background: rgba(116, 148, 184, 0.08); }

.entry__preview {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry--pending .entry__preview {
  color: var(--text-muted);
  font-style: italic;
}

.entry--pending::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  border-top-color: transparent;
  animation: spin 800ms linear infinite;
  grid-column: 2;
  justify-self: center;
  align-self: center;
}

.entry--pending .entry__badge {
  display: none;
}

.entry--failed .entry__preview {
  color: var(--danger);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-lift);
  pointer-events: auto;
  animation: slide-up 200ms ease;
}

.toast[data-kind="error"] {
  border-color: var(--danger);
  color: var(--danger);
}

.toast[data-kind="success"] {
  border-color: var(--success);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .page { padding: 24px 16px 64px; }
  .entry { grid-template-columns: 56px auto 1fr; gap: 8px; }
  .brand h1 { font-size: 18px; }
}
