/* Controls are added only once the document is interactive. */
:where(img[height]) { height: auto; }
html { scrollbar-gutter: stable; }
body { overflow-x: clip; }
.project h3 a, .rf-card h3 a, .actions a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}
/* Keep each set together even in the narrower slide and phone columns. */
.project-head { flex-wrap: nowrap; }
.project-head h3 { min-width: 0; }
.project-meta .tags { flex-wrap: nowrap; max-width: 100%; }
.project-meta .tags li { white-space: normal; text-align: center; align-content: center; }
.hero-support { max-width: 100%; }
.scene-progress {
  position: fixed; inset: 0 0 auto; height: 3px; z-index: 31;
  pointer-events: none; background: #13202b75;
}
.scene-progress i {
  display: block; height: 100%; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, #ab6c42, #ffd39e); box-shadow: 0 0 10px #f1ac7260;
}
.section-nav {
  position: fixed; right: 0; top: 50%; z-index: 30; transform: translateY(-50%);
  font-size: 16px; line-height: 1.22;
}
.section-nav .nav-list {
  list-style: none; padding: 3px 0; margin: 0; display: grid;
  background: #0c161ee8; border: 1px solid #82939c3a;
  border-right: 0; border-radius: 25px 0 0 25px;
}
.section-nav .nav-list a {
  width: 48px; height: 48px; display: grid; place-items: center;
  position: relative; color: var(--ink); text-decoration: none;
}
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #8e9a9e; }
[aria-current="location"] .nav-dot {
  width: 9px; height: 9px; background: var(--orange); outline: 1px solid #e9a15a70; outline-offset: 4px;
}
.nav-label {
  position: absolute; right: 45px; padding: 8px 12px; white-space: nowrap;
  background: #101d25; border: 1px solid #52616a; border-radius: 4px;
  opacity: 0; pointer-events: none;
}
.nav-list a:is(:hover,:focus-visible) .nav-label { opacity: 1; }
.rail-name {
  position: absolute; top: calc(100% + 12px); right: 13px;
  writing-mode: vertical-rl; white-space: nowrap; color: #ffd0a7; text-shadow: 0 1px 5px #070f14;
}
.section-toggle { display: none; }
@media (min-width: 821px) and (pointer: fine) and (not (any-pointer: coarse)) {
  .section-nav {
    translate: calc(100% + 18px) 0;
    opacity: 0;
    pointer-events: none;
    transition: translate .3s cubic-bezier(.2,.75,.25,1), opacity .2s ease;
  }
  .section-nav:is(.near-edge, :focus-within) {
    translate: 0;
    opacity: 1;
    pointer-events: auto;
  }
}
.section-nav a:focus-visible, .section-nav button:focus-visible, .track-controls button:focus-visible {
  outline: 2px solid var(--orange); outline-offset: -3px;
}
.desktop-motion main > section { min-height: 100svh; position: relative; }
.desktop-motion .stage, .desktop-motion .about, .desktop-motion .contact {
  display: grid; align-content: center;
}
.desktop-motion .wrap { width: min(calc(100% - max(140px, 10%)), 1320px); }
.desktop-motion .contact .wrap { width: min(calc(100% - max(140px, 10%)), 1320px); }
.desktop-motion .stage { padding-block: clamp(26px, 4vh, 55px); }
@media (min-width: 951px) and (max-height: 850px) and (pointer: fine) and (not (any-pointer: coarse)) {
  .hero .hero-copy { width: min(600px, 57vw); margin-bottom: 2vh; }
  .hero .headline { margin-top: 28px; }
  .hero .hero-support { margin-top: 20px; }
  .hero .actions { margin-top: 24px; }
}
.desktop-motion .contact-scene { inset: 0 0 0 47%; }
.desktop-motion .contact .wrap { padding-block: 60px; }
.desktop-motion .contact-copy { max-width: 49%; }
.desktop-motion .work:not(.track-section) .career { border-left: 1px solid #6c5745; padding-left: 22px; }
.desktop-motion .track-section {
  height: 100svh; padding-block: clamp(16px, 3.2vh, 38px); align-content: stretch;
}
.track-section > .wrap {
  height: 100%; min-height: 0; margin-block: 0; display: flex; flex-direction: column;
}
.track-section .wrap > h2 { padding: 0; margin-bottom: 12px; }
.track-section .section-intro { margin: 0 0 14px; }
.track-frame {
  width: 100%; min-height: 0; flex: 1 1 auto; overflow: hidden;
}
.track-frame .slide-track {
  display: flex; height: 100%; width: 100%; align-items: stretch; gap: 26px;
  padding: 0; margin: 0; border: 0;
}
.slide-track > * {
  flex: 0 0 100%; min-width: 0; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #a77955 #14232b; overscroll-behavior: contain;
}
@media (min-width: 1360px) {
  .slide-track:not(.credentials-track,.one-up) > * { flex-basis: calc((100% - 26px) / 2); }
}
.slide-track > .employer {
  display: block; border-top: 1px solid #846747; padding: 22px clamp(18px,2.05vw,34px);
  background: linear-gradient(120deg,#1c2c34,#14212a 75%);
}
.slide-track > .employer > :first-child { margin-bottom: 14px; }
.slide-track .practice-about { margin-bottom: 16px; }
.slide-track > .rf-feature { display: block; padding: 14px 18px; }
.slide-track > .rf-card img { max-height: min(29vh, 260px); width: 100%; object-fit: contain; background: #0e181f; }
.slide-track .project figure { max-width: min(100%, 75vh); }
.slide-track > .project .project-text { padding: 12px 2px 4px; }
.slide-track .rf-feature-copy h3 { margin-top: 12px; }
.slide-track .project, .slide-track .rf-card { padding-bottom: 8px; }
.track-controls {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  flex: none; min-height: 54px; border-top: 1px solid #53616b75; margin-top: 8px;
}
.track-controls output { min-width: 6ch; text-align: right; color: #d2d5d4; font: 500 16px/1.2 'DM Sans', sans-serif; font-variant-numeric: tabular-nums; }
.track-controls progress { width: min(21vw,150px); height: 3px; appearance: none; border: 0; background: #3b474e; color: var(--orange); }
.track-controls progress::-webkit-progress-bar { background: #3b474e; }
.track-controls progress::-webkit-progress-value { background: var(--orange); }
.track-controls button, .section-toggle {
  font: inherit; color: var(--ink); border: 1px solid #56616a; background: #16232c; cursor: pointer;
}
.track-controls button { height: 48px; width: 48px; border-radius: 50%; font-size: 22px; }
.track-controls button:disabled { opacity: .35; cursor: default; }
.desktop-motion .track-section.airband > .wrap { display: flex; align-items: stretch; }
.track-section .receiver-page .diptych { max-width: min(100%, 112vh); margin-inline: auto; }
.credential-page { padding: 10px 8px; }
.credential-page > h2, .credential-page .recommendation-heading { margin-bottom: 16px; }
.credential-page .subsection { margin-top: 0; }
.credential-page .video img { max-height: 34vh; object-fit: contain; }
@media (821px <= width < 1360px) and (pointer:fine) {
  .slide-track .project, .slide-track > .rf-card {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-content: start;
  }
  .slide-track .project > figure, .slide-track > .rf-card > img { grid-column: 1; grid-row: 1 / span 6; }
  .slide-track .project > .project-text, .slide-track > .rf-card > :not(img) { grid-column: 2; }
  .slide-track > .rf-card img { max-height: none; }
  .slide-track > .employer { display: grid; grid-template-columns: .85fr 1.5fr; gap: 10px 5%; align-content: start; }
  .slide-track .employer > :first-child { margin-bottom: 0; }
}
@media (max-width:820px), (any-pointer:coarse) {
  html { scrollbar-gutter: auto; }
  .actions a { min-width: 48px; }
  .section-nav {
    right: max(12px,env(safe-area-inset-right)); left: auto; top: auto;
    bottom: max(10px,env(safe-area-inset-bottom)); transform: none;
  }
  html.has-motion-nav .contact { padding-bottom: 70px; }
  .section-toggle {
    display: grid; grid-template-columns: 7px 1fr 16px; align-items: center; gap: 9px;
    width: min(238px, calc(100vw - 24px)); min-height: 48px; text-align: left;
    padding: 0 14px; border-radius: 25px;
    background: #101d25f5; box-shadow: 0 4px 16px #050a1055; font-size: 16px;
  }
  .section-toggle::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
  .section-toggle::after { content: '⌃'; line-height: 1; font-size: 20px; }
  .section-nav .rail-name { display: none; }
  .section-nav .nav-list {
    display: none; position: absolute; right: 0; bottom: calc(100% + 8px); width: max-content;
    max-height: calc(100dvh - 90px); overflow-y: auto; border: 1px solid #66717a; border-radius: 13px;
    background: #101d25fc; padding: 6px;
  }
  .section-nav.open .nav-list { display: block; }
  .section-nav .nav-list a { width: auto; display: flex; gap: 16px; align-items: center; padding: 0 15px; }
  .section-nav .nav-label { position: static; background: none; border: 0; opacity: 1; padding: 0; }
  main a { scroll-margin-block: 70px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::after, *::before { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The base page stays readable until its first intersection. Continuous effects run only in view. */
.cine-active .hero-scene,
.cine-active .portrait,
.cine-active .diptych,
.cine-active .project figure { overflow: hidden; }
.cine-active .portrait,
.cine-active .diptych,
.cine-active .project figure,
.cine-active .protocol-callout { position: relative; }
.cine-active .hero-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 84% 19%, #ffc27b33, transparent 14%),
              radial-gradient(ellipse at 74% 70%, #f5ac4e17, transparent 34%);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  animation: cine-lamp-up 2.5s ease-out both;
}
.cine-active .hero-scene::after { z-index: 2; }
.cine-active .hero-scene img {
  transform-origin: 70% 57%;
  animation: cine-push 2.5s cubic-bezier(.18,.55,.32,1) both,
             cine-drift 37s 2.5s ease-in-out infinite alternate;
}
.cine-active .hero:not(.cine-in-view) .hero-scene img,
.cine-active .hero:not(.cine-in-view) .hero-scene::before { animation-play-state: paused; }
@keyframes cine-push { from { transform: scale(1.015); opacity: .66; } to { transform: scale(1.05); opacity: 1; } }
@keyframes cine-drift { from { transform: scale(1.05); } to { transform: translate(-.65%,.25%) scale(1.09); } }
@keyframes cine-lamp-up { to { opacity: 1; } }
.cine-active .portrait::after {
  content: "";
  position: absolute;
  inset: -20% -65%;
  pointer-events: none;
  background: linear-gradient(106deg, transparent 41%, #f5c38638 50%, transparent 59%);
  opacity: 0;
}
.cine-active .portrait.cine-entered::after { animation: cine-sweep 1.42s .14s ease-out both; }
@keyframes cine-sweep {
  0% { transform: translateX(-44%); opacity: 0; }
  20% { opacity: .95; }
  100% { transform: translateX(45%); opacity: 0; }
}
@keyframes cine-live { from { opacity: .47; transform: scale(.82); } to { opacity: 1; transform: scale(1.1); } }
.cine-active .employer::before {
  content: "";
  position: absolute;
  pointer-events: none;
  width: 2px;
  top: 0;
  bottom: 0;
  left: -12px;
  background: linear-gradient(#f0a35e, #ad785077);
  transform: scaleY(0);
  transform-origin: center top;
  transition: transform .92s cubic-bezier(.2,.68,.25,1);
}
.cine-active .employer.cine-entered::before { transform: scaleY(1); }
.desktop-motion[data-variant="a"].cine-active .slide-track .employer::before {
  width: 100%;
  height: 2px;
  inset: 0 auto auto 0;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #f0a35e, #ad785055);
}
.desktop-motion[data-variant="a"].cine-active .slide-track .employer.cine-entered::before { transform: scaleX(1); }
.cine-active .project figure { isolation: isolate; }
.cine-active .cine-diagram { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 821px) and (prefers-reduced-motion: no-preference) {
  .cine-active .project:not([data-project="mcp"],[data-project="seo"]) figure img { scale: 1.047; transition: scale .85s cubic-bezier(.21,.66,.28,1); }
  .cine-active .project:not([data-project="mcp"],[data-project="seo"]):is(:hover,:focus-within) figure img { scale: 1.088; }
  .cine-active .project:is(:hover,:focus-within) h3 a { color: var(--orange); }
}
.cine-active .diptych::after {
  content: "";
  position: absolute;
  grid-area: 1 / 1 / 2 / 2;
  left: 56%;
  top: 23%;
  width: 14%;
  aspect-ratio: 1;
  border: 1px solid #ffcb89;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: cine-radio 4.6s ease-out infinite paused;
}
.cine-active .diptych.cine-in-view::after { animation-play-state: running; }
@keyframes cine-radio {
  0%, 17% { transform: translate(-50%,-50%) scale(.18); opacity: 0; }
  24% { opacity: .65; }
  77%, 100% { transform: translate(-50%,-50%) scale(1.85); opacity: 0; }
}
.cine-active .protocol-callout::before,
.cine-active .protocol-callout::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -8px;
  height: 1px;
  pointer-events: none;
}
.cine-active .protocol-callout::before { width: calc(100% - 14px); background: linear-gradient(90deg, #76b7bb70, #76b7bb12); }
.cine-active .protocol-callout::after {
  width: calc((100% - 14px) / 5);
  background: linear-gradient(90deg, transparent, #8ed8da 84%, transparent);
  box-shadow: 0 0 5px #85d1d51c;
  opacity: 0;
  animation: cine-health 3.8s linear infinite paused;
}
.cine-active .rf-feature.cine-in-view .protocol-callout::after { animation-play-state: running; }
@keyframes cine-health { 0% { transform: translateX(0); opacity: 0; } 12%, 72% { opacity: .95; } 86%, 100% { transform: translateX(400%); opacity: 0; } }
.cine-active .contact-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 82% 22%, #ffc27355, transparent 22%), radial-gradient(ellipse at 70% 76%, #ffb96c2b, transparent 47%);
  animation: cine-live 5.4s ease-in-out infinite alternate paused;
}
.cine-active .contact.cine-in-view .contact-scene::after { animation-play-state: running; }
@media (max-width: 820px), (any-pointer: coarse) {
  .cine-active .hero-scene::before { background: radial-gradient(ellipse at 89% 6%, #ffc7882e, transparent 19%); }
  .cine-active .hero-scene img { animation: cine-touch-hero 1s ease-out both; }
  @keyframes cine-touch-hero { from { opacity: .78; } to { opacity: 1; } }
  .cine-active .hero-scene::before { animation-duration: 1.2s; }
  .cine-active .portrait.cine-entered::after { animation-duration: .85s; }
  .cine-active .diptych::after, .cine-active .protocol-callout::after { animation-iteration-count: 1; }
  .cine-active .contact-scene::after { animation: none; opacity: .38; }
}
@media (prefers-reduced-motion: reduce) {
  .cine-active *, .cine-active ::before, .cine-active ::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
}

/* Owner tweak 2: work history cleaner. No vertical lines; one divider per employer that draws in. */
.work .role, .desktop-motion .work:not(.track-section) .career { border-left: 0 !important; padding-left: 0 !important; }
.cine-active .employer::before {
  width: 96px !important; height: 2px !important; top: -1px !important; bottom: auto !important; left: 0 !important;
  background: var(--orange) !important; transform: scaleX(0) !important; transform-origin: left center !important;
}
.cine-active .employer.cine-entered::before { transform: scaleX(1) !important; }

/* Owner tweak 3: AI capabilities grid under the AI projects intro */
.ai-stack{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 32px;margin:0 0 44px;padding:26px 0 28px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ai-stack h3{font-size:16px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--orange);margin:0 0 10px}
.ai-stack .chips{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
.ai-stack .chips li{font-size:17px;line-height:1.3;padding:6px 12px;border:1px solid rgba(255,255,255,.16);border-radius:999px}
@media (max-width:950px){.ai-stack{grid-template-columns:1fr 1fr}}
@media (max-width:650px){.ai-stack{grid-template-columns:1fr;gap:18px}.ai-stack .chips li{font-size:16px}}

/* Owner tweak 4: cards wait hidden until they glide in (no flash of the full block) */
.cine-active .project:not(.cine-entered){opacity:0}

/* Owner tweak 5: SDR section shows what JP built (driver, DSP, decoding, product) */
.airband .receiver-copy{grid-template-columns:1.45fr 1fr}
.airband .receiver-features{grid-template-columns:1fr;gap:14px;margin-top:22px}
.airband .receiver-features li{font-size:19px;line-height:1.5}
.airband .receiver-features strong{color:var(--orange)}
.receiver-stats{display:grid;gap:16px;margin:0 0 26px;padding:0 0 22px;border-bottom:1px solid var(--line)}
.receiver-stats div{display:grid;grid-template-columns:auto 1fr;align-items:baseline;gap:14px}
.receiver-stats dt{font-size:34px;font-weight:700;letter-spacing:-.02em;color:#f5f1ea;min-width:4.6ch}
.receiver-stats dd{margin:0;font-size:17px;line-height:1.4;color:var(--secondary)}
@media (max-width:650px){.receiver-stats dt{font-size:28px}.airband .receiver-features li{font-size:18px}}
.receiver-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.receiver-stats div{display:block}.receiver-stats dt{font-size:30px;min-width:0;white-space:nowrap}.receiver-stats dd{margin-top:4px;font-size:16px}

/* Owner tweak 7: power line "Customer-Facing + AI Engineering" replaces the two role lines */
.roles.roles-power{font-size:calc(var(--role) * 1.18);font-weight:700;letter-spacing:-.01em;margin-top:14px}
.roles.roles-power span{display:inline-block}
.roles-power .rp-plus{color:var(--orange);margin:0 .28em}
.roles-power .rp-b{color:#f5f1ea}
.cine-active .roles-power .rp-b{animation:rp-light 1.1s ease-out 1.25s forwards}
@keyframes rp-light{to{color:var(--orange)}}
html:not(.cine-active) .roles-power .rp-b{color:var(--orange)}
@media (max-width:650px){.roles.roles-power{font-size:24px}}
.contact-copy h2 + .actions{margin-top:28px}

/* Owner tweak: SDR subtitle saying what the app is */
.section-subtitle{font-size:24px;line-height:1.45;color:var(--secondary);margin:-22px 0 30px}
@media (max-width:650px){.section-subtitle{font-size:19px;margin:-12px 0 22px}}

/* hero support: two parallel lines, each kept whole on desktop */
.hero-support .hs-line{display:block}
@media (min-width:1100px){.hero-support{max-width:none}.hero-support .hs-line{white-space:nowrap}}
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--night);
  color: var(--ink);
  pointer-events: none;
  transition: opacity 140ms ease-out;
}
.intro-screen.is-leaving { opacity: 0; }
.intro-screen span {
  font: 500 42px/1 'DM Sans', sans-serif;
  letter-spacing: -.065em;
  text-align: center;
}
.intro-screen i {
  display: block;
  width: 76px;
  height: 2px;
  margin-top: 14px;
  background: var(--orange);
  transform-origin: left;
  animation: intro-line 1s cubic-bezier(.2,.65,.3,1) both;
}
@keyframes intro-line { from { transform: scaleX(.03); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .intro-screen { display: none; } }

/* Owner: label the toolkit and the projects so the reader knows what they are looking at */
.subsection-label{margin:0 0 14px}
.projects-head{margin:8px 0 34px}
.projects-head .subsection-title{font-size:clamp(28px,2.6vw,38px);line-height:1.15;margin:0 0 8px}
.projects-head .subsection-sub{font-size:20px;color:var(--secondary);margin:0}
@media (max-width:650px){.projects-head .subsection-sub{font-size:18px}}
