/* =========================================================================
   Seigrint — site theme
   Shared by every page that carries body.theme: the home page, the case
   studies and /resume. Sits on top of styles.css and reads the same
   tokens. What lives here: the word reveal, the statements, the pointer stroke and
   the living background.
   ========================================================================= */

.theme {
  /* SF Pro first by name, then the system UI font (which is SF Pro on
     Apple devices), then Inter where neither exists. SF Pro can't be
     downloaded onto other systems: Apple licenses it for its platforms. */
  --font-text:    "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui,
                  "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui,
                  "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* The expressive face: the statements and the italic accents. */
  --font-cal:     "Averia Serif Libre", sans-serif;

  /* Type scale. Compact and even-weighted: body 15/24, small 13/20,
     headings at weight 500 with a hair of negative tracking. */
  --rs-body: 15px;   --rs-body-lh: 24px;
  --rs-small: 13px;  --rs-small-lh: 20px;
  --rs-track-head: -0.012em;

  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rs-measure: 980px;
  --rs-word-t: 900ms;        /* one word resolving into place */

  /* Text sits on a warm tint here, not pure white. These two are darkened
     so they keep WCAG AA (4.5:1) even where every background shape
     overlaps at full strength with the grain on (5.3:1 and 4.9:1). */
  --muted:      #4c4c52;
  --flare-deep: #94300a;     /* orange for text: links on hover, the tag */
}

/* People copy from these pages: names, the email, a line for an intro. The
   home page switches selection off everywhere; this page turns it back on
   for the text. */
.theme main,
.theme main * {
  -webkit-user-select: text;
     -moz-user-select: text;
          user-select: text;
}

/* ---------------------------------- logo -------------------------------- */
/* The mark heads the intro, in the page flow, on the same left edge as the
   title, so it scrolls away with the content. Like the text, the parts of
   it nearest the pointer thicken (theme.js); strokes are non-scaling, so
   their widths are in screen pixels whatever the mark's size. Keyboard
   focus outlines the whole mark. */
.rs-logo {
  display: inline-block;
  margin-bottom: clamp(28px, 4.5vh, 48px);
  line-height: 0;
  color: var(--ink);
  transition: transform var(--t-press) var(--ease);
}
.rs-logo svg {
  width: auto;
  height: 58px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
  stroke-linejoin: round;
  overflow: visible;
  transition: stroke-width var(--t-base) var(--ease);
}
.rs-logo:focus-visible svg { stroke-width: 1.8px; }
.rs-logo:active { transform: scale(0.94); }

/* The mark writes itself in on load (theme.js): one line traces its
   centreline like a pen and the ink follows just behind it. Hidden until
   then, so it never flashes in solid first. fill-opacity, not opacity, so
   the pointer thickening (stroke-only copies) is never hidden with it. */
.rs-js .rs-logo svg { fill-opacity: 0; }
.rs-logo .rs-mark-draw { fill: none; pointer-events: none; }

.rs {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  font-family: var(--font-text);
  font-size: var(--rs-body);
  line-height: var(--rs-body-lh);
}

/* ------------------------------ edge blur ------------------------------ */
/* The home page's progressive blur along the top and bottom edges, reaching
   further into the screen here. Same strength at the very edge; only the
   ramp is longer, so more of the page softens on its way in and out. The
   strip's mask stops are percentages, so they stretch with it. */
.theme .edge-blur { --eb-ramp: clamp(150px, 24vh, 280px); }

/* The intro starts near the top of the page, inside the top strip. At
   rest nothing has scrolled under it yet, so the strip's blur grows in
   over the first stretch of scrolling (theme.js sets --eb-top, 0 to 1 on
   an eased curve) instead of softening the logo and the intro on arrival.
   It scales the blur itself, not the strip's opacity: an element that is
   even slightly transparent cuts its children off from the page behind
   them, so their blur shows nothing until opacity reaches 1 and then
   appears all at once. The short transition smooths over a fast flick. */
