/* Brilliant Inventions — résumé page: pinned identity, scroll-driven horizontal stages. */

.res {
  --head-h: 92px;
  --tech-h: 74px;
  --photo-w: clamp(220px, 21vw, 320px);
  overflow-x: hidden;
}

/* ---------- fixed identity header ---------- */
.res-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 26px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.res-mark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted); justify-self: start; text-decoration: none;
}
.res-mark:hover { color: var(--text); text-decoration: none; }
.res-mark img { width: 34px; height: 34px; display: block; }
.res-mark span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.17em;
  text-transform: uppercase; line-height: 1.35;
}
.res-id { text-align: center; }
.res-id h1 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.0vw, 30px);
  /* the tracking was tuned for Georgia; sans needs less of it and a touch more weight */
  font-weight: 600; letter-spacing: 0.005em; line-height: 1.15;
}
.res-id .contact {
  margin-top: 3px; font-size: clamp(13px, 0.95vw, 13px); color: var(--muted);
  letter-spacing: 0.01em; white-space: nowrap;
}
.res-id .contact a { color: var(--muted); text-decoration: none; }
.res-id .contact a:hover { color: var(--accent); }
.res-id .contact .sep { opacity: 0.45; padding: 0 7px; }
.res-nav { justify-self: end; display: flex; gap: 18px; align-items: center; }
.res-nav a {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
}
.res-nav a:hover { color: var(--accent); }

/* ---------- intro ---------- */
.intro {
  padding: calc(var(--head-h) + 5vh) 0 12vh;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
}
.intro .wrap {
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--photo-w);
  grid-template-areas:
    "strap strap"
    "head  head"
    "text  photo"
    "cue   cue";
  column-gap: clamp(36px, 4vw, 64px);
}
.intro .strap { grid-area: strap; }
.intro .panel { grid-area: head; }
.intro .intro-copy { grid-area: text; }
.intro-copy .lede { margin: 0 auto; }
.intro-copy .lede + .lede { margin-top: 0.9em; }
.intro .cue { grid-area: cue; }

/* portrait, cropped to a circle */
.portrait {
  grid-column: 2; grid-row: 1 / -1;
  margin: 0; align-self: start; justify-self: center;
  position: sticky; aspect-ratio: 1 / 1; width: 100%;
  top: max(14px, calc(var(--head-h) + (120vh - var(--head-h) - var(--photo-w)) / 2));
  border-radius: 50%; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  outline: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 11px;
}
.portrait img {
  display: block; width: 108%; max-width: none; height: auto;
  margin: -4% 0 0 -1.5%;
}

.intro h3 {
  font-family: var(--text);
  font-weight: 600; letter-spacing: -0.012em; line-height: 1.15;
  text-align: left;
  max-width: 68ch;
  margin: 0px 0px 15px 50px;
}
.intro .strap {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); text-align: center;
  margin-bottom: 14px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px;
}
.intro .strap .sep { color: var(--muted); }
.lede {
  font-family: var(--font-ui);
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.62;
  letter-spacing: -0.004em;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
  text-align: left;
  max-width: 68ch;
  margin: 0 auto;
}
.cue {
  margin: 56px auto 0; width: max-content;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
}
.cue .line { width: 46px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.cue .line::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: var(--accent);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0% { left: -40%; } 60%, 100% { left: 100%; } }

/* ---------- stages ---------- */
.stage { position: relative; }
.stage .sticky { position: relative; }
.track-wrap { overflow: hidden; }
.track { display: flex; will-change: transform; }
.panel, .slide { flex: 0 0 100%; min-width: 0; }

/* pinned (desktop, motion allowed) */
html.pin .stage { height: calc(var(--n, 3) * 100vh); }
html.pin .stage .sticky {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  padding-top: calc(var(--head-h) + 10px);
  padding-bottom: calc(var(--tech-h) + 14px);
}
html.pin .stage-top { flex: none; padding: 0 26px 6px; display: flex; justify-content: space-between; align-items: baseline; }
html.pin .track-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: stretch; }
html.pin .track { align-items: stretch; }
html.pin .panel, html.pin .slide { display: flex; align-items: center; }
html.pin .rail { flex: none; height: 1px; background: var(--line-soft); margin: 0 26px; position: relative; }
html.pin .rail i { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: var(--accent); opacity: 0.8; }
/* each panel sits centred in the viewport, not flush with the left edge */
html.pin .stage .panel, html.pin .stage .slide {
  justify-content: center; padding-left: 0; padding-right: 0;
}
html.pin .stage .panel-inner, html.pin .stage .slide-inner { padding-left: 0; }

