/* ==========================================================================
   Slate, journal. Index and notes.

   The anatomy follows Clay's blog, measured on 15 October 2026: a dark
   opening with a category bar and a featured carousel, a white grid with
   category, title and "Created · read time", a dark row of tall guide cards,
   and on a note: title, dek, byline, a full-width cover, then contents on the
   left, the text in the middle and an about card plus share on the right.
   Covers are sharp-cornered, drawn from the mark, never photographs.
   ========================================================================== */

/* ---------- category bar (index and notes) ---------- */
.jtabs { display: flex; gap: 4px; padding-top: calc(var(--hdr-h) + 18px); overflow-x: auto; scrollbar-width: none; }
.jtabs::-webkit-scrollbar { display: none; }
.jtabs a {
  flex: none; padding: 8px 12px 10px; font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.01em;
  color: var(--muted); border-bottom: 1.5px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.jtabs a:hover { color: var(--fg); }
.jtabs a[aria-current] { color: var(--fg); border-bottom-color: var(--fg); }

/* ---------- index: dark opening + carousel ---------- */
.jhero { padding-bottom: clamp(56px, 7vw, 96px); overflow: clip; }
.jhero-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-top: clamp(48px, 7vh, 96px); }
.jhero-head .pg-title { font-size: clamp(3rem, 6.4vw, 6.5rem); }
.jhero-head .lead { margin-top: 20px; max-width: 40ch; }
.car-arrows { display: flex; gap: 10px; flex: none; }
.car-arrows button {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--rule-2); color: var(--fg);
  display: grid; place-items: center; transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s;
}
.car-arrows button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.car-arrows button[disabled] { opacity: 0.3; pointer-events: none; }
.car-arrows svg { width: 18px; height: 18px; }
.car { margin-top: clamp(32px, 4vw, 56px); }
.car-track {
  display: flex; gap: clamp(14px, 1.6vw, 24px);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
  scroll-padding-inline: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
}
.car-track::-webkit-scrollbar { display: none; }
.fcard {
  position: relative; flex: none; width: min(66vw, 820px); aspect-ratio: 1.82 / 1;
  scroll-snap-align: start; overflow: hidden; background: #111;
}
.fcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.fcard:hover img { transform: scale(1.03); }
.fcard-text {
  position: absolute; inset: auto 0 0 0; padding: clamp(18px, 2.2vw, 32px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0));
  color: var(--paper);
}
.fcard-text .label { color: rgba(255, 255, 255, 0.8); }
.fcard-text p { margin-top: 8px; font-size: clamp(1.25rem, 1.9vw, 1.75rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; max-width: 22ch; }

/* ---------- index: latest grid ---------- */
.jsec { padding-block: clamp(72px, 9vw, 128px); }
.jsec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.jsec-head .h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
.jsec-head p { color: var(--muted); max-width: 44ch; }
.jgrid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 5vw, 72px) clamp(20px, 2.4vw, 36px); margin-top: clamp(32px, 4vw, 56px); }
.jcard { display: block; }
.jcard[hidden] { display: none; }
.jcard-img { aspect-ratio: 1.85 / 1; overflow: hidden; background: var(--mist); }
.jcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.jcard:hover .jcard-img img { transform: scale(1.03); }
.jcard .label { display: block; margin-top: 22px; color: var(--muted); }
.jcard h3 { margin-top: 10px; font-size: clamp(1.25rem, 1.7vw, 1.5rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; max-width: 26ch; }
.jcard:hover h3 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.jcard-meta { margin-top: 10px; font-size: 0.875rem; color: var(--muted); }
.jempty { margin-top: 32px; color: var(--muted); }

/* ---------- index: guides row (tall cards, title at the top) ---------- */
.guides-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); margin-top: clamp(32px, 4vw, 56px); }
.gcard { display: block; }
.gcard-img { aspect-ratio: 3 / 4; overflow: hidden; background: #111; }
.gcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.gcard:hover .gcard-img img { transform: scale(1.03); }
.gcard-text { padding-top: 18px; color: var(--fg); }
.gcard-text .label { color: var(--fg-muted); }
.gcard-text p { margin-top: 8px; font-size: clamp(1.25rem, 1.8vw, 1.625rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.gcard:hover .gcard-text p { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.jsec-foot { display: flex; justify-content: center; margin-top: clamp(28px, 3vw, 44px); }

/* ---------- note: hero ---------- */
.art-hero { padding-top: clamp(40px, 6vh, 72px); }
.art-title { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 600; letter-spacing: -0.045em; line-height: 1.04; max-width: 24ch; text-wrap: balance; }
.art-dek { margin-top: clamp(18px, 2.4vw, 30px); max-width: 60ch; font-size: clamp(1.2rem, 1.7vw, 1.5rem); line-height: 1.4; letter-spacing: -0.016em; color: var(--body); }
.art-by { margin-top: clamp(22px, 3vw, 36px); font-size: 0.9375rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.art-by a { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.art-cover { margin-top: clamp(28px, 4vw, 56px); overflow: hidden; background: var(--mist); }
.art-cover img { width: 100%; height: auto; aspect-ratio: 2.1 / 1; object-fit: cover; }

/* ---------- note: three columns ---------- */
.art-grid {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: clamp(40px, 5.6vw, 96px);
  margin-top: clamp(48px, 6vw, 96px); align-items: start;
}
.art-toc-in, .art-side-in { position: sticky; top: calc(var(--hdr-h) + 28px); }
.art-toc .label { color: var(--muted); }
.art-toc nav { margin-top: 14px; }
.art-toc a {
  position: relative; display: block; padding: 6px 0 6px 18px;
  font-size: 0.875rem; line-height: 1.35; color: var(--muted);
  transition: color 0.3s var(--ease);
}
.art-toc a::before { content: ""; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); opacity: 0; transition: opacity 0.3s; }
.art-toc a:hover { color: var(--fg); }
.art-toc a[aria-current] { color: var(--fg); font-weight: 500; }
.art-toc a[aria-current]::before { opacity: 1; }

.art-body { max-width: 640px; font-size: 1.125rem; line-height: 1.55; }
.art-body .lede { font-size: clamp(1.2rem, 1.6vw, 1.375rem); line-height: 1.45; letter-spacing: -0.014em; color: var(--fg); }
.art-body h2 { margin-top: clamp(48px, 5vw, 80px); font-size: clamp(1.75rem, 2.6vw, 2.5rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1.08; scroll-margin-top: calc(var(--hdr-h) + 24px); }
.art-body h3 { margin-top: 40px; font-size: clamp(1.375rem, 1.9vw, 1.75rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.12; }
.art-body p { margin-top: 18px; color: var(--body); }
.art-body ol, .art-body ul { margin-top: 18px; padding-left: 1.25em; color: var(--body); }
.art-body ol { list-style: decimal; }
.art-body ul { list-style: disc; }
.art-body li + li { margin-top: 10px; }
.art-body b { color: var(--fg); font-weight: 600; }
.art-body q { quotes: "\201C" "\201D"; }
.art-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--mist); padding: 2px 6px; border-radius: 4px; }
.art-body a { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.takeaways { margin-top: 36px; padding: 24px 28px; border-radius: var(--radius); background: var(--mist); }
.takeaways h3 { margin-top: 0; font-size: 1.25rem; }
.takeaways ul { margin-top: 12px; }
.takeaways li { font-size: 1.0625rem; }
.art-fig { margin-top: 40px; }
.fig-open { display: block; width: 100%; cursor: zoom-in; background: var(--mist); overflow: hidden; }
.fig-open img { width: 100%; height: auto; aspect-ratio: 1.5 / 1; object-fit: cover; transition: transform 1.2s var(--ease); }
.fig-open:hover img { transform: scale(1.02); }
.art-fig figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--muted); text-align: center; }
.art-note { margin-top: 36px; padding: 22px 24px; border-radius: var(--radius); background: var(--mist); }
.art-note .label { color: var(--muted); }
.art-note p:not(.label) { margin-top: 8px; font-size: 1rem; }
.sources-line { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); }

/* right column */
.about-card { padding: 22px; border-radius: var(--radius); background: var(--mist); }
.about-card-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.about-card-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.about-card img.mark { width: 34px; margin-top: 18px; }
.about-card h3 { margin-top: 10px; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.025em; }
.about-card p { margin-top: 8px; font-size: 0.9375rem; line-height: 1.5; color: var(--body); }
.about-card .tlink { margin-top: 10px; font-size: 0.9375rem; }
.art-share { margin-top: 28px; }
.art-share .label { color: var(--muted); }
.share-row { display: flex; gap: 8px; margin-top: 12px; }
.share-row a, .share-row button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; font-size: 0.875rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.share-row a:hover, .share-row button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.share-row svg { width: 17px; height: 17px; }
.share-note { margin-top: 10px; font-size: 0.8125rem; color: var(--muted); }

/* related */
.art-related { margin-top: clamp(72px, 9vw, 128px); padding-bottom: clamp(72px, 9vw, 128px); }
.rel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 36px); margin-top: clamp(32px, 4vw, 56px); }
.rcard { display: block; }
.rcard-img { aspect-ratio: 0.87 / 1; overflow: hidden; background: var(--mist); }
.rcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.rcard:hover .rcard-img img { transform: scale(1.03); }
.rcard .label { display: block; margin-top: 18px; color: var(--muted); }
.rcard h3 { margin-top: 8px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.rcard:hover h3 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.rcard-meta { margin-top: 8px; font-size: 0.875rem; color: var(--muted); }

/* lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lightbox-in { width: 100%; height: 100%; display: grid; place-items: center; padding: clamp(16px, 4vw, 64px); box-sizing: border-box; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox-close { position: fixed; top: 18px; right: 18px; width: 48px; height: 48px; border-radius: 50%; background: var(--paper); color: var(--ink); display: grid; place-items: center; }
.lightbox-close i { position: relative; width: 18px; height: 18px; }
.lightbox-close i::before, .lightbox-close i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: currentColor; }
.lightbox-close i::before { transform: rotate(45deg); }
.lightbox-close i::after { transform: rotate(-45deg); }

@media (max-width: 1100px) {
  .art-grid { grid-template-columns: minmax(0, 1fr) 260px; }
  .art-toc { grid-column: 1 / -1; }
  .art-toc-in { position: static; }
  .art-toc nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .art-toc a { padding-left: 14px; }
  .art-toc a::before { top: 12px; }
  .jhero-head .lead { max-width: 32ch; }
}
@media (max-width: 760px) {
  .jtabs { padding-top: calc(var(--hdr-h) + 10px); }
  .jhero-head { flex-direction: column; align-items: flex-start; }
  .fcard { width: 84vw; }
  .jgrid, .guides-row, .rel-grid { grid-template-columns: 1fr; }
  .art-grid { grid-template-columns: 1fr; gap: 40px; }
  .art-side-in { position: static; }
  .art-body { font-size: 1.0625rem; }
  .takeaways { padding: 20px; }
}