.theme .edge-blur--top .edge-blur__layer {
  -webkit-backdrop-filter: blur(calc(var(--b) * var(--eb-top, 0)));
          backdrop-filter: blur(calc(var(--b) * var(--eb-top, 0)));
  transition: -webkit-backdrop-filter 220ms linear, backdrop-filter 220ms linear;
}
@media (prefers-reduced-motion: reduce) {
  .theme .edge-blur--top .edge-blur__layer { transition: none; }
}

/* ------------------------------ accent faces ---------------------------- */
.theme .cal {
  font-family: var(--font-cal);
  font-style: italic;
  font-weight: 400;
  font-size: 1.04em;
  letter-spacing: -0.01em;
}
.theme .mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* --------------------------------- intro -------------------------------- */
.rs-intro {
  padding: clamp(28px, 5vh, 48px) 0 clamp(56px, 8vw, 96px);
}
.rs-role {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.15;
  letter-spacing: var(--rs-track-head);
  font-weight: 400;          /* regular at display size reads lighter, more editorial */
}
.rs-role .cal { color: var(--muted); }
.rs-role__bar {
  align-self: center;
  width: 1px; height: 0.9em;
  background: var(--hairline);
}
/* -------------------------------- contact ------------------------------- */
/* A solid primary and a tinted secondary, side by side, with a quiet line
   of direct links underneath. Buttons are compact (36px, 8px corners,
   14px medium text) and answer fast: colour in 150ms, a slight press on
   click. The secondary is a faint tint with a half-pixel inner hairline
   rather than an outline. Links get an underline that draws in on hover. */
.rs-contact { margin-top: 28px; }
.rs-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

.rs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-family: var(--font-text);
  font-size: 14px; line-height: 20px; font-weight: 500;
  letter-spacing: -0.006em;
  white-space: nowrap;
  transition: color 150ms cubic-bezier(0, 0, 0.2, 1),
              background-color 150ms cubic-bezier(0, 0, 0.2, 1),
              box-shadow 150ms cubic-bezier(0, 0, 0.2, 1),
              transform 200ms cubic-bezier(0, 0, 0.2, 1);
}
.rs-btn svg {
  width: 14px; height: 14px; stroke-width: 2;
  transition: transform 200ms cubic-bezier(0, 0, 0.2, 1);
}
.rs-btn:hover svg { transform: translateX(2px); }
.rs-btn:active { transform: scale(0.97); }

.rs-btn--primary {
  background: rgba(17, 17, 19, 0.95);
  color: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.1),
              0 1px 2px rgba(0, 0, 0, 0.14),
              0 4px 12px -4px rgba(0, 0, 0, 0.18);
}
.rs-btn--primary:hover { background: #000; }

.rs-btn--secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.rs-btn--secondary:hover { background: rgba(0, 0, 0, 0.085); }

.rs-links {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; align-items: center;
  font-size: var(--rs-small); line-height: var(--rs-small-lh);
  color: var(--ink-soft);
}
.rs-links li { display: flex; align-items: center; }
.rs-links li + li::before {
  content: "";
  width: 1px; height: 12px;
  margin: 0 12px;
  background: var(--hairline);
}
.rs-links a {
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 32px;
  color: var(--ink-soft);
  transition: color 150ms cubic-bezier(0, 0, 0.2, 1);
}
.rs-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform var(--t-slow) var(--ease);
}
.rs-links a:hover::after,
.rs-links a:focus-visible::after { transform: scaleX(1); transform-origin: 0 50%; }
.rs-links a:hover { color: var(--ink); }
.rs-links__meta { color: var(--muted); min-height: 32px; }

