/* ==================================================================
   SJ Ram — portfolio lite
   One canvas: copy paper, ink, and a sky-blue pen.
   Tokens up top; everything else reads from them.
   ================================================================== */

:root {
  --paper: #eeede7;
  --matte: #f7f6f1;
  --ink: #1c1b18;
  --ink-2: #5f5c55;
  --pen: #71b2cb;
  --pen-wash: rgba(113, 178, 203, 0.14);
  --rule: #cfcdc4;
  --shadow-ink: #1c1b18;
  --on-pen: #fff;
  --nav-underline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4 C 20 1, 40 5, 60 3 S 90 2, 99 4' fill='none' stroke='%2371b2cb' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --photo-filter: none;
  color-scheme: light;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", ui-serif, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --rail: 11rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --quick: 160ms;
  --soft: 320ms;

  /* photo frame: matte width, corner, drop and hover behaviour */
  --frame-pad: 14px;
  --frame-radius: 10px;
  --frame-shadow: 16px;
  --frame-shadow-strength: 30%;
  --frame-edge: 10;   /* percent, unitless: drives both frame edges */
  --photo-zoom: 1.07;
  /* the deeper bottom band of the matte, where the label is written: one
     matte width above the text line, one below, one to the left */
  --label-size: 14px;
  --label-ink: var(--ink);
}

/* Dark palette: warm night-paper, not a token flip. Explicit
   [data-theme] restates the full colour set so it beats the media query. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1916;
    --matte: #2a2823;
    --ink: #ecebe4;
    --ink-2: #b0aca0;
    --pen: #71b2cb;
    --pen-wash: rgba(113, 178, 203, 0.18);
    --rule: #3f3d36;
    --shadow-ink: #000000;
    --on-pen: #1a1916;
    --nav-underline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4 C 20 1, 40 5, 60 3 S 90 2, 99 4' fill='none' stroke='%2371b2cb' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    --photo-filter: brightness(0.9) contrast(0.96);
    color-scheme: dark;
  }
}
:root[data-theme="light"] {
  --paper: #eeede7;
  --matte: #f7f6f1;
  --ink: #1c1b18;
  --ink-2: #5f5c55;
  --pen: #71b2cb;
  --pen-wash: rgba(113, 178, 203, 0.14);
  --rule: #cfcdc4;
  --shadow-ink: #1c1b18;
  --on-pen: #fff;
  --nav-underline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4 C 20 1, 40 5, 60 3 S 90 2, 99 4' fill='none' stroke='%2371b2cb' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --photo-filter: none;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #1a1916;
  --matte: #2a2823;
  --ink: #ecebe4;
  --ink-2: #b0aca0;
  --pen: #71b2cb;
  --pen-wash: rgba(113, 178, 203, 0.18);
  --rule: #3f3d36;
  --shadow-ink: #000000;
  --on-pen: #1a1916;
  --nav-underline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4 C 20 1, 40 5, 60 3 S 90 2, 99 4' fill='none' stroke='%2371b2cb' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --photo-filter: brightness(0.9) contrast(0.96);
  color-scheme: dark;
}

/* The parts of the photo transform, registered so they can transition on
   their own (see .photo). Unregistered custom properties would snap. */
