:root {
  --color-bg: #fff0f6;
  /* Soft Lavender Pink */
  --color-text: #6b305e;
  /* Warm Plum Purple */
  --color-muted: #8d6f96;
  /* Dusty Mauve */
  --color-border: #f8dae9;
  /* Light Pinkish Border */
  --color-accent: #971d35;
  /* Vibrant Red/Pink Highlight */
  --color-code-bg: #fff9fb;
  --color-code-border: #f8dae9;
  --color-code-text: #6b305e;
  --color-inline-code-bg: #ffebf3;
  --color-lint-bg: #fff4f4;
  --color-lint-border: #f0b4b4;
  --color-lint-text: #8e0f28;
  --content-width: 64ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a050b;
    /* Deep Night Burgundy */
    --color-text: #fbc6d9;
    /* Warm Light Rose */
    --color-muted: #bc8a9d;
    /* Muted Rose */
    --color-border: #3d000e;
    /* Deep Crimson Border */
    --color-accent: #ff758f;
    /* Bright Salmon/Red Accent */
    --color-code-bg: #120004;
    --color-code-border: #3d000e;
    --color-code-text: #fbc6d9;
    --color-inline-code-bg: #3d1a34;
    --color-lint-bg: #2a1515;
    --color-lint-border: #5a2a2a;
    --color-lint-text: #f1b4b4;
  }
}

@font-face {
  font-family: "Merriweather-fallback";
  src: local("Georgia");
  size-adjust: 108.5%;
}

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

html {
  font-size: 100%;
  line-height: 1.6;
  background: var(--color-bg);
}

body {
  margin: 0 auto;
  max-width: 720px;
  font-family: "Merriweather", "Merriweather-fallback", Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--color-text);
  background: transparent;
  padding: 0.75rem 1.25rem 2.5rem;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  z-index: 1000;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

h1,
h2,
h3 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.25;
  letter-spacing: 0.015em;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: all 0.2s ease;
  padding: 0 2px;
  margin: 0 -2px;
  border-radius: 4px;
}

a:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
  text-decoration: none;
}

a:focus {
  outline: none;
}

a:focus-visible {
  outline: 2px solid var(--color-border);
  outline-offset: 2px;
}

.page {
  margin: 0 auto;
  padding: 0 0 3rem;
  position: relative;
  z-index: 10;
}

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  margin-bottom: 2.25rem;
  background: transparent !important;
}

.site-header,
main,
.site-footer {
  width: min(100%, var(--content-width));
  margin-left: auto;
  margin-right: auto;
}

.site-branding-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  position: relative;
}

.site-mark {
  display: block;
  width: min(213px, 92vw);
  margin: 0;
  padding: 0;
  /* removed auto margins as flex handles centering */
}

.clover-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 66.67px;
  height: 66.67px;
  transition: transform 0.2s ease;
  flex-shrink: 0;

  /* Fluid Positioning */
  position: absolute;
  top: 1px;
  left: 50%;
  /* 
  /* 
     Clamp Logic:
     MIN: 10px (Permit deeper overlap on narrow screens <= 320px)
     VAL: 50vw - 150px (Ensures button stays clear of the 67px side border with buffer)
     MAX: 112px (Standard desktop gap next to logo)
  */
  margin-left: clamp(10px, calc(50vw - 150px), 112px);
  z-index: 20;
}

@media (max-width: 768px) {
  .clover-toggle {
    top: 2px;
    right: 2px;
    left: auto;
    margin-left: 0;
  }
}

@media (hover: hover) and (pointer: fine) {
  .clover-toggle:hover {
    transform: scale(1.1);
  }

  .clover-toggle:hover img {
    filter: drop-shadow(0 0 10px rgba(255, 77, 109, 1));
  }
}

.clover-toggle:active {
  transform: scale(0.95);
}

.clover-toggle:active img {
  filter: drop-shadow(0 0 10px rgba(255, 77, 109, 1));
}



@media (hover: hover) and (pointer: fine) {
  .next-article-btn:hover {
    transform: scale(1.05);
  }

  .next-article-btn:hover img {
    filter: drop-shadow(0 0 20px rgba(255, 77, 109, 1));
    /* Pink glow */
  }

  .next-article-btn:hover span {
    transform: scale(1.1) translateX(10px) translateY(2px);
    opacity: 1;
    /* Show on hover */
  }
}

.next-article-btn:active {
  transform: scale(0.95);
}

.next-article-btn:active img {
  filter: drop-shadow(0 0 20px rgba(255, 77, 109, 1));
}

.next-article-btn:active span {
  transform: scale(1.1) translateX(10px) translateY(2px);
  opacity: 1;
}

.clover-toggle img {
  width: 100%;
  height: 100%;
  animation: choppy-spin 6s steps(12) infinite;
  opacity: 0.9;
}

