/* Rose Pine Theme */
:root {
  /* Rose Pine Base */
  --rp-base: #191724;
  --rp-surface: #1f1d2e;
  --rp-overlay: #26233a;
  --rp-muted: #6e6a86;
  --rp-subtle: #908caa;
  --rp-text: #e0def4;

  /* Rose Pine Accent */
  --rp-love: #eb6f92;
  --rp-gold: #f6c177;
  --rp-rose: #ebbcba;
  --rp-pine: #31748f;
  --rp-foam: #9ccfd8;
  --rp-iris: #c4a7e7;

  /* Rose Pine Highlights */
  --rp-highlight-low: #21202e;
  --rp-highlight-med: #403d52;
  --rp-highlight-high: #524f67;
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
  background: var(--rp-base);
  color: var(--rp-text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  background: var(--rp-surface);
  border-bottom: 1px solid var(--rp-overlay);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--rp-rose);
  text-decoration: none;
}

.site-title:hover {
  color: var(--rp-love);
}

/* Navigation */
nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--rp-subtle);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--rp-foam);
}

/* Search */
.search-container {
  position: relative;
}

#search {
  background: var(--rp-overlay);
  border: 1px solid var(--rp-highlight-med);
  color: var(--rp-text);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
  width: 180px;
  transition: all 0.2s;
}

#search:focus {
  outline: none;
  border-color: var(--rp-pine);
  width: 220px;
}

#search::placeholder {
  color: var(--rp-muted);
}

.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--rp-surface);
  border: 1px solid var(--rp-overlay);
  border-radius: 4px;
  margin-top: 0.5rem;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-results.active {
  display: block;
}

.search-result {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rp-overlay);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result a {
  color: var(--rp-text);
  text-decoration: none;
  display: block;
}

.search-result a:hover {
  color: var(--rp-foam);
}

.search-result-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.search-result-date {
  font-size: 0.8rem;
  color: var(--rp-muted);
}

/* Main Content */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 1.5rem 0 1rem;
  font-weight: bold;
  line-height: 1.3;
}

h1 {
  font-size: 1.75rem;
  color: var(--rp-rose);
  margin-top: 0;
}

h2 {
  font-size: 1.4rem;
  color: var(--rp-iris);
}

h3 {
  font-size: 1.2rem;
  color: var(--rp-foam);
}

h4, h5, h6 {
  font-size: 1rem;
  color: var(--rp-pine);
}

p {
  margin-bottom: 1rem;
}

/* Links */
a {
  color: var(--rp-foam);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--rp-rose);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

ul > li::marker {
  color: var(--rp-gold);
}

ol > li::marker {
  color: var(--rp-iris);
}

/* Bold and Italic */
strong, b {
  color: var(--rp-gold);
  font-weight: bold;
}

em, i {
  color: var(--rp-rose);
  font-style: italic;
}

/* Code - Inline */
code {
  background: var(--rp-overlay);
  color: var(--rp-gold);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

/* Code - Blocks */
pre {
  background: var(--rp-surface);
  border: 1px solid var(--rp-overlay);
  border-left: 3px solid var(--rp-iris);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  color: var(--rp-text);
  padding: 0;
  font-size: 0.9rem;
}

/* Blockquote */
blockquote {
  border-left: 3px solid var(--rp-iris);
  margin: 1rem 0;
  padding-left: 1rem;
  color: var(--rp-subtle);
  font-style: italic;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px !important;
  margin: 1rem 0;
  border: 2px solid var(--rp-gold) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transition: border-width 0.2s ease, transform 0.2s ease;
}

img:hover {
  border-width: 4px !important;
  transform: scale(1.02);
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--rp-overlay);
  margin: 2rem 0;
}

/* Blog Post List */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rp-overlay);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list-title {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.post-list-title a {
  color: var(--rp-text);
}

.post-list-title a:hover {
  color: var(--rp-foam);
}

.post-list-meta {
  font-size: 0.85rem;
  color: var(--rp-muted);
}

.post-list-description {
  margin-top: 0.5rem;
  color: var(--rp-subtle);
}

/* Post Header */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rp-overlay);
}

.post-meta {
  font-size: 0.9rem;
  color: var(--rp-muted);
  margin-top: 0.5rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag {
  background: var(--rp-overlay);
  color: var(--rp-iris);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* Footer */
.footer {
  background: var(--rp-surface);
  border-top: 1px solid var(--rp-overlay);
  padding: 1.5rem 0;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--rp-muted);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--rp-base);
}

::-webkit-scrollbar-thumb {
  background: var(--rp-highlight-med);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--rp-highlight-high);
}

/* Syntax Highlighting - Rose Pine */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--rp-muted);
  font-style: italic;
}

.token.punctuation {
  color: var(--rp-subtle);
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
  color: var(--rp-gold);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin {
  color: var(--rp-foam);
}

.token.operator,
.token.entity,
.token.url,
.token.variable {
  color: var(--rp-rose);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: var(--rp-iris);
}

.token.function,
.token.class-name {
  color: var(--rp-love);
}

.token.regex,
.token.important {
  color: var(--rp-gold);
}

.token.inserted {
  color: var(--rp-foam);
}

.token.deleted {
  color: var(--rp-love);
}

/* Responsive */
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  #search {
    width: 100%;
  }

  #search:focus {
    width: 100%;
  }

  .search-results {
    width: 100%;
    left: 0;
    right: 0;
  }
}

/* Entity Display / Home */
.entity-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.entity-display pre {
  background: var(--rp-surface);
  border: 1px solid var(--rp-overlay);
  border-left: 3px solid var(--rp-iris);
  max-width: 400px;
}
