/* ─── indie-web personal site ─── */
:root {
  --bg: #0f0e0c;
  --bg-soft: #161412;
  --text: #e8e4dc;
  --text-dim: #9a958a;
  --accent: #d4a574;
  --accent-warm: #c4956a;
  --accent-dim: #8b6914;
  --border: #2a2620;
  --link: #d4a574;
  --link-hover: #e8c49a;
  --code-bg: #1c1916;
  --serif: "Georgia", "Times New Roman", serif;
  --mono: "SF Mono", "Fira Code", "Consolas", monospace;
  --grain-opacity: 0.04;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.65;
  position: relative;
}

/* subtle grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 1;
}

.main {
  position: relative;
  z-index: 0;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ─── header ─── */
.site-header {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
  position: relative;
  z-index: 0;
}

.nav {
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--link-hover);
}

.nav-sep {
  color: var(--border);
  margin: 0 0.35rem;
  user-select: none;
}

.header-title {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 400;
}

.header-link {
  color: var(--accent);
  text-decoration: none;
}

.header-link:hover {
  color: var(--link-hover);
}

/* blinking cursor in header */
.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  50% { opacity: 0; }
}

.ascii-divider {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--border);
  margin: 0.5rem 0 0;
  overflow-x: auto;
  background: none;
  border: none;
  padding: 0;
}

/* ─── typography ─── */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  color: var(--text);
}

h1 { font-size: 1.75rem; margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--accent-dim);
}

/* ─── code ─── */
code, kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--accent-warm);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

pre {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

pre code {
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
}

.code-block {
  margin: 1.25rem 0;
}

/* ─── lists ─── */
ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

/* ─── home ─── */
.home-intro {
  font-size: 1.05rem;
}

.home-tagline {
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* ─── blog list ─── */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-list li {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.blog-list a {
  font-weight: 500;
}

.blog-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.blog-tags {
  margin-top: 0.5rem;
}

.blog-tags a {
  font-family: var(--mono);
  font-size: 0.75rem;
  margin-right: 0.5rem;
}

/* ─── projects ─── */
.project-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.project-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.project-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.project-card h3 a {
  text-decoration: none;
}

.project-card p {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin: 0.5rem 0 0;
}

/* ─── chat ─── */
.chat-container {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  min-height: 500px;
}

.chat-container iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: none;
}

/* ─── footer ─── */
.site-footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  position: relative;
  z-index: 0;
}

.footer-inner {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-links {
  margin: 0 0 0.5rem;
}

.footer-meta {
  margin: 0;
}

/* ─── tags page ─── */
.tag-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.tag-list li {
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-list a {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.2em 0.5em;
  background: var(--code-bg);
  border-radius: 3px;
  text-decoration: none;
}

.tag-list a:hover {
  background: var(--border);
}

/* ─── responsive ─── */
@media (max-width: 480px) {
  html { font-size: 16px; }
  .nav { font-size: 0.8rem; }
  .nav-sep { display: none; }
  .nav .nav-link::after { content: " · "; color: var(--border); }
  .nav .nav-link:last-child::after { content: ""; }
}