/* Rows that do not travel sideways. Every item sits in the same frame; the mark does the
   moving, the copy cross-fades in place, and --on takes a left item off screen whole. */
/* the track has no in-flow children once the items are stacked, so it has to be told to
   fill the wrap — otherwise its width collapses to 0 and every slide collapses with it */
html.pin .stage[data-mode="stack"] .track {
  position: relative; height: 100%; width: 100%; flex: 1 1 auto;
}
html.pin .stage[data-mode="stack"] .slide {
  position: absolute; inset: 0;
  opacity: var(--on, 1);
  will-change: opacity;
}

/* No dimming on the panels: during a slide both are on screen, and fading them to
   half strength is what made the space between panels read as a gap. The motion and the
   rail carry the emphasis instead. (A vertical offset here is worse still: it reads as a
   droop while the panel slides and a snap when it lands.) */

/* ---------- panels 02–04 ---------- */
.panel { padding-right: 6vw; }
.panel h2 { max-width: 900px; }
.panel-inner { max-width: min(1120px, 94vw); padding-left: 26px; }
.p-num {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.22em;
  color: var(--accent); text-transform: uppercase;
}
.panel h2 {
  font-family: var(--font-display);
  font-size: clamp(23px, min(2.7vw, 4.2vh), 32px);
  line-height: 1.08; letter-spacing: -0.026em;
  font-weight: 650; margin: 12px 0 18px; max-width: 28ch;
}
/* the two bookend headlines (intro panel, outro) share this one class. No max-width: the
   column is the only limit that matters, and a ch/px cap wrapped the line with room to
   spare. balance splits whatever wrapping is unavoidable evenly instead of leaving a
   stranded word. */
h2.extend {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.3vw, 30px); line-height: 1.08; letter-spacing: -0.026em;
  font-weight: 650; margin: 14px 0 24px; max-width: none;
  text-wrap: balance;
}
.p-body {
  font-family: var(--font-ui);
  font-size: clamp(15.5px, min(1.15vw, 2.35vh), 19px);
  line-height: 1.62;
  color: color-mix(in srgb, var(--text) 90%, var(--muted));
  max-width: 76ch;
}
.p-body em { font-style: normal; color: var(--text); box-shadow: inset 0 -0.55em 0 var(--accent-soft); }

.motif {
  margin-top: 26px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
}
.motif .node {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; line-height: 1;
}
.motif .node.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent); }
.motif .step { color: var(--accent); opacity: 0.8; letter-spacing: 0; font-size: 13px; }
.motif .staff { color: var(--line); }

