/* =====================================================================
   RESUME  — the resume page (resume.html) and the "Resume" link + request
   note on the Work page. Loaded after styles.css.
   ===================================================================== */

:root {
  --rs-ink: #0f0e0e;
  --rs-muted: #787575;
  --rs-line: #e4e2e2;
  --rs-fill: #efeeee;      /* empty avatar + empty tiles */
  --rs-bg: #fff;
}
.night-mode {
  --rs-ink: #fff;
  --rs-muted: #9b9797;
  --rs-line: #2c2a2a;
  --rs-fill: #1d1b1b;
  --rs-bg: #0f0e0e;
}

/* the "Resume" link itself is styled in styles.css (it's on every page) */

/* =========================================================
   Request note
   ========================================================= */
.resume-request {
  position: fixed;
  z-index: 2000;
  width: max-content;
  max-width: min(320px, calc(100vw - 30px));
  box-sizing: border-box;
  padding: 16px 18px 14px;
  background: var(--rs-bg);
  color: var(--rs-ink);
  border: 1px solid var(--rs-ink);
  border-radius: 0;
  font-size: .9rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-fast, 180ms) var(--ease-soft, ease),
              transform var(--dur-fast, 180ms) var(--ease-settle, ease);
}
.resume-request.is-open { opacity: 1; transform: none; }
.resume-request[hidden] { display: none; }
.resume-request .rr-title { font-weight: 500; }
.resume-request .rr-text { font-weight: 300; color: var(--rs-muted); margin-top: 2px; }
.resume-request .rr-actions { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.resume-request .rr-send {
  background: var(--rs-ink);
  color: var(--rs-bg) !important;
  padding: 3px 8px;
  text-decoration: none;
  font-weight: 400;
}
.resume-request .rr-send:hover { background: var(--purple); color: #fff !important; }
.resume-request .rr-close {
  font: inherit; font-weight: 300; color: var(--rs-muted);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.resume-request .rr-close:hover { color: var(--rs-ink); text-decoration: underline; text-underline-offset: 3px; }
.resume-request a:focus-visible,
.resume-request button:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

/* =========================================================
   RESUME PAGE
   ========================================================= */
.resume-page { color: var(--rs-ink); }

.rs-shell {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  column-gap: 55px;
  padding: 40px;
  min-height: calc(100vh - 80px);
}

/* nav column — same as the other pages */
.rs-side {
  position: sticky;
  top: 40px;
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.rs-phone { display: none; }

.rs-main {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  font-size: .9rem;
  line-height: 1.65;
  padding-bottom: 40px;
}

/* every bit of resume text: no inherited p/a colour rules from styles.css */
.rs-main a { color: var(--rs-ink); text-decoration: none; }
.rs-muted, .rs-main .rs-muted { color: var(--rs-muted); font-weight: 300; }
.rs-main h1, .rs-main h2 { color: var(--rs-ink); }

/* ---------- header ---------- */
.rs-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 60px 0 72px;
}
.rs-avatar {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;          /* the only rounded thing on the page */
  background: var(--rs-fill);
  overflow: hidden;
}
.rs-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-name { font-size: 1.2rem; font-weight: 400; line-height: 1.4; margin: 0; }
.rs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rs-chip {
  display: inline-block;
  font: inherit;
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 1px 7px;
  border: 0;
  border-radius: 0;
  background: var(--rs-fill);
  color: var(--rs-ink) !important;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-soft), color var(--dur-fast) var(--ease-soft);
}
.rs-chip:hover { background: var(--rs-ink); color: var(--rs-bg) !important; }
.rs-chip:focus-visible { outline: 1px solid var(--rs-ink); outline-offset: 2px; }

/* ---------- sections ---------- */
.rs-section { margin-bottom: 72px; }
.rs-label {
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.65;
  margin: 0 0 20px;
}
.rs-items > * + * { margin-top: 26px; }

/* tablets + desktop: the section name stays put while its section scrolls past */
@media (min-width: 768px) {
  .rs-section {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    column-gap: 24px;
  }
  .rs-label {
    position: sticky;
    top: 40px;
    align-self: start;
    margin: 0;
  }
  .rs-header { padding-left: 0; }
}

/* ---------- text ---------- */
.rs-text { font-weight: 300; max-width: 70ch; }

/* ---------- entry: year | details ---------- */
.rs-entry {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  column-gap: 16px;
}
.rs-when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-title { font-weight: 400; }
a.rs-title:hover,
a.rs-sublink:hover { text-decoration: underline; text-underline-offset: 3px; }
.rs-main a.rs-sublink { color: var(--rs-muted); }
.rs-main a.rs-sublink:hover { color: var(--rs-ink); }
.rs-arrow {
  display: inline-block;
  width: .7em; height: .7em;
  margin-left: .35em;
  vertical-align: .05em;
  fill: none; stroke: currentColor; stroke-width: 1.15;
  overflow: visible;
  transition: transform 140ms ease-out;
}
a:hover > .rs-arrow,
a:focus-visible > .rs-arrow { transform: translate(.14em, -.14em); }
.rs-main a:focus-visible { outline: 1px solid var(--rs-ink); outline-offset: 3px; }

/* ---------- pictures ---------- */
.rs-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.rs-img {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--rs-fill);
  border: 1px solid var(--rs-line);
  box-sizing: border-box;
  overflow: hidden;
}
.rs-img img, .rs-img video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-img.is-contain img, .rs-img.is-contain video { object-fit: contain; }
.rs-img-trigger {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  appearance: none;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  cursor: zoom-in;
}
.rs-img-trigger:focus-visible { outline: 1px solid var(--rs-ink); outline-offset: 3px; }
.rs-images > :nth-child(n+4) { display: none; }
.rs-images [data-more-desktop]::after,
.rs-images [data-more-mobile]::after {
  position: absolute;
  right: 8px; bottom: 8px;
  padding: 2px 8px;
  background: rgba(15, 14, 14, .72);
  color: #fff;
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.5;
  pointer-events: none;
}
.rs-images [data-more-desktop]::after { content: attr(data-more-desktop); }

.rs-lightbox {
  width: min(900px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  overflow: visible;
  color: var(--rs-ink);
  background: transparent;
}
.rs-lightbox::backdrop {
  background: color-mix(in srgb, var(--rs-bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.rs-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 120px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 8px;
  background: var(--rs-fill);
  touch-action: pan-y;
}
.rs-lightbox-media {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  width: 100%;
  max-height: min(72vh, 680px);
}
.rs-lightbox-media img,
.rs-lightbox-media video {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 680px);
  object-fit: contain;
}
.rs-lightbox-media video { width: 100%; }
.rs-lightbox-close,
.rs-lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 14, 14, .62);
  cursor: pointer;
  line-height: 1;
}
.rs-lightbox-close {
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-size: 28px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.rs-lightbox-nav {
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
}
.rs-lightbox-nav .arrow {
  display: block;
  width: 8px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: square;
  overflow: visible;
}
.rs-lightbox-previous { left: 12px; }
.rs-lightbox-next { right: 12px; }
.rs-lightbox.is-single .rs-lightbox-nav { display: none; }
.rs-lightbox-dots {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 88px);
  margin: 0 auto;
  padding: 6px 10px;
  overflow-x: auto;
  border-radius: 20px;
  background: rgba(15, 14, 14, .62);
}
.rs-lightbox-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
}
.rs-lightbox-dot[aria-current="true"] { background: #fff; }
.rs-lightbox-count {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.rs-lightbox-close:focus-visible,
.rs-lightbox-nav:focus-visible,
.rs-lightbox-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.rs-lightbox-close:focus-visible { outline: none; }

@media (max-width: 767px) {
  .rs-lightbox { width: calc(100vw - 24px); }
  .rs-lightbox-stage { max-height: calc(100vh - 24px); }
  .rs-lightbox-media,
  .rs-lightbox-media img,
  .rs-lightbox-media video { max-height: 78vh; }
  .rs-lightbox-previous { left: 8px; }
  .rs-lightbox-next { right: 8px; }
}

/* short write-up under an entry */
.rs-excerpt {
  margin-top: 10px;
  max-width: 60ch;
  color: var(--rs-muted);
  font-weight: 300;
}

/* read.cv link card */
.rs-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  margin-top: 16px;
  border: 1px solid var(--rs-line);
  max-width: 560px;
}
.rs-card-img { background: var(--rs-fill); overflow: hidden; }
.rs-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-card-text { display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; }
.rs-card:hover .rs-card-title { text-decoration: underline; text-underline-offset: 3px; }
.rs-card-img.is-empty {
  display: flex; align-items: center; justify-content: center;
  padding: 12px; box-sizing: border-box;
  font-size: .78rem; color: var(--rs-muted); text-align: center; overflow-wrap: anywhere;
}
.rs-card-text .rs-card-title { overflow-wrap: anywhere; }
.rs-card-img.is-contain img { object-fit: contain; padding: 14%; box-sizing: border-box; }
.rs-filler { display: block; width: 100%; height: 100%; color: var(--rs-muted); }
.rs-filler .fill { fill: currentColor; stroke: none; }
.rs-filler text { fill: currentColor; font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 300; }
.rs-card-img.is-empty { padding: 0; }

/* dot points under an entry */
.rs-points {
  margin: 12px 0 0;
  padding-left: 1.2em;
  color: var(--rs-muted);
  font-weight: 300;
}
.rs-points li { padding-left: .2em; max-width: 60ch; }
:root .rs-main .rs-points li { color: var(--rs-muted); }   /* beats styles.css's li colour */
.rs-points li + li { margin-top: 8px; }
.rs-points li::marker { color: var(--rs-muted); }

/* only: "pdf" / only: "web" (resume-data.js) */
@media screen { .rs-pdf-only { display: none !important; } }
@media print  { .rs-web-only { display: none !important; } }
.rs-pdf[disabled] { cursor: progress; opacity: .7; }

/* ---------- projects: tiles with the Work page's corner dots ---------- */
.rs-projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 28px;
  padding-top: 4px;
}
.rs-tile { display: flex; flex-direction: column; color: var(--rs-ink); }
.rs-tile-frame {
  position: relative;
  display: block;
  aspect-ratio: 1;
  margin-bottom: 12px;
}
.rs-tile-frame img,
.rs-tile-empty {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px); height: calc(100% - 28px);
}
.rs-tile-frame img {
  object-fit: contain;
  display: block;
  transition: transform var(--dur-med) var(--ease-settle);
}
.rs-tile-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--rs-fill);
  padding: 12px; box-sizing: border-box;
  font-size: .78rem;
}
/* four corner dots: two on the frame, two on .rs-dots */
.rs-tile-frame::before, .rs-tile-frame::after,
.rs-dots::before, .rs-dots::after {
  content: '';
  position: absolute;
  width: 6px; height: 6px;
  box-sizing: content-box;
  border: 1px solid var(--rs-ink);
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  transition: background-color var(--dur-med) var(--ease-soft),
              border-width var(--dur-med) var(--ease-settle);
}
.rs-dots { position: absolute; inset: 0; pointer-events: none; }
.rs-tile-frame::before { top: 0; left: 0; transform: translate(-50%, -50%); }
.rs-tile-frame::after  { top: 0; right: 0; transform: translate(50%, -50%); }
.rs-dots::before { bottom: 0; left: 0; transform: translate(-50%, 50%); }
.rs-dots::after  { bottom: 0; right: 0; transform: translate(50%, 50%); }
a.rs-tile:hover .rs-tile-frame::before, a.rs-tile:hover .rs-tile-frame::after,
a.rs-tile:hover .rs-dots::before,       a.rs-tile:hover .rs-dots::after,
a.rs-tile:focus-visible .rs-tile-frame::before, a.rs-tile:focus-visible .rs-tile-frame::after,
a.rs-tile:focus-visible .rs-dots::before,       a.rs-tile:focus-visible .rs-dots::after {
  background: var(--rs-ink);
  border-width: 3px;
}
a.rs-tile:hover .rs-tile-frame img { transform: scale(.96); }
a.rs-tile:hover .rs-tile-title { text-decoration: underline; text-underline-offset: 3px; }
a.rs-tile:focus-visible { outline: none; }
.rs-tile-sub { font-size: .8rem; }
.rs-print-url { display: none; }

