:root {
  --bg-color: #1a1b1e;
  --bg-surface: #25262b;
  --bg-code: #141517;
  --text-main: #c1c2c5;
  --text-heading: #f8f9fa;
  --text-muted: #909296;
  --accent-color: #74c0fc;
  --accent-hover: #a5d8ff;
  --border-color: #373a40;
}

body {
  max-width: 800px;
  margin: auto;
  padding: 2rem 1rem;
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

hr {
  border: 0;
  border-bottom: 1px dashed var(--border-color);
  margin: 2.5rem 0;
}

nav {
  margin-bottom: 2.5rem;
}

.menu {
  padding: 0;
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0 0 1.5rem 0;
}

.menu li {
  display: inline-block;
}

.menu a {
  color: var(--text-heading);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.menu a:hover {
  border-bottom-color: var(--accent-color);
  color: var(--accent-hover);
}

.article-meta {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.article-meta h1 {
  font-size: 2.2rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.article-meta .title {
  background: none; 
  padding: 0;
}

.article-meta .author, 
.article-meta .date {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.45;
}

code {
  background: var(--bg-surface);
  color: var(--text-heading);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Keep layout consistent for all media */
img, iframe, video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 1.5rem auto;
}

/* Specific logic for images to prevent them from dominating the screen */
img {
  width: auto;      /* Allows image to stay at its natural size if smaller than container */
  max-height: 80vh; /* Prevents tall images from forcing excessive scrolling */
}

/* On tablets and desktops, prevent images from stretching to 100% width */
@media (min-width: 768px) {
  img {
    max-width: 75%; /* Scales down large images slightly on bigger screens */
  }
}

main { 
  hyphens: auto; 
}

blockquote {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent-color);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
  color: var(--text-main);
  font-style: italic;
}

table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
}

table th, table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

table th {
  background: var(--bg-surface);
  color: var(--text-heading);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

ul, ol {
  padding-left: 1.5rem;
}


body > ul, 
.terms {
  list-style: none;
  padding-left: 0;
}

body > ul li {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  body > ul li {
    flex-direction: column;
    gap: 0.25rem;
  }
}

li .date {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

footer {
  margin-top: 4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--text-muted);
  border-bottom-color: transparent;
}

footer a:hover {
  color: var(--accent-hover);
}

::selection {
  background-color: var(--accent-color);
  color: var(--bg-color);
}