/* ------------------------------ copy email -------------------------------
   A button that copies the address. Inside, two lines share one grid cell
   behind a clip window, like a departure board: the address at rest, the
   copy prompt (or "Copied!") waiting below. On hover or keyboard focus the
   address slides up and out as the prompt rises into its place; leaving
   runs it back. Plain CSS transitions, so an interrupted hover reverses
   from wherever the lines are. The cell takes the size of the longest
   line, so the button never changes size. The window's padding, cancelled
   by a negative margin, leaves descenders room at rest; the travel is the
   line height plus that padding, so a line is fully out of view. */
.rs-copy { border: 0; cursor: pointer; font: inherit; }
.rs-btn.rs-copy { font-size: 14px; font-weight: 500; }
.rs-copy__window {
  display: grid;
  overflow: hidden;
  padding: 0.3em 0.12em;
  margin: -0.3em -0.12em;
}
.rs-copy__line {
  grid-area: 1 / 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 200ms ease;
}
.rs-copy__line--alt { display: grid; transform: translateY(calc(100% + 0.6em)); }
.rs-copy__state {
  grid-area: 1 / 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: opacity 160ms ease;
}
.rs-copy__state--done { opacity: 0; }
.rs-copy.is-copied .rs-copy__state--idle { opacity: 0; }
.rs-copy.is-copied .rs-copy__state--done { opacity: 1; }
.rs-copy__icon { width: 11px; height: 15px; flex: none; }
.rs-copy__icon--check { width: 14px; height: 14px; stroke-width: 2.2; }

/* Rolled: hover (only where hovering exists, so a tap on a phone doesn't
   leave it stuck), keyboard focus, and the moment after a copy. */
@media (hover: hover) {
  .rs-copy:hover .rs-copy__line--main { transform: translateY(calc(-100% - 0.6em)); }
  .rs-copy:hover .rs-copy__line--alt { transform: none; }
}
.rs-copy:focus-visible .rs-copy__line--main,
.rs-copy.is-copied .rs-copy__line--main { transform: translateY(calc(-100% - 0.6em)); }
.rs-copy:focus-visible .rs-copy__line--alt,
.rs-copy.is-copied .rs-copy__line--alt { transform: none; }

/* Reduced motion: the same swap as a crossfade, no travel. */
@media (prefers-reduced-motion: reduce) {
  .rs-copy__line, .rs-copy__line--alt,
  .rs-copy:hover .rs-copy__line, .rs-copy:focus-visible .rs-copy__line,
  .rs-copy.is-copied .rs-copy__line { transform: none !important; }
  .rs-copy__line--alt { opacity: 0; }
  .rs-copy:focus-visible .rs-copy__line--main,
  .rs-copy.is-copied .rs-copy__line--main { opacity: 0; }
  .rs-copy:focus-visible .rs-copy__line--alt,
  .rs-copy.is-copied .rs-copy__line--alt { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) and (hover: hover) {
  .rs-copy:hover .rs-copy__line--main { opacity: 0; }
  .rs-copy:hover .rs-copy__line--alt { opacity: 1; }
}

/* -------------------------------- blocks -------------------------------- */
.rs-block {
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--hairline-soft);
}
.rs-summary { border-top: 0; padding-top: 0; }

.rs-lede {
  max-width: 34ch;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.3;
  letter-spacing: var(--rs-track-head);
  font-weight: 400;
  color: var(--ink);
}
.rs-lede--sm {
  max-width: 46ch;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink-soft);
}
/* Links inside running text ([data-pop]): set heavier and in full ink so
   they read as things to click. They arrive letter by letter on the same
   spring as the statements, then a flare underline draws in under them,
   left to right, once the last letter has landed. A drawn line rather than
   text-decoration: split words are inline-blocks, which text-decoration
   doesn't reach into. */
[data-pop] {
  position: relative;
  display: inline-block;
  font-weight: 600;
  color: var(--ink);
  transition: color var(--t-fast) var(--ease);
}
[data-pop]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.02em;
  height: 0.07em;
  border-radius: 1px;
  background: var(--flare);
  transform-origin: 0 50%;
  transition: transform 700ms var(--ease);
}
[data-pop]:hover { color: var(--flare); }
.rs-js [data-pop]::after {
  transform: scaleX(0);
  transition-delay: calc(var(--n, 8) * var(--rs-letter-gap, 24ms) + var(--rs-letter-rise, 1000ms) * 0.5);
}
.rs-js [data-pop].is-in::after { transform: scaleX(1); }