body.animations-paused .clover-left img,
body.animations-paused .clover-right img,
body.animations-paused .clover-toggle img {
  animation-play-state: paused;
}

body.clovers-hidden .clover-left,
body.clovers-hidden .clover-right {
  display: none;
}

body.clovers-hidden .clover-toggle img {
  filter: hue-rotate(180deg);
  opacity: 0.8;
}

.site-mark:hover {
  background: transparent;
}

.site-mark img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.site-mark img.is-inverted {
  filter: invert(1);
}

.site-mark:focus-visible {
  outline: none;
}

.site-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
  text-align: center;
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0;
}

main {
  margin: 0 auto;
}

main h1:first-child {
  margin-top: 1rem;
}

.page-article {
  line-height: 1.7;
}

.page-article p {
  margin: 0.9rem 0;
}

.page-article pre,
.article-entry pre {
  margin: 1.4rem 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  background: var(--color-code-bg);
  color: var(--color-code-text);
  border: 1px solid var(--color-code-border);
  border-radius: 0.4rem;
  padding: 0.85rem 1rem;
}

.page-article pre code,
.article-entry pre code {
  background: none;
  border: 0;
  padding: 0;
}

.page-article :not(pre)>code,
.article-entry :not(pre)>code {
  background: var(--color-inline-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 0.25rem;
  padding: 0.1rem 0.25rem;
}

.article-figure {
  margin: 1.75rem 0;
  padding: 0;
  width: 100%;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.article-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
  text-align: center;
}

.listing figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
}

.listing {
  margin: 1.4rem 0;
  padding: 0;
  width: 100%;
}

.summary-list,
.archive-years,
.tag-year-list,
.index-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-meta {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.article-meta-top {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.article-meta-top p,
.article-meta-bottom p {
  margin: 0 0 0.5rem;
}

.article-meta-bottom {
  margin-top: 2rem;
}

.article-entry,
.summary {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(255, 77, 109, 0.15);
  border: 1px solid var(--color-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: relative;
  /* Position relative for the next button */
  scroll-margin-top: 5rem;
}

@media (prefers-color-scheme: dark) {

  .article-entry,
  .summary {
    background: rgba(26, 5, 11, 0.5);
    /* Matching --color-bg with transparency */
  }
}

.next-article-btn {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  transition: all 0.3s ease;
  z-index: 10;
  width: 200px;
  /* Making it much larger as requested */
  height: auto;
  font-family: "Merriweather", "Merriweather-fallback", Georgia, "Times New Roman", serif;
}

.next-article-btn img {
  width: 100%;
  height: auto;
  transition: all 0.3s ease;
  display: block;
}

.next-article-btn span {
  position: absolute;
  font-family: inherit;
  font-size: 1rem;
  /* Reduced font size */
  font-weight: 700;
  color: #ffffff;
  /* White text */
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.75);
  /* Shadow for readability */
  pointer-events: none;
  opacity: 0;
  /* Hidden by default */
  transform: translateX(10px) translateY(2px);
  margin-left: 10px;
  transition: all 0.3s ease;
}




.lint-banner {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-lint-border);
  background: var(--color-lint-bg);
  color: var(--color-lint-text);
  border-radius: 6px;
}

.lint-banner-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.lint-banner-list {
  margin: 0;
  padding-left: 1.2rem;
  color: inherit;
}

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

.lint-item+.lint-item {
  margin-top: 1.5rem;
}

.lint-item-title {
  margin: 0 0 0.4rem;
}

.lint-item-meta {
  margin: 0 0 0.6rem;
  color: var(--color-muted);
}

.lint-item-issues {
  margin: 0;
  padding-left: 1.2rem;
}

.article-entry>h1 {
  margin-top: 0.5em;
}

.summary-item+.summary-item,
.archive-years li+li,
.tag-year-list li+li,
.index-list li+li {
  margin-top: 1rem;
}



.summary-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-title {
  margin-top: 0.5em;
}

.summary-meta-line {
  margin: 0.75rem 0 0;
  color: var(--color-muted);
}

.site-footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--color-muted);
}

#fish-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

#snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

.clover-left,
.clover-right {
  position: fixed;
  top: 4px;
  width: 66.67px;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.clover-left {
  left: 2px;
}

.clover-right {
  right: 2px;
}

@media (max-width: 768px) {
  .clover-left {
    left: clamp(-40px, calc(7.9vw - 65px), 2px);
  }

  .clover-right {
    right: clamp(-40px, calc(7.9vw - 65px), 2px);
  }
}

.clover-left img,
.clover-right img {
  width: 66.67px;
  height: 66.67px;
  animation: choppy-spin 6s steps(12) infinite;
  opacity: 0.9;
}

@keyframes choppy-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
