/* Hallmark · shape: Open Executive, entrance motion: a hero load sequence, scroll reveals, an About timeline and a typed contact heading. */
/* Entrance motion: the page builds itself on load and as you scroll.
   Content is visible by default. Every hidden pre-reveal state exists only under
   html.js.motion-ready, which js/motion.js adds (never with reduced motion).
   Only opacity and transform animate. */

/* Runtime wrapper of a hero headline line (added by motion.js). */
.hero__mask { display: block; }

html.js.motion-ready .reveal {
  --rv-dur: 800ms;       /* frame / text */
  --rv-img-dur: 1200ms;  /* image settle inside a photo frame */
  --rv-y: 32px;
  --rv-scale: 1.08;
  transition:
    opacity var(--rv-dur) var(--ease-out),
    transform var(--rv-dur) var(--ease-out);
}

html.js.motion-ready .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(var(--rv-y));
  transition: none; /* never animate into the hidden state; only out of it */
}

html.js.motion-ready .reveal.is-in {
  opacity: 1;
  transform: none;
  transition-delay: var(--reveal-delay, 0ms);
}

/* ---------- Hero load sequence ---------- */
html.js.motion-ready .reveal--hero { --rv-y: 24px; --rv-dur: 700ms; }

html.js.motion-ready .reveal--header { --rv-y: -8px; --rv-dur: 600ms; }

html.js.motion-ready .reveal--dock { --rv-dur: 800ms; }

html.js.motion-ready .reveal--late { --rv-y: 0px; --rv-dur: 500ms; }

/* Headline: each line rises out of a mask. The line clips; padding and an equal
   negative margin keep descenders and side bearings from being cut without moving anything. */
html.js.motion-ready .is-masking {
  overflow: clip;
  padding: 0.14em 0.08em;
  margin: -0.14em -0.08em;
}

/* The negative margins only cancel out if they don't collapse between stacked lines;
   in a block parent they do, so the lines sit apart during the intro and snap together
   when .is-masking is removed. A grid parent never collapses margins and lays out
   identically without them. */
html.js.motion-ready .hero__title,
html.js.motion-ready .about__lines { display: grid; }

html.js.motion-ready .reveal--line { --rv-dur: 900ms; }
html.js.motion-ready .reveal--soft { --rv-y: 8px; --rv-dur: 600ms; }

html.js.motion-ready .reveal--line:not(.is-in) {
  opacity: 1;
  transform: translateY(calc(100% + 0.2em));
}

/* Sticker pop: spring overshoot, ends at its resting rotation (read from CSS at runtime). */
html.js.motion-ready .reveal--pop {
  --rv-dur: 750ms;
  transition:
    opacity 250ms var(--ease-out),
    transform var(--rv-dur) cubic-bezier(0.34, 1.7, 0.5, 1);
}

html.js.motion-ready .reveal--pop:not(.is-in) { transform: scale(0.4) rotate(-25deg); }

html.js.motion-ready .reveal--pop.is-in { transform: var(--rv-rest, rotate(8deg)); }

/* ---------- Photos: the frame fades up, the image settles from 1.08 to 1 ---------- */
html.js.motion-ready .reveal--photo { overflow: clip; border-radius: var(--radius); }

html.js.motion-ready .reveal--photo img {
  transition: transform var(--rv-img-dur) var(--ease-out) var(--reveal-delay, 0ms);
}

html.js.motion-ready .reveal--photo:not(.is-in) img { transform: scale(var(--rv-scale)); transition: none; }

html.js.motion-ready .reveal--photo.is-in img { transform: none; }

/* Hero photo: the frame stays still, only the image settles (1.06 to 1 over 1.2s). */
html.js.motion-ready .reveal--media { --rv-y: 0px; --rv-dur: 1000ms; --rv-img-dur: 1200ms; --rv-scale: 1.06; }

/* A photo inside a card that reveals itself: only the image settles. */
html.js.motion-ready .reveal--nested { overflow: visible; }
html.js.motion-ready .reveal--nested:not(.is-in),
html.js.motion-ready .reveal--nested.is-in { opacity: 1; transform: none; transition: none; }
html.js.motion-ready .reveal--nested.reveal--photo { overflow: clip; }