.rs-eyebrow { margin-bottom: clamp(28px, 4vw, 48px); }

/* ---------------------------------- jobs -------------------------------- */
.rs-job {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 3fr;
  gap: 12px clamp(24px, 4vw, 64px);
  padding: clamp(28px, 4vw, 44px) 0;
}
.rs-job + .rs-job { border-top: 1px solid var(--hairline-soft); }
.rs-block > .rs-job:first-child { padding-top: 0; }

.rs-job__meta {
  display: flex; flex-direction: column; gap: 4px;
  padding-top: 0.55em;
  font-size: var(--rs-small); line-height: var(--rs-small-lh);
  color: var(--muted);
}
.rs-job__meta .mono { font-size: var(--rs-small); }

.rs-job__body { max-width: 62ch; }
.rs-job__title {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.29;
  font-weight: 500;
  letter-spacing: var(--rs-track-head);
}
.rs-org { white-space: nowrap; }
.rs-at { color: var(--muted); font-weight: 400; }
.rs-job__title .cal { font-size: 1.06em; }

.rs-job__intro {
  margin-top: 10px;
  color: var(--muted);
}

.rs-client {
  margin-top: 34px;
  font-family: var(--font-text);
  font-size: var(--rs-body); line-height: var(--rs-body-lh); font-weight: 500;
}

.rs-list { margin-top: 14px; display: grid; gap: 8px; }
.rs-client + .rs-list { margin-top: 10px; }
.rs-list li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-soft);
}
.rs-list li::before {
  content: "";
  position: absolute; left: 2px; top: 11.5px;
  width: 8px; height: 1px;
  background: var(--muted);
}
.rs-list strong { color: var(--ink); font-weight: 500; }

/* ------------------------------- concepts ------------------------------- */
.rs-concepts {
  margin-top: clamp(32px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 64px);
}
.rs-concepts li {
  padding: 18px 0;
  border-top: 1px solid var(--hairline-soft);
  color: var(--muted);
}
.rs-concepts__name {
  display: block;
  font-family: var(--font-display);
  font-size: 18px; line-height: 26px; font-weight: 500;
  letter-spacing: var(--rs-track-head);
  color: var(--ink);
}
.rs-concepts__desc { display: block; margin-top: 4px; }
.rs-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--flare-deep);
}

/* -------------------------------- skills -------------------------------- */
.rs-skills { margin: 0; display: grid; gap: 0; }
.rs-skills > div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 3fr;
  gap: 8px clamp(24px, 4vw, 64px);
  padding: 22px 0;
  border-top: 1px solid var(--hairline-soft);
}
.rs-skills > div:first-child { border-top: 0; padding-top: 0; }
.rs-skills dt {
  font-size: var(--rs-small); line-height: var(--rs-body-lh); color: var(--muted);
}
.rs-skills dd {
  margin: 0; max-width: 62ch;
  color: var(--ink-soft);
}

/* ------------------------------ statements ------------------------------ */
/* The lines worth stopping on. Set apart by size and the serif rather than
   by empty space: they sit in the flow with the same rhythm as a block. */
.rs-statement {
  padding: clamp(56px, 8vw, 112px) 0;
}
.rs-statement__text {
  max-width: 16ch;
  font-family: var(--font-cal);
  font-weight: 400;
  font-size: clamp(48px, 8.4vw, 124px);
  line-height: 1.1;          /* 1.02 let descenders touch the next line's caps */
  letter-spacing: -0.02em;
  color: var(--ink);
}
.rs-statement__text .accent { font-style: italic; }

