@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --MAIN-font: 'Montserrat', sans-serif;
  --MAIN-font-weight: 300;
  --MAIN-BOLD-font-weight: 500;
  --MAIN-TITLES-H1-font: 'Montserrat', sans-serif;
  --MAIN-TITLES-H2-font: 'Montserrat', sans-serif;
  --MAIN-TITLES-H3-font: 'Montserrat', sans-serif;
  --MAIN-TITLES-H4-font: 'Montserrat', sans-serif;
  --MAIN-TITLES-H5-font: 'Montserrat', sans-serif;
  --MAIN-TITLES-H6-font: 'Montserrat', sans-serif;
  --MAIN-TITLES-H1-font-weight: 300;
  --MAIN-TITLES-H2-font-weight: 300;
  --MAIN-TITLES-H3-font-weight: 300;
  --MAIN-TITLES-H4-font-weight: 300;
  --MAIN-TITLES-H5-font-weight: 300;
  --MAIN-TITLES-H6-font-weight: 300;
  --LOGO-font: 'Montserrat', sans-serif;
}

/* --- Homepage Y2K pixel hero (content/_index.md) --- */
.home-y2k {
  --y2k-pink: #ffc8e0;
  --y2k-pink-deep: #d98aad;
  --y2k-green: #c5e8d0;
  --y2k-green-deep: #6aab82;
  --y2k-moss: #e8f5ec;
  --y2k-border: #4a5c52;
  --y2k-bg: #fafffb;
  --home-section-title-size: clamp(0.58rem, 2.2vw, 0.72rem);
  margin: 0;
  padding-bottom: 0;
}

/* Hide theme-injected page title on home & nature corner (custom titles in page) */
main.home > h1,
#R-body-inner.home > h1,
main:has(.nature-corner) > h1,
#R-body-inner:has(.nature-corner) > h1 {
  display: none !important;
}

.y2k-hero {
  text-align: center;
  padding: 0.25rem 0 0.5rem;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.y2k-pixel-greeting {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.5rem, 2vw, 0.68rem);
  line-height: 1.8;
  color: var(--y2k-green-deep);
  margin: 0 0 1rem;
  text-shadow: 2px 2px 0 var(--y2k-pink);
}

.y2k-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.55rem, 2.5vw, 0.78rem);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--y2k-pink-deep);
  margin: 0 0 0.35rem;
}

/* All homepage section titles (ABOUT ME, Updates, Homework, …) */
.y2k-info h2.home-section-title,
#R-body-inner.home #body h2.home-section-title,
main.home #body h2.home-section-title,
#R-body-inner.home #body > h2,
main.home #body > h2,
#R-body-inner.home article h2,
#R-body-inner.home #body .home-section-title {
  font-family: 'Press Start 2P', monospace !important;
  font-size: var(--home-section-title-size, clamp(0.58rem, 2.2vw, 0.72rem)) !important;
  font-weight: 400 !important;
  line-height: 1.65 !important;
  letter-spacing: 0.02em !important;
  color: var(--y2k-pink-deep) !important;
  text-align: left !important;
  text-transform: none !important;
  margin-top: 0.75rem !important;
  margin-bottom: 0.5rem !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  min-height: 0 !important;
}

/* ABOUT ME sits right under the name — no extra top gap */
.y2k-info h2.home-section-title {
  margin-top: 0.35rem !important;
  margin-bottom: 0.75rem !important;
}

#R-body-inner.home #body > h2.home-section-title:first-of-type {
  margin-top: 0.75rem !important;
}

.y2k-sub {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  color: var(--y2k-border);
  margin: 0;
  opacity: 0.9;
}

/* Gandalf GIF — below About me, centered on homepage */
#R-body-inner.home .y2k-gif-box,
main.home .y2k-gif-box {
  max-width: min(100%, 360px);
  margin: 0.5rem auto 2rem;
}

.y2k-gif-box {
  margin: 0;
  padding: 0.75rem;
  background: linear-gradient(160deg, var(--y2k-moss) 0%, var(--y2k-green) 100%);
  border: 3px solid var(--y2k-green-deep);
  box-shadow: 4px 4px 0 var(--y2k-pink);
}

.y2k-gif-box img {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid var(--y2k-border);
  image-rendering: auto;
}

.y2k-gif-box .theme-caption {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  margin: 0.6rem 0 0;
  color: var(--y2k-border);
  text-align: center;
}

.y2k-info {
  width: 100%;
  max-width: 100%;
  margin: 0.25rem 0 1rem;
  padding: 0.85rem 1.1rem 1rem;
  box-sizing: border-box;
  background: linear-gradient(135deg, var(--y2k-bg) 0%, rgba(255, 248, 252, 1) 100%);
  border: 3px solid var(--y2k-pink-deep);
  box-shadow: 4px 4px 0 var(--y2k-green-deep);
}

.y2k-info h3,
.y2k-info p,
.y2k-info ul,
.y2k-info p:has(a) {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
}

.y2k-info > p strong,
.y2k-info p strong {
  font-weight: 500;
}

.y2k-info h3 {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--y2k-green-deep);
  margin: 1rem 0 0.4rem;
}

.y2k-info h3:first-of-type {
  margin-top: 0.35rem;
}

.y2k-info ul {
  margin: 0.35rem 0 1rem;
  padding-left: 1.15rem;
  line-height: 1.7;
}

.y2k-info > p:last-child {
  margin: 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(106, 171, 130, 0.35);
  font-size: 0.9rem;
}

.y2k-info > p:last-child a {
  color: var(--y2k-pink-deep);
  text-decoration: none;
}