/* ---------- career highlights ---------- */
.hl-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
}
.hl-count { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.hl-count b { color: var(--accent); font-weight: 500; }

.slide { padding-right: 5vw; }
.slide-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 40px); align-items: center;
  max-width: 1180px; padding-left: 26px;
  min-height: min(62vh, 540px);
}
.hl-side, .hl-main { position: relative; z-index: 1; }
.hl-main {
  align-self: stretch; display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid var(--line-soft);
  padding-left: clamp(24px, 3vw, 46px);
}
.hl-side .kicker {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
.hl-stat {
  font-family: var(--font-display); font-weight: 640;
  font-size: clamp(36px, 4.5vw, 63px); line-height: 1;
  letter-spacing: -0.035em; color: var(--accent);
  margin-top: 14px;
}
.hl-stat.small { font-size: clamp(26px, 2.9vw, 40px); letter-spacing: -0.02em; }
/* company mark, in the slot the big stat used to occupy */
.hl-brand {
  /* fit-content, not full column width: the reveal scales the mark about its own centre, so
     the box has to hug the artwork or a wide column shifts the mark off centre */
  display: flex; align-items: center;
  width: fit-content; max-width: 100%;
  height: clamp(42px, 4.4vw, 60px);
  margin-top: 14px;
}
.hl-brand img {
  height: 100%; width: auto; max-width: 100%; object-fit: contain;
  display: block;
}

/* Brand-mark reveal. As an item slides in, its mark fades up at the middle of the row while
   the panels move under it, holds there, then shrinks into its slot on the left. resume.js
   sets --e per slide (0 = just started entering, 1 = landed), --sx (how far that slide still
   has to travel) and --logo-a / --logo-grow from the measured geometry. --d is the dock
   phase: 0 while parked at centre, 1 when home. The copy fades with --t, which stays at 0
   until the mark has had the row to itself. */
html.pin .slide-inner { --d: clamp(0, calc((var(--e, 1) - 0.35) / 0.4), 1); }
html.pin .hl-brand {
  position: relative;
  z-index: 3;
  opacity: clamp(0, calc((var(--e, 1) - 0.1) * 11), 1);
  transform:
    translateX(calc(var(--logo-a, 0px) * (1 - var(--d, 1)) - var(--sx, 0px)))
    scale(calc(1 + var(--logo-grow, 0.6) * (1 - var(--d, 1))));
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
/* the copy stays out of the way until the mark has had the row to itself, then arrives
   underneath it as the mark docks */
html.pin .slide .hl-main,
html.pin .slide .hl-side > .kicker,
html.pin .slide .hl-side > .hl-cap,
html.pin .slide .hl-side > .hl-rule {
  opacity: var(--t, 1);
  transform: translateY(calc((1 - var(--t, 1)) * 12px));
  transition: none;
}
/* No halo behind the mark. With the copy cleared away the mark is alone on the page, so a
   wash under it has nothing to mask and reads as a smudge behind the wordmark. The marks
   carry their own colour. */
.hl-stat .arrow { color: var(--muted); font-size: 0.62em; vertical-align: 0.08em; }
.hl-cap {
  margin-top: 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--muted);
}
.hl-rule { height: 1px; background: var(--line); margin-top: 22px; width: 54px; }
.slide h3 {
  font-family: var(--font-display);
  font-size: clamp(21px, min(2.35vw, 3.6vh), 34px); line-height: 1.14; letter-spacing: -0.022em;
  font-weight: 640; margin-bottom: 16px; max-width: 27ch;
}
.hl-body {
  font-family: var(--font-ui);
  font-size: clamp(15px, min(1.1vw, 2.15vh), 17px);
  line-height: 1.56;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  max-width: 72ch;
}

/* ---------- the sixth case, as its own section ---------- */
.case-solo {
  padding: clamp(56px, 11vh, 120px) 0 clamp(40px, 6vh, 72px);
  border-top: 1px solid var(--line-soft);
}
.case-solo .solo-grid {
  max-width: 1180px;
  display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px); align-items: start;
}
.case-solo .solo-main {
  border-left: 1px solid var(--line-soft);
  padding-left: clamp(24px, 3vw, 46px);
}
.case-solo h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 36px); line-height: 1.12;
  letter-spacing: -0.022em; font-weight: 640;
  margin-bottom: 16px; max-width: 26ch;
}
.case-solo .hl-body { max-width: 68ch; }

/* ---------- outro ---------- */
.outro {
  padding: 14vh 0 18vh;
  border-top: 1px solid var(--line-soft);
}
.outro .wrap { max-width: 1080px; }   /* room for the closing line to hold one line */
.outro .eyebrow { color: var(--accent); }
.outro p { color: var(--muted); max-width: 58ch; font-size: 17px; }
.outro .cta-row { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- tech footer ---------- */
.techbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line-soft);
  padding: 12px 26px;
  transform: translateY(100%); opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
