:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 720px;
  --primary: #333;
  --accent: #006d77;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  margin: 0;
  padding: 0 1rem;
  color: var(--primary);
  line-height: 1.6;
  background: #fafafa;
}

header, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
}

header {
  padding: 2rem 0 1rem;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

header a {
  color: var(--primary);
  text-decoration: none;
}

.tagline {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

.about {
  margin-bottom: 2rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin-bottom: 2rem;
}

img {
  max-width: 100%;
  height: auto;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

img:hover {
  opacity: 0.9;
}

/* Image Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.modal.show {
  display: block;
}

/* Image hover effect */
.image-hover-container {
  position: relative;
  display: inline-block;
  line-height: 0;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  overflow: hidden;
}

.image-hover-container .base-image {
  display: block !important;
  max-width: 100%;
  height: auto;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.image-hover-container .hover-image {
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Desktop hover effect */
@media (hover: hover) and (pointer: fine) {
  .image-hover-container:hover .base-image {
    opacity: 0;
  }

  .image-hover-container:hover .hover-image {
    opacity: 1;
  }
}

/* Image subtitle styling */
.image-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0 1rem 0;
  font-style: italic;
}


footer {
  text-align: center;
  margin: 4rem auto 2rem;
  font-size: 0.9rem;
  color: #666;
  max-width: var(--max-width);
}

.social-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.social-links a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Code highlighting */
.highlight {
  background: #f8f8f8;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.highlight pre {
  margin: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Inline code */
code {
  background: #f1f1f1;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
}

/* Don't double-style code inside highlight blocks */
.highlight code {
  background: none;
  padding: 0;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e1e1e1;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
}

tr:hover {
  background: #f8f9fa;
}

tr:last-child td {
  border-bottom: none;
}

/* Responsive table */
@media (max-width: 768px) {
  table {
    font-size: 0.8rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

/* Math styling */
.MathJax {
  font-size: 1.1em !important;
}

mjx-container[display="true"] {
  margin: 1.5rem 0 !important;
}

mjx-container[display="false"] {
  margin: 0 0.2rem !important;
}

/* Alternative blockquote styling if you want to switch */
blockquote {
  background: #f8f9fa;
  border-left: 4px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  line-height: 1.7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  white-space: pre-line;
}
/* 
blockquote::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  position: relative;
  top: 0.2rem;
  line-height: 0;
}

blockquote::after {
  content: '\201D';
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  position: relative;
  top: 0.2rem;
  line-height: 0;
  float: right;
} */

/* Syntax highlighting colors */
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #000000; font-weight: bold } /* Keyword */
.highlight .o { color: #000000; font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #000000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d01040 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nl { color: #990000; font-weight: bold } /* Name.Label */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d01040 } /* Literal.String.Backtick */
.highlight .sc { color: #d01040 } /* Literal.String.Char */
.highlight .sd { color: #d01040 } /* Literal.String.Doc */
.highlight .s2 { color: #d01040 } /* Literal.String.Double */
.highlight .se { color: #d01040 } /* Literal.String.Escape */
.highlight .sh { color: #d01040 } /* Literal.String.Heredoc */
.highlight .si { color: #d01040 } /* Literal.String.Interpol */
.highlight .sx { color: #d01040 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d01040 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ 

/* Hiring Banner */
.hiring-banner {
  background: #000;
  color: white;
  text-align: center;
  padding: 1rem;
  margin: 2rem 0 2rem 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 109, 119, 0.2);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.hiring-banner:hover {
  transform: translateY(-2px);
}

.hiring-banner a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  display: inline-block;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

.hiring-banner a:hover {
  text-decoration: none;
}

@media (max-width: 768px) {
  .hiring-banner {
    margin: 1rem -1rem 0;
    border-radius: 0;
  }
  
  .hiring-banner a {
    font-size: 0.9rem;
  }
}

/* Discussion banner for Hacker News links */
.discussion-banner {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 12px;
  border-radius: 6px;
  margin: 20px 0;
  text-align: center;
  color: #495057;
}

.discussion-banner a {
  color: #007bff;
  text-decoration: none;
}

.discussion-banner a:hover {
  text-decoration: underline;
} 

/* Inline update callout */
.update {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  color: #495057;
}

.update-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.update-badge {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.9rem;
  background: rgba(0, 109, 119, 0.15);
  color: var(--accent);
}

.update-date {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
}

.update p {
  margin: 0;
  line-height: 1.5;
}

.update p + p {
  margin-top: 0.6rem;
}

.update-footnote {
  font-size: 0.9rem;
  color: #6c757d;
}

@media (max-width: 600px) {
  .update {
    padding: 0.9rem 1rem;
  }

  .update-header {
    flex-direction: column;
    align-items: flex-start;
  }
}