/* nbhas.xyz/journal — shared stylesheet
   Inherits the main site's design system (V8): cream ground, Fraunces display, Inter body,
   Devanagari numerals in clay. Keep this file as the single source of style for the journal. */

:root {
  --bg: #F5F0E8;
  --surface: #FBF7F1;
  --surface-alt: #ECE3D6;
  --text: #2F2925;
  --text-secondary: #5A514A;
  --border: #D8CCBE;
  --clay: #C97B5B;
  --sage: #A8B39A;
  --ink: #1B2A3A;

  --max-width: 1200px;
  --reading-width: 720px;

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --deva: 'Noto Sans Devanagari', 'Inter', sans-serif;

  --pad: 20px;
  --nav-h: 56px;
}
@media (min-width: 600px) { :root { --pad: 32px; --nav-h: 64px; } }
@media (min-width: 960px) { :root { --pad: 48px; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-top: var(--nav-h);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s ease; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition-duration: .01ms !important; } }

/* ---------- Top bar ---------- */
nav.top {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 50;
  background: rgba(245, 240, 232, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: transform .35s cubic-bezier(.4,0,.2,1), border-color .3s ease; will-change: transform;
}
nav.top.is-scrolled { border-bottom-color: var(--border); }
nav.top.is-hidden { transform: translateY(-100%); }           /* small screens: hides on scroll-down, returns on scroll-up */
@media (min-width: 960px) { nav.top.is-hidden { transform: none; } }
nav.top .inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 var(--pad); height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
nav.top .brand { font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: .01em; }
nav.top .brand span { color: var(--text-secondary); font-weight: 300; }
nav.top .links { list-style: none; display: flex; gap: 22px; }
nav.top .links a { font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); }
nav.top .links a[aria-current] { color: var(--text); }
@media (hover: hover) { nav.top .links a:hover { color: var(--text); } }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 max(var(--pad), env(safe-area-inset-left)) 0 max(var(--pad), env(safe-area-inset-right)); }
.section-marker { display: flex; align-items: baseline; gap: 12px; margin: 48px 0 28px; }
.section-marker .num { font-family: var(--deva); font-size: 16px; color: var(--clay); letter-spacing: .05em; }
.section-marker .label { font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--text-secondary); letter-spacing: .16em; text-transform: uppercase; }
.section-marker .count { font-family: var(--sans); font-size: 12px; color: var(--text-secondary); letter-spacing: .05em; }

/* ---------- Journal hero ---------- */
.journal-hero { padding: 36px 0 4px; max-width: var(--reading-width); }
@media (min-width: 600px) { .journal-hero { padding: 56px 0 8px; } }
.journal-hero .eyebrow { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 14px; }
.journal-hero h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.01em; max-width: 26ch; }
.journal-hero h1 em { font-style: italic; font-weight: 400; }
.journal-hero p { margin-top: 12px; color: var(--text-secondary); font-size: 16px; max-width: 56ch; }
@media (min-width: 600px) { .journal-hero p { font-size: 17px; margin-top: 14px; } }

/* ---------- Filters ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; margin: 24px 0 4px; }
.filters .group {
  display: flex; gap: 8px; align-items: center; flex-wrap: nowrap;
  overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad); scroll-padding-left: var(--pad);
}
.filters .group::-webkit-scrollbar { display: none; }
.filters .group .chip { flex: 0 0 auto; scroll-snap-align: start; }
.filters .sep { display: none; }
@media (min-width: 600px) {
  .filters { flex-direction: row; flex-wrap: wrap; gap: 8px; margin: 28px 0 8px; }
  .filters .group { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .filters .sep { display: block; width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
}
.chip {
  font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary); background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 0 14px; min-height: 36px; cursor: pointer; transition: all .18s ease;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
@media (hover: hover) { .chip:hover { color: var(--text); border-color: var(--text-secondary); } }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.chip .n { color: inherit; opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Grid of entries ---------- */
/* Phones: a list. Each entry is a row — small square tile on the left, text on the right —
   with a hairline between rows. From 600px up the entries become a grid of cards. */