body.tech-on .techbar { transform: translateY(0); opacity: 1; }
.techbar .inner {
  display: flex; align-items: baseline; gap: 8px 18px; flex-wrap: wrap;
  max-width: 1400px; margin: 0 auto;
}
.techbar .lbl {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); opacity: 0.75;
}
.techbar ul { list-style: none; display: flex; flex-wrap: wrap; gap: 3px 12px; }
.techbar li {
  font-size: 11.8px; color: color-mix(in srgb, var(--text) 80%, var(--muted));
  position: relative; padding-left: 14px;
}
.techbar li::before { content: "·"; position: absolute; left: 0; color: var(--accent); opacity: 0.8; }
.techbar li { padding-left: 12px; }
.techbar .flinks { margin-left: auto; display: flex; gap: 18px; }
.techbar .flinks a {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); text-decoration: none; white-space: nowrap;
}
.techbar .flinks a:hover { color: var(--accent); }

/* ---------- not pinned: stacked, readable document ---------- */
html:not(.pin) .res-head {
  position: sticky; top: 0;
}
html:not(.pin) .intro { padding-top: calc(var(--head-h) + 6vh); min-height: auto; }
html:not(.pin) .stage { padding: 6vh 0; border-top: 1px solid var(--line-soft); }
html:not(.pin) .stage-top { padding: 0 26px 20px; display: flex; justify-content: space-between; align-items: baseline; }
html:not(.pin) .track-wrap { overflow: visible; }
html:not(.pin) .track { display: block; }
html:not(.pin) .panel, html:not(.pin) .slide { display: block; padding: 0 26px; margin-bottom: 44px; }
html:not(.pin) .panel:last-child, html:not(.pin) .slide:last-child { margin-bottom: 0; }
html:not(.pin) .panel-inner, html:not(.pin) .slide-inner { max-width: 760px; padding-left: 0; }
html:not(.pin) .slide-inner { grid-template-columns: 1fr; gap: 16px; }
html:not(.pin) .rail, html:not(.pin) .hl-count { display: none; }
html:not(.pin) .techbar { position: static; transform: none; opacity: 1; }

/* ---------- responsive ---------- */
/* the footer list wraps to two rows on narrower screens and eats panel height */
@media (max-width: 1340px) {
  .techbar { padding: 9px 20px; }
  .techbar .lbl { display: none; }
  .techbar li { font-size: 11px; }
  .techbar .flinks a { font-size: 9.5px; }
}
@media (max-width: 1100px) {
  .techbar li { font-size: 10.5px; }
  .techbar ul { gap: 2px 10px; }
  .techbar .flinks a { font-size: 9px; }
}
/* single column: the portrait goes above the copy */
@media (max-width: 980px) {
  .intro .wrap {
    grid-template-columns: 1fr;
    grid-template-areas: "strap" "head" "photo" "text" "cue";
  }
  .portrait {
    grid-area: photo; grid-row: auto; grid-column: auto;
    position: static; top: auto;
    width: clamp(150px, 38vw, 200px); margin: 6px auto 28px; outline-offset: 8px;
  }
}
@media (max-width: 900px) {
  .res-id .contact { white-space: normal; }
  .res-id .contact > span, .res-id .contact > a { white-space: nowrap; }
  .res-id .contact .sep { padding: 0 4px; }
  .res-nav { display: none; }
  .res-head { grid-template-columns: auto 1fr; padding: 12px 20px 10px; }
  .res-id { text-align: left; }
  .res-mark span { display: none; }
  .slide-inner { grid-template-columns: 1fr; }
  .case-solo .solo-grid { grid-template-columns: 1fr; gap: 18px; }
  .case-solo .solo-main { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-soft); padding-top: 20px; }
  .hl-stat { margin-top: 8px; }
  .techbar .flinks { margin-left: 0; }
}
@media (max-width: 620px) {
  .intro .strap { flex-direction: column; gap: 4px; font-size: 10px; }
  .intro .strap .sep { display: none; }
  .lede { font-size: 18px; }
  .panel h2 { max-width: none; }
  .res-id h1 { font-size: 16px; }
  .res-id .contact { font-size: 11px; }
}

/* ---------- print ---------- */
@media print {
  html.pin .stage { height: auto !important; }
  .res-head { position: static; }
  .techbar { position: static; transform: none; opacity: 1; }
  .panel-inner, .slide-inner { opacity: 1 !important; transform: none !important; }
  .track { transform: none !important; display: block; }
  .panel, .slide { page-break-inside: avoid; margin-bottom: 24px; }
  .cue, .rail { display: none; }
  body { background: #fff; color: #000; }
}