@property --rot { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --rx { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --ry { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --zoom { syntax: "<number>"; inherits: false; initial-value: 1; }
@property --reveal-y { syntax: "<length>"; inherits: false; initial-value: 0px; }

/* ---------- reset, base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  font-feature-settings: "kern", "liga";
  overflow-x: clip;
}
main, footer, header { overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.18em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 4px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.skip {
  position: absolute; left: var(--gutter); top: -3rem;
  padding: 0.5rem 0.9rem; background: var(--ink); color: var(--paper);
  border-radius: 999px; z-index: 50; text-decoration: none;
}
.skip:focus-visible { top: 0.75rem; }

/* ---------- layout: every section is rail + body ----------------- */
.hero, .work, .approach, .now, .contact {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--gutter);
  max-width: 82rem;
  margin: 0 auto;
}
.rail { align-self: start; }
@media (min-width: 60em) {
  .rail { position: sticky; top: 1.5rem; }
}
.rail__cue {
  display: block;
  font: 500 0.8125rem/1.3 var(--sans);
  letter-spacing: 0.01em;
  color: var(--ink);
  padding-top: 0.75rem;
  border-top: 1.5px solid var(--ink);
}
.rail__note {
  margin-top: 0.4rem;
  font: italic 400 0.9375rem/1.4 var(--serif);
  color: var(--ink-2);
}

/* ---------- header ------------------------------------------------ */
.top {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) auto;
  column-gap: var(--gutter);
  align-items: baseline;
  padding: 1.75rem var(--gutter) 0;
  max-width: 82rem;
  margin: 0 auto;
}
.top__name {
  font: 400 1.5rem/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color var(--quick) var(--ease);
}
.top__name:hover, .top__name:focus-visible { color: var(--pen); }
.top__role {
  font-size: 0.875rem;
  color: var(--ink-2);
  max-width: 40rem;
  line-height: 1.35;
}
.nowrap { white-space: nowrap; }
.top__nav { display: flex; gap: 1.4rem; font-size: 0.9375rem; }

/* Inline links draw a loose pen line underneath as a background image. */
.pen-link {
  text-decoration: none;
  padding-bottom: 0.2em;
  background-image: var(--nav-underline);
  background-repeat: no-repeat;
  background-size: 0% 6px;
  background-position: left bottom;
  transition: background-size var(--soft) var(--ease), color var(--quick);
}
.pen-link:hover, .pen-link:focus-visible { background-size: 100% 6px; }
.pen-link:active { color: var(--pen); }

/* The nav draws the same line as a real mark (main.js puts an svg.mark in
   each link) so it can draw on and boil like every other pen stroke. The
   link's own state class drives it: hover, focus and the current section
   all light it, and the boil starts once the line has drawn. */
.top__nav a {
  position: relative;
  text-decoration: none;
  padding-bottom: 0.2em;
  transition: color var(--quick);
}
.top__nav a:active { color: var(--pen); }
.top__nav .mark--underline {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 6px;
  overflow: visible;
  pointer-events: none;
}
.top__nav .mark--underline path {
  stroke-width: var(--underline-weight, 1.6);
  transition-duration: var(--soft);
}

/* ---------- hero -------------------------------------------------- */
.hero {
  grid-template-columns: var(--rail) minmax(0, 1.15fr) minmax(0, 0.85fr);
  grid-template-areas: "rail body photos";
  padding-top: clamp(4rem, 10vh, 7rem);
  padding-bottom: clamp(4rem, 10vh, 7rem);
  row-gap: 3rem;
}
.hero .rail { grid-area: rail; }
.hero__body { grid-area: body; }
.hero__photos { grid-area: photos; }

.hero__line {
  font: 400 clamp(2.5rem, 5.6vw, 4.9rem)/1.02 var(--serif);
  letter-spacing: -0.018em;
  text-wrap: balance;
  max-width: 11ch;
}
.hero__sub {
  margin-top: 1.5rem;
  font: italic 400 clamp(1.25rem, 1.9vw, 1.5rem)/1.3 var(--serif);
  max-width: 22ch;
}
.hero__range {
  margin-top: 1.5rem;
  max-width: var(--measure);
  color: var(--ink-2);
}

/* the word the pen circles */
.mark-word { position: relative; display: inline-block; white-space: nowrap; }
.mark-word svg {
  position: absolute; left: -0.34em; top: -0.02em;
  width: calc(100% + 0.66em); height: calc(100% + 0.14em);
  overflow: visible; pointer-events: none;
}

/* hero photo pair: one big, one small and offset, an arrow between */
.hero__photos {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  align-self: start;
  margin-top: 0.4rem;
}
.photo--main { grid-column: 1 / 4; grid-row: 1; --ratio: 3 / 2; }
.photo--small {
  grid-column: 2 / 4; grid-row: 2;
  --ratio: 3 / 2;
  margin-top: -4rem; margin-right: -1.2rem;   /* rides up over the main frame's lower matte so the two overlap */
  z-index: 1;
  --rot: 1.2deg;
  --rot-hover: 2.2deg;
}
.mark--arrow {
  position: absolute; left: -0.5rem; bottom: 0.6rem;
  width: 6rem; height: auto;
}

/* ---------- photos ------------------------------------------------ */
.photo {
  /* Polaroid matte: white card, thicker below, barely-there corner. The
     transform is composed from a base tilt and the pointer-follow angles
     main.js writes, so every photo animates the same way. */
  --rot: 0deg;
  --rot-hover: -0.8deg;
  --rx: 0deg;
  --ry: 0deg;
  --zoom: 1;
  position: relative;
  overflow: hidden;
  background: var(--matte);
  padding: var(--frame-pad);
  padding-bottom: calc(var(--frame-pad) * 2 + var(--label-size));
  border: 1px solid color-mix(in srgb, var(--ink) calc(var(--frame-edge) * 1%), transparent);
  border-radius: var(--frame-radius);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--shadow-ink) 6%, transparent),
              0 calc(var(--frame-shadow) * 0.75) var(--frame-shadow) calc(var(--frame-shadow) * -0.55)
                color-mix(in srgb, var(--shadow-ink) var(--frame-shadow-strength), transparent);
  transform: translateY(var(--reveal-y)) rotate(var(--rot)) scale(var(--zoom))
             perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  /* Each part of the transform eases on its own, not the transform as a
     whole: with one transition on transform, every pointer move restarted
     the zoom and the tilt mid-flight, which WebKit turned into a visible
     lag. The angles the pointer drives get only a short smoothing so they
     track it. The properties are registered at the top of the file so
     they interpolate; will-change keeps the card on its own layer instead
     of promoting it on every hover. */
  --photo-transition: --rot var(--soft) var(--ease), --zoom var(--soft) var(--ease),
                      --rx 90ms linear, --ry 90ms linear,
                      box-shadow var(--soft) var(--ease);
  transition: var(--photo-transition);
  will-change: transform;
}
.photo img {
  width: 100%; height: auto; aspect-ratio: var(--ratio, 3 / 2); object-fit: cover;
  border-radius: calc(var(--frame-radius) * 0.4);
  filter: var(--photo-filter);
  transition: transform 600ms var(--ease), filter var(--soft);
}
.photo figcaption {
  /* The label lives in the deeper band under the print, the way a caption is
     written on a polaroid. main.js swaps the text for an SVG whose mask is a
     stroke that draws on left to right on hover, so the words look written
     in; off hover it fades and resets. */
  position: absolute;
  left: var(--frame-pad); right: var(--frame-pad); bottom: var(--frame-pad);
  height: var(--label-size);
  display: flex; align-items: center;
  color: var(--label-ink);
  font: italic var(--label-size)/1 var(--serif);
  white-space: nowrap; overflow: visible;   /* descenders may cross the row; the frame clips the rest */
  pointer-events: none;
}
.label { display: block; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity var(--quick); }
.label text { fill: currentColor; font: inherit; }
.label__pen {
  /* the mask stroke: thick enough to cover the x-height and descenders */
  fill: none; stroke: #fff; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
/* Hover styling hangs off html.can-hover rather than (hover: hover):
   main.js sets the class from that media query, and also the moment a
   pen or mouse pointer moves, which is how an Apple Pencil hovering over
   an iPad gets these while a bare touch screen never sticks a :hover. */
/* Where photos overlap, the one under the pointer comes to the top. */
.photo:focus-within { --rot: var(--rot-hover); --zoom: var(--photo-zoom); z-index: 2; }
.photo:focus-within .label { opacity: 1; }
.photo:focus-within .label__pen { stroke-dashoffset: 0; transition: stroke-dashoffset var(--label-dur, 700ms) cubic-bezier(0.3, 0, 0.75, 1); }
.can-hover .photo:hover, .photo.is-lit { --rot: var(--rot-hover); --zoom: var(--photo-zoom); z-index: 2; }
.can-hover .photo:hover .label, .photo.is-lit .label { opacity: 1; }
.can-hover .photo:hover .label__pen, .photo.is-lit .label__pen { stroke-dashoffset: 0; transition: stroke-dashoffset var(--label-dur, 700ms) cubic-bezier(0.3, 0, 0.75, 1); }
/* A tap on a touch screen lights a photo the way hover does (main.js
   toggles is-lit); the next tap anywhere else puts it back. */

/* ---------- hand-drawn marks -------------------------------------- */
.mark path {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 520ms var(--ease);
}
.mark path:nth-child(2) { transition-delay: 380ms; transition-duration: 220ms; }
.mark.is-drawn path { stroke-dashoffset: 0; }
.mark--star path { transition-duration: 220ms; }
.mark--star path:nth-child(n) { transition-delay: calc(var(--i, 0) * 45ms); }

/* Posterized boil, after the line has drawn itself in. Each mark keeps two
   jittered copies of its own paths in <g class="mark__frame">, and the three
   frames take turns on a stepped cycle — time is quantized the way cel
   animation is shot on twos, and nothing about the colour or position of the
   mark as a whole moves. Frame 0 is the original path, so the mark always
   rests on exactly what it drew. main.js builds the frames and sets the vars. */
.mark__frame { opacity: 0; }
.mark.is-boiling > path,
.mark.is-boiling > .mark__frame {
  animation: mark-boil var(--boil-dur, 0.375s) steps(1, end) var(--boil-count, infinite);
}
.mark.is-boiling > .mark__frame:nth-of-type(1) { animation-delay: calc(var(--boil-frame, 0.125s) * -1); }
.mark.is-boiling > .mark__frame:nth-of-type(2) { animation-delay: calc(var(--boil-frame, 0.125s) * -2); }
@keyframes mark-boil {
  0%, 33.333% { opacity: 1; }
  33.334%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mark.is-boiling > path,
  .mark.is-boiling > .mark__frame { animation: none; }
  .mark__frame { display: none; }
}

/* ---------- selected work ----------------------------------------- */
.work { padding-top: 1rem; padding-bottom: clamp(4rem, 10vh, 7rem); }
.work__list { border-top: 1.5px solid var(--ink); }
.card { border-bottom: 1px solid var(--rule); }
.card__title { font: inherit; }
.card__toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  column-gap: var(--gutter);
  align-items: baseline;
  padding: 1.35rem 0.25rem 1.35rem 0;
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color var(--quick), padding var(--soft) var(--ease);
}
.can-hover .card__toggle:hover { background: linear-gradient(90deg, var(--matte), transparent 70%); padding-left: 0.5rem; }
.can-hover .card__toggle:hover .card__name { color: var(--pen); }
.can-hover .card__toggle:hover .card__plus { background: var(--pen-wash); border-color: var(--pen); color: var(--pen); }
.card__toggle:active { padding-left: 0.35rem; }
.card__toggle:focus-visible { outline-offset: -2px; }
.card__label { font-size: 0.8125rem; color: var(--ink-2); }
.card__name {
  font: 400 clamp(1.5rem, 2.6vw, 2.1rem)/1.1 var(--serif);
  letter-spacing: -0.01em;
  transition: color var(--quick);
}
.card__meta { display: block; margin-top: 0.35rem; font-size: 0.9375rem; color: var(--ink-2); }

