/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=VT323&display=swap');

/* ---------- Joan Mitchell Color Palette ---------- */
:root{
  /* Inspired by "La Grande Vallée" series - Spring landscapes */
  --color-bg: linear-gradient(135deg, #f4f1de 0%, #e8d5c4 25%, #d4a574 50%, #b08968 75%, #8b4513 100%);
  --color-text:#2d1810;
  --color-anchor:#d2691e; /* burnt sienna */
  --color-heading:#8b4513; /* saddle brown */
  --color-divider:#cd853f; /* peru */
  --color-code-bg:rgba(244, 241, 222, 0.9);
  --color-code-text:#2d1810;
  --color-table-border:#cd853f;
  --color-table-row-even:rgba(212, 165, 116, 0.3);
  --color-table-row-odd:rgba(244, 241, 222, 0.8);
  --color-toggle-accent: #8b0000; /* dark red */
}

/* Dark mode - Inspired by "Nocturnes" series */
html.dark{
  --color-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #1a1a2e 100%);
  --color-text:#f4f1de;
  --color-anchor:#d2691e; /* burnt sienna */
  --color-heading:#f4f1de;
  --color-divider:#8b4513;
  --color-code-bg:rgba(26, 26, 46, 0.9);
  --color-code-text:#f4f1de;
  --color-table-border:#8b4513;
  --color-table-row-even:rgba(45, 55, 72, 0.6);
  --color-table-row-odd:rgba(26, 26, 46, 0.8);
}

/* Fallback for users that prefer a dark scheme */
@media (prefers-color-scheme: dark){
  :root:not(.dark){
    --color-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #1a1a2e 100%);
    --color-text:#f4f1de;
    --color-anchor:#d2691e; /* burnt sienna */
    --color-heading:#f4f1de;
    --color-divider:#8b4513;
    --color-code-bg:rgba(26, 26, 46, 0.9);
    --color-code-text:#f4f1de;
    --color-table-border:#8b4513;
    --color-table-row-even:rgba(45, 55, 72, 0.6);
    --color-table-row-odd:rgba(26, 26, 46, 0.8);
  }
}

/* ---------- Global element styles ---------- */
*{box-sizing:border-box;}

/* Subtle gradient animation inspired by Joan Mitchell's gestural brushstrokes */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body{
  margin:0;
  font-family:'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.125rem;
  line-height:1.75;
  background:var(--color-bg);
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  color:var(--color-text);
}

/* Images & SVG */
img,svg{max-width:100%;height:auto;}

/* Layout container */
.container-fluid{padding:48px 18px;margin:auto;max-width:1100px;position:relative;}

/* ASCII Stars Background */
.container-fluid::before,
.container-fluid::after {
  content: "★ ☆ ✦ ✧";
  position: fixed;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: var(--color-anchor);
  opacity: 0.1;
  pointer-events: none;
  z-index: -1;
  line-height: 1.2;
  letter-spacing: 0.35em;
}

.container-fluid::before {
  top: 2rem;
  left: 2rem;
  transform: rotate(-15deg);
}

.container-fluid::after {
  bottom: 2rem;
  right: 2rem;
  transform: rotate(15deg);
}

/* Mobile adjustments for stars */
@media only screen and (orientation: portrait) {
  .container-fluid::before,
  .container-fluid::after {
    font-size: 0.95rem;
    opacity: 0.1;
  }
  
  .container-fluid::before {
    top: 1rem;
    left: 1rem;
  }
  
  .container-fluid::after {
    bottom: 1rem;
    right: 1rem;
  }
}

/* Color‑mode switch layout */
#color-mode-switch{display:flex;align-items:center;}
#color-mode-switch label{cursor:pointer;font-size:.875rem;user-select:none;}

/*
  Color Scheme Toggle Switch
  - Styled checkbox with slight animation when toggling
*/
#color-mode-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#color-mode-switch > span {
  font-size: 30px;
  display: inline-block;
  margin-right: 8px;
}

#color-mode-switch svg {
  width: 24px;
  height: 24px;
  margin: 0 4px;
}

#color-mode-switch input[type=checkbox] {
  height: 0;
  width: 0;
  margin: 0;
  visibility: hidden;
}

