/* =====================================================================
   NOTES (JT Notes hub + article page). Uses the site's tokens; light theme at the bottom.
   ===================================================================== */
.nt-hero .page-sub { max-width: 40ch; }
.nt-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; }
.nt-stat { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); background: rgba(255,255,255,.04); }
.nt-stat strong { color: var(--gold, #d4b27a); font-weight: 500; }
.nt-bar { margin-bottom: 34px; }
.chip .chip-n { margin-left: 8px; font-family: var(--f-mono); font-size: 10.5px; opacity: .6; }
.nt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.nt-head h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(28px, 4vw, 40px); }
.nt-count { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
#nt-default > section, #nt-results { margin-bottom: 56px; }
#nt-default[hidden], #nt-results[hidden], #nt-featured-sec[hidden], #nt-latest-sec[hidden] { display: none; }

/* cards */
.note-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .note-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .note-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } .note-grid--feat > .note-card--feat:first-child:nth-last-child(n+3) { grid-column: span 1; } }
.note-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 24px; border-radius: 22px; color: inherit; text-decoration: none; overflow: hidden;
  border: 1px solid rgba(255,255,255,.12); background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 18px 40px -26px rgba(0,0,0,.8); transition: transform .35s var(--ease), border-color .3s, opacity .7s var(--ease); }
