/* ===== ELEGANT MATHEMATICAL AESTHETIC ===== */
/* DARK MODE ONLY - NO LIGHT MODE */

/* 169c39 */

/* Content width constraint - better approach */
body {
  font-family: "Liberation Sans", -apple-system, BlinkMacSystemFont, 
               "Segoe UI", Roboto, Arial, sans-serif;
  max-width: 100vw;
  overflow-x: hidden;
  background: #262626;
  color: #e0e0e0;
  min-height: 100vh;
}

body > * {
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  font-size: 14pt
}

/* Padding only on actual content containers, not list wrappers */
body > main,
body > article,
body > div:not(.hero-section):not(.fullbleed-canvas) {
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Full width exceptions */
body > .hero-section,
body > nav,
body > .main-nav,
body > header {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body {
  line-height: 1;
}

/* Prevent orphaned punctuation and improve typography */
article p,
article li {
  text-wrap: pretty; /* Modern browsers */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Prevent single characters/punctuation on new lines */
article p::after,
article li::after {
  content: "\00a0\00a0"; /* Non-breaking spaces to prevent orphans */
  display: inline;
  width: 0;
  font-size: 0;
}

html {
  margin: 0;
  padding: 0;
  background: #262626;
  min-height: 100vh;
}

@media (max-width: 900px) {
  main,
  article {
  }
}

@media (max-width: 600px) {
  main,
  article {
  }
}

/* Fix LaTeX/Math equation overflow with horizontal scroll */
.math,
.katex-display,
.MathJax,
.MathJax_Display,
mjx-container,
.mjx-chtml {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
  margin: 1rem 0;
}

/* Scrollable container for math blocks */
.math-display,
.katex-display {
  padding: 0.4rem;
  border-radius: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(255, 255, 255, 0.03);
}

/* Inline math should not scroll */
.math.inline,
.katex.inline,
mjx-container[display="inline"] {
  overflow-x: visible;
  padding: 0;
  margin: 0;
}

/* Custom scrollbar for math containers */
.math-display::-webkit-scrollbar,
.katex-display::-webkit-scrollbar {
  height: 6px;
}

.math-display::-webkit-scrollbar-track,
.katex-display::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.math-display::-webkit-scrollbar-thumb,
.katex-display::-webkit-scrollbar-thumb {
  background: rgba(22, 156, 57, 0.4);
  border-radius: 3px;
}

.math-display::-webkit-scrollbar-thumb:hover,
.katex-display::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 156, 57, 0.6);
}

/* Firefox scrollbar */
.math-display,
.katex-display {
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 156, 57, 0.4) rgba(255, 255, 255, 0.05);
}

/* Ensure tables in math don't break */
.math table,
.katex-display table {
  margin: 0;
  white-space: nowrap;
}

/* Ensure regular tables take full width */
/* Tables take full width */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

/* Optional: style the table cells */
th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

/* Alternating row colors for readability */
tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Code blocks should also scroll horizontally */
pre {
  font-family: 'Berkeley Mono', monospace;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem;
  margin: 1rem 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}

pre::-webkit-scrollbar {
  height: 6px;
}

pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

pre::-webkit-scrollbar-thumb {
  background: rgba(22, 156, 57, 0.4);
  border-radius: 3px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 156, 57, 0.6);
}

/* Prevent horizontal page scroll */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Images should never overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Clean, readable typography */
h1 {
  font-weight: 700;
  color: #e0e0e0;
  letter-spacing: -0.02em;
}

h2 {
  font-weight: 700;
  color: #e0e0e0;
  margin-top: 2rem;
}

.hero-section {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: 200px;
  margin-bottom: 3rem;
}

.hero-section iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0.75; /* Make it subtle background */
}

.hero-section h1 {
  position: relative;
  z-index: 10;
  text-align: center;
  padding-top: 20px;
  margin: 0;
  font-size: 3rem;
  font-weight: 600;
}

.hero-section .tagline {
  position: relative;
  z-index: 10;
  text-align: center;
  margin-top: 1rem;
  color: #999;
  font-size: 0.9rem;
}