/* the plus that becomes a minus */
.card__plus {
  position: relative; width: 1.6rem; height: 1.6rem; align-self: center;
  border: 1.5px solid var(--ink); border-radius: 50%;
  transition: background-color var(--quick), border-color var(--quick), transform var(--quick);
}
.card__plus::before, .card__plus::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 0.7rem; height: 1.5px; background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform var(--soft) var(--ease), background-color var(--quick);
}
.card__plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.card__toggle:active .card__plus { transform: scale(0.9); }
.card__toggle[aria-expanded="true"] .card__plus { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.card__toggle[aria-expanded="true"] .card__plus::after { transform: translate(-50%, -50%) rotate(0deg); }
.card__toggle[aria-expanded="true"] .card__plus::before { transform: translate(-50%, -50%) rotate(180deg); }

/* detail panel: height animates via grid rows, no JS measuring */
.card__panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows var(--soft) var(--ease), visibility 0s var(--soft);
}
.card.is-open .card__panel {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows var(--soft) var(--ease), visibility 0s 0s;
}
.card__inner { overflow: hidden; min-height: 0; }
.card__detail {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 0.9fr);
  column-gap: var(--gutter);
  row-gap: 1rem;
  padding: 0.5rem 0 2.25rem;
  opacity: 0; transform: translateY(-6px);
  transition: opacity var(--quick), transform var(--soft) var(--ease);
}
.card.is-open .card__detail { opacity: 1; transform: none; transition-delay: 80ms; }
.card__metric { align-self: start; }
.card__metric b { display: block; font: 400 2.4rem/1 var(--serif); letter-spacing: -0.02em; }
.card__metric span { display: block; margin-top: 0.3rem; font-size: 0.8125rem; color: var(--ink-2); }
.card__fields { max-width: var(--measure); }
.card__fields div + div { margin-top: 0.9rem; }
.card__fields dt { font-size: 0.8125rem; color: var(--ink-2); }
.card__fields dd { margin-top: 0.15rem; }
.card__photo { --ratio: 3 / 2; align-self: start; }
.card__photo img { cursor: inherit; }