.note-card[hidden] { display: none; }
.note-card--feat { border-color: hsla(var(--hue, 40), 45%, 65%, .35); background: linear-gradient(160deg, hsla(var(--hue, 40), 40%, 55%, .16), rgba(255,255,255,.03)); }
@media (hover: hover) { .note-card:hover { transform: translateY(-4px); border-color: hsla(var(--hue, 40), 55%, 68%, .65); } }
.note-card:focus-visible { outline: 2px solid var(--gold, #d4b27a); outline-offset: 3px; }
.note-cover { display: block; width: calc(100% + 48px); margin: -24px -24px 6px; aspect-ratio: 16 / 9; object-fit: cover; background: #111; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.note-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  color: hsl(var(--hue, 40), 60%, 74%); background: hsla(var(--hue, 40), 50%, 50%, .14); border: 1px solid hsla(var(--hue, 40), 55%, 65%, .35); }
.note-name { font-family: var(--f-display); font-size: 27px; line-height: 1.1; overflow-wrap: anywhere; }
.note-sum { font-size: 14.5px; line-height: 1.6; color: var(--mute); }
.note-tagline { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--f-mono); font-size: 11px; color: rgba(241,238,232,.5); }
.note-more { margin-top: auto; padding-top: 4px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold, #d4b27a); }

/* article page */
.read-progress { position: fixed; left: 0; right: 0; top: var(--header-h); height: 2px; z-index: 59; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--gold, #d4b27a); transform: scaleX(0); transform-origin: left; }
.note-read { padding-top: calc(var(--header-h) + 32px); }
.note-wrap { max-width: 1120px; }
.note-head, .note-body, .note-coverfig { max-width: 740px; }
.note-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0 14px; }
.note-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--f-mono); font-size: 11px; color: var(--mute); }
.note-title { font-size: clamp(34px, 6vw, 64px); margin: 0 0 14px; line-height: 1.03; }
.note-lead { margin: 0 0 20px; font-size: clamp(17px, 2.4vw, 21px); line-height: 1.55; color: var(--mute); }
.note-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.note-share { margin-left: auto; }
.note-coverfig { margin: 26px 0 0; } .note-coverfig img { width: 100%; border-radius: 18px; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.note-coverfig figcaption, .note-fig figcaption { margin-top: 8px; font-size: 13px; color: var(--mute); }
.note-layout { margin-top: 28px; }
.note-toc { margin: 0 0 26px; max-width: 740px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.04); }
.note-toc summary { cursor: pointer; padding: 14px 18px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold, #d4b27a); list-style: none; }
.note-toc summary::-webkit-details-marker { display: none; }
.note-toc summary::after { content: "+"; float: right; } .note-toc details[open] summary::after { content: "–"; }
.note-toc ol { margin: 0; padding: 0 18px 16px 38px; } .note-toc li { margin: 6px 0; font-size: 14.5px; }
.note-toc a { color: var(--mute); text-decoration: none; } .note-toc a:hover, .note-toc a.is-on { color: var(--paper); }
.note-toc a.is-on { font-weight: 600; }
@media (min-width: 1100px) {
  .has-toc .note-layout { display: grid; grid-template-columns: minmax(0, 740px) 260px; gap: 56px; align-items: start; }
  .has-toc .note-toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 24px); margin: 0; }
  .has-toc .note-body { grid-column: 1; grid-row: 1; }
}
.note-body { font-size: 18px; line-height: 1.8; overflow-wrap: anywhere; }
.note-body h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(28px, 4vw, 36px); line-height: 1.15; margin: 44px 0 10px; scroll-margin-top: calc(var(--header-h) + 16px); }
.note-body h3 { font-size: 20px; margin: 30px 0 6px; }
.note-body p { margin: 0 0 18px; }
.note-body ul, .note-body ol { margin: 0 0 20px; padding-left: 24px; } .note-body li { margin: 8px 0; padding-left: 4px; }
.note-body li::marker { color: var(--gold, #d4b27a); }
.note-codebox { margin: 0 0 22px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: rgba(0,0,0,.35); }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid var(--line); }
.code-copy { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.code-copy:hover { border-color: var(--gold, #d4b27a); }
.note-code { margin: 0; padding: 16px 18px; overflow-x: auto; font: 13px/1.65 var(--f-mono); tab-size: 2; }
.note-quote { margin: 30px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--gold, #d4b27a); font-family: var(--f-display); font-style: italic; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.3; }
.note-callout { margin: 0 0 22px; padding: 16px 18px; border-radius: 14px; font-size: 16px; line-height: 1.65; background: rgba(212,178,122,.1); border: 1px solid rgba(212,178,122,.35); }
.note-fig { margin: 0 0 24px; } .note-fig img { width: 100%; height: auto; border-radius: 14px; display: block; }
.note-related { margin-top: 64px; padding-top: 34px; border-top: 1px solid var(--line); }
.note-related h2 { margin: 0 0 18px; font-family: var(--f-display); font-weight: 400; font-size: 32px; }
.note-end { margin: 40px 0 0; }

/* light theme */
html[data-theme="light"] .nt-stat { background: rgba(255,255,255,.6); color: #55605A; border-color: #D2CCBF; }
html[data-theme="light"] .nt-stat strong, html[data-theme="light"] .note-more, html[data-theme="light"] .note-toc summary { color: #8A6A2F; }
html[data-theme="light"] .note-card { background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.72)); border-color: rgba(20,32,26,.12); box-shadow: 0 1px 2px rgba(20,32,26,.06), 0 16px 34px -22px rgba(20,32,26,.3); }
html[data-theme="light"] .note-card--feat { background: linear-gradient(160deg, hsla(var(--hue, 40), 55%, 80%, .55), rgba(255,255,255,.85)); border-color: hsla(var(--hue, 40), 45%, 45%, .35); }
html[data-theme="light"] .note-pill { color: hsl(var(--hue, 40), 55%, 28%); background: hsla(var(--hue, 40), 55%, 55%, .16); border-color: hsla(var(--hue, 40), 50%, 40%, .4); }
html[data-theme="light"] .note-meta, html[data-theme="light"] .note-sum, html[data-theme="light"] .note-lead, html[data-theme="light"] .note-info, html[data-theme="light"] .note-tags, html[data-theme="light"] .nt-count, html[data-theme="light"] .note-tagline { color: #55605A; }
html[data-theme="light"] .note-toc, html[data-theme="light"] .note-codebox { background: rgba(255,255,255,.7); border-color: #D2CCBF; }
html[data-theme="light"] .note-code { color: #14201A; } html[data-theme="light"] .code-bar { border-color: #D2CCBF; color: #55605A; }
html[data-theme="light"] .note-toc a { color: #55605A; } html[data-theme="light"] .note-toc a:hover, html[data-theme="light"] .note-toc a.is-on { color: #14201A; }
html[data-theme="light"] .note-callout { background: rgba(138,106,47,.1); border-color: rgba(138,106,47,.4); }
html[data-theme="light"] .note-quote, html[data-theme="light"] .note-body li::marker { border-color: #8A6A2F; }
html[data-theme="light"] .read-progress span { background: #8A6A2F; }
@media (max-width: 900px), (hover: none) { .note-card { background: rgba(26,30,28,.85); } html[data-theme="light"] .note-card { background: rgba(255,255,255,.92); } }
@media (prefers-reduced-motion: reduce) { .note-card { transition: none; } }
