:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --border: #e5e5e5;
  --text: #444444;
  --muted: #999999;
  --heading: #111111;
  --accent: #000000;
  --mono: 'Courier New', Courier, monospace;
}

html {
  font-size: 19px;
}

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

body {
  margin: 0 auto;
  max-width: 660px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  padding: 0 1.5rem;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: var(--heading);
  font-weight: bold;
  line-height: 1.2;
}

h2 { margin: 2.5rem 0 0.75rem; }
h3 { margin: 1.5rem 0 0.5rem; }

p { margin: 0 0 1rem; }

a {
  color: var(--accent);
  text-decoration: underline;
  transition: opacity 0.15s;
}

a:hover { opacity: 0.7; }

/* ── Header ── */

#profile-header {
  padding: 3rem 0 0;
  text-align: center;
}

#profile-img {
  display: block;
  margin: 0 auto 1.25rem;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  transition: opacity 0.25s;
}

#profile-img:hover {
  opacity: 0.8;
}

#banner-title {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 1.375rem;
  font-weight: bold;
  margin: 0 0 1.5rem;
}

#banner-title a {
  color: var(--heading);
  text-decoration: none;
}

/* ── Nav ── */

#nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#nav a {
  color: var(--heading);
  text-decoration: none;
  transition: opacity 0.15s;
  position: relative;
}

#nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

#nav a:hover {
  opacity: 0.8;
}

#nav a:hover::after { width: 100%; }

/* ── Code blocks ── */

.code, .small-code {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--surface);
  color: var(--text);
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  margin: 1.25rem 0;
  overflow-x: auto;
}

pre, code {
  font-family: var(--mono);
  font-size: 0.875rem;
}

code {
  background: var(--surface);
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--surface);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  line-height: 1.6;
}

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

/* ── Rouge syntax highlighting ── */

.highlight .k,
.highlight .kd,
.highlight .kn { color: #871094; font-weight: 600; }  /* keywords — purple */
.highlight .s,
.highlight .s1,
.highlight .s2 { color: #067d17; }                    /* strings — green */
.highlight .na  { color: #871094; }                    /* attributes — purple */
.highlight .l,
.highlight .m,
.highlight .mi,
.highlight .mf  { color: #067d17; }                    /* numbers — green */
.highlight .c,
.highlight .c1,
.highlight .cm  { color: #8c8c8c; font-style: italic; } /* comments — gray */
.highlight .p,
.highlight .pi,
.highlight .nt  { color: #444444; }                    /* punctuation — dark gray */
.highlight .nv,
.highlight .n   { color: #871094; }                    /* names/variables — purple */
.highlight .o   { color: #444444; }                    /* operators — dark gray */
.highlight .err { color: #067d17; font-weight: 600; background: none; } /* >>> prompt — green */

/* ── Post layout ── */

.post-header {
  margin: 2.5rem 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.post-meta {
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Post list ── */

#post-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

#post-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

#post-list li:first-child { border-top: 1px solid var(--border); }

.post-title {
  color: var(--text);
  font-size: 0.9375rem;
  text-align: left;
  margin: 0;
  transition: color 0.15s;
}

.post-title:hover {
  color: var(--heading);
  opacity: 1;
  text-decoration: none;
}

.post-date {
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  font-style: normal;
  margin: 0;
  padding: 0;
}

/* ── Projects grid ── */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: 2rem 0;
}

.card {
  background: var(--surface);
  padding: 1.5rem;
  transition: background 0.15s;
  position: relative;
}

.card-date {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.6;
}

.card:hover { background: #111111; }

.card:hover h3 { color: #ffffff; }
.card:hover p  { color: #aaaaaa; }
.card:hover .card-date { color: #777777; }
.card:hover .btn { color: #ffffff; }

.card h3 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  font-weight: bold;
  margin: 0 0 0.5rem;
  padding-right: 3rem;
  color: var(--heading);
}

.card p {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.6;
}

.btn {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-right: 1rem;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.65; }

/* ── Posts feed layout ── */

.posts-feed-page {
  max-width: 960px;
}

.feed-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  margin-top: 2rem;
  align-items: start;
}

.feed-sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
}

.sidebar-entry {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.875rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: border-color 0.15s, background 0.15s;
}

.sidebar-entry:hover {
  border-left-color: var(--accent);
  background: var(--surface);
  opacity: 1;
}

.sidebar-title {
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.35;
  transition: color 0.15s;
}

.sidebar-entry:hover .sidebar-title {
  color: var(--heading);
}

.sidebar-date {
  font-size: 0.625rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-main {
  min-width: 0;
}

.feed-post {
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

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

.feed-post .post-header h1 a {
  color: var(--heading);
  text-decoration: none;
}

.feed-post .post-header h1 a:hover {
  opacity: 0.75;
}

@media (max-width: 720px) {
  .posts-feed-page {
    max-width: 100%;
  }

  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar {
    display: none;
  }
}

/* ── Footer ── */

main {
  margin-top: 2rem;
}

#social {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2rem;
}

#social a {
  color: var(--heading);
  text-decoration: none;
  transition: opacity 0.15s;
  position: relative;
}

#social a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

#social a:hover {
  opacity: 0.8;
}

#social a:hover::after { width: 100%; }

#footer {
  font-size: 0.6875rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem 0 2.5rem;
  letter-spacing: 0.04em;
}
