/* ==========================================================================
   TAPAS: Journal index & articles
   ========================================================================== */
/* ---------- index ---------- */
.grade-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.grade { padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); display: grid; gap: 8px; }
.grade p { margin: 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }

.meter { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.meter .bars { display: inline-flex; gap: 3px; }
.meter .bars i { width: 16px; height: 5px; border-radius: 2px; background: var(--line-2); }
.meter[data-level="3"] .bars i { background: var(--sage); }
.meter[data-level="2"] .bars i:nth-child(-n+2) { background: var(--saffron); }
.meter[data-level="1"] .bars i:first-child { background: var(--ember); }

.featured { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; border-radius: var(--r-lg); overflow: hidden; }
.featured .f-art { position: relative; min-height: 440px; }
.featured .f-art > div, .featured .f-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.featured .f-body { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; gap: 18px; justify-content: flex-end; }
.featured h2 { font-size: clamp(34px, 3.6vw, 56px); line-height: 1.02; }
.featured p { color: var(--ink-2); margin: 0; font-size: 16px; max-width: 52ch; }
.f-art .f-art-inner { transition: transform 1.2s var(--ease-out); }
.featured:hover .f-art .f-art-inner { transform: scale(1.04); }

.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.path { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.path h3 { font-size: 28px; }
.path > p { margin: 0; font-size: 14px; color: var(--ink-3); }
.path ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: p; }
.path li a { display: grid; grid-template-columns: 26px 1fr 18px; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); transition: color .3s, padding .5s var(--ease-out); counter-increment: p; }
.path li a::before { content: counter(p, decimal-leading-zero); font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-4); }
.path li a:hover { color: var(--ink); padding-left: 6px; }
.path li a .done { color: var(--sage); font-size: 13px; opacity: 0; }
.path li a.is-read .done { opacity: 1; }
.path-progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: auto; }
.path-progress i { display: block; height: 100%; background: var(--fire); transform-origin: 0 50%; transition: transform 1s var(--ease-out); }
.path-foot { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; color: var(--ink-4); text-transform: uppercase; }

.j-controls { display: grid; gap: 18px; margin-bottom: 34px; }
.j-controls .row { justify-content: space-between; }
.j-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.j-topics { display: flex; gap: 8px; flex-wrap: wrap; }
.j-search { position: relative; min-width: min(320px, 100%); }
.j-search input { padding-left: 42px; border-radius: var(--r-pill); }
.j-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }

.j-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.pcard { display: flex; flex-direction: column; border-radius: var(--r); }
.pcard .p-art { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid var(--line); }
.pcard .p-art > div, .pcard .p-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard .p-art > div { transition: transform 1.1s var(--ease-out); }
.pcard:hover .p-art > div { transform: scale(1.05) rotate(.6deg); }
.pcard .p-read { position: absolute; right: 14px; top: 14px; z-index: 2; }
.pcard .p-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pcard .p-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pcard h3 { font-size: 26px; line-height: 1.12; }
.pcard p { margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.55; }
.pcard .p-bl { font-size: 13.5px; color: var(--ink-2); border-left: 2px solid var(--ember); padding-left: 12px; }
.pcard .p-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--ink-4); text-transform: uppercase; }
.j-empty { padding: 60px 0; text-align: center; color: var(--ink-3); }

/* ---------- article ---------- */
.post-hero { position: relative; padding: calc(var(--header-h) + clamp(60px, 9vw, 120px)) 0 clamp(40px, 5vw, 70px); overflow: hidden; isolation: isolate; }
.post-hero-art { position: absolute; inset: 0; z-index: -1; opacity: .5; -webkit-mask-image: linear-gradient(180deg, #000, transparent 92%); mask-image: linear-gradient(180deg, #000, transparent 92%); }
.post-hero-art svg { width: 100%; height: 100%; }
.post-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 90% at 30% 40%, rgba(10, 8, 6, .4), rgba(10, 8, 6, .92) 70%); }
.post-head { position: relative; }
.post-badges { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.post-head h1 { font-size: clamp(42px, 5.4vw, 82px); line-height: 1; }
.post-dek { font-family: var(--f-display); font-size: clamp(21px, 1.9vw, 27px); line-height: 1.38; color: var(--ink-2); margin: 26px 0 0; font-style: italic; font-weight: 300; max-width: 40ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 34px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.post-meta .share { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); font: inherit; letter-spacing: inherit; text-transform: inherit; border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.post-meta .share:hover { color: var(--ink); border-color: var(--ember); }
.post-meta .share svg { width: 14px; height: 14px; }
.post-meta .save[aria-pressed=true] { color: var(--saffron); border-color: rgba(255, 140, 70, .5); }

/* discussion */
.comments { margin-top: 48px; padding-top: 34px; border-top: 1px solid var(--line); }
.comments-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.comments-head h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 2.6vw, 38px); margin: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment.is-pending { opacity: .72; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; color: var(--ink-3); }
.comment-meta b { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.comment p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.65; overflow-wrap: anywhere; }
.comment-empty { padding: 14px 0 6px; color: var(--ink-3); font-size: 14.5px; }
.comment-compose { margin-top: 22px; }
.comment-form { display: grid; gap: 12px; }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.comment-signin { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0; }

.post-layout { display: grid; grid-template-columns: 220px minmax(0, 720px) 1fr; gap: clamp(30px, 4vw, 70px); padding-top: 20px; padding-bottom: 40px; }
.post-toc { position: sticky; top: calc(var(--header-h) + 30px); align-self: start; display: grid; gap: 14px; }
.post-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.post-toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13px; color: var(--ink-3); line-height: 1.4; transition: color .3s, border-color .3s; }
.post-toc a:hover { color: var(--ink); }
.post-toc a.is-active { color: var(--ink); border-left-color: var(--ember); }
.toc-ring { display: flex; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); margin-top: 8px; }
.toc-ring svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.toc-ring circle { fill: none; stroke-width: 2; }