.entries { display: grid; grid-template-columns: 1fr; gap: 0; margin: 16px 0 48px; }
.entry { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: start; min-width: 0; padding: 18px 0; border-top: 1px solid var(--border); -webkit-tap-highlight-color: transparent; }
.entry:first-child { border-top: none; }
.entry.is-hidden { display: none; }
.entry .tile { grid-row: 1 / span 5; aspect-ratio: 1; overflow: hidden; background: var(--surface-alt); position: relative; display: block; border: 1px solid var(--border); }
.entry .tile img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) contrast(.98); transition: filter .4s ease, transform .6s ease; }
.entry .tile.mark { display: flex; align-items: center; justify-content: center; background: var(--surface); }
.entry .tile.mark .num { font-family: var(--deva); font-size: 30px; color: var(--clay); }
.entry .tile.quote { display: flex; align-items: center; justify-content: center; padding: 10px; background: var(--surface); }
.entry .tile.quote p { display: none; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.35; color: var(--text); }
.entry .tile.quote::before { content: "\201C"; font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--clay); margin-top: 14px; }
.entry .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 0 0 4px; font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); }
.entry .meta .kind { color: var(--clay); font-weight: 500; }
.entry h3 { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.25; letter-spacing: -.005em; }
.entry .deck { margin-top: 4px; color: var(--text-secondary); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry .tags { margin-top: 8px; font-family: var(--sans); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
.entry .tags span + span::before { content: " · "; }
.entry .player { margin-top: 10px; grid-column: 1 / -1; }
.entry .player audio { width: 100%; height: 36px; }
.entry .series { display: none; font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
@media (min-width: 600px) {
  .entries { grid-template-columns: 1fr 1fr; gap: 32px; margin: 28px 0 64px; }
  .entry { display: flex; flex-direction: column; padding: 0; border-top: none; }
  .entry .tile { grid-row: auto; aspect-ratio: 3/2; }
  .entry .tile.mark .num { font-size: 44px; }
  .entry .tile.quote { padding: 22px; justify-content: flex-start; }
  .entry .tile.quote p { display: block; }
  .entry .tile.quote::before { display: none; }
  .entry .meta { margin: 14px 0 6px; font-size: 11px; letter-spacing: .16em; gap: 10px; }
  .entry h3 { font-size: 22px; }
  .entry .deck { margin-top: 6px; font-size: 15px; line-height: 1.5; display: block; -webkit-line-clamp: unset; overflow: visible; }
  .entry .tags { margin-top: 10px; font-size: 11px; }
  .entry .player { margin-top: 12px; }
  .entry .player audio { height: auto; }
  .entry .series { display: block; }
}
@media (min-width: 1080px) { .entries { grid-template-columns: 1fr 1fr 1fr; } }
@media (hover: hover) {
  .entry .tile:hover img { filter: saturate(1.02) contrast(1); transform: scale(1.02); }
  .entry h3 a:hover { color: var(--clay); }
}
.empty { font-family: var(--serif); font-style: italic; color: var(--text-secondary); padding: 32px 0; display: none; }
.entries:has(> .entry:not(.is-hidden)) + .empty { display: none; }

/* ---------- Post page ---------- */
article.post { max-width: var(--reading-width); margin: 0 auto; padding: 28px 0 24px; }
@media (min-width: 600px) { article.post { padding: 48px 0 24px; } }
.post .kicker { display: flex; gap: 10px; align-items: baseline; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-secondary); }
.post h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 5vw, 48px); line-height: 1.12; letter-spacing: -.01em; margin: 14px 0 12px; }
.post .deck { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.4; color: var(--text-secondary); }
@media (min-width: 600px) { .post .deck { font-size: 20px; } }
.post .byline { margin-top: 18px; font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.post .byline span + span:not(.draft)::before { content: " · "; }
.post .draft { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--clay); color: var(--clay); border-radius: 999px; font-size: 10px; letter-spacing: .12em; }

figure.header { margin: 24px calc(-1 * var(--pad)) 8px; }
figure.header figcaption { padding: 0 var(--pad); }
@media (min-width: 600px) { figure.header { margin-top: 32px; } }
@media (min-width: 820px) { figure.header { margin-left: -60px; margin-right: -60px; } figure.header figcaption { padding: 0 60px; } }
figure.header .tile { aspect-ratio: 3/2; overflow: hidden; background: var(--surface-alt); border: 1px solid var(--border); }
figure.header img { width: 100%; height: 100%; object-fit: cover; }
figure.header figcaption, figure.inline figcaption { margin-top: 10px; font-family: var(--sans); font-size: 12px; color: var(--text-secondary); letter-spacing: .02em; }
figure.header figcaption .cap { display: block; }