.y2k-info > p:last-child a:hover {
  color: var(--y2k-green-deep);
  text-decoration: underline;
}

.y2k-info > p:first-of-type {
  font-size: 1.02rem;
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.y2k-info > p:not(:last-child):not(:first-of-type) {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

main.home,
#R-body-inner.home {
  --MAIN-TITLES-H2-font: 'Press Start 2P', monospace;
  --MAIN-TITLES-H2-font-weight: 400;
  --INTERNAL-MAIN-TITLES-H2-font: 'Press Start 2P', monospace;
  --INTERNAL-MAIN-TITLES-H2-font-weight: 400;
  --INTERNAL-MAIN-TITLES-H2-font-size: clamp(0.58rem, 2.2vw, 0.72rem);
}

/* Beat Relearn heading anchor / permalink wrappers on home h2 */
#R-body-inner.home #body h2.home-section-title a,
#R-body-inner.home #body h2.home-section-title .anchor,
#R-body-inner.home #body > h2 a {
  font: inherit !important;
  color: inherit !important;
}

.home-ascii-art {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 2.5rem auto 1rem;
  padding: 1rem 0.75rem;
  overflow-x: auto;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
  font-size: clamp(0.45rem, 1.1vw, 0.62rem);
  line-height: 1.15;
  color: var(--y2k-green-deep, #6aab82);
  background: transparent;
  border: none;
  white-space: pre;
  text-align: left;
  opacity: 0.85;
}

/* --- Nature Corner page (content/nature-corner/) --- */
.nature-corner {
  --nature-moss: #e8f5ec;
  --nature-green: #6aab82;
  --nature-sky: #d4ebe8;
  margin-bottom: 2rem;
}

.nature-corner-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.45rem, 1.8vw, 0.58rem);
  line-height: 1.8;
  color: var(--nature-green);
  text-align: center;
  margin: 0 0 1rem;
}

.nature-corner h2 {
  font-family: 'Press Start 2P', monospace !important;
  font-size: clamp(0.65rem, 3vw, 0.85rem) !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
  text-align: center;
  color: var(--y2k-pink-deep, #d98aad);
  margin: 0 0 0.75rem !important;
  border: none !important;
}

.nature-corner-caption {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
  margin: 0 auto 1.25rem;
  color: var(--y2k-border, #4a5c52);
}

.nature-audio {
  max-width: 22rem;
  margin: 0 auto 1.5rem;
  padding: 0.85rem 1rem;
  text-align: center;
  background: linear-gradient(160deg, var(--nature-moss) 0%, var(--nature-sky) 100%);
  border: 2px solid var(--nature-green);
  border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(217, 138, 173, 0.45);
}

.nature-audio-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  line-height: 1.7;
  color: var(--nature-green);
  margin: 0 0 0.65rem;
}

.nature-audio-player {
  width: 100%;
  height: 2.5rem;
}

.nature-audio-hint {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--y2k-border, #4a5c52);
  margin: 0.5rem 0 0;
  opacity: 0.85;
}

.nature-gif-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  margin: 1.5rem 0;
}

.nature-corner .nature-gif-grid {
  margin: 0;
  width: 100%;
}

.nature-corner .nature-gif-card {
  margin: 0 auto;
  padding: 0;
  width: 100%;
  max-width: min(100%, 720px);
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.nature-corner .nature-gif-card img {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  object-fit: contain;
}

/* Keep GIF frames animating (no pixelated freeze) */
.nature-gif-card img[data-nature-gif] {
  image-rendering: auto;
}

/* Theme-specific GIFs: Pastel Nature vs Space */
.theme-gif--space,
.theme-caption--space {
  display: none !important;
}

html[data-r-theme-variant="space"] .theme-gif--pastel,
html[data-r-theme-variant="space"] .theme-caption--pastel {
  display: none !important;
}

html[data-r-theme-variant="space"] .theme-gif--space,
html[data-r-theme-variant="space"] .theme-caption--space {
  display: block !important;
}


.nature-gif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed var(--nature-green);
  border-radius: 4px;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--y2k-border, #4a5c52);
}

.nature-gif-empty span {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--nature-green);
  margin-bottom: 0.35rem;
}

.nature-gif-empty code {
  font-size: 0.7rem;
  word-break: break-all;
}

/* Nature corner “how to add” section */
.nature-corner ~ h3,
#body:has(.nature-corner) h3 {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.95rem !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin-top: 2rem !important;
}

/* --- Space theme: Y2K + nature corner on dark navy --- */
html[data-r-theme-variant="space"] {
  --y2k-pink: #4a5f8a;
  --y2k-pink-deep: #a8c8ff;
  --y2k-green: #1a2840;
  --y2k-green-deep: #6b9fff;
  --y2k-moss: #0f1828;
  --y2k-border: #9aa8c4;
  --y2k-bg: #0a101c;
  --nature-moss: #0f1828;
  --nature-green: #5a7ab8;
  --nature-sky: #121c30;
}

html[data-r-theme-variant="space"] .y2k-pixel-greeting {
  text-shadow: 2px 2px 0 #1e3058;
}

html[data-r-theme-variant="space"] .y2k-info {
  background: linear-gradient(135deg, #0a101c 0%, #121c30 100%);
  box-shadow: 4px 4px 0 #1e3058;
}

html[data-r-theme-variant="space"] .y2k-gif-box {
  background: linear-gradient(160deg, #0f1828 0%, #1a2840 100%);
  box-shadow: 4px 4px 0 #2a4070;
}

html[data-r-theme-variant="space"] .home-ascii-art {
  color: var(--y2k-border);
  opacity: 0.75;
}