/* ---------- contact ---------- */
.rs-links > * + * { margin-top: 6px; }

/* ---------- tags ---------- */
.rs-tags { display: flex; flex-wrap: wrap; gap: 4px 22px; font-weight: 300; }

/* ---------- footer credit ---------- */
.rs-credit { font-size: .75rem; line-height: 1.6; max-width: 60ch; margin-top: 24px; }
.rs-credit a { color: var(--rs-muted) !important; text-decoration: underline; text-underline-offset: 3px; }
.rs-credit a:hover { color: var(--rs-ink) !important; }
@media (min-width: 768px) { .rs-credit { margin-left: 174px; } }

/* ---------- medium screens ---------- */
@media (min-width: 768px) and (max-width: 1059px) {
  .rs-section { grid-template-columns: 110px minmax(0, 1fr); column-gap: 16px; }
  .rs-credit { margin-left: 126px; }
  .rs-entry { grid-template-columns: 100px minmax(0, 1fr); column-gap: 12px; }
}

/* ---------- phones ---------- */
@media (max-width: 767px) {
  .rs-shell { display: block; padding: 107px 15px 15px; }
  .rs-side { display: none; }
  .rs-phone {
    display: block;
    position: fixed;
    inset: 0 0 auto;
    padding: 20px;
    z-index: 1001;
    pointer-events: none;
    background: var(--rs-bg);   /* solid logo bar, so text scrolls behind it cleanly */
  }
  .rs-header { margin: 0 0 56px; gap: 18px; }
  .rs-avatar { width: 72px; height: 72px; }
  .rs-section { margin-bottom: 56px; }
  /* phones: the section name sticks just under the logo bar while you scroll that section */
  .rs-label {
    position: sticky;
    top: 78px;
    z-index: 5;
    margin: 0 -15px 14px;
    padding: 6px 15px;
    background: var(--rs-bg);
  }

  .rs-entry { grid-template-columns: 92px minmax(0, 1fr); column-gap: 12px; }
  .rs-when { font-size: .8rem; line-height: 1.85; }
  .rs-images { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
  .rs-images > :nth-child(n+3) { display: none; }
  .rs-images [data-more-desktop]::after { content: none; }
  .rs-images [data-more-mobile]::after { content: attr(data-more-mobile); }
  .rs-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .rs-card-text { padding: 10px 12px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .resume-request, .rs-tile-frame img, .rs-arrow { transition: none; }
}

/* =========================================================
   PDF  (Save as PDF → print)
   ========================================================= */
@page { size: A4; margin: 0; }
@media print { .rs-points { margin-top: 1.5mm; } .rs-points li + li { margin-top: .8mm; } }   /* margin 0 stops the browser adding its date/title header */
@media print {
  :root, .night-mode {
    --rs-ink: #000; --rs-muted: #666; --rs-line: #ddd; --rs-fill: #f1f1f1; --rs-bg: #fff;
  }
  html, body { width: auto !important; height: auto !important; background: #fff !important; }
  .cursor-dot, .cursor-ring, .rs-side, .rs-phone, .rs-pdf, .resume-request { display: none !important; }
  .rs-shell { display: block; padding: 14mm 16mm; min-height: 0; }
  .rs-credit { display: none !important; }
  .rs-main { max-width: none; font-size: 8.6pt; line-height: 1.5; padding: 0; }
  .rs-header { margin: 0 0 7mm; gap: 5mm; }
  .rs-avatar { width: 16mm; height: 16mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rs-name { font-size: 13pt; }
  .rs-chip { background: none; padding: 0; font-size: 8pt; }
  .rs-section {
    display: grid; grid-template-columns: 30mm minmax(0, 1fr); column-gap: 4mm;
    margin-bottom: 6mm;
  }
  .rs-label { position: static; margin: 0; font-size: 8.6pt; }
  .rs-items > * + * { margin-top: 2.6mm; }
  .rs-entry { grid-template-columns: 26mm minmax(0, 1fr); column-gap: 3mm; break-inside: avoid; }
  .rs-arrow { display: none; }
  .rs-main, .rs-main a, .rs-main h1, .rs-main h2, .rs-tile { color: #000 !important; }
  .rs-main .rs-muted, .rs-credit a { color: #666 !important; }
  .rs-text { max-width: none; }
  .rs-tags { gap: 0 4mm; }
  .rs-projects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4mm; }
  .rs-tile { break-inside: avoid; }
  .rs-tile-frame { margin-bottom: 1.5mm; }
  .rs-tile-frame img, .rs-tile-empty { inset: 2mm; width: calc(100% - 4mm); height: calc(100% - 4mm); }
  .rs-tile-frame::before, .rs-tile-frame::after, .rs-dots::before, .rs-dots::after { display: none; }
  .rs-print-url { display: block; font-size: 7.4pt; overflow-wrap: anywhere; }
  .rs-tile-sub { font-size: 7.6pt; }
  .rs-avatar.is-empty { display: none; }
  .rs-credit { margin: 4mm 0 0 34mm; font-size: 7pt; }

  .rs-images, .rs-card { display: none !important; }
  .rs-excerpt { margin-top: 1mm; max-width: none; }

}

/* phones: the bar ignores taps, but the logo and menu inside it should not */
@media (max-width: 767px) {
  .rs-phone .phone-nav, .rs-phone .phone-nav * { pointer-events: auto; }
}