.post .body { margin-top: 28px; font-size: 17px; line-height: 1.65; }
@media (min-width: 600px) { .post .body { margin-top: 36px; font-size: 18px; line-height: 1.7; } }
.post .body p { margin: 0 0 22px; }
.post .body h2 { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.25; margin: 36px 0 14px; letter-spacing: -.005em; }
@media (min-width: 600px) { .post .body h2 { font-size: 26px; margin: 44px 0 16px; } }
.post .body h2::before { content: "— "; color: var(--clay); }
.post .body em { font-style: italic; }
.post .body strong { font-weight: 600; }
.post .body ul, .post .body ol { margin: 0 0 22px 22px; }
.post .body li { margin-bottom: 8px; }
.post .body blockquote { margin: 0 0 22px; padding-left: 18px; border-left: 2px solid var(--clay); color: var(--text-secondary); font-family: var(--serif); font-style: italic; font-size: 19px; }
.post .body a { border-bottom: 1px solid var(--border); }
.post .body a:hover { border-bottom-color: var(--clay); color: var(--clay); }
figure.inline { margin: 32px 0; }
figure.inline .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
figure.inline .scroll::-webkit-scrollbar { display: none; }
figure.inline svg { width: 100%; min-width: 560px; height: auto; display: block; }
figure.inline.diagram img { width: 100%; min-width: 560px; height: auto; display: block; border: 1px solid var(--border); }
figure.inline.photo .scroll { overflow: visible; margin: 0; padding: 0; }
figure.inline.photo img { width: auto; max-width: 100%; max-height: 620px; height: auto; display: block; margin: 0 auto; border: 1px solid var(--border); }
figure.inline .hint { display: block; margin-top: 8px; font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--clay); }
@media (min-width: 640px) {
  figure.inline { margin: 36px 0; }
  figure.inline .scroll { overflow: visible; margin: 0; padding: 0; }
  figure.inline svg { min-width: 0; }
  figure.inline.diagram img { min-width: 0; }
  figure.inline.photo .scroll { overflow: visible; margin: 0; padding: 0; }
figure.inline.photo img { width: auto; max-width: 100%; max-height: 620px; height: auto; display: block; margin: 0 auto; border: 1px solid var(--border); }
figure.inline .hint { display: none; }
}

.post .sources { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-family: var(--sans); font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.post .sources h4 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 8px; font-weight: 500; }
.post .sources ul { list-style: none; }
.post .sources li { margin-bottom: 6px; padding-left: 14px; text-indent: -14px; }
.post .sources li::before { content: "— "; color: var(--clay); }
.post .sources a { border-bottom: 1px solid var(--border); }

.also { max-width: var(--max-width); margin: 56px auto 0; padding: 0 var(--pad); }
.also .entries { margin-top: 20px; }

footer.site { max-width: var(--max-width); margin: 48px auto 0; padding: 24px var(--pad) 56px; border-top: 1px solid var(--border); text-align: center; font-family: var(--sans); font-size: 12px; color: var(--text-secondary); }
footer.site a { border-bottom: 1px solid var(--border); }

@media print { nav.top, .filters, .also, footer.site { display: none; } body { padding-top: 0; } }

/* ---------- Song page ---------- */
.song-head { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 32px; align-items: start; }
@media (min-width: 640px) { .song-head { grid-template-columns: 220px 1fr; gap: 32px; } }
.song-head .cover { aspect-ratio: 1; overflow: hidden; border: 1px solid var(--border); background: var(--surface-alt); width: 160px; }
@media (min-width: 640px) { .song-head .cover { width: auto; } }
.song-head .cover img { width: 100%; height: 100%; object-fit: cover; }
.song-head .play audio { width: 100%; margin-top: 4px; }
.song-head .facts { margin-top: 14px; font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); line-height: 1.9; }
.song-head .facts a { border-bottom: 1px solid var(--border); }
.song-head .facts a:hover { color: var(--clay); border-bottom-color: var(--clay); }
.post .about { margin-top: 28px; font-size: 17px; line-height: 1.65; }
@media (min-width: 600px) { .post .about { margin-top: 32px; font-size: 18px; line-height: 1.7; } }
.post .about p { margin-bottom: 22px; }
.post .lyrics { margin-top: 36px; }
.post .lyrics h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin-bottom: 16px; }
.post .lyrics h2::before { content: "— "; color: var(--clay); }
.post .lyrics pre { font-family: var(--serif); font-size: 17px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.post .lyrics .part { display: block; margin: 18px 0 4px; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--clay); }