/* Lissajous curve decoration - appears on page load */
body::before {
  content: "";
  position: fixed;
  top: 60px;
  right: 40px;
  width: 120px;
  height: 120px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50,10 Q80,30 90,50 Q80,70 50,90 Q20,70 10,50 Q20,30 50,10' stroke='%23999' stroke-width='0.5' fill='none' opacity='0.2'/%3E%3Cpath d='M30,20 Q70,35 80,50 Q70,65 30,80 Q20,65 20,50 Q20,35 30,20' stroke='%23999' stroke-width='0.5' fill='none' opacity='0.15'/%3E%3Ccircle cx='50' cy='50' r='2' fill='%23ccc' opacity='0.3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  animation: curveRotate 20s linear infinite;
  pointer-events: none;
  opacity: 0.3;
  z-index: -1;
}

@keyframes curveRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


main::before {
  content: "";
  position: fixed;
  bottom: 40px;
  left: 40px;
  width: 150px;
  height: 150px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50,50 Q50,30 65,20 Q80,20 90,35 Q90,60 70,75 Q40,90 15,75 Q0,50 10,25 Q30,5 55,5' stroke='%23777' stroke-width='0.5' fill='none' opacity='0.15'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  animation: spiralPulse 12s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.2;
  z-index: -1;
}

@keyframes spiralPulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    opacity: 0.15;
  }
  50% { 
    transform: scale(1.1) rotate(15deg);
    opacity: 0.25;
  }
}

/* Clean image styling */
img {
  display: block;
  margin: auto;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px;
  background: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Refined links */
a {
  color: #169c39;
  text-decoration: none;
  border-bottom: 1px solid #555;
  transition: border-color 0.2s ease;
}

a:hover {
  border-bottom-color: #169c39;
  color: #c0c0c0;
}

/* ===== ENHANCED CODE BLOCK STYLING ===== */

/* Inline code */
code {
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.9em;
  color: #169c39;
  background: #2e2e2e;
  padding: 0.35em 0.5em;
  border-radius: 2px;
  font-weight: 900;
}

/* Code blocks */
pre {
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 1.5rem;
  margin: 2rem 0;
  background: #1a1a1a;
  border-radius: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  border: none;
}

/* Pink accent bar on left */
pre::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 6px 0 0 6px;
}

/* Code inside pre blocks shouldn't have inline styling */
pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* Syntax highlighting (if using Prism/Highlight.js) */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6c6c6c;
}

.token.punctuation {
  color: #c9c9c9;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #169c39;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #c9c9c9;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #169c39;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #169c39;
}

.token.function,
.token.class-name {
  color: #169c39;
}

.token.regex,
.token.important,
.token.variable {
  color: #c9c9c9;
}

/* Enhanced scrollbar for code blocks */
pre::-webkit-scrollbar {
  height: 8px;
}

pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
  background: rgba(22, 156, 57, 0.5);
  border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 156, 57, 0.7);
}

/* Line numbers (if you want them) */
pre[class*="language-"].line-numbers {
  padding-left: 3.8rem;
  counter-reset: linenumber;
}

pre[class*="language-"].line-numbers > code {
  position: relative;
  white-space: inherit;
}

.line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 100%;
  left: -3.8rem;
  width: 3rem;
  letter-spacing: -1px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

.line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.line-numbers-rows > span:before {
  content: counter(linenumber);
  color: #666;
  display: block;
  padding-right: 0.8rem;
  text-align: right;
}

/* Inline code shouldn't have the block styling */
p code,
li code,
td code,
h1 code,
h2 code,
h3 code {
  background: #2e2e2e;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  color: #169c39;
}

/* Copy button for code blocks (optional) */
.code-block-wrapper {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(22, 156, 57, 0.15);
  border: 1px solid rgba(22, 156, 57, 0.3);
  border-radius: 4px;
  color: #c9c9c9;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.code-block-wrapper:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  background: rgba(22, 156, 57, 0.25);
  border-color: #169c39;
}

.copy-button:active {
  transform: scale(0.95);
}

/* Copied state */
.copy-button.copied {
  background: rgba(22, 156, 57, 0.2);
  border-color: #169c39;
}

.copy-button.copied::after {
  content: " ✓";
}

/* ===== MINIMALIST NAVIGATION ===== */

/* Main navigation bar */
.main-nav {
  width: 100%;
  padding: 1.5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
}

