:root {
  color-scheme: light dark;
  --bg-page: #ffffff;
  --text-page: #1a1a1a;
  --text-prose: #1a1a1a;   /* article prose: black (cards override below) */
  --text-muted: gray;
  --text-accent: #8b7355;
  --bg-surface: transparent;
  --bg-card: #f5ede0;
  --bg-score: #fdf6e3;
}

/* Card surface deviates: brown text on parchment */
.card {
  --text-prose: #4a3a2a;
  --bg-surface: var(--bg-card);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode tokens — fill in deliberately when designing dark theme */
    --bg-page: #1a1a1a;
    --text-page: #e0e0e0;
    --text-prose: #e0e0e0;
    --text-muted: #999;
    --text-accent: #b89976;
    --bg-card: #2a2520;
  }

  .card {
    --text-prose: #e8dfc8;
  }
}

/* Laila for Devanagari, forced to a heavier weight via the 600 file.
   Declared at weight 400 so it applies regardless of the element's font-weight. */
@font-face {
  font-family: "LailaDeva";
  src: url(https://fonts.gstatic.com/s/laila/v20/LYjBdG_8nE8jDLyFpANA.ttf) format("truetype");
  font-weight: 400;
  font-style: normal;
  unicode-range: U+0900-097F, U+A8E0-A8FF, U+1CD0-1CFF;
}

@font-face {
  font-family: "Apple Chancery";
  src: url("/assets/fonts/Apple Chancery.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Zapf Chancery";
  src: url("/assets/fonts/Zapf Chancery/Zapf Chancery Italic/Zapf Chancery Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: "Zapf Chancery";
  src: url("/assets/fonts/Zapf Chancery/Zapf Chancery Medium Italic/Zapf Chancery Medium Italic.otf") format("opentype");
  font-weight: bold;
  font-style: italic;
}

body {
  min-height: calc(100vh - 16px);
  max-width: 640px;
  margin: 8px auto;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-page);
}

.prose {
  font-family: "Fraunces", "LailaDeva", Georgia, serif;
  text-align: justify;
  line-height: 1.55;
}

.prose > *:not(pre):not(figure) {
  color: var(--text-prose);
}

.prose p {
  margin: 1.2em 0;
}

a {
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.9em;
}

article h1,
article h2,
article h3,
article h4,
article h5,
article h6,
article small,
.post-meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main {
  flex: 1;
  padding-top: 2em;
}

hr {
  width: 100%;
  border: none;
  border-top: 1px solid currentColor;
  opacity: 0.5;
}

hr.hr-subtle {
  opacity: 0;
}


header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5em 0;
}

.site-title {
  display: none;
}

nav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
}

.nav-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
}

.nav-group:first-child { align-items: flex-start; }
.nav-group:last-child  { align-items: flex-end; }

nav a {
  text-decoration: none;
  color: inherit;
  font-size: 1em;
}

main, footer {
  text-align: center;
}

main h1, main h2, main h3, main h4 {
  text-align: left;
}

article {
  text-align: left;
}


article h1 {
  margin-bottom: 0.15em;
}

.score-breakout {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow-x: auto;
  padding: 1em 0;
  background: var(--bg-score);
}

main > ul,
main .section-group > ul {
  list-style: none;
  padding: 0;
}

main > ul > li,
main .section-group > ul > li {
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  text-align: left;
  overflow: hidden;
}

main > ul > li a,
main .section-group > ul > li a {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.post-meta {
  font-size: 0.75em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.field-software { color: #7bafd4; }
.field-science  { color: #e8a87c; }
.field-art      { color: #c9a0dc; }

.intro {
  text-align: left;
}

.field-filters {
  display: none;
}

.field-filter {
  cursor: pointer;
  filter: grayscale(1) opacity(0.5);
}

.field-filter.active {
  font-weight: bold;
  filter: none;
}


article img {
  max-width: 100%;
}

blockquote {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  margin: 0.75em 0;
  padding: 0.6em 1em;
}

.card-quote .prose {
  font-family: "Apple Chancery", "Zapf Chancery", cursive;
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  max-width: 32ch;
  margin: 0.3em auto;
}

.card-quote .prose p:last-child {
  font-family: "Fraunces", Georgia, serif;
  font-weight: normal;
  font-size: 0.7em;
  color: var(--text-muted);
  margin-top: 0.8em;
}

code, pre, code[class*="language-"], pre[class*="language-"] {
  font-size: 0.9em !important;
  font-family: "Courier Prime", Courier, monospace !important;
}

pre[class*="language-"] {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.copy-btn:hover {
  color: var(--text-prose);
  background: rgba(0, 0, 0, 0.06);
}

.copy-btn.copied {
  color: #5a8a5a;
}

/* Copy button on dark code blocks needs light colors */
pre[class*="language-"] .copy-btn {
  color: rgba(255, 255, 255, 0.5);
}

pre[class*="language-"] .copy-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}


.stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 25px;
  position: relative;
}

.card-meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.7em;
  color: var(--text-muted);
  margin-top: 0.5em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.card-meta:not(:has(.card-til-label)) {
  justify-content: flex-end;
}

/* Song card: date sits on the same bottom line as the song row, not below it */
.card-song {
  display: flex;
  align-items: flex-end;
  gap: 1em;
}

.card-song .song-card {
  flex: 1;
  min-width: 0;
}

.card-song .card-meta {
  margin-top: 0;
  flex-shrink: 0;
}

.card-til-label {
  font-size: 1.1em;
  color: var(--text-accent);
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

.card-title {
  margin: 0 0 0.25em 0;
  font-size: 1em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.card-body {
  margin: 0;
}

.card-song {
  padding: 10px 16px;
}

.song-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  font-size: 1rem;
}

.song-thumb {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
}

.song-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(74, 58, 42, 0.4);
}

.song-thumb-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0.95;
  display: flex;
  transition: opacity 0.15s, transform 0.15s;
}

.song-card:hover .song-thumb-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.song-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  text-align: left;
}

.song-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-prose);
  font-size: 1.05em;
  font-weight: 600;
}

.song-artist {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85em;
  color: var(--text-muted);
}

.song-caption {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 0.95em;
  color: var(--text-prose);
  text-align: left;
  margin-top: 0.3em;
}

.song-caption p {
  margin: 0;
}