/* Phone nav: brand links home, so Home drops out; everything on one line. */
@media (max-width: 520px) { nav.top .brand span { display: none; } nav.top .brand { white-space: nowrap; font-size: 15px; } nav.top .links { gap: 12px; } nav.top .links a { white-space: nowrap; font-size: 11px; letter-spacing: .1em; } nav.top .links li:first-child { display: none; } }

/* ---------- In-card media (songs, videos), after the side-quests mock ---------- */
.tile .badge { position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(14,13,11,.8); color: #ece7dd; font-family: var(--sans); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tile .go { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: #ece7dd; color: #0e0d0b; display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-size: 15px; }
.tile.media { position: relative; }
.tile.media .pic { display: block; width: 100%; height: 100%; }
.tile.media .preview { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ece7dd; color: #0e0d0b; font-family: var(--sans); font-size: 15px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .15s ease; }
.tile.media .preview:active { transform: scale(.95); }
@media (hover: hover) { .tile.media .preview:hover { transform: scale(1.06); } }
.tile.media .watch { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border: 0; border-radius: 50%; background: #ece7dd; cursor: pointer; box-shadow: 0 0 0 10px rgba(236,231,221,.18), 0 0 40px rgba(236,231,221,.35); transition: transform .15s ease; -webkit-tap-highlight-color: transparent; }
.tile.media .watch:active { transform: scale(.95); }
.tile.media .watch .ico { position: absolute; left: 21px; top: 17px; border-left: 14px solid #0e0d0b; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.tile.media .dur { position: absolute; right: 8px; bottom: 8px; padding: 3px 7px; background: rgba(14,13,11,.8); color: #ece7dd; font-family: var(--sans); font-size: 11px; letter-spacing: .06em; }
@media (hover: hover) { .tile.media .watch:hover { transform: scale(1.06); } }

.player { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.player audio { display: none; }
.player .pp { flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; transition: background .2s ease, border-color .2s ease; }
.player .pp .ico { position: absolute; left: 14px; top: 11px; border-left: 10px solid var(--text); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.player.is-playing .pp .ico { left: 12px; top: 11px; width: 3px; height: 12px; border: 0; border-left: 3px solid var(--text); border-right: 3px solid var(--text); padding-left: 4px; }
.player .seek { flex: 1; -webkit-appearance: none; appearance: none; height: 2px; background: linear-gradient(to right, var(--clay) var(--p, 0%), var(--border) var(--p, 0%)); border-radius: 2px; outline: none; cursor: pointer; margin: 0; min-width: 0; }
.player .seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--clay); border: 0; }
.player .seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--clay); border: 0; }
.player .time { flex: 0 0 auto; font-family: var(--sans); font-size: 11px; letter-spacing: .06em; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

dialog.lightbox { position: fixed; inset: 0; margin: auto; border: 0; padding: 0; background: transparent; max-width: min(960px, 92vw); width: 100%; max-height: 92vh; overflow: auto; }
dialog.lightbox::backdrop { background: rgba(14,13,11,.86); backdrop-filter: blur(4px); }
dialog.lightbox .box { position: relative; background: var(--surface); border: 1px solid var(--border); padding: 22px 22px 18px; }
dialog.lightbox h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--text); margin: 0 40px 4px 0; }
dialog.lightbox .deck { color: var(--text-secondary); font-size: 15px; margin: 0 0 14px; }
dialog.lightbox video, dialog.lightbox img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
dialog.lightbox [hidden] { display: none; }
dialog.lightbox .open { margin: 12px 0 0; font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
dialog.lightbox .open a { color: var(--text-secondary); border-bottom: 1px solid var(--border); }
@media (hover: hover) { dialog.lightbox .open a:hover { color: var(--text); } }
dialog.lightbox .close { position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); font-size: 22px; line-height: 1; cursor: pointer; }
@media (hover: hover) { dialog.lightbox .close:hover { color: var(--text); } }

@media (max-width: 599px) { .tile .badge { display: none; } .tile .go { width: 26px; height: 26px; right: 6px; bottom: 6px; font-size: 12px; } }

/* focus and motion */
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.chip:focus-visible, .player .pp:focus-visible, .tile.media button:focus-visible { outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
.entry .meta .draft { color: var(--clay); border: 1px solid var(--clay); border-radius: 999px; padding: 1px 7px; font-size: 9.5px; }

/* journal: one link per card, stretched over the whole card */
.entry { position: relative; }
.entry h3 a::after { content: ""; position: absolute; inset: 0; }
.entry .tile.mark .num, .entry .tile.quote p { pointer-events: none; }

.entry .tile { width: 100%; }

/* series next-link to a piece not yet published */
