/* resources.css: the /resources/ hub and the guide pages.
   Built from the blog's own tokens and faces (blog.css, blog-post.css): Fraunces for headings,
   Hanken Grotesk for reading, JetBrains Mono for labels, the glass panel, the baby blue button.
   Nothing here introduces a colour or a face the site does not already use. */

.rs-hub, .rs-guide-page {
  --bx-paper: #f6f1e6;
  --bx-muted: rgba(246, 241, 230, .70);
  --bx-faint: rgba(246, 241, 230, .52);
  --bx-line: rgba(233, 220, 255, .14);
  --bx-line-strong: rgba(233, 220, 255, .28);
  --bx-signal: #d8c6f5;
  --bx-glass: rgba(233, 220, 255, .045);
  --bx-glass-hi: rgba(233, 220, 255, .075);
  --bx-blue: #cfdaf5;
  --bx-blue-ink: #0f0a1e;
  --rs-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --rs-serif: 'Fraunces', Georgia, serif;
  --rs-sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
}
.rs-wrap { width: var(--bp-wrap); margin-inline: auto; }

/* ── shared ──────────────────────────────────────────────────────────────────────────────── */
.rs-eyebrow {
  margin: 0 0 18px;
  font-family: var(--rs-mono);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bp-ink-58);
}
.rs-lede {
  margin: 22px 0 0;
  max-width: 60ch;
  font-family: var(--rs-sans);
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: -.011em;
  color: var(--bp-ink-82);
  text-wrap: pretty;
}
.rs-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ── the hub ─────────────────────────────────────────────────────────────────────────────── */
.rs-head { max-width: 860px; }
.rs-head h1 {
  margin: 0;
  font-family: var(--rs-serif);
  font-weight: 450;
  font-size: clamp(44px, 4.6vw, 68px);
  line-height: 1.06;
  letter-spacing: -.035em;
  color: var(--bp-paper);
  text-wrap: balance;
}
.rs-sec { margin-top: clamp(64px, 9vh, 104px); }
.rs-sec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.rs-sec-title {
  margin: 0 0 26px;
  font-family: var(--rs-serif);
  font-weight: 450;
  font-size: clamp(28px, 2.4vw, 34px);
  letter-spacing: -.025em;
  color: var(--bp-paper);
}
.rs-all {
  font-family: var(--rs-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bp-ink-58);
  text-decoration: none;
  transition: color .18s ease;
}
.rs-all:hover, .rs-all:focus-visible { color: var(--bp-paper); }

.rs-guide {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 3.4vw, 48px);
  border: 1px solid var(--bp-line);
  border-radius: 24px;
  background:
    radial-gradient(110% 140% at 0% 0%, rgba(167, 122, 227, .16), transparent 58%),
    radial-gradient(120% 150% at 100% 100%, rgba(79, 173, 227, .10), transparent 60%),
    var(--bp-glass);
}
.rs-guide-cover { display: block; perspective: 1200px; }
.rs-guide-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 60px rgba(4, 2, 12, .5), 0 4px 12px rgba(4, 2, 12, .35), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transform: rotate(-1.6deg);
  transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}
.rs-guide:hover .rs-guide-cover img { transform: rotate(0deg) translateY(-4px); }
.rs-guide-body .bx-chip { display: inline-block; }
.rs-guide-body h3 {
  margin: 18px 0 0;
  font-family: var(--rs-serif);
  font-weight: 450;
  font-size: clamp(30px, 2.8vw, 42px);
  line-height: 1.12;
  letter-spacing: -.028em;
  text-wrap: balance;
}
.rs-guide-body h3 a { color: var(--bp-paper); text-decoration: none; }
.rs-guide-body h3 a:hover { text-decoration: underline; text-decoration-color: var(--bp-signal); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.rs-meta {
  margin: 16px 0 0;
  font-family: var(--rs-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--bp-ink-58);
}
.rs-summary {
  margin: 18px 0 0;
  max-width: 58ch;
  font-family: var(--rs-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--bp-ink-82);
}

.rs-cards { margin-top: 0; }

.rs-qgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rs-qrow, .fq-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 24px 26px;
  border: 1px solid rgba(201, 182, 236, .16);
  border-radius: 14px;
  background: rgba(28, 21, 48, .35);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s ease, background-color .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}
