/* ============================================================
   Design tokens — semantic. Values are placeholders for the
   skeleton; final palette tuned in the styling pass.
   ============================================================ */

:root {
  /* Surface (paper) */
  --surface-page:     #f7f3ec;   /* the canvas */
  --surface-raised:   #fbf8f2;   /* sidebar / header / cards */
  --surface-sunken:   #efeae0;   /* inputs, code blocks */
  --surface-edge:     #d8d0bf;   /* hairline borders */

  /* Ink */
  --ink-primary:      #1c1a16;   /* body */
  --ink-secondary:    #4a4639;   /* labels, metadata */
  --ink-muted:        #8a8472;   /* placeholders, hints */
  --ink-inverse:      #fbf8f2;   /* text on dark accents */

  /* Accent */
  --accent-mark:      #b34a2c;   /* iron-oxide red, sparing */
  --accent-link:      #2a4a7f;   /* ink blue */

  /* Feedback */
  --feedback-positive: #4a7a3a;
  --feedback-negative: #a23a3a;
  --feedback-pending:  #8a6a2a;

  /* Elevation */
  --shadow-sheet: 0 1px 2px rgba(40, 30, 20, 0.06), 0 4px 12px rgba(40, 30, 20, 0.04);
  --shadow-stack: 0 8px 24px rgba(40, 30, 20, 0.18);

  /* Type */
  --font-display: ui-serif, Georgia, "Times New Roman", serif;
  --font-body:    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;

  /* Rhythm */
  --measure-text: 68ch;
  --radius-edge:  3px;
}

[data-theme="dark"] {
  /* Aged parchment / tobacco */
  --surface-page:     #1a1411;
  --surface-raised:   #221a15;
  --surface-sunken:   #14100c;
  --surface-edge:     #3a2e25;

  --ink-primary:      #ece4d6;
  --ink-secondary:    #b8aa92;
  --ink-muted:        #7a6e5c;
  --ink-inverse:      #14100c;

  --accent-mark:      #d97a52;
  --accent-link:      #8aa6d9;

  --feedback-positive: #8aba6f;
  --feedback-negative: #d97070;
  --feedback-pending:  #c9a35a;

  --shadow-sheet: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-stack: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Base reset additions Tailwind doesn't cover */
html, body { height: 100%; }
body { -webkit-font-smoothing: antialiased; }

/* Markdown-rendered content (reader view) */
.prose-paper {
  color: var(--ink-primary);
  max-width: var(--measure-text);
}
.prose-paper h1, .prose-paper h2, .prose-paper h3, .prose-paper h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.2;
}
.prose-paper h1 { font-size: 1.875rem; }
.prose-paper h2 { font-size: 1.5rem; }
.prose-paper h3 { font-size: 1.25rem; }
.prose-paper p, .prose-paper ul, .prose-paper ol { margin: 0.75em 0; }
.prose-paper ul, .prose-paper ol { padding-left: 1.5em; }
.prose-paper li { margin: 0.25em 0; }
.prose-paper a { color: var(--accent-link); text-decoration: underline; text-underline-offset: 2px; }
.prose-paper code {
  font-family: var(--font-mono);
  background: var(--surface-sunken);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-edge);
  font-size: 0.9em;
}
.prose-paper pre {
  background: var(--surface-sunken);
  padding: 1em;
  border-radius: var(--radius-edge);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.prose-paper pre code { background: none; padding: 0; }
.prose-paper blockquote {
  border-left: 3px solid var(--accent-mark);
  padding-left: 1em;
  color: var(--ink-secondary);
  font-style: italic;
}

/* Toast */
.toast {
  padding: 0.625rem 0.875rem;
  background: var(--surface-raised);
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius-edge);
  box-shadow: var(--shadow-stack);
  color: var(--ink-primary);
  margin-top: 0.5rem;
  max-width: 22rem;
  font-size: 0.875rem;
}
.toast--positive { border-color: var(--feedback-positive); }
.toast--negative { border-color: var(--feedback-negative); }

/* Drag overlay */
.drag-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 16, 12, 0.85);
  display: none;
  align-items: center; justify-content: center;
  z-index: 60;
  pointer-events: none;
}
.drag-overlay--active { display: flex; }
.drag-overlay__inner {
  border: 2px dashed var(--accent-mark);
  border-radius: 12px;
  padding: 3rem 4.5rem;
  color: var(--ink-inverse);
  text-align: center;
  font-family: var(--font-display);
}

/* Dialog (modal) */
.dialog-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 16, 12, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 70;
}
.dialog-panel {
  background: var(--surface-raised);
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius-edge);
  box-shadow: var(--shadow-stack);
  padding: 1.5rem;
  width: min(28rem, calc(100vw - 2rem));
}

/* Skill list item with per-item download icon */
.skill-item {
  position: relative;
}
.skill-download {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.15s;
  padding: 4px;
  border-radius: 4px;
  color: var(--ink-muted);
  line-height: 0;
  text-decoration: none;
}
.skill-item:hover .skill-download,
.skill-item--active .skill-download {
  opacity: 1;
}
.skill-download:hover {
  color: var(--ink-primary);
}

/* Sidebar social links */
.sidebar-socials {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--surface-edge);
}
.sidebar-social-link {
  color: var(--ink-muted);
  text-decoration: none;
  line-height: 0;
  transition: color 0.15s;
}
.sidebar-social-link:hover {
  color: var(--ink-primary);
}