.rs-statement--quote .rs-statement__text {
  max-width: 22ch;
  font-size: clamp(34px, 5.2vw, 76px);
  line-height: 1.14;
}
.rs-cite {
  margin-top: 24px;
  font-size: var(--rs-small); line-height: var(--rs-small-lh);
  color: var(--muted);
}

.rs-statement--end { padding-bottom: clamp(96px, 14vw, 180px); }
.rs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }

/* The accent words take the site's flare sweep once they've landed. The
   gradient is clipped to the text with background-clip:text, which only
   works on text the element holds directly, so theme.js turns the word's
   letter spans back into plain text before it adds .is-lit. */
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .rs-statement .accent.is-lit {
    color: transparent;
    /* A soft, wide band at three-quarter strength: the flare is mixed 75/25 into the
       ink at its peak and eases out over twice the old width, so it reads
       as light passing over the word rather than a coloured stripe. */
    --sweep-peak: color-mix(in oklab, var(--flare) 75%, var(--ink));
    --sweep-mid:  color-mix(in oklab, var(--flare) 45%, var(--ink));
    --sweep-low:  color-mix(in oklab, var(--flare) 15%, var(--ink));
    background-image: linear-gradient(100deg,
        var(--ink) 0%,
        var(--ink) 40%,
        var(--sweep-low) 43.5%,
        var(--sweep-mid) 46.5%,
        var(--sweep-peak) 50%,
        var(--sweep-mid) 53.5%,
        var(--sweep-low) 56.5%,
        var(--ink) 60%,
        var(--ink) 100%);
    background-size: 300% 100%;
    background-position: 100% 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
            background-clip: text;
    animation: rs-sweep 2.4s var(--ease-inout) 1 forwards,
               text-sweep 11s var(--ease-inout) 2.4s infinite;
    /* background-clip:text only paints inside the padding box, and italic
       glyphs overhang theirs: "AI" ran ~0.1em past its right edge and was
       shaved. Padding on both sides makes room; the matching negative
       margin cancels it so the line doesn't shift. Vertical padding covers
       ascenders and accents without changing the line box. clone gives
       every line of a wrapped accent the same room, not just its ends. */
    padding: 0.12em 0.16em;
    margin: 0 -0.16em;
    -webkit-box-decoration-break: clone;
            box-decoration-break: clone;
  }
}
@keyframes rs-sweep {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

/* ============================== motion =================================
   Everything below only applies once theme.js is running (html.rs-js is
   set in the head, and never under reduced motion).
   ======================================================================= */

/* Running text: each word rises, unblurs and fades in on its own. */
.rs-js .wd {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(0.5em);
  transition: opacity var(--rs-word-t) var(--ease),
              filter var(--rs-word-t) var(--ease),
              transform var(--rs-word-t) var(--ease);
}
.rs-js .wd.is-in { opacity: 1; filter: blur(0); transform: none; }
/* Once settled, drop the filter entirely so the text renders crisp. */
.rs-js .wd.is-done { filter: none; transition: none; }

/* A bullet's dash waits for its first word instead of sitting there alone. */
.rs-js .rs-list li::before { transition: opacity var(--rs-word-t) var(--ease); }
.rs-js .rs-list li:not(:has(.wd.is-in))::before { opacity: 0; }

/* Statements: letter by letter. Each letter rises, fades in and unblurs
   like the running text, but on a lightly under-damped spring: it
   overshoots by about 8% of its travel and settles. Enough to feel
   physical, not enough to wobble. Gap and rise time come from theme.js.
   .sm only keeps a word's letters together on one line. */
[data-statement] .sm { display: inline-block; white-space: nowrap; }
[data-statement] .si { display: inline-block; }

.rs {
  /* Damping ratio ~0.62, sampled from the spring itself. Browsers without
     linear() get the nearest cubic: a small overshoot, then settle. */
  --rs-spring: cubic-bezier(0.3, 1.4, 0.5, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  .rs {
    --rs-spring: linear(0, 0.036 2.5%, 0.127 5%, 0.251 7.5%, 0.388 10%,
      0.527 12.5%, 0.656 15%, 0.771 17.5%, 0.866 20%, 0.943 22.5%, 1 25%,
      1.041 27.5%, 1.066 30%, 1.08 32.5%, 1.084 35%, 1.081 37.5%,
      1.073 40%, 1.063 42.5%, 1.051 45%, 1.04 47.5%, 1.029 50%,
      1.019 52.5%, 1.011 55%, 1.005 57.5%, 1 60%, 0.997 62.5%,
      0.995 65%, 0.993 70%, 0.995 77.5%, 0.997 82.5%, 0.999 90%, 1);
  }
}

/* Only the rise springs. Fade and blur clear on the plain settle curve:
   focus should resolve once, not swing past sharp and back. */
.rs-js [data-statement] .si {
  opacity: 0;
  transform: translateY(0.5em);
  filter: blur(10px);
  transition: transform var(--rs-letter-rise, 1000ms) var(--rs-spring),
              opacity var(--rs-letter-rise, 1000ms) var(--ease),
              filter var(--rs-letter-rise, 1000ms) var(--ease);
  transition-delay: calc(var(--k, 0) * var(--rs-letter-gap, 24ms));
}
.rs-js [data-statement].is-in .si { opacity: 1; transform: none; filter: blur(0); }

/* A [data-pop] link's word holds still; its letters do the same spring as
   a statement's, timed from the moment the word's turn comes up. */
.rs-js .wd--pop,
.rs-js .wd--pop.is-in { opacity: 1; filter: none; transform: none; transition: none; }
.rs-js .wd--pop .pl {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
  filter: blur(10px);
  transition: transform var(--rs-letter-rise, 1000ms) var(--rs-spring),
              opacity var(--rs-letter-rise, 1000ms) var(--ease),
              filter var(--rs-letter-rise, 1000ms) var(--ease);
  transition-delay: calc(var(--k, 0) * var(--rs-letter-gap, 24ms));
}
.rs-js .wd--pop.is-in .pl { opacity: 1; transform: none; filter: blur(0); }

/* Landed: no filter or transform left behind on any letter (see
   settleLater in theme.js). */
.rs-js [data-statement].is-settled .si,
.rs-js .wd--pop.is-settled .pl { filter: none; transform: none; transition: none; }

/* ---------------------------- pointer stroke ---------------------------
   theme.js sets --st (0-1) on letters within reach of the pointer. A
   stroke thickens the glyph without changing its width, so nothing moves.
   paint-order puts the stroke behind the fill: many glyphs are built from
   overlapping contours (the bowl and stem of an "a"), and a stroke painted
   on top drew those hidden inner edges as lines across the letter. Behind
   the fill only the outer half shows: the added weight is half the width
   set here, a light touch rather than a full bold. Sized in em, scaled down for the statements so a
   100px letter gains about as much visible weight as a 15px one. */
.rs .ch  { -webkit-text-stroke-width: calc(var(--st, 0) * 0.06em); }
.rs .si  { -webkit-text-stroke-width: calc(var(--st, 0) * 0.027em); }
.rs .ch, .rs .si {
  -webkit-text-stroke-color: currentColor;
  paint-order: stroke fill;
}

.rs-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============================ breakpoints ============================== */
@media (max-width: 860px) {
  .rs-job,
  .rs-skills > div { grid-template-columns: 1fr; }
  .rs-job__meta { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding-top: 0; }
  .rs-concepts { grid-template-columns: 1fr; }
  .theme .edge-blur { --eb-ramp: clamp(110px, 18vh, 180px); }
  .rs-logo svg { height: 46px; }
}

/* Phones: the two buttons share the width at a 44px tap height, and the
   links become full-width rows split by hairlines. */
@media (max-width: 560px) {
  /* The title wraps here; the divider would dangle at the end of line one. */
  .rs-role__bar { display: none; }
  .rs-buttons, .rs-actions { display: grid; grid-template-columns: 1fr 1fr; }
  /* The copy button is as wide as its longest line ("Copy my email to
     clipboard"), more than half a phone, so it takes a row of its own. */
  .rs-buttons .rs-copy, .rs-actions .rs-copy { grid-column: 1 / -1; }
  .rs-btn { height: 44px; }
  .rs-links { flex-direction: column; align-items: stretch; margin-top: 16px; }
  .rs-links li { border-top: 1px solid var(--hairline-soft); }
  .rs-links li:last-child { border-bottom: 1px solid var(--hairline-soft); }
  .rs-links li + li::before { display: none; }
  .rs-links a, .rs-links__meta { min-height: 44px; width: 100%; font-size: 14px; }
  .rs-links a::after { bottom: 11px; right: auto; width: 100%; }
}

/* ------------------------------ background ------------------------------
   Sunlight on a wall. A warm off-white gradient, then two layers above
   it: soft leaf-shaped shadows (multiplied in, so they only darken) and
   bright flecks of light between them (screened in, so they only
   lighten). Both layers sway slowly from a pivot above the page, the way
   a branch moves, and the flecks shimmer on their own. Grain on top. The
   whole thing is pinned to the top of the page, scrolls away with it and
   fades out downward into the page colour. sunlit.js places the
   leaves and flecks and adds a little depth on scroll. */
.theme { --page: #f3f2ee; }

.rs-sun {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: clamp(640px, 110vh, 980px);
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(100deg, #fbfbf8 0%, #f2f1eb 50%, #e8e6dd 100%);
  -webkit-mask-image: linear-gradient(#000 52%, transparent);
          mask-image: linear-gradient(#000 52%, transparent);
  opacity: 0;
  animation: rs-sun-in 1400ms var(--ease) 100ms forwards;
}
@keyframes rs-sun-in { to { opacity: 1; } }

/* The depth wrappers take the scroll parallax (transform); the layers
   inside take the sway (rotate and translate), so the two never fight. */
.rs-sun__depth { position: absolute; inset: 0; will-change: transform; }
.rs-sun__tree,
.rs-sun__flecks {
  position: absolute;
  inset: 0;
  transform-origin: 50% -30%;          /* a branch swings from above */
  animation: rs-sun-sway 7s ease-in-out infinite alternate;
  will-change: transform;
}
.rs-sun__flecks { animation-duration: 8.5s; }
@keyframes rs-sun-sway {
  0%   { rotate: -1.5deg; }
  100% { rotate: 2deg; translate: -12px 6px; }
}

/* A leaf: a square with two opposite corners rounded right off. */
.rs-sun__leaf {
  position: absolute;
  width: 100px; height: 100px;
  border-radius: 0 80px;
  background: #8d8b7c;
  mix-blend-mode: multiply;
}
.rs-sun__fleck {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff, #fffdf5 55%, rgba(255, 253, 245, 0));
  mix-blend-mode: screen;
  animation: rs-sun-flicker 3.5s ease-in-out infinite alternate;
}
@keyframes rs-sun-flicker { 100% { translate: 4px -2px; scale: 0.8; } }

/* Performance, invisible: sunlit.js adds .is-offscreen once the light has
   scrolled out of view, and everything in it holds still until it returns.
   contain keeps its repaints from spilling into the rest of the page. */
.rs-sun { contain: layout paint; }
.rs-sun.is-offscreen,
.rs-sun.is-offscreen * { animation-play-state: paused !important; }

.rs-sun__grain {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.18;
  mix-blend-mode: multiply;
}

/* The page colour carries on below the light. Body and footer stay
   transparent so the canvas shows the page colour beneath the layer. */
.theme { background: var(--page); }
html:has(> .theme) { background: transparent; }
.theme .footer { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .rs-sun { animation: none; opacity: 1; }
  .rs-sun__tree, .rs-sun__flecks, .rs-sun__fleck { animation: none; }
}