/* Navigation list */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.main-nav li {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

/* Navigation links */
.main-nav a {
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.95rem;
  color: #aaa;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

/* Hover state */
.main-nav a:hover {
  color: #169c39;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* Active/current page */
.main-nav a.active {
  color: #e0e0e0;
  border-bottom-color: #169c39;
}

/* Dot separators */
.main-nav li:not(:last-child)::after {
  content: "·";
  color: #555;
  margin-left: 0.5rem;
  font-size: 1.2rem;
  line-height: 1;
}

/* Mobile optimization */
@media (max-width: 768px) {
  .main-nav {
    padding: 1rem 0;
    font-size: 0.9rem;
  }

  body > * {
      font-size: 12pt;
  }
  
  .main-nav a {
    padding: 0.4rem 0.6rem;
  }
  
  .main-nav li:not(:last-child)::after {
    margin-left: 0.3rem;
  }
}

/* Alternative style: no separators, just spacing */
.main-nav.no-separators li:not(:last-child)::after {
  content: none;
}

.main-nav.no-separators ul {
  gap: 2rem;
}

/* Alternative style: pills */
.main-nav.pills a {
  border: 1px solid #333;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #333;
}

.main-nav.pills a:hover,
.main-nav.pills a.active {
  border-color: #169c39;
  background: rgba(22, 156, 57, 0.1);
}

/* ===== BLOG POST TITLE & METADATA STYLING ===== */

/* Article/Post container */
article {
  max-width: 750px;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-family: 'Hack Nerd Font Mono', monospace;
  font-size: 11pt;
}

/* Post title */
article h1,
.post-title {
  font-family: 'Berkeley Mono', monospace;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
  color: #e0e0e0;
}

/* Post metadata container */
.post-meta,
article > p:first-of-type {
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.85rem;
  color: #999;
  margin: 0 0 3rem 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.02em;
}

/* Date styling with icon */
.post-date::before {
  content: "◆";
  color: #169c39;
  margin-right: 0.5rem;
  font-size: 0.7rem;
}

/* Alternative: date with mathematical symbol */
.post-date.math-style::before {
  content: "∂";
  color: #169c39;
  margin-right: 0.5rem;
  font-size: 1rem;
}

/* Reading time estimate (if you want to add it) */
.reading-time {
  color: #777;
  margin-left: 1rem;
}

.reading-time::before {
  content: "·";
  margin-right: 0.5rem;
}

/* Tags/Categories in metadata */
.post-tags {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: #aaa;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-tag:hover {
  background: rgba(22, 156, 57, 0.15);
  border-color: #169c39;
  color: #169c39;
}

/* Post header section (title + meta together) */
.post-header {
  margin-bottom: 3rem;
  text-align: left;
}

/* Centered variant */
.post-header.centered {
  text-align: center;
}

.post-header.centered .post-meta {
  justify-content: center;
}

/* Minimal divider after header */
.post-header::after {
  content: "";
  display: block;
  width: 70%;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent);
  margin: 2rem 0;
}

.post-header.centered::after {
  margin: 2rem auto;
}

/* Callout/Alert styling */
blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid #555;
  border-radius: 4px;
  line-height: 1.3;
  background: rgba(255, 255, 255, 0.02);
}

/* Remove default indentation */
blockquote {
  margin-left: 0;
  margin-right: 0;
}


/* Post content styling */
article > p {
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* First paragraph drop cap (optional, for style) */
article > p:first-of-type:first-letter {
  font-size: 3.5rem;
  line-height: 0.9;
  float: left;
  margin: 0.1rem 0.1rem 0 0;
  color: #169c39;
  font-weight: 500;
}

/* Remove drop cap if you don't want it */
article.no-drop-cap > p:first-of-type:first-letter {
  font-size: inherit;
  line-height: inherit;
  float: none;
  margin: 0;
  color: inherit;
  font-weight: inherit;
}

/* Mobile optimization */
@media (max-width: 768px) {
  article h1,
  .post-title {
    font-size: 2rem;
  }

  .hero-section {
    height: 110px;
  }

  article {
      font-size: 10pt;
  }
  
  .post-header::after {
    margin: 1.5rem 0;
  }

    blockquote {
      font-size: 10pt;
    }
}

/* Footer with social icons */
footer {
  text-align: center;
  padding: 2rem 2rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
}

.social-links a {
  color: #aaa;
  text-decoration: none;
  border-bottom: none;
  transition: all 0.2s ease;
  display: inline-block;
  width: 24px;
  height: 24px;
}

.social-links a:hover {
  color: #169c39;
  transform: translateY(-2px);
}

.social-links svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Reset general lists to normal behavior */
article ul,
main ul {
}

article ul li,
main ul li {
}

article ul li:hover,
main ul li:hover {
}

article ul li::before,
main ul li::before {
}

/* Post list styling ONLY for homepage/list pages */
body > main > ul li,
.post-list li {
}
  /* ... rest of your post list styles */

/* Base Callout Styling */
.callout {
  position: relative;
  padding: 20px;
  margin: 20px 0;
  border: 2px solid;
  border-radius: 8px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  line-height: 1.5;
}

/* Light mode (default) */
.callout {
  background-color: #f9f9f9;
  color: #333;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .callout {
    background-color: #2a2a2a;
    color: #e0e0e0;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
  }
}

/* Icon with ::before */
.callout::before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: inherit;
}