/* ---------- range and approach ------------------------------------ */
.approach {
  grid-template-columns: var(--rail) minmax(0, 1fr) minmax(0, 0.8fr);
  grid-template-areas: "rail body photos";
  padding-bottom: clamp(4rem, 10vh, 7rem);
}
.approach .rail { grid-area: rail; }
.approach__body { grid-area: body; }
.approach__photos { grid-area: photos; }
.range {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.4rem;
  max-width: var(--measure);
  font: 400 clamp(1.25rem, 2vw, 1.6rem)/1.25 var(--serif);
}
.range li { display: inline-flex; align-items: baseline; }
.range .dot { flex: none; align-self: center; width: 0.7em; height: 0.7em; margin: 0 0.375em 0 -0.025em; }
/* The separator dot is a mark, not a CSS circle: main.js gives it the same
   filled path every other mark gets, so it picks up the draw-on and the boil
   from .mark above with no animation of its own. The boil redraws the dot's
   edge — the dot itself never moves — and it runs on the marks' clock, off the
   marks' Jitter dial, at 0.55 of their amplitude because a 7px disc shows a
   given wobble far louder than a hairline does (data-amp, read by buildFrames). */
.mark--dot path { fill: var(--pen); stroke: none; }

.how { margin-top: 2.5rem; max-width: var(--measure); border-top: 1px solid var(--rule); }
.how div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); column-gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.how dt { font: italic 400 1.0625rem/1.5 var(--serif); }
.how dd { color: var(--ink-2); }
.approach__photos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  align-items: start; align-self: start;
}
.photo--tall { --ratio: 2 / 3; margin-top: 2.5rem; }
.photo--wide { --ratio: 4 / 5; }