.glance { padding: 26px 28px; border-radius: var(--r); margin-bottom: 46px; }
.glance-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.glance-bl { font-size: 17px; color: var(--ink); margin: 0 0 14px; line-height: 1.55; }
.glance-bl b { color: var(--saffron); font-weight: 600; }
.glance ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.glance li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.glance li::before { content: "✦"; color: var(--ember); font-size: 10px; line-height: 2.1; }

.prose { font-family: var(--f-read); font-size: 19px; line-height: 1.75; color: #e6ddd0; font-weight: 400; }
.prose > * { margin-bottom: 0; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-family: var(--f-display); font-size: clamp(30px, 3vw, 42px); line-height: 1.1; font-weight: 500; color: var(--ink); margin-top: 2.1em; scroll-margin-top: calc(var(--header-h) + 30px); }
.prose h3 { font-family: var(--f-sans); font-size: 18px; font-weight: 700; margin-top: 1.8em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(255, 106, 44, .6); text-underline-offset: 3px; transition: text-decoration-color .3s; }
.prose a:hover { text-decoration-color: var(--ember); }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: .55em; }
.prose li::marker { color: var(--ember); font-family: var(--f-mono); font-size: .8em; }
.prose blockquote {
  margin: 2em 0; padding: 0 0 0 28px; border-left: 2px solid var(--ember);
  font-family: var(--f-display); font-size: clamp(25px, 2.3vw, 32px); line-height: 1.3; font-style: italic; font-weight: 300; color: var(--ink);
}
.prose .callout { font-family: var(--f-sans); font-size: 16px; line-height: 1.65; padding: 22px 26px; }
.prose .callout strong { color: var(--saffron); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--f-sans); font-size: 14.5px; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose th { text-align: left; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 0 16px 12px 0; white-space: nowrap; }
.prose td { padding: 12px 16px 12px 0; border-top: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.prose sup a { font-family: var(--f-mono); font-size: 11px; text-decoration: none; color: var(--saffron); padding: 0 2px; }
.prose .drop:first-letter { float: left; font-family: var(--f-display); font-size: 4.4em; line-height: .82; padding: .06em .1em 0 0; color: var(--saffron); }
.prose em { font-style: italic; }

.ref-pop {
  position: absolute; z-index: 70; max-width: 340px; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-3); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9);
  font-size: 13px; line-height: 1.5; color: var(--ink-2); pointer-events: none; opacity: 0; transform: translateY(6px);
  transition: opacity .25s, transform .35s var(--ease-out);
}
.ref-pop.is-on { opacity: 1; transform: translateY(0); }

.refs { margin-top: 64px; padding-top: 30px; border-top: 1px solid var(--line); }
.refs h2 { font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin: 0 0 18px; }
.refs ol { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }
.refs li:target { color: var(--ink); }
.refs li::marker { font-family: var(--f-mono); color: var(--ink-4); }
.revised { margin-top: 22px; font-size: 12.5px; color: var(--ink-4); font-style: italic; }

.tool-cta { margin-top: 50px; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 22px 24px; border-radius: var(--r); }
.tool-cta .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--fire); color: #1a0b04; }
.tool-cta .ic svg { width: 20px; height: 20px; }
.tool-cta b { display: block; font-family: var(--f-display); font-size: 24px; font-weight: 500; line-height: 1.1; }
.tool-cta span { font-size: 13px; color: var(--ink-3); }

.post-coach { margin-top: 22px; padding: 26px 28px; border-radius: var(--r); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; background: linear-gradient(120deg, rgba(255, 106, 44, .08), transparent 60%); border: 1px solid var(--line); }
.post-coach p { margin: 0; font-size: 15px; color: var(--ink-2); }
.post-coach b { display: block; font-family: var(--f-display); font-size: 24px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }

.post-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 50px; }
.post-next a { padding: 22px; border-radius: var(--r); border: 1px solid var(--line); display: grid; gap: 6px; transition: border-color .4s, background .4s; }
.post-next a:hover { border-color: var(--line-3); background: rgba(255, 255, 255, .02); }
.post-next .lbl { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }
.post-next .t { font-family: var(--f-display); font-size: 22px; line-height: 1.2; }
.post-next a:last-child { text-align: right; }

@media (max-width: 1180px) {
  .post-layout { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .j-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paths { grid-template-columns: minmax(0, 1fr); }
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured .f-art { min-height: 300px; }
}
@media (max-width: 900px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-toc { display: none; }
  .grade-legend { grid-template-columns: minmax(0, 1fr); }
  .prose { font-size: 18px; }
}
@media (max-width: 640px) {
  .j-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-cta, .post-coach { grid-template-columns: minmax(0, 1fr); }
  .post-next { grid-template-columns: minmax(0, 1fr); }
  .post-next a:last-child { text-align: left; }
}