/* ---------- About: silent triggers and the career timeline ---------- */
html.js.motion-ready .reveal--trigger:not(.is-in),
html.js.motion-ready .reveal--trigger.is-in { opacity: 1; transform: none; transition: none; }

/* Bracket: the static ::before is swapped for a line (draws from the centre), two ticks and the label. */
html.js.motion-ready .career__total.career-pending::before { opacity: 0; }
html.js.motion-ready .ct-line, html.js.motion-ready .ct-tick { position: absolute; top: 50%; background: var(--color-rule-strong); pointer-events: none; }
html.js.motion-ready .ct-line { left: 0; right: 0; height: 1px; transform: scaleX(0); transform-origin: center; }
html.js.motion-ready .ct-tick { width: 1px; height: 10px; opacity: 0; transform: translateY(-6px); }
html.js.motion-ready .ct-tick--l { left: 0; }
html.js.motion-ready .ct-tick--r { right: 0; }
html.js.motion-ready .career__total.career-pending .career__tt { opacity: 0; }
html.js.motion-ready .career-go .ct-line { transform: none; transition: transform 700ms var(--ease-out); }
html.js.motion-ready .career-go .ct-tick { opacity: 1; transform: none; transition: opacity 300ms var(--ease-out) 500ms, transform 400ms var(--ease-out) 500ms; }
html.js.motion-ready .career__total.career-go .career__tt { opacity: 1; transition: opacity 500ms var(--ease-out) 750ms; }

/* Bar: a runtime fill layer grows from the left behind the text (text itself is never scaled). */
html.js.motion-ready .career__seg.career-pending { background: transparent; }
html.js.motion-ready .career__fill { position: absolute; inset: 0; border-radius: var(--radius); transform: scaleX(0); transform-origin: left center; pointer-events: none; }
html.js.motion-ready .career__seg--ink .career__fill { background: var(--color-ink); }
html.js.motion-ready .career__seg--accent .career__fill { background: var(--color-accent-text); }
html.js.motion-ready .career__seg.career-pending > :not(.career__fill),
html.js.motion-ready .career__seg.career-pending::before,
html.js.motion-ready .career__seg.career-pending::after { position: relative; }
html.js.motion-ready .career__seg.career-pending .career__fig,
html.js.motion-ready .career__seg.career-pending .career__label { opacity: 0; transform: translateY(12px); }
html.js.motion-ready .career__seg.career-pending::after { transform: scaleX(0); }
html.js.motion-ready .career__seg.career-go .career__fill { transform: none; transition: transform var(--fdur) var(--ease-out) var(--fd); }
html.js.motion-ready .career__seg.career-go .career__fig { opacity: 1; transform: none; transition: opacity 300ms var(--ease-out) calc(var(--fd) + 100ms), transform 500ms var(--ease-out) calc(var(--fd) + 100ms); }
html.js.motion-ready .career__seg.career-go .career__label { opacity: 1; transform: none; transition: opacity 600ms var(--ease-out) calc(var(--fd) + var(--fdur) * 0.6), transform 600ms var(--ease-out) calc(var(--fd) + var(--fdur) * 0.6); }
/* Mobile inner meter: scales in after its fill (only exists in the stacked layout). */
html.js.motion-ready .career__seg.career-go::after { transform: scaleX(var(--w, 1)); transition: transform 600ms var(--ease-out) var(--md); }

/* ---------- Contact heading typewriter ---------- */
html.js.motion-ready .tw-host { position: relative; }
html.js.motion-ready .tw-ch { opacity: 0; }
html.js.motion-ready .tw-ch.is-typed { opacity: 1; }
html.js.motion-ready .tw-caret { position: absolute; left: 0; top: 0; width: 2px; height: 0.9em; background: currentColor; opacity: 0; pointer-events: none; }
html.js.motion-ready .tw-caret.is-on { opacity: 1; }
html.js.motion-ready .tw-caret.is-blinking { animation: tw-blink 1000ms steps(1, end) 2; }
html.js.motion-ready .tw-caret.is-out { opacity: 0; transition: opacity 300ms var(--ease-out); }
@keyframes tw-blink { 0% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html.js.motion-ready .reveal,
  html.js.motion-ready .reveal:not(.is-in),
  html.js.motion-ready .reveal.is-in,
  html.js.motion-ready .reveal--photo img,
  html.js.motion-ready .reveal--photo:not(.is-in) img {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