#color-mode-switch label {
  cursor: pointer;
  text-indent: -9999px;
  width: 42px;
  height: 21px;
  border-radius: 30px;
  background: var(--color-toggle-accent);
  display: block;
  position: relative;
  margin: 0;
}

#color-mode-switch label:after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 90px;
  transition: 0.3s;
}

#color-mode-switch input:checked + label:after {
  left: calc(100% - 3px);
  transform: translateX(-100%);
}

#color-mode-switch label:active:after {
  width: 30px;
}

/* Constrain main markdown content */
.markdown-body{max-width:760px;margin:auto;padding:52px 20px 56px 20px;position:relative;letter-spacing:.01em}

/* Markdown body basics */
.markdown-body table{width:100%;border-collapse:collapse;margin:1em 0;}
.markdown-body th,.markdown-body td{border:1px solid var(--color-table-border);padding:.6em .8em;}
.markdown-body table tr:nth-child(2n){background:var(--color-table-row-even);}
.markdown-body blockquote{margin:0 0 1em;padding:0 1em;border-left:4px solid var(--color-divider);color:var(--color-text);opacity:.8;}
.markdown-body code{background:var(--color-code-bg);color:var(--color-code-text);padding:.2em .4em;border-radius:4px;}
.markdown-body pre{background:var(--color-code-bg);color:var(--color-code-text);padding:.8em;overflow:auto;border-radius:4px;}

.markdown-body h1{
  font-weight:700;
  margin:3.5rem auto 2rem;
  text-align:center;
  color:var(--color-heading);
  letter-spacing:0.04em;
}

.markdown-body h1::after{
  content:'';
  display:block;
  width:72px;
  height:3px;
  margin:18px auto 0;
  background:var(--color-anchor);
  border-radius:999px;
  opacity:0.65;
}

.markdown-body hr {
  height:2px;
  padding:0;
  margin:2.5rem 0;
  background:linear-gradient(90deg,transparent,var(--color-divider),transparent);
  border:0;
  border-radius:1px;
}

/* Date & meta info */
.markdown-body small{font-size:.95rem;color:var(--color-text);display:block;opacity:0.75;font-weight:500;}

/* Utility – visually hidden */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;}

/* Size utilities used by inline SVG icons (Tailwind‑style) */
.h-6{height:1.5rem;}
.w-6{width:1.5rem;}

/* Links */
a{color:var(--color-anchor);text-decoration:none;}
a:hover,a:focus{text-decoration:underline;}

/* Headings */
h1,h2,h3,h4,h5,h6{color:var(--color-heading);line-height:1.2;margin-top:1.35em;margin-bottom:.7em;}
h1{font-size:2.4rem;}
h2{font-size:2rem;}
h3{font-size:1.65rem;}

/* Responsive typography */
@media only screen and (orientation: portrait) {
  .markdown-body{max-width:1000px; padding: 40px;}
  body{font-size:1.05rem;}
  h1{font-size:2.6rem;}
  h2{font-size:2.2rem;}
  h3{font-size:1.9rem;}
  .markdown-body p,li,div,span,code,table {font-size: 1.05rem;}
  .markdown-body small {font-size: 0.95rem;}
}

/* Simple clearfix for floats */
.clearfix::after,
.container-fluid::after{content:"";display:block;clear:both;}

.post-list {
  margin-left: 0;
  padding-left: 0;
  list-style: none; }
  .post-list > li {
    margin-bottom: 30px;
    }

@media only screen and (orientation: landscape) {
    .post-link {
      display: block;
      font-size: 24px; }

    .post-meta {
      font-size: 14px;
      color: var(--color-text);
      opacity: 0.9; }

    .toc-category {
      display: inline-block;
      width: 100px;
      padding-top: 8px;
      padding-bottom: 8px;
      padding-right: 4px;
      padding-left: 4px; }
}

@media only screen and (orientation: portrait) {
    .post-link {
      display: block; }
    .post-meta {
      font-size: 24px;
      color: var(--color-text);
      opacity: 0.9; }
    .post-list > li {
      margin-bottom: 60px;
     }

    .toc-category {
      display: inline-block;
      width: 200px;
      padding-top: 20px;
      padding-bottom: 20px;
      padding-right: 12px;
      padding-left: 12px; }
}