.rs-qrow:hover, .rs-qrow:focus-visible {
  border-color: rgba(201, 182, 236, .38);
  background: rgba(38, 28, 64, .5);
  transform: translateY(-1px);
}
.rs-qrow:focus-visible { outline: 2px solid #c9b6ec; outline-offset: 3px; }
.rs-qrow h3 {
  margin: 0;
  font-family: var(--rs-sans);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -.012em;
  color: #e4dbf6;
  text-wrap: balance;
}
.rs-qrow .faq-row-src {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(232, 228, 240, .44);
}
.rs-qrow .faq-row-go {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(201, 182, 236, .45);
  border-radius: 50%;
  color: #e9dcff;
  transition: transform .28s cubic-bezier(.16, 1, .3, 1), border-color .18s ease;
}
.rs-qrow .faq-row-go svg { width: 13px; height: 13px; display: block; }
.rs-qrow:hover .faq-row-go { border-color: #c9b6ec; transform: translate(2px, -2px); }

/* ── the guide page ──────────────────────────────────────────────────────────────────────── */
.rs-ghead { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr); gap: clamp(40px, 5vw, 88px); align-items: end; }
.rs-contents { padding: 24px 26px; border: 1px solid var(--bp-line); border-radius: 20px; background: var(--bp-glass); }
.rs-contents-title {
  margin: 0 0 12px; font-family: var(--rs-mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--bp-ink-58);
}
.rs-contents ol { margin: 0; padding: 0; list-style: none; }
.rs-contents li + li { border-top: 1px solid var(--bp-line); }
.rs-contents a {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 9px 2px;
  font-family: var(--rs-sans); font-size: 16px; line-height: 1.35; color: var(--bp-ink-82); text-decoration: none;
  transition: color .18s ease;
}
.rs-contents a span { font-family: var(--rs-mono); font-size: 12.5px; color: #c9b6ec; padding-top: 2px; }
.rs-contents a:hover, .rs-contents a:focus-visible { color: var(--bp-paper); }
.rs-ghead h1 {
  margin: 0;
  font-family: var(--rs-serif);
  font-weight: 450;
  font-size: clamp(42px, 4.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -.034em;
  color: var(--bp-paper);
}
.rs-ghead h1 span { display: block; margin-top: 6px; font-weight: 350; color: rgba(246, 241, 230, .72); }

.rs-gbody {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 600px);
  column-gap: clamp(40px, 4.5vw, 72px);
  align-items: start;
  margin-top: clamp(56px, 8vh, 88px);
}
.rs-gtext { max-width: 68ch; }
.rs-gsec { scroll-margin-top: 96px; padding-bottom: clamp(36px, 5vh, 56px); }
.rs-gsec + .rs-gsec { padding-top: clamp(28px, 4vh, 44px); border-top: 1px solid var(--bp-line); }
.rs-gsec#page-05 { border-top: 0; padding-top: 0; }
.rs-gsec h2 {
  margin: 0 0 22px;
  font-family: var(--rs-serif);
  font-weight: 450;
  font-size: clamp(28px, 2.4vw, 34px);
  line-height: 1.16;
  letter-spacing: -.024em;
  color: var(--bp-paper);
  text-wrap: balance;
}
.rs-gsec h3 {
  margin: 30px 0 12px;
  font-family: var(--rs-sans);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.014em;
  color: #e4dbf6;
}
.rs-gsec h2 + h3 { margin-top: 0; }
.rs-gsec p, .rs-list li {
  font-family: var(--rs-sans);
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: -.011em;
  color: var(--bp-ink-82);
}
.rs-gsec p { margin: 0 0 22px; }
.rs-gsec p:last-child { margin-bottom: 0; }
.rs-gsec strong { font-weight: 650; color: var(--bp-paper); }
.rs-gsec a:not(.bp-btn) { color: var(--bp-paper); text-decoration: underline; text-decoration-color: var(--bp-signal); text-underline-offset: 3px; }
.rs-lead { font-size: 20px !important; }
.rs-list { margin: 0 0 8px; padding: 0; list-style: none; }
.rs-list li { position: relative; padding-left: 30px; margin: 0 0 16px; }
.rs-list--ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .66em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bp-signal);
}
.rs-list--ol { counter-reset: rs; }
.rs-list--ol li { counter-increment: rs; padding-left: 46px; }
.rs-list--ol li::before {
  content: counter(rs, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .2em;
  font-family: var(--rs-mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: #c9b6ec;
}
.rs-close {
  margin-top: 12px;
  padding: clamp(32px, 4vw, 52px) !important;
  border: 1px solid var(--bp-line) !important;
  border-radius: 24px;
  background:
    radial-gradient(120% 160% at 12% 0%, rgba(167, 122, 227, .18), transparent 60%),
    radial-gradient(120% 160% at 92% 100%, rgba(79, 173, 227, .14), transparent 62%),
    var(--bp-glass);
}
.rs-contact { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* the designed page beside the words */
.rs-viewer { position: sticky; top: 96px; }
.rs-viewer-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.rs-viewer-page { margin: 0; }
.rs-viewer-page img {
  display: block;
  /* as large as the column allows, but never taller than the screen below the sticky header;
     1545 x 2000 is the page's own proportion, so nothing is cropped or stretched */
  width: min(100%, calc((100vh - 170px) * 0.7725));
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 30px 60px rgba(4, 2, 12, .45), 0 4px 12px rgba(4, 2, 12, .3), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: opacity .24s ease;
}
.rs-viewer.is-swapping .rs-viewer-page img { opacity: .35; }
.rs-viewer-open:focus-visible { outline: 2px solid #c9b6ec; outline-offset: 6px; border-radius: 12px; }
.rs-viewer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-family: var(--rs-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--bp-ink-58);
}
.rs-viewer-count b { color: var(--bp-paper); font-weight: 500; }
.rs-viewer-dl { color: var(--bp-ink-58); text-decoration: none; text-transform: uppercase; letter-spacing: .08em; }
.rs-viewer-dl:hover { color: var(--bp-paper); }

/* every page, as designed */
.rs-pages { margin-top: clamp(64px, 9vh, 104px); }
.rs-pages h2 {
  margin: 0;
  font-family: var(--rs-serif);
  font-weight: 450;
  font-size: clamp(28px, 2.4vw, 34px);
  letter-spacing: -.024em;
  color: var(--bp-paper);
}
.rs-pages > p { margin: 10px 0 28px; font-family: var(--rs-sans); font-size: 16px; color: var(--bp-ink-58); }
.rs-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rs-thumb { display: block; text-decoration: none; }
.rs-thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(4, 2, 12, .4), inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.rs-thumb:hover img, .rs-thumb:focus-visible img { transform: translateY(-4px); }
.rs-thumb span {
  display: block;
  margin-top: 10px;
  font-family: var(--rs-mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bp-ink-58);
}

.rs-lightbox {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 3vh 0;
  border: 0;
  background: rgba(8, 5, 18, .92);
  overflow: auto;
}
.rs-lightbox::backdrop { background: rgba(8, 5, 18, .7); }
.rs-lightbox img { display: block; height: 94vh; width: auto; margin: 0 auto; border-radius: 8px; }
.rs-lightbox form { position: fixed; top: 18px; right: 22px; margin: 0; }
.rs-lightbox-close {
  padding: 10px 18px;
  border: 1px solid rgba(233, 220, 255, .28);
  border-radius: 999px;
  background: rgba(20, 13, 38, .8);
  color: #f6f1e6;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 980px) {
  .rs-guide { grid-template-columns: minmax(0, 1fr); }
  .rs-guide-cover { max-width: 320px; }
  .rs-qgrid { grid-template-columns: minmax(0, 1fr); }
  .rs-gbody, .rs-ghead { grid-template-columns: minmax(0, 1fr); }
  .rs-viewer { display: none; }
  .rs-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .rs-guide-cover img, .rs-thumb img, .rs-qrow, .rs-viewer-page img { transition: none; }
  .rs-guide-cover img { transform: none; }
}