/* Warning Callout */
.callout.warning {
  border-color: #ff6f00;
}

.callout.warning::before {
  content: "\f071";
  color: #ff6f00;
}

/* Light mode warning */
.callout.warning {
  background-color: #fff3e0;
}

/* Dark mode warning */
@media (prefers-color-scheme: dark) {
  .callout.warning {
    background-color: rgba(255, 111, 0, 0.15);
    border-color: #ff8f00;
  }
  
  .callout.warning::before {
    color: #ff8f00;
  }
}

/* Info Callout */
.callout.info {
  border-color: #00acc1;
}

.callout.info::before {
  content: "\f05a";
  color: #00acc1;
}

.callout.info {
  background-color: #e0f7fa;
}

@media (prefers-color-scheme: dark) {
  .callout.info {
    background-color: rgba(0, 172, 193, 0.15);
    border-color: #26c6da;
  }
  
  .callout.info::before {
    color: #26c6da;
  }
}

/* Success Callout */
.callout.success {
  border-color: #43a047;
}

.callout.success::before {
  content: "\f058";
  color: #43a047;
}

.callout.success {
  background-color: #e8f5e9;
}

@media (prefers-color-scheme: dark) {
  .callout.success {
    background-color: rgba(67, 160, 71, 0.15);
    border-color: #66bb6a;
  }
  
  .callout.success::before {
    color: #66bb6a;
  }
}

/* Error Callout */
.callout.error {
  border-color: #e53935;
}

.callout.error::before {
  content: "\f057";
  color: #e53935;
}

.callout.error {
  background-color: #ffebee;
}

@media (prefers-color-scheme: dark) {
  .callout.error {
    background-color: rgba(229, 57, 53, 0.15);
    border-color: #ef5350;
  }
  
  .callout.error::before {
    color: #ef5350;
  }
}

p code,
li code,
.callout code {
  padding: 0.1em 0.3em !important;
  margin: 0;
  font-size: 0.9em;
  line-height: 1;
  vertical-align: baseline;
}

/* Give paragraphs and list items more breathing room */
p, li {
  line-height: 1.7 !important;
}

/* Keep code padding tight */
code {
  padding: 0.05em 0.3em !important;
  font-size: 0.9em;
}

/* Fix iOS Safari text size adjustment in code blocks */
pre, code {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Extra insurance for code blocks */
pre code {
  -webkit-text-size-adjust: 100%;
  font-size: 0.9rem; /* or whatever size you prefer */
  line-height: 1.5;
}

/* Comprehensive fix for iOS Firefox code rendering */
pre, pre code, code {
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  
  /* Disable font inflation/boosting */
  max-height: 999999px !important;
  
  /* Force consistent font size */
  font-size: 14px !important;
  font-size: 0.875rem !important;
  
  /* Explicit font stack */
  font-family: 'Courier New', Courier, monospace !important;
  
  /* Prevent text zoom */
  -webkit-text-zoom: 100%;
}

/* Specific fix for code blocks */
pre {
  font-size: 14px !important;
  line-height: 1.5 !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Screen size query for making code font smaller on phones */
@media (max-width: 600px) {
  pre {
    font-size: 10px !important;
  }
}

pre code {
  font-size: inherit !important;
  line-height: inherit !important;
  display: block;
  padding: 0 !important;
  background: transparent !important;
}

/* Inline code */
p code, li code, td code {
  font-size: 0.9em !important;
  padding: 0.1em 0.3em !important;
  white-space: nowrap;
  max-height: none !important;
}