/* ---------- now --------------------------------------------------- */
.now {
  grid-template-columns: var(--rail) minmax(0, 1fr) minmax(0, 0.5fr);
  grid-template-areas: "rail body photo";
  padding-bottom: clamp(4rem, 10vh, 7rem);
}
.now .rail { grid-area: rail; }
.now__body { grid-area: body; position: relative; }
.photo--now { grid-area: photo; --ratio: 3 / 4; max-width: 16rem; justify-self: end; }
.stops { border-top: 1.5px solid var(--ink); max-width: var(--measure); }
.stops li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; align-items: baseline;
  padding: 0.85rem 0; border-bottom: 1px solid var(--rule);
}
.stops b { font: 400 clamp(1.35rem, 2.2vw, 1.75rem)/1.15 var(--serif); }
.stops span { font-size: 0.9375rem; color: var(--ink-2); text-align: right; }
.now__note { margin-top: 1.5rem; max-width: var(--measure); }
.mark--star { display: inline-block; vertical-align: top; margin-top: -0.25em; width: 1.5rem; height: auto; margin-left: 0.45rem; }

/* ---------- contact ----------------------------------------------- */
.contact {
  grid-template-areas: "rail body" "colophon colophon";
  padding-top: 1rem;
  padding-bottom: 2rem;
}
.contact .rail { grid-area: rail; }
.contact__body { grid-area: body; }
.contact__line { font: 400 clamp(2rem, 4.2vw, 3.4rem)/1.05 var(--serif); letter-spacing: -0.015em; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.contact__where { margin-top: 2rem; max-width: var(--measure); color: var(--ink-2); font-size: 0.9375rem; }
.colophon {
  grid-area: colophon;
  margin-top: 5rem; padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem; color: var(--ink-2);
}

/* ---------- buttons ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  font-size: 0.9375rem; line-height: 1;
  text-decoration: none; color: var(--ink); background: transparent;
  cursor: pointer;
  transition: background-color var(--quick), color var(--quick), border-color var(--quick),
              transform var(--quick) var(--ease), border-radius var(--soft) var(--ease), padding var(--soft) var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline-offset: 3px; }
.btn--primary { background: var(--pen); border-color: var(--pen); color: var(--on-pen); padding-right: 0.9rem; }
.btn--quiet { border-color: transparent; color: var(--ink-2); }
.can-hover .btn:hover { background: var(--ink); color: var(--paper); border-radius: 0.6rem; }
.can-hover .btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); padding-right: 1.15rem; }
.can-hover .btn--quiet:hover { background: transparent; color: var(--ink); border-color: var(--rule); }
.can-hover .btn:hover .btn__arrow path { stroke-dashoffset: 0; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.45; pointer-events: none; }
.btn__arrow { width: 1.3rem; height: auto; overflow: visible; }
.btn__arrow path {
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 30; stroke-dashoffset: 30;
  transition: stroke-dashoffset var(--soft) var(--ease);
}
.btn__arrow path:nth-child(2) { transition-delay: 120ms; }
.btn:focus-visible .btn__arrow path { stroke-dashoffset: 0; }

/* ---------- portrait that peeks out of the wordmark ---------------
   Positioned on the pointer by main.js; the margin is what puts it to
   the pointer's bottom right. Grows from that corner, so it reads as
   coming out of the name rather than landing on it. */
.name-peek {
  position: fixed; left: 0; top: 0; z-index: 70;
  pointer-events: none;
  will-change: transform;
}
.name-peek img {
  width: 92px; height: 92px;
  margin: 0.75rem 0 0 0.75rem;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  object-fit: cover;
  filter: var(--photo-filter);
  opacity: 0;
  transform: scale(0.8) rotate(-2.5deg);
  transform-origin: top left;
  transition: opacity var(--quick) var(--ease), transform var(--soft) var(--ease);
}
.name-peek.is-in img { opacity: 1; transform: none; }

/* ---------- custom cursor ----------------------------------------- */
.cursor { display: none; }
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.has-cursor { cursor: none; }
  body.has-cursor a, body.has-cursor button, body.has-cursor img { cursor: none; }
  body.has-cursor .cursor {
    display: block;
    position: fixed; left: 0; top: 0; z-index: 9999;
    pointer-events: none;
    will-change: transform;
  }
  .cursor__ring {
    display: flex; align-items: center; justify-content: center;
    width: 10px; height: 10px;
    margin: -5px 0 0 -5px;
    border: 1.5px solid var(--ink); border-radius: 50%;
    background: var(--ink);
    color: var(--on-pen);
    font: 500 0.6875rem/1 var(--sans); letter-spacing: 0.02em;
    transform-origin: center;
    transition: width 180ms var(--ease), height 180ms var(--ease), margin 180ms var(--ease),
                background-color 180ms, border-color 180ms, transform 120ms var(--ease), opacity 180ms, border-radius 180ms var(--ease);
  }
  .cursor__label { opacity: 0; transition: opacity 120ms; white-space: nowrap; }
  .cursor--link .cursor__ring { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: var(--pen-wash); border-color: var(--pen); }
  .cursor--image .cursor__ring { width: 48px; height: 48px; margin: -24px 0 0 -24px; background: transparent; border-color: var(--pen); border-width: 2px; }
  .cursor--project .cursor__ring { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: var(--pen); border-color: var(--pen); }
  .cursor--project .cursor__label { opacity: 1; }
  .cursor--press .cursor__ring { transform: scale(0.82); }
  .cursor--gone .cursor__ring { opacity: 0; }
}

/* ---------- scroll reveals (added only by JS) --------------------- */
.reveal { opacity: 0; --reveal-y: 12px; transition-delay: var(--reveal-delay, 0ms); }
.reveal:not(.photo) { transform: translateY(var(--reveal-y)); transition: opacity 360ms var(--ease) var(--reveal-delay, 0ms), transform 520ms var(--ease) var(--reveal-delay, 0ms); }
.photo.reveal { transition: opacity 360ms var(--ease) var(--reveal-delay, 0ms), --reveal-y 520ms var(--ease) var(--reveal-delay, 0ms), var(--photo-transition); }
.reveal.is-in { opacity: 1; --reveal-y: 0px; }
.hero__body > * { opacity: 0; transform: translateY(8px); animation: rise 420ms var(--ease) forwards; }
.hero__sub { animation-delay: 90ms; }
.hero__range { animation-delay: 160ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

.noscript { max-width: var(--measure); margin: 0 auto 3rem; padding: 0 var(--gutter); color: var(--ink-2); }

/* ---------- reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-delay: 0ms !important; transition-delay: 0ms !important; }
  .mark path { stroke-dashoffset: 0; }
  .photo:hover .label__pen, .photo:focus-within .label__pen, .photo.is-lit .label__pen { stroke-dashoffset: 0; }
  .reveal { opacity: 1; --reveal-y: 0px; transform: none; }
  .hero__body > * { opacity: 1; transform: none; animation: none; }
  .photo, .photo:hover, .photo:focus-within, .photo.is-lit { --rot-hover: var(--rot); --rx: 0deg; --ry: 0deg; }
  .photo, .photo:hover, .photo:focus-within, .photo.is-lit { --zoom: 1; }
  .can-hover .card__toggle:hover { padding-left: 0; }
}

/* ---------- responsive -------------------------------------------- */
@media (max-width: 60em) {
  :root { --rail: 8rem; }
  .top { grid-template-columns: auto 1fr; row-gap: 0.5rem; }
  .top__role { grid-column: 1 / -1; grid-row: 2; }
  .top__nav { grid-column: 2; justify-self: end; gap: 1.1rem; }
  .hero, .approach, .now {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    grid-template-areas: "rail body" "photos photos";
  }
  .now { grid-template-areas: "rail body" "photo photo"; }
  .hero__photos { grid-template-columns: 1fr 1fr 1fr; max-width: 40rem; }
  .approach__photos { max-width: 40rem; }
  .photo--now { justify-self: start; }
  .card__detail { grid-template-columns: 6rem minmax(0, 1fr); }
  .card__photo { grid-column: 1 / -1; max-width: 32rem; }
}
@media (max-width: 40em) {
  :root { --gutter: 1.25rem; }
  .hero, .work, .approach, .now, .contact, .top { display: block; }
  /* Sit the name just under the safe area; the nav lines up on the right. */
  .top { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
  .top__nav { margin-top: 1rem; justify-content: flex-end; }
  .top__role { margin-top: 0.5rem; }
  .rail { margin-bottom: 1.25rem; }
  .hero { padding-top: 3rem; padding-bottom: 3rem; }
  .hero__line { max-width: none; }
  .hero__photos { margin-top: 2.5rem; }
  /* Off the main frame's right edge, so the pair is not flush on one side. */
  .photo--small { margin-right: 1.5rem; margin-left: -1.5rem; }
  .card__toggle { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.25rem; }
  .card__label { grid-column: 1 / -1; }
  .card__detail { grid-template-columns: 1fr; }
  .approach__photos { margin-top: 2.5rem; }
  .photo--tall { margin-top: 0; }
  .now .photo--now { margin-top: 2rem; margin-left: auto; margin-right: auto; }   /* centred on phones */
  .colophon { margin-top: 3rem; }
}

/* ---------- theme pill (Cmd/Ctrl+K; closed until invoked) ------ */
.theme-pill {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  max-width: calc(100vw - 2.5rem);
}
.theme-pill__group {
  display: flex;
  align-items: center;
  padding: 0.22rem;
  background: var(--matte);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font: 500 0.8125rem/1 var(--sans);
  letter-spacing: 0.01em;
}
.theme-pill__group button {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--quick), color var(--quick);
}
.theme-pill__group button[aria-checked="true"] {
  background: var(--pen);
  color: var(--on-pen);
}
.can-hover .theme-pill__group button:hover:not([aria-checked="true"]) { background: var(--pen-wash); }
